@agent-team-foundation/first-tree-hub 0.10.3 → 0.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,387 @@
1
+ var Q0=e=>{throw TypeError(e)};var Km=(e,t,n)=>t.has(e)||Q0("Cannot "+n);var L=(e,t,n)=>(Km(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?Q0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ge=(e,t,n,a)=>(Km(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),De=(e,t,n)=>(Km(e,t,"access private method"),n);var vd=(e,t,n,a)=>({set _(l){ge(e,t,l,n)},get _(){return L(e,t,a)}});function M2(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(a,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function ff(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ym={exports:{}},nu={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var G0;function L2(){if(G0)return nu;G0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:c,ref:l!==void 0?l:null,props:o}}return nu.Fragment=t,nu.jsx=n,nu.jsxs=n,nu}var K0;function I2(){return K0||(K0=1,Ym.exports=L2()),Ym.exports}var u=I2(),Xm={exports:{}},Be={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Y0;function U2(){if(Y0)return Be;Y0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function S(B){return B===null||typeof B!="object"?null:(B=b&&B[b]||B["@@iterator"],typeof B=="function"?B:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function E(B,$,_){this.props=B,this.context=$,this.refs=C,this.updater=_||k}E.prototype.isReactComponent={},E.prototype.setState=function(B,$){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,$,"setState")},E.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function A(){}A.prototype=E.prototype;function z(B,$,_){this.props=B,this.context=$,this.refs=C,this.updater=_||k}var I=z.prototype=new A;I.constructor=z,j(I,E.prototype),I.isPureReactComponent=!0;var M=Array.isArray;function O(){}var D={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function W(B,$,_){var F=_.ref;return{$$typeof:e,type:B,key:$,ref:F!==void 0?F:null,props:_}}function H(B,$){return W(B.type,$,B.props)}function ne(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function X(B){var $={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(_){return $[_]})}var be=/\/+/g;function fe(B,$){return typeof B=="object"&&B!==null&&B.key!=null?X(""+B.key):$.toString(36)}function ie(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(O,O):(B.status="pending",B.then(function($){B.status==="pending"&&(B.status="fulfilled",B.value=$)},function($){B.status==="pending"&&(B.status="rejected",B.reason=$)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function Z(B,$,_,F,J){var ue=typeof B;(ue==="undefined"||ue==="boolean")&&(B=null);var xe=!1;if(B===null)xe=!0;else switch(ue){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(B.$$typeof){case e:case t:xe=!0;break;case y:return xe=B._init,Z(xe(B._payload),$,_,F,J)}}if(xe)return J=J(B),xe=F===""?"."+fe(B,0):F,M(J)?(_="",xe!=null&&(_=xe.replace(be,"$&/")+"/"),Z(J,$,_,"",function(Ct){return Ct})):J!=null&&(ne(J)&&(J=H(J,_+(J.key==null||B&&B.key===J.key?"":(""+J.key).replace(be,"$&/")+"/")+xe)),$.push(J)),1;xe=0;var Le=F===""?".":F+":";if(M(B))for(var Se=0;Se<B.length;Se++)F=B[Se],ue=Le+fe(F,Se),xe+=Z(F,$,_,ue,J);else if(Se=S(B),typeof Se=="function")for(B=Se.call(B),Se=0;!(F=B.next()).done;)F=F.value,ue=Le+fe(F,Se++),xe+=Z(F,$,_,ue,J);else if(ue==="object"){if(typeof B.then=="function")return Z(ie(B),$,_,F,J);throw $=String(B),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return xe}function ae(B,$,_){if(B==null)return B;var F=[],J=0;return Z(B,F,"","",function(ue){return $.call(_,ue,J++)}),F}function K(B){if(B._status===-1){var $=B._result;$=$(),$.then(function(_){(B._status===0||B._status===-1)&&(B._status=1,B._result=_)},function(_){(B._status===0||B._status===-1)&&(B._status=2,B._result=_)}),B._status===-1&&(B._status=0,B._result=$)}if(B._status===1)return B._result.default;throw B._result}var he=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},T={map:ae,forEach:function(B,$,_){ae(B,function(){$.apply(this,arguments)},_)},count:function(B){var $=0;return ae(B,function(){$++}),$},toArray:function(B){return ae(B,function($){return $})||[]},only:function(B){if(!ne(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Be.Activity=g,Be.Children=T,Be.Component=E,Be.Fragment=n,Be.Profiler=l,Be.PureComponent=z,Be.StrictMode=a,Be.Suspense=m,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Be.__COMPILER_RUNTIME={__proto__:null,c:function(B){return D.H.useMemoCache(B)}},Be.cache=function(B){return function(){return B.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(B,$,_){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var F=j({},B.props),J=B.key;if($!=null)for(ue in $.key!==void 0&&(J=""+$.key),$)!U.call($,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&$.ref===void 0||(F[ue]=$[ue]);var ue=arguments.length-2;if(ue===1)F.children=_;else if(1<ue){for(var xe=Array(ue),Le=0;Le<ue;Le++)xe[Le]=arguments[Le+2];F.children=xe}return W(B.type,J,F)},Be.createContext=function(B){return B={$$typeof:c,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:o,_context:B},B},Be.createElement=function(B,$,_){var F,J={},ue=null;if($!=null)for(F in $.key!==void 0&&(ue=""+$.key),$)U.call($,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(J[F]=$[F]);var xe=arguments.length-2;if(xe===1)J.children=_;else if(1<xe){for(var Le=Array(xe),Se=0;Se<xe;Se++)Le[Se]=arguments[Se+2];J.children=Le}if(B&&B.defaultProps)for(F in xe=B.defaultProps,xe)J[F]===void 0&&(J[F]=xe[F]);return W(B,ue,J)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(B){return{$$typeof:f,render:B}},Be.isValidElement=ne,Be.lazy=function(B){return{$$typeof:y,_payload:{_status:-1,_result:B},_init:K}},Be.memo=function(B,$){return{$$typeof:h,type:B,compare:$===void 0?null:$}},Be.startTransition=function(B){var $=D.T,_={};D.T=_;try{var F=B(),J=D.S;J!==null&&J(_,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(O,he)}catch(ue){he(ue)}finally{$!==null&&_.types!==null&&($.types=_.types),D.T=$}},Be.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Be.use=function(B){return D.H.use(B)},Be.useActionState=function(B,$,_){return D.H.useActionState(B,$,_)},Be.useCallback=function(B,$){return D.H.useCallback(B,$)},Be.useContext=function(B){return D.H.useContext(B)},Be.useDebugValue=function(){},Be.useDeferredValue=function(B,$){return D.H.useDeferredValue(B,$)},Be.useEffect=function(B,$){return D.H.useEffect(B,$)},Be.useEffectEvent=function(B){return D.H.useEffectEvent(B)},Be.useId=function(){return D.H.useId()},Be.useImperativeHandle=function(B,$,_){return D.H.useImperativeHandle(B,$,_)},Be.useInsertionEffect=function(B,$){return D.H.useInsertionEffect(B,$)},Be.useLayoutEffect=function(B,$){return D.H.useLayoutEffect(B,$)},Be.useMemo=function(B,$){return D.H.useMemo(B,$)},Be.useOptimistic=function(B,$){return D.H.useOptimistic(B,$)},Be.useReducer=function(B,$,_){return D.H.useReducer(B,$,_)},Be.useRef=function(B){return D.H.useRef(B)},Be.useState=function(B){return D.H.useState(B)},Be.useSyncExternalStore=function(B,$,_){return D.H.useSyncExternalStore(B,$,_)},Be.useTransition=function(){return D.H.useTransition()},Be.version="19.2.4",Be}var X0;function qg(){return X0||(X0=1,Xm.exports=U2()),Xm.exports}var x=qg();const P2=ff(x),Hg=M2({__proto__:null,default:P2},[x]);var Jm={exports:{}},ru={},Wm={exports:{}},ep={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var J0;function B2(){return J0||(J0=1,(function(e){function t(Z,ae){var K=Z.length;Z.push(ae);e:for(;0<K;){var he=K-1>>>1,T=Z[he];if(0<l(T,ae))Z[he]=ae,Z[K]=T,K=he;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var ae=Z[0],K=Z.pop();if(K!==ae){Z[0]=K;e:for(var he=0,T=Z.length,B=T>>>1;he<B;){var $=2*(he+1)-1,_=Z[$],F=$+1,J=Z[F];if(0>l(_,K))F<T&&0>l(J,_)?(Z[he]=J,Z[F]=K,he=F):(Z[he]=_,Z[$]=K,he=$);else if(F<T&&0>l(J,K))Z[he]=J,Z[F]=K,he=F;else break e}}return ae}function l(Z,ae){var K=Z.sortIndex-ae.sortIndex;return K!==0?K:Z.id-ae.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],y=1,g=null,b=3,S=!1,k=!1,j=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function I(Z){for(var ae=n(h);ae!==null;){if(ae.callback===null)a(h);else if(ae.startTime<=Z)a(h),ae.sortIndex=ae.expirationTime,t(m,ae);else break;ae=n(h)}}function M(Z){if(j=!1,I(Z),!k)if(n(m)!==null)k=!0,O||(O=!0,X());else{var ae=n(h);ae!==null&&ie(M,ae.startTime-Z)}}var O=!1,D=-1,U=5,W=-1;function H(){return C?!0:!(e.unstable_now()-W<U)}function ne(){if(C=!1,O){var Z=e.unstable_now();W=Z;var ae=!0;try{e:{k=!1,j&&(j=!1,A(D),D=-1),S=!0;var K=b;try{t:{for(I(Z),g=n(m);g!==null&&!(g.expirationTime>Z&&H());){var he=g.callback;if(typeof he=="function"){g.callback=null,b=g.priorityLevel;var T=he(g.expirationTime<=Z);if(Z=e.unstable_now(),typeof T=="function"){g.callback=T,I(Z),ae=!0;break t}g===n(m)&&a(m),I(Z)}else a(m);g=n(m)}if(g!==null)ae=!0;else{var B=n(h);B!==null&&ie(M,B.startTime-Z),ae=!1}}break e}finally{g=null,b=K,S=!1}ae=void 0}}finally{ae?X():O=!1}}}var X;if(typeof z=="function")X=function(){z(ne)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,fe=be.port2;be.port1.onmessage=ne,X=function(){fe.postMessage(null)}}else X=function(){E(ne,0)};function ie(Z,ae){D=E(function(){Z(e.unstable_now())},ae)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(Z){switch(b){case 1:case 2:case 3:var ae=3;break;default:ae=b}var K=b;b=ae;try{return Z()}finally{b=K}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(Z,ae){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var K=b;b=Z;try{return ae()}finally{b=K}},e.unstable_scheduleCallback=function(Z,ae,K){var he=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?he+K:he):K=he,Z){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=K+T,Z={id:y++,callback:ae,priorityLevel:Z,startTime:K,expirationTime:T,sortIndex:-1},K>he?(Z.sortIndex=K,t(h,Z),n(m)===null&&Z===n(h)&&(j?(A(D),D=-1):j=!0,ie(M,K-he))):(Z.sortIndex=T,t(m,Z),k||S||(k=!0,O||(O=!0,X()))),Z},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(Z){var ae=b;return function(){var K=b;b=ae;try{return Z.apply(this,arguments)}finally{b=K}}}})(ep)),ep}var W0;function $2(){return W0||(W0=1,Wm.exports=B2()),Wm.exports}var tp={exports:{}},jn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var e1;function F2(){if(e1)return jn;e1=1;var e=qg();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(m,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:h,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,jn.createPortal=function(m,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(m,h,null,y)},jn.flushSync=function(m){var h=c.T,y=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=y,a.d.f()}},jn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(m,h))},jn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},jn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:S}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},jn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(m)},jn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin);a.d.L(m,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},jn.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=f(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},jn.requestFormReset=function(m){a.d.r(m)},jn.unstable_batchedUpdates=function(m,h){return m(h)},jn.useFormState=function(m,h,y){return c.H.useFormState(m,h,y)},jn.useFormStatus=function(){return c.H.useHostTransitionStatus()},jn.version="19.2.4",jn}var t1;function Fw(){if(t1)return tp.exports;t1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),tp.exports=F2(),tp.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var n1;function q2(){if(n1)return ru;n1=1;var e=$2(),t=qg(),n=Fw();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===d)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=v;else{for(var w=!1,N=p.child;N;){if(N===s){w=!0,s=p,d=v;break}if(N===d){w=!0,d=p,s=v;break}N=N.sibling}if(!w){for(N=v.child;N;){if(N===s){w=!0,s=v,d=p;break}if(N===d){w=!0,d=v,s=p;break}N=N.sibling}if(!w)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function y(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=y(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),z=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function X(r){return r===null||typeof r!="object"?null:(r=ne&&r[ne]||r["@@iterator"],typeof r=="function"?r:null)}var be=Symbol.for("react.client.reference");function fe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===be?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case M:return"Suspense";case O:return"SuspenseList";case W:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case z:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case I:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case D:return i=r.displayName||null,i!==null?i:fe(r.type)||"Memo";case U:i=r._payload,r=r._init;try{return fe(r(i))}catch{}}return null}var ie=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},he=[],T=-1;function B(r){return{current:r}}function $(r){0>T||(r.current=he[T],he[T]=null,T--)}function _(r,i){T++,he[T]=r.current,r.current=i}var F=B(null),J=B(null),ue=B(null),xe=B(null);function Le(r,i){switch(_(ue,i),_(J,r),_(F,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?g0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=g0(i),r=y0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}$(F),_(F,r)}function Se(){$(F),$(J),$(ue)}function Ct(r){r.memoizedState!==null&&_(xe,r);var i=F.current,s=y0(i,r.type);i!==s&&(_(J,r),_(F,s))}function te(r){J.current===r&&($(F),$(J)),xe.current===r&&($(xe),Jo._currentValue=K)}var Te,Ue;function Fe(r){if(Te===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);Te=i&&i[1]||"",Ue=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Te+r+Ue}var qt=!1;function dn(r,i){if(!r||qt)return"";qt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ee){var Y=ee}Reflect.construct(r,[],ce)}else{try{ce.call()}catch(ee){Y=ee}r.call(ce.prototype)}}else{try{throw Error()}catch(ee){Y=ee}(ce=r())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ee){if(ee&&Y&&typeof ee.stack=="string")return[ee.stack,Y.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),w=v[0],N=v[1];if(w&&N){var P=w.split(`
44
+ `),G=N.split(`
45
+ `);for(p=d=0;d<P.length&&!P[d].includes("DetermineComponentFrameRoot");)d++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(d===P.length||p===G.length)for(d=P.length-1,p=G.length-1;1<=d&&0<=p&&P[d]!==G[p];)p--;for(;1<=d&&0<=p;d--,p--)if(P[d]!==G[p]){if(d!==1||p!==1)do if(d--,p--,0>p||P[d]!==G[p]){var re=`
46
+ `+P[d].replace(" at new "," at ");return r.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",r.displayName)),re}while(1<=d&&0<=p);break}}}finally{qt=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Fe(s):""}function Oa(r,i){switch(r.tag){case 26:case 27:case 5:return Fe(r.type);case 16:return Fe("Lazy");case 13:return r.child!==i&&i!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return dn(r.type,!1);case 11:return dn(r.type.render,!1);case 1:return dn(r.type,!0);case 31:return Fe("Activity");default:return""}}function Al(r){try{var i="",s=null;do i+=Oa(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
47
+ Error generating stack: `+d.message+`
48
+ `+d.stack}}var Da=Object.prototype.hasOwnProperty,Ma=e.unstable_scheduleCallback,ta=e.unstable_cancelCallback,oo=e.unstable_shouldYield,uo=e.unstable_requestPaint,fn=e.unstable_now,co=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,rt=e.unstable_IdlePriority,hn=e.log,cr=e.unstable_setDisableYieldValue,tn=null,Ht=null;function mn(r){if(typeof hn=="function"&&cr(r),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(tn,r)}catch{}}var dt=Math.clz32?Math.clz32:rc,Tr=Math.log,Mn=Math.LN2;function rc(r){return r>>>=0,r===0?32:31-(Tr(r)/Mn|0)|0}var Li=256,Ii=262144,Ui=4194304;function Ir(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Pi(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var N=d&134217727;return N!==0?(d=N&~v,d!==0?p=Ir(d):(w&=N,w!==0?p=Ir(w):s||(s=N&~r,s!==0&&(p=Ir(s))))):(N=d&~v,N!==0?p=Ir(N):w!==0?p=Ir(w):s||(s=d&~r,s!==0&&(p=Ir(s)))),p===0?0:i!==0&&i!==p&&(i&v)===0&&(v=p&-p,s=i&-i,v>=s||v===32&&(s&4194048)!==0)?i:p}function La(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function ac(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ve(){var r=Ui;return Ui<<=1,(Ui&62914560)===0&&(Ui=4194304),r}function Ye(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function pn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function na(r,i,s,d,p,v){var w=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var N=r.entanglements,P=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var re=31-dt(s),ce=1<<re;N[re]=0,P[re]=-1;var Y=G[re];if(Y!==null)for(G[re]=null,re=0;re<Y.length;re++){var ee=Y[re];ee!==null&&(ee.lane&=-536870913)}s&=~ce}d!==0&&fo(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~i))}function fo(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-dt(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function ic(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-dt(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function ev(r,i){var s=i&-i;return s=(s&42)!==0?1:Uf(s),(s&(r.suspendedLanes|i))!==0?0:s}function Uf(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Pf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function tv(){var r=ae.p;return r!==0?r:(r=window.event,r===void 0?32:B0(r.type))}function nv(r,i){var s=ae.p;try{return ae.p=r,i()}finally{ae.p=s}}var Ia=Math.random().toString(36).slice(2),gn="__reactFiber$"+Ia,Ln="__reactProps$"+Ia,Tl="__reactContainer$"+Ia,Bf="__reactEvents$"+Ia,jN="__reactListeners$"+Ia,CN="__reactHandles$"+Ia,rv="__reactResources$"+Ia,ho="__reactMarker$"+Ia;function $f(r){delete r[gn],delete r[Ln],delete r[Bf],delete r[jN],delete r[CN]}function Rl(r){var i=r[gn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Tl]||s[gn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=j0(r);r!==null;){if(s=r[gn])return s;r=j0(r)}return i}r=s,s=r.parentNode}return null}function zl(r){if(r=r[gn]||r[Tl]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function mo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Ol(r){var i=r[rv];return i||(i=r[rv]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function sn(r){r[ho]=!0}var av=new Set,iv={};function Bi(r,i){Dl(r,i),Dl(r+"Capture",i)}function Dl(r,i){for(iv[r]=i,r=0;r<i.length;r++)av.add(i[r])}var EN=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lv={},sv={};function NN(r){return Da.call(sv,r)?!0:Da.call(lv,r)?!1:EN.test(r)?sv[r]=!0:(lv[r]=!0,!1)}function lc(r,i,s){if(NN(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function sc(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function ra(r,i,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+d)}}function dr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ov(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function _N(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,v=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(w){s=""+w,v.call(this,w)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Ff(r){if(!r._valueTracker){var i=ov(r)?"checked":"value";r._valueTracker=_N(r,i,""+r[i])}}function uv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=ov(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function oc(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var AN=/[\n"\\]/g;function fr(r){return r.replace(AN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function qf(r,i,s,d,p,v,w,N){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+dr(i)):r.value!==""+dr(i)&&(r.value=""+dr(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?Hf(r,w,dr(i)):s!=null?Hf(r,w,dr(s)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+dr(N):r.removeAttribute("name")}function cv(r,i,s,d,p,v,w,N){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){Ff(r);return}s=s!=null?""+dr(s):"",i=i!=null?""+dr(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=N?r.checked:!!d,r.defaultChecked=!!d,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Ff(r)}function Hf(r,i,s){i==="number"&&oc(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Ml(r,i,s,d){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&d&&(r[s].defaultSelected=!0)}else{for(s=""+dr(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function dv(r,i,s){if(i!=null&&(i=""+dr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+dr(s):""}function fv(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(ie(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=dr(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),Ff(r)}function Ll(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var TN=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function hv(r,i,s){var d=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,s):typeof s!="number"||s===0||TN.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function mv(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&s[p]!==d&&hv(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&hv(r,v,i[v])}function Zf(r){if(r.indexOf("-")===-1)return!1;switch(r){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 RN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),zN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function uc(r){return zN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function aa(){}var Vf=null;function Qf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Il=null,Ul=null;function pv(r){var i=zl(r);if(i&&(r=i.stateNode)){var s=r[Ln]||null;e:switch(r=i.stateNode,i.type){case"input":if(qf(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+fr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[Ln]||null;if(!p)throw Error(a(90));qf(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&uv(d)}break e;case"textarea":dv(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Ml(r,!!s.multiple,i,!1)}}}var Gf=!1;function gv(r,i,s){if(Gf)return r(i,s);Gf=!0;try{var d=r(i);return d}finally{if(Gf=!1,(Il!==null||Ul!==null)&&(Yc(),Il&&(i=Il,r=Ul,Ul=Il=null,pv(i),r)))for(i=0;i<r.length;i++)pv(r[i])}}function po(r,i){var s=r.stateNode;if(s===null)return null;var d=s[Ln]||null;if(d===null)return null;s=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kf=!1;if(ia)try{var go={};Object.defineProperty(go,"passive",{get:function(){Kf=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{Kf=!1}var Ua=null,Yf=null,cc=null;function yv(){if(cc)return cc;var r,i=Yf,s=i.length,d,p="value"in Ua?Ua.value:Ua.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var w=s-r;for(d=1;d<=w&&i[s-d]===p[v-d];d++);return cc=p.slice(r,1<d?1-d:void 0)}function dc(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function fc(){return!0}function vv(){return!1}function In(r){function i(s,d,p,v,w){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(s=r[N],this[N]=s?s(v):v[N]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?fc:vv,this.isPropagationStopped=vv,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=fc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=fc)},persist:function(){},isPersistent:fc}),i}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hc=In($i),yo=g({},$i,{view:0,detail:0}),ON=In(yo),Xf,Jf,vo,mc=g({},yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eh,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==vo&&(vo&&r.type==="mousemove"?(Xf=r.screenX-vo.screenX,Jf=r.screenY-vo.screenY):Jf=Xf=0,vo=r),Xf)},movementY:function(r){return"movementY"in r?r.movementY:Jf}}),bv=In(mc),DN=g({},mc,{dataTransfer:0}),MN=In(DN),LN=g({},yo,{relatedTarget:0}),Wf=In(LN),IN=g({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),UN=In(IN),PN=g({},$i,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),BN=In(PN),$N=g({},$i,{data:0}),xv=In($N),FN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qN={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"},HN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZN(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=HN[r])?!!i[r]:!1}function eh(){return ZN}var VN=g({},yo,{key:function(r){if(r.key){var i=FN[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=dc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?qN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eh,charCode:function(r){return r.type==="keypress"?dc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?dc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),QN=In(VN),GN=g({},mc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sv=In(GN),KN=g({},yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eh}),YN=In(KN),XN=g({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),JN=In(XN),WN=g({},mc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),e_=In(WN),t_=g({},$i,{newState:0,oldState:0}),n_=In(t_),r_=[9,13,27,32],th=ia&&"CompositionEvent"in window,bo=null;ia&&"documentMode"in document&&(bo=document.documentMode);var a_=ia&&"TextEvent"in window&&!bo,wv=ia&&(!th||bo&&8<bo&&11>=bo),kv=" ",jv=!1;function Cv(r,i){switch(r){case"keyup":return r_.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ev(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Pl=!1;function i_(r,i){switch(r){case"compositionend":return Ev(i);case"keypress":return i.which!==32?null:(jv=!0,kv);case"textInput":return r=i.data,r===kv&&jv?null:r;default:return null}}function l_(r,i){if(Pl)return r==="compositionend"||!th&&Cv(r,i)?(r=yv(),cc=Yf=Ua=null,Pl=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return wv&&i.locale!=="ko"?null:i.data;default:return null}}var s_={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 Nv(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!s_[r.type]:i==="textarea"}function _v(r,i,s,d){Il?Ul?Ul.push(d):Ul=[d]:Il=d,i=rd(i,"onChange"),0<i.length&&(s=new hc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var xo=null,So=null;function o_(r){c0(r,0)}function pc(r){var i=mo(r);if(uv(i))return r}function Av(r,i){if(r==="change")return i}var Tv=!1;if(ia){var nh;if(ia){var rh="oninput"in document;if(!rh){var Rv=document.createElement("div");Rv.setAttribute("oninput","return;"),rh=typeof Rv.oninput=="function"}nh=rh}else nh=!1;Tv=nh&&(!document.documentMode||9<document.documentMode)}function zv(){xo&&(xo.detachEvent("onpropertychange",Ov),So=xo=null)}function Ov(r){if(r.propertyName==="value"&&pc(So)){var i=[];_v(i,So,r,Qf(r)),gv(o_,i)}}function u_(r,i,s){r==="focusin"?(zv(),xo=i,So=s,xo.attachEvent("onpropertychange",Ov)):r==="focusout"&&zv()}function c_(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return pc(So)}function d_(r,i){if(r==="click")return pc(i)}function f_(r,i){if(r==="input"||r==="change")return pc(i)}function h_(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Yn=typeof Object.is=="function"?Object.is:h_;function wo(r,i){if(Yn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),d=Object.keys(i);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var p=s[d];if(!Da.call(i,p)||!Yn(r[p],i[p]))return!1}return!0}function Dv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Mv(r,i){var s=Dv(r);r=0;for(var d;s;){if(s.nodeType===3){if(d=r+s.textContent.length,r<=i&&d>=i)return{node:s,offset:i-r};r=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Dv(s)}}function Lv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Lv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Iv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=oc(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=oc(r.document)}return i}function ah(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var m_=ia&&"documentMode"in document&&11>=document.documentMode,Bl=null,ih=null,ko=null,lh=!1;function Uv(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;lh||Bl==null||Bl!==oc(d)||(d=Bl,"selectionStart"in d&&ah(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ko&&wo(ko,d)||(ko=d,d=rd(ih,"onSelect"),0<d.length&&(i=new hc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Bl)))}function Fi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var $l={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},sh={},Pv={};ia&&(Pv=document.createElement("div").style,"AnimationEvent"in window||(delete $l.animationend.animation,delete $l.animationiteration.animation,delete $l.animationstart.animation),"TransitionEvent"in window||delete $l.transitionend.transition);function qi(r){if(sh[r])return sh[r];if(!$l[r])return r;var i=$l[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Pv)return sh[r]=i[s];return r}var Bv=qi("animationend"),$v=qi("animationiteration"),Fv=qi("animationstart"),p_=qi("transitionrun"),g_=qi("transitionstart"),y_=qi("transitioncancel"),qv=qi("transitionend"),Hv=new Map,oh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");oh.push("scrollEnd");function Rr(r,i){Hv.set(r,i),Bi(i,[r])}var gc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},hr=[],Fl=0,uh=0;function yc(){for(var r=Fl,i=uh=Fl=0;i<r;){var s=hr[i];hr[i++]=null;var d=hr[i];hr[i++]=null;var p=hr[i];hr[i++]=null;var v=hr[i];if(hr[i++]=null,d!==null&&p!==null){var w=d.pending;w===null?p.next=p:(p.next=w.next,w.next=p),d.pending=p}v!==0&&Zv(s,p,v)}}function vc(r,i,s,d){hr[Fl++]=r,hr[Fl++]=i,hr[Fl++]=s,hr[Fl++]=d,uh|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function ch(r,i,s,d){return vc(r,i,s,d),bc(r)}function Hi(r,i){return vc(r,null,null,i),bc(r)}function Zv(r,i,s){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,d=v.alternate,d!==null&&(d.childLanes|=s),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&i!==null&&(p=31-dt(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function bc(r){if(50<Zo)throw Zo=0,bm=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var ql={};function v_(r,i,s,d){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(r,i,s,d){return new v_(r,i,s,d)}function dh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function la(r,i){var s=r.alternate;return s===null?(s=Xn(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function Vv(r,i){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function xc(r,i,s,d,p,v){var w=0;if(d=r,typeof r=="function")dh(r)&&(w=1);else if(typeof r=="string")w=k2(r,s,F.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case W:return r=Xn(31,s,i,p),r.elementType=W,r.lanes=v,r;case j:return Zi(s.children,p,v,i);case C:w=8,p|=24;break;case E:return r=Xn(12,s,i,p|2),r.elementType=E,r.lanes=v,r;case M:return r=Xn(13,s,i,p),r.elementType=M,r.lanes=v,r;case O:return r=Xn(19,s,i,p),r.elementType=O,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case z:w=10;break e;case A:w=9;break e;case I:w=11;break e;case D:w=14;break e;case U:w=16,d=null;break e}w=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Xn(w,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Zi(r,i,s,d){return r=Xn(7,r,d,i),r.lanes=s,r}function fh(r,i,s){return r=Xn(6,r,null,i),r.lanes=s,r}function Qv(r){var i=Xn(18,null,null,0);return i.stateNode=r,i}function hh(r,i,s){return i=Xn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Gv=new WeakMap;function mr(r,i){if(typeof r=="object"&&r!==null){var s=Gv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:Al(i)},Gv.set(r,i),i)}return{value:r,source:i,stack:Al(i)}}var Hl=[],Zl=0,Sc=null,jo=0,pr=[],gr=0,Pa=null,Ur=1,Pr="";function sa(r,i){Hl[Zl++]=jo,Hl[Zl++]=Sc,Sc=r,jo=i}function Kv(r,i,s){pr[gr++]=Ur,pr[gr++]=Pr,pr[gr++]=Pa,Pa=r;var d=Ur;r=Pr;var p=32-dt(d)-1;d&=~(1<<p),s+=1;var v=32-dt(i)+p;if(30<v){var w=p-p%5;v=(d&(1<<w)-1).toString(32),d>>=w,p-=w,Ur=1<<32-dt(i)+p|s<<p|d,Pr=v+r}else Ur=1<<v|s<<p|d,Pr=r}function mh(r){r.return!==null&&(sa(r,1),Kv(r,1,0))}function ph(r){for(;r===Sc;)Sc=Hl[--Zl],Hl[Zl]=null,jo=Hl[--Zl],Hl[Zl]=null;for(;r===Pa;)Pa=pr[--gr],pr[gr]=null,Pr=pr[--gr],pr[gr]=null,Ur=pr[--gr],pr[gr]=null}function Yv(r,i){pr[gr++]=Ur,pr[gr++]=Pr,pr[gr++]=Pa,Ur=i.id,Pr=i.overflow,Pa=r}var yn=null,Et=null,at=!1,Ba=null,yr=!1,gh=Error(a(519));function $a(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(mr(i,r)),gh}function Xv(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[gn]=r,i[Ln]=d,s){case"dialog":Je("cancel",i),Je("close",i);break;case"iframe":case"object":case"embed":Je("load",i);break;case"video":case"audio":for(s=0;s<Qo.length;s++)Je(Qo[s],i);break;case"source":Je("error",i);break;case"img":case"image":case"link":Je("error",i),Je("load",i);break;case"details":Je("toggle",i);break;case"input":Je("invalid",i),cv(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Je("invalid",i);break;case"textarea":Je("invalid",i),fv(i,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||d.suppressHydrationWarning===!0||m0(i.textContent,s)?(d.popover!=null&&(Je("beforetoggle",i),Je("toggle",i)),d.onScroll!=null&&Je("scroll",i),d.onScrollEnd!=null&&Je("scrollend",i),d.onClick!=null&&(i.onclick=aa),i=!0):i=!1,i||$a(r,!0)}function Jv(r){for(yn=r.return;yn;)switch(yn.tag){case 5:case 31:case 13:yr=!1;return;case 27:case 3:yr=!0;return;default:yn=yn.return}}function Vl(r){if(r!==yn)return!1;if(!at)return Jv(r),at=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Dm(r.type,r.memoizedProps)),s=!s),s&&Et&&$a(r),Jv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=k0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=k0(r)}else i===27?(i=Et,ti(r.type)?(r=Pm,Pm=null,Et=r):Et=i):Et=yn?br(r.stateNode.nextSibling):null;return!0}function Vi(){Et=yn=null,at=!1}function yh(){var r=Ba;return r!==null&&($n===null?$n=r:$n.push.apply($n,r),Ba=null),r}function Co(r){Ba===null?Ba=[r]:Ba.push(r)}var vh=B(null),Qi=null,oa=null;function Fa(r,i,s){_(vh,i._currentValue),i._currentValue=s}function ua(r){r._currentValue=vh.current,$(vh)}function bh(r,i,s){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===s)break;r=r.return}}function xh(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var w=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var P=0;P<i.length;P++)if(N.context===i[P]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),bh(v.return,s,r),d||(w=null);break e}v=N.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(a(341));w.lanes|=s,v=w.alternate,v!==null&&(v.lanes|=s),bh(w,s,r),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===r){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Ql(r,i,s,d){r=null;for(var p=i,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var N=p.type;Yn(p.pendingProps.value,w.value)||(r!==null?r.push(N):r=[N])}}else if(p===xe.current){if(w=p.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Jo):r=[Jo])}p=p.return}r!==null&&xh(i,r,s,d),i.flags|=262144}function wc(r){for(r=r.firstContext;r!==null;){if(!Yn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Gi(r){Qi=r,oa=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function vn(r){return Wv(Qi,r)}function kc(r,i){return Qi===null&&Gi(r),Wv(r,i)}function Wv(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},oa===null){if(r===null)throw Error(a(308));oa=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else oa=oa.next=i;return s}var b_=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},x_=e.unstable_scheduleCallback,S_=e.unstable_NormalPriority,Gt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sh(){return{controller:new b_,data:new Map,refCount:0}}function Eo(r){r.refCount--,r.refCount===0&&x_(S_,function(){r.controller.abort()})}var No=null,wh=0,Gl=0,Kl=null;function w_(r,i){if(No===null){var s=No=[];wh=0,Gl=Cm(),Kl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return wh++,i.then(eb,eb),i}function eb(){if(--wh===0&&No!==null){Kl!==null&&(Kl.status="fulfilled");var r=No;No=null,Gl=0,Kl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function k_(r,i){var s=[],d={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),d}var tb=Z.S;Z.S=function(r,i){Ux=fn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&w_(r,i),tb!==null&&tb(r,i)};var Ki=B(null);function kh(){var r=Ki.current;return r!==null?r:wt.pooledCache}function jc(r,i){i===null?_(Ki,Ki.current):_(Ki,i.pool)}function nb(){var r=kh();return r===null?null:{parent:Gt._currentValue,pool:r}}var Yl=Error(a(460)),jh=Error(a(474)),Cc=Error(a(542)),Ec={then:function(){}};function rb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function ab(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(aa,aa),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,lb(r),r;default:if(typeof i.status=="string")i.then(aa,aa);else{if(r=wt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,lb(r),r}throw Xi=i,Yl}}function Yi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Xi=s,Yl):s}}var Xi=null;function ib(){if(Xi===null)throw Error(a(459));var r=Xi;return Xi=null,r}function lb(r){if(r===Yl||r===Cc)throw Error(a(483))}var Xl=null,_o=0;function Nc(r){var i=_o;return _o+=1,Xl===null&&(Xl=[]),ab(Xl,r,i)}function Ao(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function _c(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function sb(r){function i(V,q){if(r){var Q=V.deletions;Q===null?(V.deletions=[q],V.flags|=16):Q.push(q)}}function s(V,q){if(!r)return null;for(;q!==null;)i(V,q),q=q.sibling;return null}function d(V){for(var q=new Map;V!==null;)V.key!==null?q.set(V.key,V):q.set(V.index,V),V=V.sibling;return q}function p(V,q){return V=la(V,q),V.index=0,V.sibling=null,V}function v(V,q,Q){return V.index=Q,r?(Q=V.alternate,Q!==null?(Q=Q.index,Q<q?(V.flags|=67108866,q):Q):(V.flags|=67108866,q)):(V.flags|=1048576,q)}function w(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function N(V,q,Q,oe){return q===null||q.tag!==6?(q=fh(Q,V.mode,oe),q.return=V,q):(q=p(q,Q),q.return=V,q)}function P(V,q,Q,oe){var Re=Q.type;return Re===j?re(V,q,Q.props.children,oe,Q.key):q!==null&&(q.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===U&&Yi(Re)===q.type)?(q=p(q,Q.props),Ao(q,Q),q.return=V,q):(q=xc(Q.type,Q.key,Q.props,null,V.mode,oe),Ao(q,Q),q.return=V,q)}function G(V,q,Q,oe){return q===null||q.tag!==4||q.stateNode.containerInfo!==Q.containerInfo||q.stateNode.implementation!==Q.implementation?(q=hh(Q,V.mode,oe),q.return=V,q):(q=p(q,Q.children||[]),q.return=V,q)}function re(V,q,Q,oe,Re){return q===null||q.tag!==7?(q=Zi(Q,V.mode,oe,Re),q.return=V,q):(q=p(q,Q),q.return=V,q)}function ce(V,q,Q){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=fh(""+q,V.mode,Q),q.return=V,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case S:return Q=xc(q.type,q.key,q.props,null,V.mode,Q),Ao(Q,q),Q.return=V,Q;case k:return q=hh(q,V.mode,Q),q.return=V,q;case U:return q=Yi(q),ce(V,q,Q)}if(ie(q)||X(q))return q=Zi(q,V.mode,Q,null),q.return=V,q;if(typeof q.then=="function")return ce(V,Nc(q),Q);if(q.$$typeof===z)return ce(V,kc(V,q),Q);_c(V,q)}return null}function Y(V,q,Q,oe){var Re=q!==null?q.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Re!==null?null:N(V,q,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return Q.key===Re?P(V,q,Q,oe):null;case k:return Q.key===Re?G(V,q,Q,oe):null;case U:return Q=Yi(Q),Y(V,q,Q,oe)}if(ie(Q)||X(Q))return Re!==null?null:re(V,q,Q,oe,null);if(typeof Q.then=="function")return Y(V,q,Nc(Q),oe);if(Q.$$typeof===z)return Y(V,q,kc(V,Q),oe);_c(V,Q)}return null}function ee(V,q,Q,oe,Re){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return V=V.get(Q)||null,N(q,V,""+oe,Re);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return V=V.get(oe.key===null?Q:oe.key)||null,P(q,V,oe,Re);case k:return V=V.get(oe.key===null?Q:oe.key)||null,G(q,V,oe,Re);case U:return oe=Yi(oe),ee(V,q,Q,oe,Re)}if(ie(oe)||X(oe))return V=V.get(Q)||null,re(q,V,oe,Re,null);if(typeof oe.then=="function")return ee(V,q,Q,Nc(oe),Re);if(oe.$$typeof===z)return ee(V,q,Q,kc(q,oe),Re);_c(q,oe)}return null}function je(V,q,Q,oe){for(var Re=null,ot=null,Ne=q,Ze=q=0,tt=null;Ne!==null&&Ze<Q.length;Ze++){Ne.index>Ze?(tt=Ne,Ne=null):tt=Ne.sibling;var ut=Y(V,Ne,Q[Ze],oe);if(ut===null){Ne===null&&(Ne=tt);break}r&&Ne&&ut.alternate===null&&i(V,Ne),q=v(ut,q,Ze),ot===null?Re=ut:ot.sibling=ut,ot=ut,Ne=tt}if(Ze===Q.length)return s(V,Ne),at&&sa(V,Ze),Re;if(Ne===null){for(;Ze<Q.length;Ze++)Ne=ce(V,Q[Ze],oe),Ne!==null&&(q=v(Ne,q,Ze),ot===null?Re=Ne:ot.sibling=Ne,ot=Ne);return at&&sa(V,Ze),Re}for(Ne=d(Ne);Ze<Q.length;Ze++)tt=ee(Ne,V,Ze,Q[Ze],oe),tt!==null&&(r&&tt.alternate!==null&&Ne.delete(tt.key===null?Ze:tt.key),q=v(tt,q,Ze),ot===null?Re=tt:ot.sibling=tt,ot=tt);return r&&Ne.forEach(function(li){return i(V,li)}),at&&sa(V,Ze),Re}function Oe(V,q,Q,oe){if(Q==null)throw Error(a(151));for(var Re=null,ot=null,Ne=q,Ze=q=0,tt=null,ut=Q.next();Ne!==null&&!ut.done;Ze++,ut=Q.next()){Ne.index>Ze?(tt=Ne,Ne=null):tt=Ne.sibling;var li=Y(V,Ne,ut.value,oe);if(li===null){Ne===null&&(Ne=tt);break}r&&Ne&&li.alternate===null&&i(V,Ne),q=v(li,q,Ze),ot===null?Re=li:ot.sibling=li,ot=li,Ne=tt}if(ut.done)return s(V,Ne),at&&sa(V,Ze),Re;if(Ne===null){for(;!ut.done;Ze++,ut=Q.next())ut=ce(V,ut.value,oe),ut!==null&&(q=v(ut,q,Ze),ot===null?Re=ut:ot.sibling=ut,ot=ut);return at&&sa(V,Ze),Re}for(Ne=d(Ne);!ut.done;Ze++,ut=Q.next())ut=ee(Ne,V,Ze,ut.value,oe),ut!==null&&(r&&ut.alternate!==null&&Ne.delete(ut.key===null?Ze:ut.key),q=v(ut,q,Ze),ot===null?Re=ut:ot.sibling=ut,ot=ut);return r&&Ne.forEach(function(D2){return i(V,D2)}),at&&sa(V,Ze),Re}function vt(V,q,Q,oe){if(typeof Q=="object"&&Q!==null&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var Re=Q.key;q!==null;){if(q.key===Re){if(Re=Q.type,Re===j){if(q.tag===7){s(V,q.sibling),oe=p(q,Q.props.children),oe.return=V,V=oe;break e}}else if(q.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===U&&Yi(Re)===q.type){s(V,q.sibling),oe=p(q,Q.props),Ao(oe,Q),oe.return=V,V=oe;break e}s(V,q);break}else i(V,q);q=q.sibling}Q.type===j?(oe=Zi(Q.props.children,V.mode,oe,Q.key),oe.return=V,V=oe):(oe=xc(Q.type,Q.key,Q.props,null,V.mode,oe),Ao(oe,Q),oe.return=V,V=oe)}return w(V);case k:e:{for(Re=Q.key;q!==null;){if(q.key===Re)if(q.tag===4&&q.stateNode.containerInfo===Q.containerInfo&&q.stateNode.implementation===Q.implementation){s(V,q.sibling),oe=p(q,Q.children||[]),oe.return=V,V=oe;break e}else{s(V,q);break}else i(V,q);q=q.sibling}oe=hh(Q,V.mode,oe),oe.return=V,V=oe}return w(V);case U:return Q=Yi(Q),vt(V,q,Q,oe)}if(ie(Q))return je(V,q,Q,oe);if(X(Q)){if(Re=X(Q),typeof Re!="function")throw Error(a(150));return Q=Re.call(Q),Oe(V,q,Q,oe)}if(typeof Q.then=="function")return vt(V,q,Nc(Q),oe);if(Q.$$typeof===z)return vt(V,q,kc(V,Q),oe);_c(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,q!==null&&q.tag===6?(s(V,q.sibling),oe=p(q,Q),oe.return=V,V=oe):(s(V,q),oe=fh(Q,V.mode,oe),oe.return=V,V=oe),w(V)):s(V,q)}return function(V,q,Q,oe){try{_o=0;var Re=vt(V,q,Q,oe);return Xl=null,Re}catch(Ne){if(Ne===Yl||Ne===Cc)throw Ne;var ot=Xn(29,Ne,null,V.mode);return ot.lanes=oe,ot.return=V,ot}finally{}}}var Ji=sb(!0),ob=sb(!1),qa=!1;function Ch(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eh(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ha(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Za(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(ct&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=bc(r),Zv(r,null,s),i}return vc(r,d,i,s),bc(r)}function To(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,ic(r,s)}}function Nh(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=w:v=v.next=w,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var _h=!1;function Ro(){if(_h){var r=Kl;if(r!==null)throw r}}function zo(r,i,s,d){_h=!1;var p=r.updateQueue;qa=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var P=N,G=P.next;P.next=null,w===null?v=G:w.next=G,w=P;var re=r.alternate;re!==null&&(re=re.updateQueue,N=re.lastBaseUpdate,N!==w&&(N===null?re.firstBaseUpdate=G:N.next=G,re.lastBaseUpdate=P))}if(v!==null){var ce=p.baseState;w=0,re=G=P=null,N=v;do{var Y=N.lane&-536870913,ee=Y!==N.lane;if(ee?(et&Y)===Y:(d&Y)===Y){Y!==0&&Y===Gl&&(_h=!0),re!==null&&(re=re.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var je=r,Oe=N;Y=i;var vt=s;switch(Oe.tag){case 1:if(je=Oe.payload,typeof je=="function"){ce=je.call(vt,ce,Y);break e}ce=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Oe.payload,Y=typeof je=="function"?je.call(vt,ce,Y):je,Y==null)break e;ce=g({},ce,Y);break e;case 2:qa=!0}}Y=N.callback,Y!==null&&(r.flags|=64,ee&&(r.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[Y]:ee.push(Y))}else ee={lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},re===null?(G=re=ee,P=ce):re=re.next=ee,w|=Y;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;ee=N,N=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);re===null&&(P=ce),p.baseState=P,p.firstBaseUpdate=G,p.lastBaseUpdate=re,v===null&&(p.shared.lanes=0),Ya|=w,r.lanes=w,r.memoizedState=ce}}function ub(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function cb(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)ub(s[r],i)}var Jl=B(null),Ac=B(0);function db(r,i){r=va,_(Ac,r),_(Jl,i),va=r|i.baseLanes}function Ah(){_(Ac,va),_(Jl,Jl.current)}function Th(){va=Ac.current,$(Jl),$(Ac)}var Jn=B(null),vr=null;function Va(r){var i=r.alternate;_(Zt,Zt.current&1),_(Jn,r),vr===null&&(i===null||Jl.current!==null||i.memoizedState!==null)&&(vr=r)}function Rh(r){_(Zt,Zt.current),_(Jn,r),vr===null&&(vr=r)}function fb(r){r.tag===22?(_(Zt,Zt.current),_(Jn,r),vr===null&&(vr=r)):Qa()}function Qa(){_(Zt,Zt.current),_(Jn,Jn.current)}function Wn(r){$(Jn),vr===r&&(vr=null),$(Zt)}var Zt=B(0);function Tc(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Im(s)||Um(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ca=0,He=null,gt=null,Kt=null,Rc=!1,Wl=!1,Wi=!1,zc=0,Oo=0,es=null,j_=0;function It(){throw Error(a(321))}function zh(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Yn(r[s],i[s]))return!1;return!0}function Oh(r,i,s,d,p,v){return ca=v,He=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?Kb:Gh,Wi=!1,v=s(d,p),Wi=!1,Wl&&(v=mb(i,s,d,p)),hb(r),v}function hb(r){Z.H=Lo;var i=gt!==null&&gt.next!==null;if(ca=0,Kt=gt=He=null,Rc=!1,Oo=0,es=null,i)throw Error(a(300));r===null||Yt||(r=r.dependencies,r!==null&&wc(r)&&(Yt=!0))}function mb(r,i,s,d){He=r;var p=0;do{if(Wl&&(es=null),Oo=0,Wl=!1,25<=p)throw Error(a(301));if(p+=1,Kt=gt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}Z.H=Yb,v=i(s,d)}while(Wl);return v}function C_(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?Do(i):i,r=r.useState()[0],(gt!==null?gt.memoizedState:null)!==r&&(He.flags|=1024),i}function Dh(){var r=zc!==0;return zc=0,r}function Mh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Lh(r){if(Rc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Rc=!1}ca=0,Kt=gt=He=null,Wl=!1,Oo=zc=0,es=null}function Tn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?He.memoizedState=Kt=r:Kt=Kt.next=r,Kt}function Vt(){if(gt===null){var r=He.alternate;r=r!==null?r.memoizedState:null}else r=gt.next;var i=Kt===null?He.memoizedState:Kt.next;if(i!==null)Kt=i,gt=r;else{if(r===null)throw He.alternate===null?Error(a(467)):Error(a(310));gt=r,r={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Kt===null?He.memoizedState=Kt=r:Kt=Kt.next=r}return Kt}function Oc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(r){var i=Oo;return Oo+=1,es===null&&(es=[]),r=ab(es,r,i),i=He,(Kt===null?i.memoizedState:Kt.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?Kb:Gh),r}function Dc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Do(r);if(r.$$typeof===z)return vn(r)}throw Error(a(438,String(r)))}function Ih(r){var i=null,s=He.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=He.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Oc(),He.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),d=0;d<r;d++)s[d]=H;return i.index++,s}function da(r,i){return typeof i=="function"?i(r):i}function Mc(r){var i=Vt();return Uh(i,gt,r)}function Uh(r,i,s){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=s;var p=r.baseQueue,v=d.pending;if(v!==null){if(p!==null){var w=p.next;p.next=v.next,v.next=w}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=w=null,P=null,G=i,re=!1;do{var ce=G.lane&-536870913;if(ce!==G.lane?(et&ce)===ce:(ca&ce)===ce){var Y=G.revertLane;if(Y===0)P!==null&&(P=P.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ce===Gl&&(re=!0);else if((ca&Y)===Y){G=G.next,Y===Gl&&(re=!0);continue}else ce={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},P===null?(N=P=ce,w=v):P=P.next=ce,He.lanes|=Y,Ya|=Y;ce=G.action,Wi&&s(v,ce),v=G.hasEagerState?G.eagerState:s(v,ce)}else Y={lane:ce,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},P===null?(N=P=Y,w=v):P=P.next=Y,He.lanes|=ce,Ya|=ce;G=G.next}while(G!==null&&G!==i);if(P===null?w=v:P.next=N,!Yn(v,r.memoizedState)&&(Yt=!0,re&&(s=Kl,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=P,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Ph(r){var i=Vt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var w=p=p.next;do v=r(v,w.action),w=w.next;while(w!==p);Yn(v,i.memoizedState)||(Yt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function pb(r,i,s){var d=He,p=Vt(),v=at;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var w=!Yn((gt||p).memoizedState,s);if(w&&(p.memoizedState=s,Yt=!0),p=p.queue,Fh(vb.bind(null,d,p,r),[r]),p.getSnapshot!==i||w||Kt!==null&&Kt.memoizedState.tag&1){if(d.flags|=2048,ts(9,{destroy:void 0},yb.bind(null,d,p,s,i),null),wt===null)throw Error(a(349));v||(ca&127)!==0||gb(d,i,s)}return s}function gb(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=He.updateQueue,i===null?(i=Oc(),He.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function yb(r,i,s,d){i.value=s,i.getSnapshot=d,bb(i)&&xb(r)}function vb(r,i,s){return s(function(){bb(i)&&xb(r)})}function bb(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Yn(r,s)}catch{return!0}}function xb(r){var i=Hi(r,2);i!==null&&Fn(i,r,2)}function Bh(r){var i=Tn();if(typeof r=="function"){var s=r;if(r=s(),Wi){mn(!0);try{s()}finally{mn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:r},i}function Sb(r,i,s,d){return r.baseState=s,Uh(r,gt,typeof d=="function"?d:da)}function E_(r,i,s,d,p){if(Uc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};Z.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,wb(i,v)):(v.next=s.next,i.pending=s.next=v)}}function wb(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=Z.T,w={};Z.T=w;try{var N=s(p,d),P=Z.S;P!==null&&P(w,N),kb(r,i,N)}catch(G){$h(r,i,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),Z.T=v}}else try{v=s(p,d),kb(r,i,v)}catch(G){$h(r,i,G)}}function kb(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){jb(r,i,d)},function(d){return $h(r,i,d)}):jb(r,i,s)}function jb(r,i,s){i.status="fulfilled",i.value=s,Cb(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,wb(r,s)))}function $h(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,Cb(i),i=i.next;while(i!==d)}r.action=null}function Cb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Eb(r,i){return i}function Nb(r,i){if(at){var s=wt.formState;if(s!==null){e:{var d=He;if(at){if(Et){t:{for(var p=Et,v=yr;p.nodeType!==8;){if(!v){p=null;break t}if(p=br(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Et=br(p.nextSibling),d=p.data==="F!";break e}}$a(d)}d=!1}d&&(i=s[0])}}return s=Tn(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eb,lastRenderedState:i},s.queue=d,s=Vb.bind(null,He,d),d.dispatch=s,d=Bh(!1),v=Qh.bind(null,He,!1,d.queue),d=Tn(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=E_.bind(null,He,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function _b(r){var i=Vt();return Ab(i,gt,r)}function Ab(r,i,s){if(i=Uh(r,i,Eb)[0],r=Mc(da)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Do(i)}catch(w){throw w===Yl?Cc:w}else d=i;i=Vt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(He.flags|=2048,ts(9,{destroy:void 0},N_.bind(null,p,s),null)),[d,v,r]}function N_(r,i){r.action=i}function Tb(r){var i=Vt(),s=gt;if(s!==null)return Ab(i,s,r);Vt(),i=i.memoizedState,s=Vt();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function ts(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=He.updateQueue,i===null&&(i=Oc(),He.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(d=s.next,s.next=r,r.next=d,i.lastEffect=r),r}function Rb(){return Vt().memoizedState}function Lc(r,i,s,d){var p=Tn();He.flags|=r,p.memoizedState=ts(1|i,{destroy:void 0},s,d===void 0?null:d)}function Ic(r,i,s,d){var p=Vt();d=d===void 0?null:d;var v=p.memoizedState.inst;gt!==null&&d!==null&&zh(d,gt.memoizedState.deps)?p.memoizedState=ts(i,v,s,d):(He.flags|=r,p.memoizedState=ts(1|i,v,s,d))}function zb(r,i){Lc(8390656,8,r,i)}function Fh(r,i){Ic(2048,8,r,i)}function __(r){He.flags|=4;var i=He.updateQueue;if(i===null)i=Oc(),He.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Ob(r){var i=Vt().memoizedState;return __({ref:i,nextImpl:r}),function(){if((ct&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Db(r,i){return Ic(4,2,r,i)}function Mb(r,i){return Ic(4,4,r,i)}function Lb(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Ib(r,i,s){s=s!=null?s.concat([r]):null,Ic(4,4,Lb.bind(null,i,r),s)}function qh(){}function Ub(r,i){var s=Vt();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&zh(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function Pb(r,i){var s=Vt();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&zh(i,d[1]))return d[0];if(d=r(),Wi){mn(!0);try{r()}finally{mn(!1)}}return s.memoizedState=[d,i],d}function Hh(r,i,s){return s===void 0||(ca&1073741824)!==0&&(et&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Bx(),He.lanes|=r,Ya|=r,s)}function Bb(r,i,s,d){return Yn(s,i)?s:Jl.current!==null?(r=Hh(r,s,d),Yn(r,i)||(Yt=!0),r):(ca&42)===0||(ca&1073741824)!==0&&(et&261930)===0?(Yt=!0,r.memoizedState=s):(r=Bx(),He.lanes|=r,Ya|=r,i)}function $b(r,i,s,d,p){var v=ae.p;ae.p=v!==0&&8>v?v:8;var w=Z.T,N={};Z.T=N,Qh(r,!1,i,s);try{var P=p(),G=Z.S;if(G!==null&&G(N,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var re=k_(P,d);Mo(r,i,re,nr(r))}else Mo(r,i,d,nr(r))}catch(ce){Mo(r,i,{then:function(){},status:"rejected",reason:ce},nr())}finally{ae.p=v,w!==null&&N.types!==null&&(w.types=N.types),Z.T=w}}function A_(){}function Zh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=Fb(r).queue;$b(r,p,i,K,s===null?A_:function(){return qb(r),s(d)})}function Fb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:K},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function qb(r){var i=Fb(r);i.next===null&&(i=r.alternate.memoizedState),Mo(r,i.next.queue,{},nr())}function Vh(){return vn(Jo)}function Hb(){return Vt().memoizedState}function Zb(){return Vt().memoizedState}function T_(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=nr();r=Ha(s);var d=Za(i,r,s);d!==null&&(Fn(d,i,s),To(d,i,s)),i={cache:Sh()},r.payload=i;return}i=i.return}}function R_(r,i,s){var d=nr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Uc(r)?Qb(i,s):(s=ch(r,i,s,d),s!==null&&(Fn(s,r,d),Gb(s,i,d)))}function Vb(r,i,s){var d=nr();Mo(r,i,s,d)}function Mo(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Uc(r))Qb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,N=v(w,s);if(p.hasEagerState=!0,p.eagerState=N,Yn(N,w))return vc(r,i,p,0),wt===null&&yc(),!1}catch{}finally{}if(s=ch(r,i,p,d),s!==null)return Fn(s,r,d),Gb(s,i,d),!0}return!1}function Qh(r,i,s,d){if(d={lane:2,revertLane:Cm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Uc(r)){if(i)throw Error(a(479))}else i=ch(r,s,d,2),i!==null&&Fn(i,r,2)}function Uc(r){var i=r.alternate;return r===He||i!==null&&i===He}function Qb(r,i){Wl=Rc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function Gb(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,ic(r,s)}}var Lo={readContext:vn,use:Dc,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};Lo.useEffectEvent=It;var Kb={readContext:vn,use:Dc,useCallback:function(r,i){return Tn().memoizedState=[r,i===void 0?null:i],r},useContext:vn,useEffect:zb,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Lc(4194308,4,Lb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Lc(4194308,4,r,i)},useInsertionEffect:function(r,i){Lc(4,2,r,i)},useMemo:function(r,i){var s=Tn();i=i===void 0?null:i;var d=r();if(Wi){mn(!0);try{r()}finally{mn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=Tn();if(s!==void 0){var p=s(i);if(Wi){mn(!0);try{s(i)}finally{mn(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=R_.bind(null,He,r),[d.memoizedState,r]},useRef:function(r){var i=Tn();return r={current:r},i.memoizedState=r},useState:function(r){r=Bh(r);var i=r.queue,s=Vb.bind(null,He,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:qh,useDeferredValue:function(r,i){var s=Tn();return Hh(s,r,i)},useTransition:function(){var r=Bh(!1);return r=$b.bind(null,He,r.queue,!0,!1),Tn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=He,p=Tn();if(at){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),wt===null)throw Error(a(349));(et&127)!==0||gb(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,zb(vb.bind(null,d,v,r),[r]),d.flags|=2048,ts(9,{destroy:void 0},yb.bind(null,d,v,s,i),null),s},useId:function(){var r=Tn(),i=wt.identifierPrefix;if(at){var s=Pr,d=Ur;s=(d&~(1<<32-dt(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=zc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=j_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Vh,useFormState:Nb,useActionState:Nb,useOptimistic:function(r){var i=Tn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Qh.bind(null,He,!0,s),s.dispatch=i,[r,i]},useMemoCache:Ih,useCacheRefresh:function(){return Tn().memoizedState=T_.bind(null,He)},useEffectEvent:function(r){var i=Tn(),s={impl:r};return i.memoizedState=s,function(){if((ct&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Gh={readContext:vn,use:Dc,useCallback:Ub,useContext:vn,useEffect:Fh,useImperativeHandle:Ib,useInsertionEffect:Db,useLayoutEffect:Mb,useMemo:Pb,useReducer:Mc,useRef:Rb,useState:function(){return Mc(da)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Vt();return Bb(s,gt.memoizedState,r,i)},useTransition:function(){var r=Mc(da)[0],i=Vt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:pb,useId:Hb,useHostTransitionStatus:Vh,useFormState:_b,useActionState:_b,useOptimistic:function(r,i){var s=Vt();return Sb(s,gt,r,i)},useMemoCache:Ih,useCacheRefresh:Zb};Gh.useEffectEvent=Ob;var Yb={readContext:vn,use:Dc,useCallback:Ub,useContext:vn,useEffect:Fh,useImperativeHandle:Ib,useInsertionEffect:Db,useLayoutEffect:Mb,useMemo:Pb,useReducer:Ph,useRef:Rb,useState:function(){return Ph(da)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Vt();return gt===null?Hh(s,r,i):Bb(s,gt.memoizedState,r,i)},useTransition:function(){var r=Ph(da)[0],i=Vt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:pb,useId:Hb,useHostTransitionStatus:Vh,useFormState:Tb,useActionState:Tb,useOptimistic:function(r,i){var s=Vt();return gt!==null?Sb(s,gt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Ih,useCacheRefresh:Zb};Yb.useEffectEvent=Ob;function Kh(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Yh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=nr(),p=Ha(d);p.payload=i,s!=null&&(p.callback=s),i=Za(r,p,d),i!==null&&(Fn(i,r,d),To(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=nr(),p=Ha(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Za(r,p,d),i!==null&&(Fn(i,r,d),To(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=nr(),d=Ha(s);d.tag=2,i!=null&&(d.callback=i),i=Za(r,d,s),i!==null&&(Fn(i,r,s),To(i,r,s))}};function Xb(r,i,s,d,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,w):i.prototype&&i.prototype.isPureReactComponent?!wo(s,d)||!wo(p,v):!0}function Jb(r,i,s,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,d),i.state!==r&&Yh.enqueueReplaceState(i,i.state,null)}function el(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function Wb(r){gc(r)}function ex(r){console.error(r)}function tx(r){gc(r)}function Pc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function nx(r,i,s){try{var d=r.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Xh(r,i,s){return s=Ha(s),s.tag=3,s.payload={element:null},s.callback=function(){Pc(r,i)},s}function rx(r){return r=Ha(r),r.tag=3,r}function ax(r,i,s,d){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=d.value;r.payload=function(){return p(v)},r.callback=function(){nx(i,s,d)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){nx(i,s,d),typeof p!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})})}function z_(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Ql(i,s,p,!0),s=Jn.current,s!==null){switch(s.tag){case 31:case 13:return vr===null?Xc():s.alternate===null&&Ut===0&&(Ut=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===Ec?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),wm(r,d,p)),!1;case 22:return s.flags|=65536,d===Ec?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([d]):s.add(d)),wm(r,d,p)),!1}throw Error(a(435,s.tag))}return wm(r,d,p),Xc(),!1}if(at)return i=Jn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==gh&&(r=Error(a(422),{cause:d}),Co(mr(r,s)))):(d!==gh&&(i=Error(a(423),{cause:d}),Co(mr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=mr(d,s),p=Xh(r.stateNode,d,p),Nh(r,p),Ut!==4&&(Ut=2)),!1;var v=Error(a(520),{cause:d});if(v=mr(v,s),Ho===null?Ho=[v]:Ho.push(v),Ut!==4&&(Ut=2),i===null)return!0;d=mr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Xh(s.stateNode,d,r),Nh(s,r),!1;case 1:if(i=s.type,v=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Xa===null||!Xa.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=rx(p),ax(p,r,s,d),Nh(s,p),!1}s=s.return}while(s!==null);return!1}var Jh=Error(a(461)),Yt=!1;function bn(r,i,s,d){i.child=r===null?ob(i,null,s,d):Ji(i,r.child,s,d)}function ix(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var w={};for(var N in d)N!=="ref"&&(w[N]=d[N])}else w=d;return Gi(i),d=Oh(r,i,s,w,v,p),N=Dh(),r!==null&&!Yt?(Mh(r,i,p),fa(r,i,p)):(at&&N&&mh(i),i.flags|=1,bn(r,i,d,p),i.child)}function lx(r,i,s,d,p){if(r===null){var v=s.type;return typeof v=="function"&&!dh(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,sx(r,i,v,d,p)):(r=xc(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!lm(r,p)){var w=v.memoizedProps;if(s=s.compare,s=s!==null?s:wo,s(w,d)&&r.ref===i.ref)return fa(r,i,p)}return i.flags|=1,r=la(v,d),r.ref=i.ref,r.return=i,i.child=r}function sx(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(wo(v,d)&&r.ref===i.ref)if(Yt=!1,i.pendingProps=d=v,lm(r,p))(r.flags&131072)!==0&&(Yt=!0);else return i.lanes=r.lanes,fa(r,i,p)}return Wh(r,i,s,d,p)}function ox(r,i,s,d){var p=d.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~v}else d=0,i.child=null;return ux(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&jc(i,v!==null?v.cachePool:null),v!==null?db(i,v):Ah(),fb(i);else return d=i.lanes=536870912,ux(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(jc(i,v.cachePool),db(i,v),Qa(),i.memoizedState=null):(r!==null&&jc(i,null),Ah(),Qa());return bn(r,i,p,s),i.child}function Io(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function ux(r,i,s,d,p){var v=kh();return v=v===null?null:{parent:Gt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&jc(i,null),Ah(),fb(i),r!==null&&Ql(r,i,d,!0),i.childLanes=p,null}function Bc(r,i){return i=Fc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function cx(r,i,s){return Ji(i,r.child,null,s),r=Bc(i,i.pendingProps),r.flags|=2,Wn(i),i.memoizedState=null,r}function O_(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(at){if(d.mode==="hidden")return r=Bc(i,d),i.lanes=536870912,Io(null,r);if(Rh(i),(r=Et)?(r=w0(r,yr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},s=Qv(r),s.return=i,i.child=s,yn=i,Et=null)):r=null,r===null)throw $a(i);return i.lanes=536870912,null}return Bc(i,d)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(Rh(i),p)if(i.flags&256)i.flags&=-257,i=cx(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Yt||Ql(r,i,s,!1),p=(s&r.childLanes)!==0,Yt||p){if(d=wt,d!==null&&(w=ev(d,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,Hi(r,w),Fn(d,r,w),Jh;Xc(),i=cx(r,i,s)}else r=v.treeContext,Et=br(w.nextSibling),yn=i,at=!0,Ba=null,yr=!1,r!==null&&Yv(i,r),i=Bc(i,d),i.flags|=4096;return i}return r=la(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function $c(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function Wh(r,i,s,d,p){return Gi(i),s=Oh(r,i,s,d,void 0,p),d=Dh(),r!==null&&!Yt?(Mh(r,i,p),fa(r,i,p)):(at&&d&&mh(i),i.flags|=1,bn(r,i,s,p),i.child)}function dx(r,i,s,d,p,v){return Gi(i),i.updateQueue=null,s=mb(i,d,s,p),hb(r),d=Dh(),r!==null&&!Yt?(Mh(r,i,v),fa(r,i,v)):(at&&d&&mh(i),i.flags|=1,bn(r,i,s,v),i.child)}function fx(r,i,s,d,p){if(Gi(i),i.stateNode===null){var v=ql,w=s.contextType;typeof w=="object"&&w!==null&&(v=vn(w)),v=new s(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Yh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},Ch(i),w=s.contextType,v.context=typeof w=="object"&&w!==null?vn(w):ql,v.state=i.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Kh(i,s,w,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&Yh.enqueueReplaceState(v,v.state,null),zo(i,d,v,p),Ro(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,P=el(s,N);v.props=P;var G=v.context,re=s.contextType;w=ql,typeof re=="object"&&re!==null&&(w=vn(re));var ce=s.getDerivedStateFromProps;re=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,re||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||G!==w)&&Jb(i,v,d,w),qa=!1;var Y=i.memoizedState;v.state=Y,zo(i,d,v,p),Ro(),G=i.memoizedState,N||Y!==G||qa?(typeof ce=="function"&&(Kh(i,s,ce,d),G=i.memoizedState),(P=qa||Xb(i,s,P,d,Y,G,w))?(re||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=G),v.props=d,v.state=G,v.context=w,d=P):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,Eh(r,i),w=i.memoizedProps,re=el(s,w),v.props=re,ce=i.pendingProps,Y=v.context,G=s.contextType,P=ql,typeof G=="object"&&G!==null&&(P=vn(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||Y!==P)&&Jb(i,v,d,P),qa=!1,Y=i.memoizedState,v.state=Y,zo(i,d,v,p),Ro();var ee=i.memoizedState;w!==ce||Y!==ee||qa||r!==null&&r.dependencies!==null&&wc(r.dependencies)?(typeof N=="function"&&(Kh(i,s,N,d),ee=i.memoizedState),(re=qa||Xb(i,s,re,d,Y,ee,P)||r!==null&&r.dependencies!==null&&wc(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,ee,P),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,ee,P)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ee),v.props=d,v.state=ee,v.context=P,d=re):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,$c(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=Ji(i,r.child,null,p),i.child=Ji(i,null,s,p)):bn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=fa(r,i,p),r}function hx(r,i,s,d){return Vi(),i.flags|=256,bn(r,i,s,d),i.child}var em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tm(r){return{baseLanes:r,cachePool:nb()}}function nm(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=tr),r}function mx(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Zt.current&2)!==0),w&&(p=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,r===null){if(at){if(p?Va(i):Qa(),(r=Et)?(r=w0(r,yr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},s=Qv(r),s.return=i,i.child=s,yn=i,Et=null)):r=null,r===null)throw $a(i);return Um(r)?i.lanes=32:i.lanes=536870912,null}var N=d.children;return d=d.fallback,p?(Qa(),p=i.mode,N=Fc({mode:"hidden",children:N},p),d=Zi(d,p,s,null),N.return=i,d.return=i,N.sibling=d,i.child=N,d=i.child,d.memoizedState=tm(s),d.childLanes=nm(r,w,s),i.memoizedState=em,Io(null,d)):(Va(i),rm(i,N))}var P=r.memoizedState;if(P!==null&&(N=P.dehydrated,N!==null)){if(v)i.flags&256?(Va(i),i.flags&=-257,i=am(r,i,s)):i.memoizedState!==null?(Qa(),i.child=r.child,i.flags|=128,i=null):(Qa(),N=d.fallback,p=i.mode,d=Fc({mode:"visible",children:d.children},p),N=Zi(N,p,s,null),N.flags|=2,d.return=i,N.return=i,d.sibling=N,i.child=d,Ji(i,r.child,null,s),d=i.child,d.memoizedState=tm(s),d.childLanes=nm(r,w,s),i.memoizedState=em,i=Io(null,d));else if(Va(i),Um(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var G=w.dgst;w=G,d=Error(a(419)),d.stack="",d.digest=w,Co({value:d,source:null,stack:null}),i=am(r,i,s)}else if(Yt||Ql(r,i,s,!1),w=(s&r.childLanes)!==0,Yt||w){if(w=wt,w!==null&&(d=ev(w,s),d!==0&&d!==P.retryLane))throw P.retryLane=d,Hi(r,d),Fn(w,r,d),Jh;Im(N)||Xc(),i=am(r,i,s)}else Im(N)?(i.flags|=192,i.child=r.child,i=null):(r=P.treeContext,Et=br(N.nextSibling),yn=i,at=!0,Ba=null,yr=!1,r!==null&&Yv(i,r),i=rm(i,d.children),i.flags|=4096);return i}return p?(Qa(),N=d.fallback,p=i.mode,P=r.child,G=P.sibling,d=la(P,{mode:"hidden",children:d.children}),d.subtreeFlags=P.subtreeFlags&65011712,G!==null?N=la(G,N):(N=Zi(N,p,s,null),N.flags|=2),N.return=i,d.return=i,d.sibling=N,i.child=d,Io(null,d),d=i.child,N=r.child.memoizedState,N===null?N=tm(s):(p=N.cachePool,p!==null?(P=Gt._currentValue,p=p.parent!==P?{parent:P,pool:P}:p):p=nb(),N={baseLanes:N.baseLanes|s,cachePool:p}),d.memoizedState=N,d.childLanes=nm(r,w,s),i.memoizedState=em,Io(r.child,d)):(Va(i),s=r.child,r=s.sibling,s=la(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(w=i.deletions,w===null?(i.deletions=[r],i.flags|=16):w.push(r)),i.child=s,i.memoizedState=null,s)}function rm(r,i){return i=Fc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Fc(r,i){return r=Xn(22,r,null,i),r.lanes=0,r}function am(r,i,s){return Ji(i,r.child,null,s),r=rm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function px(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),bh(r.return,i,s)}function im(r,i,s,d,p,v){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function gx(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var w=Zt.current,N=(w&2)!==0;if(N?(w=w&1|2,i.flags|=128):w&=1,_(Zt,w),bn(r,i,d,s),d=at?jo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&px(r,s,i);else if(r.tag===19)px(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&Tc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),im(i,!1,p,s,v,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&Tc(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}im(i,!0,s,null,v,d);break;case"together":im(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function fa(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Ya|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Ql(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,s=la(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=la(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function lm(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&wc(r)))}function D_(r,i,s){switch(i.tag){case 3:Le(i,i.stateNode.containerInfo),Fa(i,Gt,r.memoizedState.cache),Vi();break;case 27:case 5:Ct(i);break;case 4:Le(i,i.stateNode.containerInfo);break;case 10:Fa(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Rh(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Va(i),i.flags|=128,null):(s&i.child.childLanes)!==0?mx(r,i,s):(Va(i),r=fa(r,i,s),r!==null?r.sibling:null);Va(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Ql(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return gx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),_(Zt,Zt.current),d)break;return null;case 22:return i.lanes=0,ox(r,i,s,i.pendingProps);case 24:Fa(i,Gt,r.memoizedState.cache)}return fa(r,i,s)}function yx(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Yt=!0;else{if(!lm(r,s)&&(i.flags&128)===0)return Yt=!1,D_(r,i,s);Yt=(r.flags&131072)!==0}else Yt=!1,at&&(i.flags&1048576)!==0&&Kv(i,jo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Yi(i.elementType),i.type=r,typeof r=="function")dh(r)?(d=el(r,d),i.tag=1,i=fx(null,i,r,d,s)):(i.tag=0,i=Wh(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===I){i.tag=11,i=ix(null,i,r,d,s);break e}else if(p===D){i.tag=14,i=lx(null,i,r,d,s);break e}}throw i=fe(r)||r,Error(a(306,i,""))}}return i;case 0:return Wh(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=el(d,i.pendingProps),fx(r,i,d,p,s);case 3:e:{if(Le(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,Eh(r,i),zo(i,d,null,s);var w=i.memoizedState;if(d=w.cache,Fa(i,Gt,d),d!==v.cache&&xh(i,[Gt],s,!0),Ro(),d=w.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=hx(r,i,d,s);break e}else if(d!==p){p=mr(Error(a(424)),i),Co(p),i=hx(r,i,d,s);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Et=br(r.firstChild),yn=i,at=!0,Ba=null,yr=!0,s=ob(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Vi(),d===p){i=fa(r,i,s);break e}bn(r,i,d,s)}i=i.child}return i;case 26:return $c(r,i),r===null?(s=_0(i.type,null,i.pendingProps,null))?i.memoizedState=s:at||(s=i.type,r=i.pendingProps,d=ad(ue.current).createElement(s),d[gn]=i,d[Ln]=r,xn(d,s,r),sn(d),i.stateNode=d):i.memoizedState=_0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Ct(i),r===null&&at&&(d=i.stateNode=C0(i.type,i.pendingProps,ue.current),yn=i,yr=!0,p=Et,ti(i.type)?(Pm=p,Et=br(d.firstChild)):Et=p),bn(r,i,i.pendingProps.children,s),$c(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&at&&((p=d=Et)&&(d=c2(d,i.type,i.pendingProps,yr),d!==null?(i.stateNode=d,yn=i,Et=br(d.firstChild),yr=!1,p=!0):p=!1),p||$a(i)),Ct(i),p=i.type,v=i.pendingProps,w=r!==null?r.memoizedProps:null,d=v.children,Dm(p,v)?d=null:w!==null&&Dm(p,w)&&(i.flags|=32),i.memoizedState!==null&&(p=Oh(r,i,C_,null,null,s),Jo._currentValue=p),$c(r,i),bn(r,i,d,s),i.child;case 6:return r===null&&at&&((r=s=Et)&&(s=d2(s,i.pendingProps,yr),s!==null?(i.stateNode=s,yn=i,Et=null,r=!0):r=!1),r||$a(i)),null;case 13:return mx(r,i,s);case 4:return Le(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Ji(i,null,d,s):bn(r,i,d,s),i.child;case 11:return ix(r,i,i.type,i.pendingProps,s);case 7:return bn(r,i,i.pendingProps,s),i.child;case 8:return bn(r,i,i.pendingProps.children,s),i.child;case 12:return bn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,Fa(i,i.type,d.value),bn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Gi(i),p=vn(p),d=d(p),i.flags|=1,bn(r,i,d,s),i.child;case 14:return lx(r,i,i.type,i.pendingProps,s);case 15:return sx(r,i,i.type,i.pendingProps,s);case 19:return gx(r,i,s);case 31:return O_(r,i,s);case 22:return ox(r,i,s,i.pendingProps);case 24:return Gi(i),d=vn(Gt),r===null?(p=kh(),p===null&&(p=wt,v=Sh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},Ch(i),Fa(i,Gt,p)):((r.lanes&s)!==0&&(Eh(r,i),zo(i,null,null,s),Ro()),p=r.memoizedState,v=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),Fa(i,Gt,d)):(d=v.cache,Fa(i,Gt,d),d!==p.cache&&xh(i,[Gt],s,!0))),bn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ha(r){r.flags|=4}function sm(r,i,s,d,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Hx())r.flags|=8192;else throw Xi=Ec,jh}else r.flags&=-16777217}function vx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!O0(i))if(Hx())r.flags|=8192;else throw Xi=Ec,jh}function qc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ve():536870912,r.lanes|=i,is|=i)}function Uo(r,i){if(!at)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Nt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,d=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=s,i}function M_(r,i,s){var d=i.pendingProps;switch(ph(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(i),null;case 1:return Nt(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),ua(Gt),Se(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Vl(i)?ha(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,yh())),Nt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ha(i),v!==null?(Nt(i),vx(i,v)):(Nt(i),sm(i,p,null,d,s))):v?v!==r.memoizedState?(ha(i),Nt(i),vx(i,v)):(Nt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&ha(i),Nt(i),sm(i,p,r,d,s)),null;case 27:if(te(i),s=ue.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ha(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}r=F.current,Vl(i)?Xv(i):(r=C0(p,d,s),i.stateNode=r,ha(i))}return Nt(i),null;case 5:if(te(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ha(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}if(v=F.current,Vl(i))Xv(i);else{var w=ad(ue.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?w.createElement("select",{is:d.is}):w.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?w.createElement(p,{is:d.is}):w.createElement(p)}}v[gn]=i,v[Ln]=d;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(xn(v,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ha(i)}}return Nt(i),sm(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&ha(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ue.current,Vl(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=yn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[gn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||m0(r.nodeValue,s)),r||$a(i,!0)}else r=ad(r).createTextNode(d),r[gn]=i,i.stateNode=r}return Nt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=Vl(i),s!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[gn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),r=!1}else s=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Wn(i),i):(Wn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Nt(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Vl(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[gn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),p=!1}else p=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Wn(i),i):(Wn(i),null)}return Wn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=d!==null,r=r!==null&&r.memoizedState!==null,s&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),qc(i,i.updateQueue),Nt(i),null);case 4:return Se(),r===null&&Am(i.stateNode.containerInfo),Nt(i),null;case 10:return ua(i.type),Nt(i),null;case 19:if($(Zt),d=i.memoizedState,d===null)return Nt(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Uo(d,!1);else{if(Ut!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=Tc(r),v!==null){for(i.flags|=128,Uo(d,!1),r=v.updateQueue,i.updateQueue=r,qc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Vv(s,r),s=s.sibling;return _(Zt,Zt.current&1|2),at&&sa(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&fn()>Gc&&(i.flags|=128,p=!0,Uo(d,!1),i.lanes=4194304)}else{if(!p)if(r=Tc(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,qc(i,r),Uo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!at)return Nt(i),null}else 2*fn()-d.renderingStartTime>Gc&&s!==536870912&&(i.flags|=128,p=!0,Uo(d,!1),i.lanes=4194304);d.isBackwards?(v.sibling=i.child,i.child=v):(r=d.last,r!==null?r.sibling=v:i.child=v,d.last=v)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=fn(),r.sibling=null,s=Zt.current,_(Zt,p?s&1|2:s&1),at&&sa(i,d.treeForkCount),r):(Nt(i),null);case 22:case 23:return Wn(i),Th(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(s&536870912)!==0&&(i.flags&128)===0&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),s=i.updateQueue,s!==null&&qc(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&$(Ki),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ua(Gt),Nt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function L_(r,i){switch(ph(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ua(Gt),Se(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return te(i),null;case 31:if(i.memoizedState!==null){if(Wn(i),i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Wn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return $(Zt),null;case 4:return Se(),null;case 10:return ua(i.type),null;case 22:case 23:return Wn(i),Th(),r!==null&&$(Ki),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ua(Gt),null;case 25:return null;default:return null}}function bx(r,i){switch(ph(i),i.tag){case 3:ua(Gt),Se();break;case 26:case 27:case 5:te(i);break;case 4:Se();break;case 31:i.memoizedState!==null&&Wn(i);break;case 13:Wn(i);break;case 19:$(Zt);break;case 10:ua(i.type);break;case 22:case 23:Wn(i),Th(),r!==null&&$(Ki);break;case 24:ua(Gt)}}function Po(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var v=s.create,w=s.inst;d=v(),w.destroy=d}s=s.next}while(s!==p)}}catch(N){pt(i,i.return,N)}}function Ga(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var w=d.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,p=i;var P=s,G=N;try{G()}catch(re){pt(p,P,re)}}}d=d.next}while(d!==v)}}catch(re){pt(i,i.return,re)}}function xx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{cb(i,s)}catch(d){pt(r,r.return,d)}}}function Sx(r,i,s){s.props=el(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){pt(r,i,d)}}function Bo(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof s=="function"?r.refCleanup=s(d):s.current=d}}catch(p){pt(r,i,p)}}function Br(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){pt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){pt(r,i,p)}else s.current=null}function wx(r){var i=r.type,s=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(p){pt(r,r.return,p)}}function om(r,i,s){try{var d=r.stateNode;a2(d,r.type,s,i),d[Ln]=i}catch(p){pt(r,r.return,p)}}function kx(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ti(r.type)||r.tag===4}function um(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||kx(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ti(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function cm(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=aa));else if(d!==4&&(d===27&&ti(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(cm(r,i,s),r=r.sibling;r!==null;)cm(r,i,s),r=r.sibling}function Hc(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&ti(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Hc(r,i,s),r=r.sibling;r!==null;)Hc(r,i,s),r=r.sibling}function jx(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);xn(i,d,s),i[gn]=r,i[Ln]=s}catch(v){pt(r,r.return,v)}}var ma=!1,Xt=!1,dm=!1,Cx=typeof WeakSet=="function"?WeakSet:Set,on=null;function I_(r,i){if(r=r.containerInfo,zm=dd,r=Iv(r),ah(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var w=0,N=-1,P=-1,G=0,re=0,ce=r,Y=null;t:for(;;){for(var ee;ce!==s||p!==0&&ce.nodeType!==3||(N=w+p),ce!==v||d!==0&&ce.nodeType!==3||(P=w+d),ce.nodeType===3&&(w+=ce.nodeValue.length),(ee=ce.firstChild)!==null;)Y=ce,ce=ee;for(;;){if(ce===r)break t;if(Y===s&&++G===p&&(N=w),Y===v&&++re===d&&(P=w),(ee=ce.nextSibling)!==null)break;ce=Y,Y=ce.parentNode}ce=ee}s=N===-1||P===-1?null:{start:N,end:P}}else s=null}s=s||{start:0,end:0}}else s=null;for(Om={focusedElem:r,selectionRange:s},dd=!1,on=i;on!==null;)if(i=on,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,on=r;else for(;on!==null;){switch(i=on,v=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,s=i,p=v.memoizedProps,v=v.memoizedState,d=s.stateNode;try{var je=el(s.type,p);r=d.getSnapshotBeforeUpdate(je,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(Oe){pt(s,s.return,Oe)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Lm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Lm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,on=r;break}on=i.return}}function Ex(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ga(r,s),d&4&&Po(5,s);break;case 1:if(ga(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(w){pt(s,s.return,w)}else{var p=el(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(w){pt(s,s.return,w)}}d&64&&xx(s),d&512&&Bo(s,s.return);break;case 3:if(ga(r,s),d&64&&(r=s.updateQueue,r!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{cb(r,i)}catch(w){pt(s,s.return,w)}}break;case 27:i===null&&d&4&&jx(s);case 26:case 5:ga(r,s),i===null&&d&4&&wx(s),d&512&&Bo(s,s.return);break;case 12:ga(r,s);break;case 31:ga(r,s),d&4&&Ax(r,s);break;case 13:ga(r,s),d&4&&Tx(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=V_.bind(null,s),f2(r,s))));break;case 22:if(d=s.memoizedState!==null||ma,!d){i=i!==null&&i.memoizedState!==null||Xt,p=ma;var v=Xt;ma=d,(Xt=i)&&!v?ya(r,s,(s.subtreeFlags&8772)!==0):ga(r,s),ma=p,Xt=v}break;case 30:break;default:ga(r,s)}}function Nx(r){var i=r.alternate;i!==null&&(r.alternate=null,Nx(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&$f(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var _t=null,Un=!1;function pa(r,i,s){for(s=s.child;s!==null;)_x(r,i,s),s=s.sibling}function _x(r,i,s){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(tn,s)}catch{}switch(s.tag){case 26:Xt||Br(s,i),pa(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Xt||Br(s,i);var d=_t,p=Un;ti(s.type)&&(_t=s.stateNode,Un=!1),pa(r,i,s),Ko(s.stateNode),_t=d,Un=p;break;case 5:Xt||Br(s,i);case 6:if(d=_t,p=Un,_t=null,pa(r,i,s),_t=d,Un=p,_t!==null)if(Un)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(s.stateNode)}catch(v){pt(s,i,v)}else try{_t.removeChild(s.stateNode)}catch(v){pt(s,i,v)}break;case 18:_t!==null&&(Un?(r=_t,x0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),hs(r)):x0(_t,s.stateNode));break;case 4:d=_t,p=Un,_t=s.stateNode.containerInfo,Un=!0,pa(r,i,s),_t=d,Un=p;break;case 0:case 11:case 14:case 15:Ga(2,s,i),Xt||Ga(4,s,i),pa(r,i,s);break;case 1:Xt||(Br(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Sx(s,i,d)),pa(r,i,s);break;case 21:pa(r,i,s);break;case 22:Xt=(d=Xt)||s.memoizedState!==null,pa(r,i,s),Xt=d;break;default:pa(r,i,s)}}function Ax(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{hs(r)}catch(s){pt(i,i.return,s)}}}function Tx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{hs(r)}catch(s){pt(i,i.return,s)}}function U_(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Cx),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Cx),i;default:throw Error(a(435,r.tag))}}function Zc(r,i){var s=U_(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=Q_.bind(null,r,d);d.then(p,p)}})}function Pn(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,w=i,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(ti(N.type)){_t=N.stateNode,Un=!1;break e}break;case 5:_t=N.stateNode,Un=!1;break e;case 3:case 4:_t=N.stateNode.containerInfo,Un=!0;break e}N=N.return}if(_t===null)throw Error(a(160));_x(v,w,p),_t=null,Un=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Rx(i,r),i=i.sibling}var zr=null;function Rx(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Pn(i,r),Bn(r),d&4&&(Ga(3,r,r.return),Po(3,r),Ga(5,r,r.return));break;case 1:Pn(i,r),Bn(r),d&512&&(Xt||s===null||Br(s,s.return)),d&64&&ma&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var p=zr;if(Pn(i,r),Bn(r),d&512&&(Xt||s===null||Br(s,s.return)),d&4){var v=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":v=p.getElementsByTagName("title")[0],(!v||v[ho]||v[gn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),xn(v,d,s),v[gn]=r,sn(v),d=v;break e;case"link":var w=R0("link","href",p).get(d+(s.href||""));if(w){for(var N=0;N<w.length;N++)if(v=w[N],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(N,1);break t}}v=p.createElement(d),xn(v,d,s),p.head.appendChild(v);break;case"meta":if(w=R0("meta","content",p).get(d+(s.content||""))){for(N=0;N<w.length;N++)if(v=w[N],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(N,1);break t}}v=p.createElement(d),xn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[gn]=r,sn(v),d=v}r.stateNode=d}else z0(p,r.type,r.stateNode);else r.stateNode=T0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?z0(p,r.type,r.stateNode):T0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&om(r,r.memoizedProps,s.memoizedProps)}break;case 27:Pn(i,r),Bn(r),d&512&&(Xt||s===null||Br(s,s.return)),s!==null&&d&4&&om(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Pn(i,r),Bn(r),d&512&&(Xt||s===null||Br(s,s.return)),r.flags&32){p=r.stateNode;try{Ll(p,"")}catch(je){pt(r,r.return,je)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,om(r,p,s!==null?s.memoizedProps:p)),d&1024&&(dm=!0);break;case 6:if(Pn(i,r),Bn(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(je){pt(r,r.return,je)}}break;case 3:if(sd=null,p=zr,zr=id(i.containerInfo),Pn(i,r),zr=p,Bn(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{hs(i.containerInfo)}catch(je){pt(r,r.return,je)}dm&&(dm=!1,zx(r));break;case 4:d=zr,zr=id(r.stateNode.containerInfo),Pn(i,r),Bn(r),zr=d;break;case 12:Pn(i,r),Bn(r);break;case 31:Pn(i,r),Bn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Zc(r,d)));break;case 13:Pn(i,r),Bn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Qc=fn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Zc(r,d)));break;case 22:p=r.memoizedState!==null;var P=s!==null&&s.memoizedState!==null,G=ma,re=Xt;if(ma=G||p,Xt=re||P,Pn(i,r),Xt=re,ma=G,Bn(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||P||ma||Xt||tl(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){P=s=i;try{if(v=P.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=P.stateNode;var ce=P.memoizedProps.style,Y=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;N.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(je){pt(P,P.return,je)}}}else if(i.tag===6){if(s===null){P=i;try{P.stateNode.nodeValue=p?"":P.memoizedProps}catch(je){pt(P,P.return,je)}}}else if(i.tag===18){if(s===null){P=i;try{var ee=P.stateNode;p?S0(ee,!0):S0(P.stateNode,!1)}catch(je){pt(P,P.return,je)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,Zc(r,s))));break;case 19:Pn(i,r),Bn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Zc(r,d)));break;case 30:break;case 21:break;default:Pn(i,r),Bn(r)}}function Bn(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(kx(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=um(r);Hc(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(Ll(w,""),s.flags&=-33);var N=um(r);Hc(r,N,w);break;case 3:case 4:var P=s.stateNode.containerInfo,G=um(r);cm(r,G,P);break;default:throw Error(a(161))}}catch(re){pt(r,r.return,re)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function zx(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;zx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function ga(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Ex(r,i.alternate,i),i=i.sibling}function tl(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ga(4,i,i.return),tl(i);break;case 1:Br(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Sx(i,i.return,s),tl(i);break;case 27:Ko(i.stateNode);case 26:case 5:Br(i,i.return),tl(i);break;case 22:i.memoizedState===null&&tl(i);break;case 30:tl(i);break;default:tl(i)}r=r.sibling}}function ya(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:ya(p,v,s),Po(4,v);break;case 1:if(ya(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){pt(d,d.return,G)}if(d=v,p=d.updateQueue,p!==null){var N=d.stateNode;try{var P=p.shared.hiddenCallbacks;if(P!==null)for(p.shared.hiddenCallbacks=null,p=0;p<P.length;p++)ub(P[p],N)}catch(G){pt(d,d.return,G)}}s&&w&64&&xx(v),Bo(v,v.return);break;case 27:jx(v);case 26:case 5:ya(p,v,s),s&&d===null&&w&4&&wx(v),Bo(v,v.return);break;case 12:ya(p,v,s);break;case 31:ya(p,v,s),s&&w&4&&Ax(p,v);break;case 13:ya(p,v,s),s&&w&4&&Tx(p,v);break;case 22:v.memoizedState===null&&ya(p,v,s),Bo(v,v.return);break;case 30:break;default:ya(p,v,s)}i=i.sibling}}function fm(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&Eo(s))}function hm(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Eo(r))}function Or(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ox(r,i,s,d),i=i.sibling}function Ox(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Or(r,i,s,d),p&2048&&Po(9,i);break;case 1:Or(r,i,s,d);break;case 3:Or(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Eo(r)));break;case 12:if(p&2048){Or(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,w=v.id,N=v.onPostCommit;typeof N=="function"&&N(w,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(P){pt(i,i.return,P)}}else Or(r,i,s,d);break;case 31:Or(r,i,s,d);break;case 13:Or(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?Or(r,i,s,d):$o(r,i):v._visibility&2?Or(r,i,s,d):(v._visibility|=2,ns(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&fm(w,i);break;case 24:Or(r,i,s,d),p&2048&&hm(i.alternate,i);break;default:Or(r,i,s,d)}}function ns(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,w=i,N=s,P=d,G=w.flags;switch(w.tag){case 0:case 11:case 15:ns(v,w,N,P,p),Po(8,w);break;case 23:break;case 22:var re=w.stateNode;w.memoizedState!==null?re._visibility&2?ns(v,w,N,P,p):$o(v,w):(re._visibility|=2,ns(v,w,N,P,p)),p&&G&2048&&fm(w.alternate,w);break;case 24:ns(v,w,N,P,p),p&&G&2048&&hm(w.alternate,w);break;default:ns(v,w,N,P,p)}i=i.sibling}}function $o(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:$o(s,d),p&2048&&fm(d.alternate,d);break;case 24:$o(s,d),p&2048&&hm(d.alternate,d);break;default:$o(s,d)}i=i.sibling}}var Fo=8192;function rs(r,i,s){if(r.subtreeFlags&Fo)for(r=r.child;r!==null;)Dx(r,i,s),r=r.sibling}function Dx(r,i,s){switch(r.tag){case 26:rs(r,i,s),r.flags&Fo&&r.memoizedState!==null&&j2(s,zr,r.memoizedState,r.memoizedProps);break;case 5:rs(r,i,s);break;case 3:case 4:var d=zr;zr=id(r.stateNode.containerInfo),rs(r,i,s),zr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Fo,Fo=16777216,rs(r,i,s),Fo=d):rs(r,i,s));break;default:rs(r,i,s)}}function Mx(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function qo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];on=d,Ix(d,r)}Mx(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Lx(r),r=r.sibling}function Lx(r){switch(r.tag){case 0:case 11:case 15:qo(r),r.flags&2048&&Ga(9,r,r.return);break;case 3:qo(r);break;case 12:qo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Vc(r)):qo(r);break;default:qo(r)}}function Vc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];on=d,Ix(d,r)}Mx(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ga(8,i,i.return),Vc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Vc(i));break;default:Vc(i)}r=r.sibling}}function Ix(r,i){for(;on!==null;){var s=on;switch(s.tag){case 0:case 11:case 15:Ga(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Eo(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,on=d;else e:for(s=r;on!==null;){d=on;var p=d.sibling,v=d.return;if(Nx(d),d===s){on=null;break e}if(p!==null){p.return=v,on=p;break e}on=v}}}var P_={getCacheForType:function(r){var i=vn(Gt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return vn(Gt).controller.signal}},B_=typeof WeakMap=="function"?WeakMap:Map,ct=0,wt=null,Xe=null,et=0,mt=0,er=null,Ka=!1,as=!1,mm=!1,va=0,Ut=0,Ya=0,nl=0,pm=0,tr=0,is=0,Ho=null,$n=null,gm=!1,Qc=0,Ux=0,Gc=1/0,Kc=null,Xa=null,nn=0,Ja=null,ls=null,ba=0,ym=0,vm=null,Px=null,Zo=0,bm=null;function nr(){return(ct&2)!==0&&et!==0?et&-et:Z.T!==null?Cm():tv()}function Bx(){if(tr===0)if((et&536870912)===0||at){var r=Ii;Ii<<=1,(Ii&3932160)===0&&(Ii=262144),tr=r}else tr=536870912;return r=Jn.current,r!==null&&(r.flags|=32),tr}function Fn(r,i,s){(r===wt&&(mt===2||mt===9)||r.cancelPendingCommit!==null)&&(ss(r,0),Wa(r,et,tr,!1)),pn(r,s),((ct&2)===0||r!==wt)&&(r===wt&&((ct&2)===0&&(nl|=s),Ut===4&&Wa(r,et,tr,!1)),$r(r))}function $x(r,i,s){if((ct&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||La(r,i),p=d?q_(r,i):Sm(r,i,!0),v=d;do{if(p===0){as&&!d&&Wa(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!$_(s)){p=Sm(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var N=r;p=Ho;var P=N.current.memoizedState.isDehydrated;if(P&&(ss(N,w).flags|=256),w=Sm(N,w,!1),w!==2){if(mm&&!P){N.errorRecoveryDisabledLanes|=v,nl|=v,p=4;break e}v=$n,$n=p,v!==null&&($n===null?$n=v:$n.push.apply($n,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){ss(r,0),Wa(r,i,0,!0);break}e:{switch(d=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Wa(d,i,tr,!Ka);break e;case 2:$n=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Qc+300-fn(),10<p)){if(Wa(d,i,tr,!Ka),Pi(d,0,!0)!==0)break e;ba=i,d.timeoutHandle=v0(Fx.bind(null,d,s,$n,Kc,gm,i,tr,nl,is,Ka,v,"Throttled",-0,0),p);break e}Fx(d,s,$n,Kc,gm,i,tr,nl,is,Ka,v,null,-0,0)}}break}while(!0);$r(r)}function Fx(r,i,s,d,p,v,w,N,P,G,re,ce,Y,ee){if(r.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:aa},Dx(i,v,ce);var je=(v&62914560)===v?Qc-fn():(v&4194048)===v?Ux-fn():0;if(je=C2(ce,je),je!==null){ba=v,r.cancelPendingCommit=je(Yx.bind(null,r,i,v,s,d,p,w,N,P,re,ce,null,Y,ee)),Wa(r,v,w,!G);return}}Yx(r,i,v,s,d,p,w,N,P)}function $_(r){for(var i=r;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var d=0;d<s.length;d++){var p=s[d],v=p.getSnapshot;p=p.value;try{if(!Yn(v(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Wa(r,i,s,d){i&=~pm,i&=~nl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-dt(p),w=1<<v;d[v]=-1,p&=~w}s!==0&&fo(r,s,i)}function Yc(){return(ct&6)===0?(Vo(0),!1):!0}function xm(){if(Xe!==null){if(mt===0)var r=Xe.return;else r=Xe,oa=Qi=null,Lh(r),Xl=null,_o=0,r=Xe;for(;r!==null;)bx(r.alternate,r),r=r.return;Xe=null}}function ss(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,s2(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),ba=0,xm(),wt=r,Xe=s=la(r.current,null),et=i,mt=0,er=null,Ka=!1,as=La(r,i),mm=!1,is=tr=pm=nl=Ya=Ut=0,$n=Ho=null,gm=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-dt(d),v=1<<p;i|=r[p],d&=~v}return va=i,yc(),s}function qx(r,i){He=null,Z.H=Lo,i===Yl||i===Cc?(i=ib(),mt=3):i===jh?(i=ib(),mt=4):mt=i===Jh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,er=i,Xe===null&&(Ut=1,Pc(r,mr(i,r.current)))}function Hx(){var r=Jn.current;return r===null?!0:(et&4194048)===et?vr===null:(et&62914560)===et||(et&536870912)!==0?r===vr:!1}function Zx(){var r=Z.H;return Z.H=Lo,r===null?Lo:r}function Vx(){var r=Z.A;return Z.A=P_,r}function Xc(){Ut=4,Ka||(et&4194048)!==et&&Jn.current!==null||(as=!0),(Ya&134217727)===0&&(nl&134217727)===0||wt===null||Wa(wt,et,tr,!1)}function Sm(r,i,s){var d=ct;ct|=2;var p=Zx(),v=Vx();(wt!==r||et!==i)&&(Kc=null,ss(r,i)),i=!1;var w=Ut;e:do try{if(mt!==0&&Xe!==null){var N=Xe,P=er;switch(mt){case 8:xm(),w=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(i=!0);var G=mt;if(mt=0,er=null,os(r,N,P,G),s&&as){w=0;break e}break;default:G=mt,mt=0,er=null,os(r,N,P,G)}}F_(),w=Ut;break}catch(re){qx(r,re)}while(!0);return i&&r.shellSuspendCounter++,oa=Qi=null,ct=d,Z.H=p,Z.A=v,Xe===null&&(wt=null,et=0,yc()),w}function F_(){for(;Xe!==null;)Qx(Xe)}function q_(r,i){var s=ct;ct|=2;var d=Zx(),p=Vx();wt!==r||et!==i?(Kc=null,Gc=fn()+500,ss(r,i)):as=La(r,i);e:do try{if(mt!==0&&Xe!==null){i=Xe;var v=er;t:switch(mt){case 1:mt=0,er=null,os(r,i,v,1);break;case 2:case 9:if(rb(v)){mt=0,er=null,Gx(i);break}i=function(){mt!==2&&mt!==9||wt!==r||(mt=7),$r(r)},v.then(i,i);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:rb(v)?(mt=0,er=null,Gx(i)):(mt=0,er=null,os(r,i,v,7));break;case 5:var w=null;switch(Xe.tag){case 26:w=Xe.memoizedState;case 5:case 27:var N=Xe;if(w?O0(w):N.stateNode.complete){mt=0,er=null;var P=N.sibling;if(P!==null)Xe=P;else{var G=N.return;G!==null?(Xe=G,Jc(G)):Xe=null}break t}}mt=0,er=null,os(r,i,v,5);break;case 6:mt=0,er=null,os(r,i,v,6);break;case 8:xm(),Ut=6;break e;default:throw Error(a(462))}}H_();break}catch(re){qx(r,re)}while(!0);return oa=Qi=null,Z.H=d,Z.A=p,ct=s,Xe!==null?0:(wt=null,et=0,yc(),Ut)}function H_(){for(;Xe!==null&&!oo();)Qx(Xe)}function Qx(r){var i=yx(r.alternate,r,va);r.memoizedProps=r.pendingProps,i===null?Jc(r):Xe=i}function Gx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=dx(s,i,i.pendingProps,i.type,void 0,et);break;case 11:i=dx(s,i,i.pendingProps,i.type.render,i.ref,et);break;case 5:Lh(i);default:bx(s,i),i=Xe=Vv(i,va),i=yx(s,i,va)}r.memoizedProps=r.pendingProps,i===null?Jc(r):Xe=i}function os(r,i,s,d){oa=Qi=null,Lh(i),Xl=null,_o=0;var p=i.return;try{if(z_(r,p,i,s,et)){Ut=1,Pc(r,mr(s,r.current)),Xe=null;return}}catch(v){if(p!==null)throw Xe=p,v;Ut=1,Pc(r,mr(s,r.current)),Xe=null;return}i.flags&32768?(at||d===1?r=!0:as||(et&536870912)!==0?r=!1:(Ka=r=!0,(d===2||d===9||d===3||d===6)&&(d=Jn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Kx(i,r)):Jc(i)}function Jc(r){var i=r;do{if((i.flags&32768)!==0){Kx(i,Ka);return}r=i.return;var s=M_(i.alternate,i,va);if(s!==null){Xe=s;return}if(i=i.sibling,i!==null){Xe=i;return}Xe=i=r}while(i!==null);Ut===0&&(Ut=5)}function Kx(r,i){do{var s=L_(r.alternate,r);if(s!==null){s.flags&=32767,Xe=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Xe=r;return}Xe=r=s}while(r!==null);Ut=6,Xe=null}function Yx(r,i,s,d,p,v,w,N,P){r.cancelPendingCommit=null;do Wc();while(nn!==0);if((ct&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=uh,na(r,s,v,w,N,P),r===wt&&(Xe=wt=null,et=0),ls=i,Ja=r,ba=s,ym=v,vm=p,Px=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,G_(Me,function(){return t0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null,p=ae.p,ae.p=2,w=ct,ct|=4;try{I_(r,i,s)}finally{ct=w,ae.p=p,Z.T=d}}nn=1,Xx(),Jx(),Wx()}}function Xx(){if(nn===1){nn=0;var r=Ja,i=ls,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null;var d=ae.p;ae.p=2;var p=ct;ct|=4;try{Rx(i,r);var v=Om,w=Iv(r.containerInfo),N=v.focusedElem,P=v.selectionRange;if(w!==N&&N&&N.ownerDocument&&Lv(N.ownerDocument.documentElement,N)){if(P!==null&&ah(N)){var G=P.start,re=P.end;if(re===void 0&&(re=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(re,N.value.length);else{var ce=N.ownerDocument||document,Y=ce&&ce.defaultView||window;if(Y.getSelection){var ee=Y.getSelection(),je=N.textContent.length,Oe=Math.min(P.start,je),vt=P.end===void 0?Oe:Math.min(P.end,je);!ee.extend&&Oe>vt&&(w=vt,vt=Oe,Oe=w);var V=Mv(N,Oe),q=Mv(N,vt);if(V&&q&&(ee.rangeCount!==1||ee.anchorNode!==V.node||ee.anchorOffset!==V.offset||ee.focusNode!==q.node||ee.focusOffset!==q.offset)){var Q=ce.createRange();Q.setStart(V.node,V.offset),ee.removeAllRanges(),Oe>vt?(ee.addRange(Q),ee.extend(q.node,q.offset)):(Q.setEnd(q.node,q.offset),ee.addRange(Q))}}}}for(ce=[],ee=N;ee=ee.parentNode;)ee.nodeType===1&&ce.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ce.length;N++){var oe=ce[N];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}dd=!!zm,Om=zm=null}finally{ct=p,ae.p=d,Z.T=s}}r.current=i,nn=2}}function Jx(){if(nn===2){nn=0;var r=Ja,i=ls,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=Z.T,Z.T=null;var d=ae.p;ae.p=2;var p=ct;ct|=4;try{Ex(r,i.alternate,i)}finally{ct=p,ae.p=d,Z.T=s}}nn=3}}function Wx(){if(nn===4||nn===3){nn=0,uo();var r=Ja,i=ls,s=ba,d=Px;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?nn=5:(nn=0,ls=Ja=null,e0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Xa=null),Pf(s),i=i.stateNode,Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(tn,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Z.T,p=ae.p,ae.p=2,Z.T=null;try{for(var v=r.onRecoverableError,w=0;w<d.length;w++){var N=d[w];v(N.value,{componentStack:N.stack})}}finally{Z.T=i,ae.p=p}}(ba&3)!==0&&Wc(),$r(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===bm?Zo++:(Zo=0,bm=r):Zo=0,Vo(0)}}function e0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Eo(i)))}function Wc(){return Xx(),Jx(),Wx(),t0()}function t0(){if(nn!==5)return!1;var r=Ja,i=ym;ym=0;var s=Pf(ba),d=Z.T,p=ae.p;try{ae.p=32>s?32:s,Z.T=null,s=vm,vm=null;var v=Ja,w=ba;if(nn=0,ls=Ja=null,ba=0,(ct&6)!==0)throw Error(a(331));var N=ct;if(ct|=4,Lx(v.current),Ox(v,v.current,w,s),ct=N,Vo(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(tn,v)}catch{}return!0}finally{ae.p=p,Z.T=d,e0(r,i)}}function n0(r,i,s){i=mr(s,i),i=Xh(r.stateNode,i,2),r=Za(r,i,2),r!==null&&(pn(r,2),$r(r))}function pt(r,i,s){if(r.tag===3)n0(r,r,s);else for(;i!==null;){if(i.tag===3){n0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Xa===null||!Xa.has(d))){r=mr(s,r),s=rx(2),d=Za(i,s,2),d!==null&&(ax(s,d,i,r),pn(d,2),$r(d));break}}i=i.return}}function wm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new B_;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(s)||(mm=!0,p.add(s),r=Z_.bind(null,r,i,s),i.then(r,r))}function Z_(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,wt===r&&(et&s)===s&&(Ut===4||Ut===3&&(et&62914560)===et&&300>fn()-Qc?(ct&2)===0&&ss(r,0):pm|=s,is===et&&(is=0)),$r(r)}function r0(r,i){i===0&&(i=ve()),r=Hi(r,i),r!==null&&(pn(r,i),$r(r))}function V_(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),r0(r,s)}function Q_(r,i){var s=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),r0(r,s)}function G_(r,i){return Ma(r,i)}var ed=null,us=null,km=!1,td=!1,jm=!1,ei=0;function $r(r){r!==us&&r.next===null&&(us===null?ed=us=r:us=us.next=r),td=!0,km||(km=!0,Y_())}function Vo(r,i){if(!jm&&td){jm=!0;do for(var s=!1,d=ed;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var w=d.suspendedLanes,N=d.pingedLanes;v=(1<<31-dt(42|r)+1)-1,v&=p&~(w&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,s0(d,v))}else v=et,v=Pi(d,d===wt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||La(d,v)||(s=!0,s0(d,v));d=d.next}while(s);jm=!1}}function K_(){a0()}function a0(){td=km=!1;var r=0;ei!==0&&l2()&&(r=ei);for(var i=fn(),s=null,d=ed;d!==null;){var p=d.next,v=i0(d,i);v===0?(d.next=null,s===null?ed=p:s.next=p,p===null&&(us=s)):(s=d,(r!==0||(v&3)!==0)&&(td=!0)),d=p}nn!==0&&nn!==5||Vo(r),ei!==0&&(ei=0)}function i0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-dt(v),N=1<<w,P=p[w];P===-1?((N&s)===0||(N&d)!==0)&&(p[w]=ac(N,i)):P<=i&&(r.expiredLanes|=N),v&=~N}if(i=wt,s=et,s=Pi(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(mt===2||mt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&ta(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||La(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&ta(d),Pf(s)){case 2:case 8:s=ye;break;case 32:s=Me;break;case 268435456:s=rt;break;default:s=Me}return d=l0.bind(null,r),s=Ma(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&ta(d),r.callbackPriority=2,r.callbackNode=null,2}function l0(r,i){if(nn!==0&&nn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Wc()&&r.callbackNode!==s)return null;var d=et;return d=Pi(r,r===wt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:($x(r,d,i),i0(r,fn()),r.callbackNode!=null&&r.callbackNode===s?l0.bind(null,r):null)}function s0(r,i){if(Wc())return null;$x(r,i,!0)}function Y_(){o2(function(){(ct&6)!==0?Ma(le,K_):a0()})}function Cm(){if(ei===0){var r=Gl;r===0&&(r=Li,Li<<=1,(Li&261888)===0&&(Li=256)),ei=r}return ei}function o0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:uc(""+r)}function u0(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function X_(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=o0((p[Ln]||null).action),w=d.submitter;w&&(i=(i=w[Ln]||null)?o0(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var N=new hc("action","action",null,d,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ei!==0){var P=w?u0(p,w):new FormData(p);Zh(s,{pending:!0,data:P,method:p.method,action:v},null,P)}}else typeof v=="function"&&(N.preventDefault(),P=w?u0(p,w):new FormData(p),Zh(s,{pending:!0,data:P,method:p.method,action:v},v,P))},currentTarget:p}]})}}for(var Em=0;Em<oh.length;Em++){var Nm=oh[Em],J_=Nm.toLowerCase(),W_=Nm[0].toUpperCase()+Nm.slice(1);Rr(J_,"on"+W_)}Rr(Bv,"onAnimationEnd"),Rr($v,"onAnimationIteration"),Rr(Fv,"onAnimationStart"),Rr("dblclick","onDoubleClick"),Rr("focusin","onFocus"),Rr("focusout","onBlur"),Rr(p_,"onTransitionRun"),Rr(g_,"onTransitionStart"),Rr(y_,"onTransitionCancel"),Rr(qv,"onTransitionEnd"),Dl("onMouseEnter",["mouseout","mouseover"]),Dl("onMouseLeave",["mouseout","mouseover"]),Dl("onPointerEnter",["pointerout","pointerover"]),Dl("onPointerLeave",["pointerout","pointerover"]),Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="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(" "),e2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qo));function c0(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var w=d.length-1;0<=w;w--){var N=d[w],P=N.instance,G=N.currentTarget;if(N=N.listener,P!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(re){gc(re)}p.currentTarget=null,v=P}else for(w=0;w<d.length;w++){if(N=d[w],P=N.instance,G=N.currentTarget,N=N.listener,P!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(re){gc(re)}p.currentTarget=null,v=P}}}}function Je(r,i){var s=i[Bf];s===void 0&&(s=i[Bf]=new Set);var d=r+"__bubble";s.has(d)||(d0(i,r,2,!1),s.add(d))}function _m(r,i,s){var d=0;i&&(d|=4),d0(s,r,d,i)}var nd="_reactListening"+Math.random().toString(36).slice(2);function Am(r){if(!r[nd]){r[nd]=!0,av.forEach(function(s){s!=="selectionchange"&&(e2.has(s)||_m(s,!1,r),_m(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[nd]||(i[nd]=!0,_m("selectionchange",!1,i))}}function d0(r,i,s,d){switch(B0(i)){case 2:var p=_2;break;case 8:p=A2;break;default:p=Hm}s=p.bind(null,i,s,r),p=void 0,!Kf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function Tm(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var w=d.tag;if(w===3||w===4){var N=d.stateNode.containerInfo;if(N===p)break;if(w===4)for(w=d.return;w!==null;){var P=w.tag;if((P===3||P===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;N!==null;){if(w=Rl(N),w===null)return;if(P=w.tag,P===5||P===6||P===26||P===27){d=v=w;continue e}N=N.parentNode}}d=d.return}gv(function(){var G=v,re=Qf(s),ce=[];e:{var Y=Hv.get(r);if(Y!==void 0){var ee=hc,je=r;switch(r){case"keypress":if(dc(s)===0)break e;case"keydown":case"keyup":ee=QN;break;case"focusin":je="focus",ee=Wf;break;case"focusout":je="blur",ee=Wf;break;case"beforeblur":case"afterblur":ee=Wf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=bv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=MN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=YN;break;case Bv:case $v:case Fv:ee=UN;break;case qv:ee=JN;break;case"scroll":case"scrollend":ee=ON;break;case"wheel":ee=e_;break;case"copy":case"cut":case"paste":ee=BN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Sv;break;case"toggle":case"beforetoggle":ee=n_}var Oe=(i&4)!==0,vt=!Oe&&(r==="scroll"||r==="scrollend"),V=Oe?Y!==null?Y+"Capture":null:Y;Oe=[];for(var q=G,Q;q!==null;){var oe=q;if(Q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Q===null||V===null||(oe=po(q,V),oe!=null&&Oe.push(Go(q,oe,Q))),vt)break;q=q.return}0<Oe.length&&(Y=new ee(Y,je,null,s,re),ce.push({event:Y,listeners:Oe}))}}if((i&7)===0){e:{if(Y=r==="mouseover"||r==="pointerover",ee=r==="mouseout"||r==="pointerout",Y&&s!==Vf&&(je=s.relatedTarget||s.fromElement)&&(Rl(je)||je[Tl]))break e;if((ee||Y)&&(Y=re.window===re?re:(Y=re.ownerDocument)?Y.defaultView||Y.parentWindow:window,ee?(je=s.relatedTarget||s.toElement,ee=G,je=je?Rl(je):null,je!==null&&(vt=o(je),Oe=je.tag,je!==vt||Oe!==5&&Oe!==27&&Oe!==6)&&(je=null)):(ee=null,je=G),ee!==je)){if(Oe=bv,oe="onMouseLeave",V="onMouseEnter",q="mouse",(r==="pointerout"||r==="pointerover")&&(Oe=Sv,oe="onPointerLeave",V="onPointerEnter",q="pointer"),vt=ee==null?Y:mo(ee),Q=je==null?Y:mo(je),Y=new Oe(oe,q+"leave",ee,s,re),Y.target=vt,Y.relatedTarget=Q,oe=null,Rl(re)===G&&(Oe=new Oe(V,q+"enter",je,s,re),Oe.target=Q,Oe.relatedTarget=vt,oe=Oe),vt=oe,ee&&je)t:{for(Oe=t2,V=ee,q=je,Q=0,oe=V;oe;oe=Oe(oe))Q++;oe=0;for(var Re=q;Re;Re=Oe(Re))oe++;for(;0<Q-oe;)V=Oe(V),Q--;for(;0<oe-Q;)q=Oe(q),oe--;for(;Q--;){if(V===q||q!==null&&V===q.alternate){Oe=V;break t}V=Oe(V),q=Oe(q)}Oe=null}else Oe=null;ee!==null&&f0(ce,Y,ee,Oe,!1),je!==null&&vt!==null&&f0(ce,vt,je,Oe,!0)}}e:{if(Y=G?mo(G):window,ee=Y.nodeName&&Y.nodeName.toLowerCase(),ee==="select"||ee==="input"&&Y.type==="file")var ot=Av;else if(Nv(Y))if(Tv)ot=f_;else{ot=c_;var Ne=u_}else ee=Y.nodeName,!ee||ee.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&Zf(G.elementType)&&(ot=Av):ot=d_;if(ot&&(ot=ot(r,G))){_v(ce,ot,s,re);break e}Ne&&Ne(r,Y,G),r==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&Hf(Y,"number",Y.value)}switch(Ne=G?mo(G):window,r){case"focusin":(Nv(Ne)||Ne.contentEditable==="true")&&(Bl=Ne,ih=G,ko=null);break;case"focusout":ko=ih=Bl=null;break;case"mousedown":lh=!0;break;case"contextmenu":case"mouseup":case"dragend":lh=!1,Uv(ce,s,re);break;case"selectionchange":if(m_)break;case"keydown":case"keyup":Uv(ce,s,re)}var Ze;if(th)e:{switch(r){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else Pl?Cv(r,s)&&(tt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(tt="onCompositionStart");tt&&(wv&&s.locale!=="ko"&&(Pl||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Pl&&(Ze=yv()):(Ua=re,Yf="value"in Ua?Ua.value:Ua.textContent,Pl=!0)),Ne=rd(G,tt),0<Ne.length&&(tt=new xv(tt,r,null,s,re),ce.push({event:tt,listeners:Ne}),Ze?tt.data=Ze:(Ze=Ev(s),Ze!==null&&(tt.data=Ze)))),(Ze=a_?i_(r,s):l_(r,s))&&(tt=rd(G,"onBeforeInput"),0<tt.length&&(Ne=new xv("onBeforeInput","beforeinput",null,s,re),ce.push({event:Ne,listeners:tt}),Ne.data=Ze)),X_(ce,r,G,s,re)}c0(ce,i)})}function Go(r,i,s){return{instance:r,listener:i,currentTarget:s}}function rd(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=po(r,s),p!=null&&d.unshift(Go(r,p,v)),p=po(r,i),p!=null&&d.push(Go(r,p,v))),r.tag===3)return d;r=r.return}return[]}function t2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function f0(r,i,s,d,p){for(var v=i._reactName,w=[];s!==null&&s!==d;){var N=s,P=N.alternate,G=N.stateNode;if(N=N.tag,P!==null&&P===d)break;N!==5&&N!==26&&N!==27||G===null||(P=G,p?(G=po(s,v),G!=null&&w.unshift(Go(s,G,P))):p||(G=po(s,v),G!=null&&w.push(Go(s,G,P)))),s=s.return}w.length!==0&&r.push({event:i,listeners:w})}var n2=/\r\n?/g,r2=/\u0000|\uFFFD/g;function h0(r){return(typeof r=="string"?r:""+r).replace(n2,`
49
+ `).replace(r2,"")}function m0(r,i){return i=h0(i),h0(r)===i}function yt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ll(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ll(r,""+d);break;case"className":sc(r,"class",d);break;case"tabIndex":sc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":sc(r,s,d);break;case"style":mv(r,d,v);break;case"data":if(i!=="object"){sc(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=uc(""+d),r.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(s==="formAction"?(i!=="input"&&yt(r,i,"name",p.name,p,null),yt(r,i,"formEncType",p.formEncType,p,null),yt(r,i,"formMethod",p.formMethod,p,null),yt(r,i,"formTarget",p.formTarget,p,null)):(yt(r,i,"encType",p.encType,p,null),yt(r,i,"method",p.method,p,null),yt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=uc(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=aa);break;case"onScroll":d!=null&&Je("scroll",r);break;case"onScrollEnd":d!=null&&Je("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}s=uc(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""+d):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":d===!0?r.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,d):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(s,d):r.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(s):r.setAttribute(s,d);break;case"popover":Je("beforetoggle",r),Je("toggle",r),lc(r,"popover",d);break;case"xlinkActuate":ra(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ra(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ra(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ra(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ra(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ra(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ra(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ra(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ra(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":lc(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=RN.get(s)||s,lc(r,s,d))}}function Rm(r,i,s,d,p,v){switch(s){case"style":mv(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof d=="string"?Ll(r,d):(typeof d=="number"||typeof d=="bigint")&&Ll(r,""+d);break;case"onScroll":d!=null&&Je("scroll",r);break;case"onScrollEnd":d!=null&&Je("scrollend",r);break;case"onClick":d!=null&&(r.onclick=aa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!iv.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),v=r[Ln]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof d=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,d,p);break e}s in r?r[s]=d:d===!0?r.setAttribute(s,""):lc(r,s,d)}}}function xn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",r),Je("load",r);var d=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var w=s[v];if(w!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:yt(r,i,v,w,s,null)}}p&&yt(r,i,"srcSet",s.srcSet,s,null),d&&yt(r,i,"src",s.src,s,null);return;case"input":Je("invalid",r);var N=v=w=p=null,P=null,G=null;for(d in s)if(s.hasOwnProperty(d)){var re=s[d];if(re!=null)switch(d){case"name":p=re;break;case"type":w=re;break;case"checked":P=re;break;case"defaultChecked":G=re;break;case"value":v=re;break;case"defaultValue":N=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:yt(r,i,d,re,s,null)}}cv(r,v,N,P,G,w,p,!1);return;case"select":Je("invalid",r),d=w=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":w=N;break;case"multiple":d=N;default:yt(r,i,p,N,s,null)}i=v,s=w,r.multiple=!!d,i!=null?Ml(r,!!d,i,!1):s!=null&&Ml(r,!!d,s,!0);return;case"textarea":Je("invalid",r),v=p=d=null;for(w in s)if(s.hasOwnProperty(w)&&(N=s[w],N!=null))switch(w){case"value":d=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:yt(r,i,w,N,s,null)}fv(r,d,p,v);return;case"option":for(P in s)if(s.hasOwnProperty(P)&&(d=s[P],d!=null))switch(P){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:yt(r,i,P,d,s,null)}return;case"dialog":Je("beforetoggle",r),Je("toggle",r),Je("cancel",r),Je("close",r);break;case"iframe":case"object":Je("load",r);break;case"video":case"audio":for(d=0;d<Qo.length;d++)Je(Qo[d],r);break;case"image":Je("error",r),Je("load",r);break;case"details":Je("toggle",r);break;case"embed":case"source":case"link":Je("error",r),Je("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in s)if(s.hasOwnProperty(G)&&(d=s[G],d!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:yt(r,i,G,d,s,null)}return;default:if(Zf(i)){for(re in s)s.hasOwnProperty(re)&&(d=s[re],d!==void 0&&Rm(r,i,re,d,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(d=s[N],d!=null&&yt(r,i,N,d,s,null))}function a2(r,i,s,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,w=null,N=null,P=null,G=null,re=null;for(ee in s){var ce=s[ee];if(s.hasOwnProperty(ee)&&ce!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":P=ce;default:d.hasOwnProperty(ee)||yt(r,i,ee,null,d,ce)}}for(var Y in d){var ee=d[Y];if(ce=s[Y],d.hasOwnProperty(Y)&&(ee!=null||ce!=null))switch(Y){case"type":v=ee;break;case"name":p=ee;break;case"checked":G=ee;break;case"defaultChecked":re=ee;break;case"value":w=ee;break;case"defaultValue":N=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,i));break;default:ee!==ce&&yt(r,i,Y,ee,d,ce)}}qf(r,w,N,P,G,re,v,p);return;case"select":ee=w=N=Y=null;for(v in s)if(P=s[v],s.hasOwnProperty(v)&&P!=null)switch(v){case"value":break;case"multiple":ee=P;default:d.hasOwnProperty(v)||yt(r,i,v,null,d,P)}for(p in d)if(v=d[p],P=s[p],d.hasOwnProperty(p)&&(v!=null||P!=null))switch(p){case"value":Y=v;break;case"defaultValue":N=v;break;case"multiple":w=v;default:v!==P&&yt(r,i,p,v,d,P)}i=N,s=w,d=ee,Y!=null?Ml(r,!!s,Y,!1):!!d!=!!s&&(i!=null?Ml(r,!!s,i,!0):Ml(r,!!s,s?[]:"",!1));return;case"textarea":ee=Y=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!d.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:yt(r,i,N,null,d,p)}for(w in d)if(p=d[w],v=s[w],d.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":Y=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&yt(r,i,w,p,d,v)}dv(r,Y,ee);return;case"option":for(var je in s)if(Y=s[je],s.hasOwnProperty(je)&&Y!=null&&!d.hasOwnProperty(je))switch(je){case"selected":r.selected=!1;break;default:yt(r,i,je,null,d,Y)}for(P in d)if(Y=d[P],ee=s[P],d.hasOwnProperty(P)&&Y!==ee&&(Y!=null||ee!=null))switch(P){case"selected":r.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:yt(r,i,P,Y,d,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in s)Y=s[Oe],s.hasOwnProperty(Oe)&&Y!=null&&!d.hasOwnProperty(Oe)&&yt(r,i,Oe,null,d,Y);for(G in d)if(Y=d[G],ee=s[G],d.hasOwnProperty(G)&&Y!==ee&&(Y!=null||ee!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:yt(r,i,G,Y,d,ee)}return;default:if(Zf(i)){for(var vt in s)Y=s[vt],s.hasOwnProperty(vt)&&Y!==void 0&&!d.hasOwnProperty(vt)&&Rm(r,i,vt,void 0,d,Y);for(re in d)Y=d[re],ee=s[re],!d.hasOwnProperty(re)||Y===ee||Y===void 0&&ee===void 0||Rm(r,i,re,Y,d,ee);return}}for(var V in s)Y=s[V],s.hasOwnProperty(V)&&Y!=null&&!d.hasOwnProperty(V)&&yt(r,i,V,null,d,Y);for(ce in d)Y=d[ce],ee=s[ce],!d.hasOwnProperty(ce)||Y===ee||Y==null&&ee==null||yt(r,i,ce,Y,d,ee)}function p0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],v=p.transferSize,w=p.initiatorType,N=p.duration;if(v&&N&&p0(w)){for(w=0,N=p.responseEnd,d+=1;d<s.length;d++){var P=s[d],G=P.startTime;if(G>N)break;var re=P.transferSize,ce=P.initiatorType;re&&p0(ce)&&(P=P.responseEnd,w+=re*(P<N?1:(N-G)/(P-G)))}if(--d,i+=8*(v+w)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var zm=null,Om=null;function ad(r){return r.nodeType===9?r:r.ownerDocument}function g0(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function y0(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function Dm(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Mm=null;function l2(){var r=window.event;return r&&r.type==="popstate"?r===Mm?!1:(Mm=r,!0):(Mm=null,!1)}var v0=typeof setTimeout=="function"?setTimeout:void 0,s2=typeof clearTimeout=="function"?clearTimeout:void 0,b0=typeof Promise=="function"?Promise:void 0,o2=typeof queueMicrotask=="function"?queueMicrotask:typeof b0<"u"?function(r){return b0.resolve(null).then(r).catch(u2)}:v0;function u2(r){setTimeout(function(){throw r})}function ti(r){return r==="head"}function x0(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),hs(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Ko(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Ko(s);for(var v=s.firstChild;v;){var w=v.nextSibling,N=v.nodeName;v[ho]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&Ko(r.ownerDocument.body);s=p}while(s);hs(i)}function S0(r,i){var s=r;r=0;do{var d=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=d}while(s)}function Lm(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Lm(s),$f(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function c2(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[ho])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=br(r.nextSibling),r===null)break}return null}function d2(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=br(r.nextSibling),r===null))return null;return r}function w0(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=br(r.nextSibling),r===null))return null;return r}function Im(r){return r.data==="$?"||r.data==="$~"}function Um(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function f2(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var d=function(){i(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function br(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var Pm=null;function k0(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return br(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function j0(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function C0(r,i,s){switch(i=ad(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Ko(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);$f(r)}var xr=new Map,E0=new Set;function id(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var xa=ae.d;ae.d={f:h2,r:m2,D:p2,C:g2,L:y2,m:v2,X:x2,S:b2,M:S2};function h2(){var r=xa.f(),i=Yc();return r||i}function m2(r){var i=zl(r);i!==null&&i.tag===5&&i.type==="form"?qb(i):xa.r(r)}var cs=typeof document>"u"?null:document;function N0(r,i,s){var d=cs;if(d&&typeof i=="string"&&i){var p=fr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),E0.has(p)||(E0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),xn(i,"link",r),sn(i),d.head.appendChild(i)))}}function p2(r){xa.D(r),N0("dns-prefetch",r,null)}function g2(r,i){xa.C(r,i),N0("preconnect",r,i)}function y2(r,i,s){xa.L(r,i,s);var d=cs;if(d&&r&&i){var p='link[rel="preload"][as="'+fr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+fr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+fr(s.imageSizes)+'"]')):p+='[href="'+fr(r)+'"]';var v=p;switch(i){case"style":v=ds(r);break;case"script":v=fs(r)}xr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),xr.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Yo(v))||i==="script"&&d.querySelector(Xo(v))||(i=d.createElement("link"),xn(i,"link",r),sn(i),d.head.appendChild(i)))}}function v2(r,i){xa.m(r,i);var s=cs;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+fr(d)+'"][href="'+fr(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=fs(r)}if(!xr.has(v)&&(r=g({rel:"modulepreload",href:r},i),xr.set(v,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Xo(v)))return}d=s.createElement("link"),xn(d,"link",r),sn(d),s.head.appendChild(d)}}}function b2(r,i,s){xa.S(r,i,s);var d=cs;if(d&&r){var p=Ol(d).hoistableStyles,v=ds(r);i=i||"default";var w=p.get(v);if(!w){var N={loading:0,preload:null};if(w=d.querySelector(Yo(v)))N.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=xr.get(v))&&Bm(r,s);var P=w=d.createElement("link");sn(P),xn(P,"link",r),P._p=new Promise(function(G,re){P.onload=G,P.onerror=re}),P.addEventListener("load",function(){N.loading|=1}),P.addEventListener("error",function(){N.loading|=2}),N.loading|=4,ld(w,i,d)}w={type:"stylesheet",instance:w,count:1,state:N},p.set(v,w)}}}function x2(r,i){xa.X(r,i);var s=cs;if(s&&r){var d=Ol(s).hoistableScripts,p=fs(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0},i),(i=xr.get(p))&&$m(r,i),v=s.createElement("script"),sn(v),xn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function S2(r,i){xa.M(r,i);var s=cs;if(s&&r){var d=Ol(s).hoistableScripts,p=fs(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=xr.get(p))&&$m(r,i),v=s.createElement("script"),sn(v),xn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function _0(r,i,s,d){var p=(p=ue.current)?id(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=ds(s.href),s=Ol(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=ds(s.href);var v=Ol(p).hoistableStyles,w=v.get(r);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,w),(v=p.querySelector(Yo(r)))&&!v._p&&(w.instance=v,w.state.loading=5),xr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},xr.set(r,s),v||w2(p,r,s,w.state))),i&&d===null)throw Error(a(528,""));return w}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fs(s),s=Ol(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function ds(r){return'href="'+fr(r)+'"'}function Yo(r){return'link[rel="stylesheet"]['+r+"]"}function A0(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function w2(r,i,s,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),xn(i,"link",s),sn(i),r.head.appendChild(i))}function fs(r){return'[src="'+fr(r)+'"]'}function Xo(r){return"script[async]"+r}function T0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+fr(s.href)+'"]');if(d)return i.instance=d,sn(d),d;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),sn(d),xn(d,"style",p),ld(d,s.precedence,r),i.instance=d;case"stylesheet":p=ds(s.href);var v=r.querySelector(Yo(p));if(v)return i.state.loading|=4,i.instance=v,sn(v),v;d=A0(s),(p=xr.get(p))&&Bm(d,p),v=(r.ownerDocument||r).createElement("link"),sn(v);var w=v;return w._p=new Promise(function(N,P){w.onload=N,w.onerror=P}),xn(v,"link",d),i.state.loading|=4,ld(v,s.precedence,r),i.instance=v;case"script":return v=fs(s.src),(p=r.querySelector(Xo(v)))?(i.instance=p,sn(p),p):(d=s,(p=xr.get(v))&&(d=g({},s),$m(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),sn(p),xn(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,ld(d,s.precedence,r));return i.instance}function ld(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,w=0;w<d.length;w++){var N=d[w];if(N.dataset.precedence===i)v=N;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function Bm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function $m(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var sd=null;function R0(r,i,s){if(sd===null){var d=new Map,p=sd=new Map;p.set(s,d)}else p=sd,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[ho]||v[gn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=r+w;var N=d.get(w);N?N.push(v):d.set(w,[v])}}return d}function z0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function k2(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function O0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function j2(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=ds(d.href),v=i.querySelector(Yo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=od.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,sn(v);return}v=i.ownerDocument||i,d=A0(d),(p=xr.get(p))&&Bm(d,p),v=v.createElement("link"),sn(v);var w=v;w._p=new Promise(function(N,P){w.onload=N,w.onerror=P}),xn(v,"link",d),s.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=od.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Fm=0;function C2(r,i){return r.stylesheets&&r.count===0&&cd(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&cd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Fm===0&&(Fm=62500*i2());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&cd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Fm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function od(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ud=null;function cd(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ud=new Map,i.forEach(E2,r),ud=null,od.call(r))}function E2(r,i){if(!(i.state.loading&4)){var s=ud.get(r);if(s)var d=s.get(null);else{s=new Map,ud.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var w=p[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),d=w)}d&&s.set(null,d)}p=i.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||d,v===d&&s.set(null,p),s.set(w,p),this.count++,d=od.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Jo={$$typeof:z,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function N2(r,i,s,d,p,v,w,N,P){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=P,this.incompleteTransitions=new Map}function D0(r,i,s,d,p,v,w,N,P,G,re,ce){return r=new N2(r,i,s,w,P,G,re,ce,N),i=1,v===!0&&(i|=24),v=Xn(3,null,null,i),r.current=v,v.stateNode=r,i=Sh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},Ch(v),r}function M0(r){return r?(r=ql,r):ql}function L0(r,i,s,d,p,v){p=M0(p),d.context===null?d.context=p:d.pendingContext=p,d=Ha(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Za(r,d,i),s!==null&&(Fn(s,r,i),To(s,r,i))}function I0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function qm(r,i){I0(r,i),(r=r.alternate)&&I0(r,i)}function U0(r){if(r.tag===13||r.tag===31){var i=Hi(r,67108864);i!==null&&Fn(i,r,67108864),qm(r,67108864)}}function P0(r){if(r.tag===13||r.tag===31){var i=nr();i=Uf(i);var s=Hi(r,i);s!==null&&Fn(s,r,i),qm(r,i)}}var dd=!0;function _2(r,i,s,d){var p=Z.T;Z.T=null;var v=ae.p;try{ae.p=2,Hm(r,i,s,d)}finally{ae.p=v,Z.T=p}}function A2(r,i,s,d){var p=Z.T;Z.T=null;var v=ae.p;try{ae.p=8,Hm(r,i,s,d)}finally{ae.p=v,Z.T=p}}function Hm(r,i,s,d){if(dd){var p=Zm(d);if(p===null)Tm(r,i,d,fd,s),$0(r,d);else if(R2(p,r,i,s,d))d.stopPropagation();else if($0(r,d),i&4&&-1<T2.indexOf(r)){for(;p!==null;){var v=zl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Ir(v.pendingLanes);if(w!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var P=1<<31-dt(w);N.entanglements[1]|=P,w&=~P}$r(v),(ct&6)===0&&(Gc=fn()+500,Vo(0))}}break;case 31:case 13:N=Hi(v,2),N!==null&&Fn(N,v,2),Yc(),qm(v,2)}if(v=Zm(d),v===null&&Tm(r,i,d,fd,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else Tm(r,i,d,null,s)}}function Zm(r){return r=Qf(r),Vm(r)}var fd=null;function Vm(r){if(fd=null,r=Rl(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=c(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return fd=r,null}function B0(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(co()){case le:return 2;case ye:return 8;case Me:case Pe:return 32;case rt:return 268435456;default:return 32}default:return 32}}var Qm=!1,ni=null,ri=null,ai=null,Wo=new Map,eu=new Map,ii=[],T2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function $0(r,i){switch(r){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Wo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":eu.delete(i.pointerId)}}function tu(r,i,s,d,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:v,targetContainers:[p]},i!==null&&(i=zl(i),i!==null&&U0(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function R2(r,i,s,d,p){switch(i){case"focusin":return ni=tu(ni,r,i,s,d,p),!0;case"dragenter":return ri=tu(ri,r,i,s,d,p),!0;case"mouseover":return ai=tu(ai,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Wo.set(v,tu(Wo.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,eu.set(v,tu(eu.get(v)||null,r,i,s,d,p)),!0}return!1}function F0(r){var i=Rl(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){r.blockedOn=i,nv(r.priority,function(){P0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,nv(r.priority,function(){P0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function hd(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Zm(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);Vf=d,s.target.dispatchEvent(d),Vf=null}else return i=zl(s),i!==null&&U0(i),r.blockedOn=s,!1;i.shift()}return!0}function q0(r,i,s){hd(r)&&s.delete(i)}function z2(){Qm=!1,ni!==null&&hd(ni)&&(ni=null),ri!==null&&hd(ri)&&(ri=null),ai!==null&&hd(ai)&&(ai=null),Wo.forEach(q0),eu.forEach(q0)}function md(r,i){r.blockedOn===i&&(r.blockedOn=null,Qm||(Qm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,z2)))}var pd=null;function H0(r){pd!==r&&(pd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){pd===r&&(pd=null);for(var i=0;i<r.length;i+=3){var s=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(Vm(d||s)===null)continue;break}var v=zl(s);v!==null&&(r.splice(i,3),i-=3,Zh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function hs(r){function i(P){return md(P,r)}ni!==null&&md(ni,r),ri!==null&&md(ri,r),ai!==null&&md(ai,r),Wo.forEach(i),eu.forEach(i);for(var s=0;s<ii.length;s++){var d=ii[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<ii.length&&(s=ii[0],s.blockedOn===null);)F0(s),s.blockedOn===null&&ii.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],v=s[d+1],w=p[Ln]||null;if(typeof v=="function")w||H0(s);else if(w){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[Ln]||null)N=w.formAction;else if(Vm(p)!==null)continue}else N=w.action;typeof N=="function"?s[d+1]=N:(s.splice(d,3),d-=3),H0(s)}}}function Z0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Gm(r){this._internalRoot=r}gd.prototype.render=Gm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=nr();L0(s,d,r,i,null,null)},gd.prototype.unmount=Gm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;L0(r.current,2,null,r,null,null),Yc(),i[Tl]=null}};function gd(r){this._internalRoot=r}gd.prototype.unstable_scheduleHydration=function(r){if(r){var i=tv();r={blockedOn:null,target:r,priority:i};for(var s=0;s<ii.length&&i!==0&&i<ii[s].priority;s++);ii.splice(s,0,r),s===0&&F0(r)}};var V0=t.version;if(V0!=="19.2.4")throw Error(a(527,V0,"19.2.4"));ae.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=h(i),r=r!==null?y(r):null,r=r===null?null:r.stateNode,r};var O2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yd.isDisabled&&yd.supportsFiber)try{tn=yd.inject(O2),Ht=yd}catch{}}return ru.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=Wb,v=ex,w=tx;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=D0(r,1,!1,null,null,s,d,null,p,v,w,Z0),r[Tl]=i.current,Am(r),new Gm(i)},ru.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=Wb,w=ex,N=tx,P=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(P=s.formState)),i=D0(r,1,!0,i,s??null,d,p,P,v,w,N,Z0),i.context=M0(null),s=i.current,d=nr(),d=Uf(d),p=Ha(d),p.callback=null,Za(s,p,d),s=d,i.current.lanes=s,pn(i,s),$r(i),r[Tl]=i.current,Am(r),new gd(i)},ru.version="19.2.4",ru}var r1;function H2(){if(r1)return Jm.exports;r1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Jm.exports=q2(),Jm.exports}var Z2=H2(),kl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ll,hi,Ts,Tw,V2=(Tw=class extends kl{constructor(){super();we(this,ll);we(this,hi);we(this,Ts);ge(this,Ts,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){L(this,hi)||this.setEventListener(L(this,Ts))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,hi))==null||t.call(this),ge(this,hi,void 0))}setEventListener(t){var n;ge(this,Ts,t),(n=L(this,hi))==null||n.call(this),ge(this,hi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){L(this,ll)!==t&&(ge(this,ll,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof L(this,ll)=="boolean"?L(this,ll):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ll=new WeakMap,hi=new WeakMap,Ts=new WeakMap,Tw),Zg=new V2,Q2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},mi,Fg,Rw,G2=(Rw=class{constructor(){we(this,mi,Q2);we(this,Fg,!1)}setTimeoutProvider(e){ge(this,mi,e)}setTimeout(e,t){return L(this,mi).setTimeout(e,t)}clearTimeout(e){L(this,mi).clearTimeout(e)}setInterval(e,t){return L(this,mi).setInterval(e,t)}clearInterval(e){L(this,mi).clearInterval(e)}},mi=new WeakMap,Fg=new WeakMap,Rw),il=new G2;function K2(e){setTimeout(e,0)}var Y2=typeof window>"u"||"Deno"in globalThis;function Nn(){}function X2(e,t){return typeof e=="function"?e(t):e}function qp(e){return typeof e=="number"&&e>=0&&e!==1/0}function qw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ji(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function a1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==Vg(c,t.options))return!1}else if(!wu(t.queryKey,c))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function i1(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(pl(t.options.mutationKey)!==pl(o))return!1}else if(!wu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function Vg(e,t){return((t==null?void 0:t.queryKeyHashFn)||pl)(e)}function pl(e){return JSON.stringify(e,(t,n)=>Hp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function wu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>wu(e[n],t[n])):!1}var J2=Object.prototype.hasOwnProperty;function Qg(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=l1(e)&&l1(t);if(!a&&!(Hp(e)&&Hp(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),f=c.length,m=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:c[y],b=e[g],S=t[g];if(b===S){m[g]=b,(a?y<o:J2.call(e,g))&&h++;continue}if(b===null||S===null||typeof b!="object"||typeof S!="object"){m[g]=S;continue}const k=Qg(b,S,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function ku(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function l1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hp(e){if(!s1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!s1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function s1(e){return Object.prototype.toString.call(e)==="[object Object]"}function W2(e){return new Promise(t=>{il.setTimeout(t,e)})}function Zp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Qg(e,t):t}function eA(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function tA(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Gg=Symbol();function Hw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Gg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Kg(e,t){return typeof e=="function"?e(...t):!!e}function nA(e,t,n){let a=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??(l=t()),a||(a=!0,l.aborted?n():l.addEventListener("abort",n,{once:!0})),l)}),e}var ju=(()=>{let e=()=>Y2;return{isServer(){return e()},setIsServer(t){e=t}}})();function Vp(){let e,t;const n=new Promise((l,o)=>{e=l,t=o});n.status="pending",n.catch(()=>{});function a(l){Object.assign(n,l),delete n.resolve,delete n.reject}return n.resolve=l=>{a({status:"fulfilled",value:l}),e(l)},n.reject=l=>{a({status:"rejected",reason:l}),t(l)},n}var rA=K2;function aA(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=rA;const o=f=>{t?e.push(f):l(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&l(()=>{a(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||c()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Bt=aA(),Rs,pi,zs,zw,iA=(zw=class extends kl{constructor(){super();we(this,Rs,!0);we(this,pi);we(this,zs);ge(this,zs,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){L(this,pi)||this.setEventListener(L(this,zs))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,pi))==null||t.call(this),ge(this,pi,void 0))}setEventListener(t){var n;ge(this,zs,t),(n=L(this,pi))==null||n.call(this),ge(this,pi,t(this.setOnline.bind(this)))}setOnline(t){L(this,Rs)!==t&&(ge(this,Rs,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return L(this,Rs)}},Rs=new WeakMap,pi=new WeakMap,zs=new WeakMap,zw),Gd=new iA;function lA(e){return Math.min(1e3*2**e,3e4)}function Zw(e){return(e??"online")==="online"?Gd.isOnline():!0}var Qp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vw(e){let t=!1,n=0,a;const l=Vp(),o=()=>l.status!=="pending",c=j=>{var C;if(!o()){const E=new Qp(j);b(E),(C=e.onCancel)==null||C.call(e,E)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Zg.isFocused()&&(e.networkMode==="always"||Gd.isOnline())&&e.canRun(),y=()=>Zw(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},S=()=>new Promise(j=>{var C;a=E=>{(o()||h())&&j(E)},(C=e.onPause)==null||C.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const C=n===0?e.initialPromise:void 0;try{j=C??e.fn()}catch(E){j=Promise.reject(E)}Promise.resolve(j).then(g).catch(E=>{var O;if(o())return;const A=e.retry??(ju.isServer()?0:3),z=e.retryDelay??lA,I=typeof z=="function"?z(n,E):z,M=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,E);if(t||!M){b(E);return}n++,(O=e.onFail)==null||O.call(e,n,E),W2(I).then(()=>h()?void 0:S()).then(()=>{t?b(E):k()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():S().then(k),l)}}var sl,Ow,Qw=(Ow=class{constructor(){we(this,sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qp(this.gcTime)&&ge(this,sl,il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ju.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,sl)&&(il.clearTimeout(L(this,sl)),ge(this,sl,void 0))}},sl=new WeakMap,Ow),ol,Os,Sr,ul,un,Du,cl,lr,Gw,wa,Dw,sA=(Dw=class extends Qw{constructor(t){super();we(this,lr);we(this,ol);we(this,Os);we(this,Sr);we(this,ul);we(this,un);we(this,Du);we(this,cl);ge(this,cl,!1),ge(this,Du,t.defaultOptions),this.setOptions(t.options),this.observers=[],ge(this,ul,t.client),ge(this,Sr,L(this,ul).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ge(this,ol,u1(this.options)),this.state=t.state??L(this,ol),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=L(this,un))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,Du),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=u1(this.options);n.data!==void 0&&(this.setState(o1(n.data,n.dataUpdatedAt)),ge(this,ol,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,Sr).remove(this)}setData(t,n){const a=Zp(this.state.data,t,this.options);return De(this,lr,wa).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){De(this,lr,wa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=L(this,un))==null?void 0:a.promise;return(l=L(this,un))==null||l.cancel(t),n?n.then(Nn).catch(Nn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,ol)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ji(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!qw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,un))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,un))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,Sr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(L(this,un)&&(L(this,cl)||De(this,lr,Gw).call(this)?L(this,un).cancel({revert:!0}):L(this,un).cancelRetry()),this.scheduleGc()),L(this,Sr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,lr,wa).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,S,k,j,C,E,A,z;if(this.state.fetchStatus!=="idle"&&((m=L(this,un))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(L(this,un))return L(this,un).continueRetry(),L(this,un).promise}if(t&&this.setOptions(t),!this.options.queryFn){const I=this.observers.find(M=>M.options.queryFn);I&&this.setOptions(I.options)}const a=new AbortController,l=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(ge(this,cl,!0),a.signal)})},o=()=>{const I=Hw(this.options,n),O=(()=>{const D={client:L(this,ul),queryKey:this.queryKey,meta:this.meta};return l(D),D})();return ge(this,cl,!1),this.options.persister?this.options.persister(I,O,this):I(O)},f=(()=>{const I={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:L(this,ul),state:this.state,fetchFn:o};return l(I),I})();(h=this.options.behavior)==null||h.onFetch(f,this),ge(this,Os,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&De(this,lr,wa).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),ge(this,un,Vw({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:I=>{I instanceof Qp&&I.revert&&this.setState({...L(this,Os),fetchStatus:"idle"}),a.abort()},onFail:(I,M)=>{De(this,lr,wa).call(this,{type:"failed",failureCount:I,error:M})},onPause:()=>{De(this,lr,wa).call(this,{type:"pause"})},onContinue:()=>{De(this,lr,wa).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const I=await L(this,un).start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(S=(b=L(this,Sr).config).onSuccess)==null||S.call(b,I,this),(j=(k=L(this,Sr).config).onSettled)==null||j.call(k,I,this.state.error,this),I}catch(I){if(I instanceof Qp){if(I.silent)return L(this,un).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw De(this,lr,wa).call(this,{type:"error",error:I}),(E=(C=L(this,Sr).config).onError)==null||E.call(C,I,this),(z=(A=L(this,Sr).config).onSettled)==null||z.call(A,this.state.data,I,this),I}finally{this.scheduleGc()}}},ol=new WeakMap,Os=new WeakMap,Sr=new WeakMap,ul=new WeakMap,un=new WeakMap,Du=new WeakMap,cl=new WeakMap,lr=new WeakSet,Gw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},wa=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...Kw(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...o1(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,Os,t.manual?l:void 0),l;case"error":const o=t.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),Bt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),L(this,Sr).notify({query:this,type:"updated",action:t})})},Dw);function Kw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function o1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function u1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Hn,it,Mu,zn,dl,Ds,ka,gi,Lu,Ms,Ls,fl,hl,yi,Is,ht,hu,Gp,Kp,Yp,Xp,Jp,Wp,eg,Yw,Mw,Yg=(Mw=class extends kl{constructor(t,n){super();we(this,ht);we(this,Hn);we(this,it);we(this,Mu);we(this,zn);we(this,dl);we(this,Ds);we(this,ka);we(this,gi);we(this,Lu);we(this,Ms);we(this,Ls);we(this,fl);we(this,hl);we(this,yi);we(this,Is,new Set);this.options=n,ge(this,Hn,t),ge(this,gi,null),ge(this,ka,Vp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,it).addObserver(this),c1(L(this,it),this.options)?De(this,ht,hu).call(this):this.updateResult(),De(this,ht,Xp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tg(L(this,it),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tg(L(this,it),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,De(this,ht,Jp).call(this),De(this,ht,Wp).call(this),L(this,it).removeObserver(this)}setOptions(t){const n=this.options,a=L(this,it);if(this.options=L(this,Hn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,L(this,it))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");De(this,ht,eg).call(this),L(this,it).setOptions(this.options),n._defaulted&&!ku(this.options,n)&&L(this,Hn).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,it),observer:this});const l=this.hasListeners();l&&d1(L(this,it),a,this.options,n)&&De(this,ht,hu).call(this),this.updateResult(),l&&(L(this,it)!==a||kr(this.options.enabled,L(this,it))!==kr(n.enabled,L(this,it))||ji(this.options.staleTime,L(this,it))!==ji(n.staleTime,L(this,it)))&&De(this,ht,Gp).call(this);const o=De(this,ht,Kp).call(this);l&&(L(this,it)!==a||kr(this.options.enabled,L(this,it))!==kr(n.enabled,L(this,it))||o!==L(this,yi))&&De(this,ht,Yp).call(this,o)}getOptimisticResult(t){const n=L(this,Hn).getQueryCache().build(L(this,Hn),t),a=this.createResult(n,t);return uA(this,a)&&(ge(this,zn,a),ge(this,Ds,this.options),ge(this,dl,L(this,it).state)),a}getCurrentResult(){return L(this,zn)}trackResult(t,n){return new Proxy(t,{get:(a,l)=>(this.trackProp(l),n==null||n(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,ka).status==="pending"&&L(this,ka).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){L(this,Is).add(t)}getCurrentQuery(){return L(this,it)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=L(this,Hn).defaultQueryOptions(t),a=L(this,Hn).getQueryCache().build(L(this,Hn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return De(this,ht,hu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,zn)))}createResult(t,n){var W;const a=L(this,it),l=this.options,o=L(this,zn),c=L(this,dl),f=L(this,Ds),h=t!==a?t.state:L(this,Mu),{state:y}=t;let g={...y},b=!1,S;if(n._optimisticResults){const H=this.hasListeners(),ne=!H&&c1(t,n),X=H&&d1(t,a,n,l);(ne||X)&&(g={...g,...Kw(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:C}=g;S=g.data;let E=!1;if(n.placeholderData!==void 0&&S===void 0&&C==="pending"){let H;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(H=o.data,E=!0):H=typeof n.placeholderData=="function"?n.placeholderData((W=L(this,Ls))==null?void 0:W.state.data,L(this,Ls)):n.placeholderData,H!==void 0&&(C="success",S=Zp(o==null?void 0:o.data,H,n),b=!0)}if(n.select&&S!==void 0&&!E)if(o&&S===(c==null?void 0:c.data)&&n.select===L(this,Lu))S=L(this,Ms);else try{ge(this,Lu,n.select),S=n.select(S),S=Zp(o==null?void 0:o.data,S,n),ge(this,Ms,S),ge(this,gi,null)}catch(H){ge(this,gi,H)}L(this,gi)&&(k=L(this,gi),S=L(this,Ms),j=Date.now(),C="error");const A=g.fetchStatus==="fetching",z=C==="pending",I=C==="error",M=z&&A,O=S!==void 0,U={status:C,fetchStatus:g.fetchStatus,isPending:z,isSuccess:C==="success",isError:I,isInitialLoading:M,isLoading:M,data:S,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!z,isLoadingError:I&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:I&&O,isStale:Xg(t,n),refetch:this.refetch,promise:L(this,ka),isEnabled:kr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const H=U.data!==void 0,ne=U.status==="error"&&!H,X=ie=>{ne?ie.reject(U.error):H&&ie.resolve(U.data)},be=()=>{const ie=ge(this,ka,U.promise=Vp());X(ie)},fe=L(this,ka);switch(fe.status){case"pending":t.queryHash===a.queryHash&&X(fe);break;case"fulfilled":(ne||U.data!==fe.value)&&be();break;case"rejected":(!ne||U.error!==fe.reason)&&be();break}}return U}updateResult(){const t=L(this,zn),n=this.createResult(L(this,it),this.options);if(ge(this,dl,L(this,it).state),ge(this,Ds,this.options),L(this,dl).data!==void 0&&ge(this,Ls,L(this,it)),ku(n,t))return;ge(this,zn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!L(this,Is).size)return!0;const c=new Set(o??L(this,Is));return this.options.throwOnError&&c.add("error"),Object.keys(L(this,zn)).some(f=>{const m=f;return L(this,zn)[m]!==t[m]&&c.has(m)})};De(this,ht,Yw).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&De(this,ht,Xp).call(this)}},Hn=new WeakMap,it=new WeakMap,Mu=new WeakMap,zn=new WeakMap,dl=new WeakMap,Ds=new WeakMap,ka=new WeakMap,gi=new WeakMap,Lu=new WeakMap,Ms=new WeakMap,Ls=new WeakMap,fl=new WeakMap,hl=new WeakMap,yi=new WeakMap,Is=new WeakMap,ht=new WeakSet,hu=function(t){De(this,ht,eg).call(this);let n=L(this,it).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Nn)),n},Gp=function(){De(this,ht,Jp).call(this);const t=ji(this.options.staleTime,L(this,it));if(ju.isServer()||L(this,zn).isStale||!qp(t))return;const a=qw(L(this,zn).dataUpdatedAt,t)+1;ge(this,fl,il.setTimeout(()=>{L(this,zn).isStale||this.updateResult()},a))},Kp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,it)):this.options.refetchInterval)??!1},Yp=function(t){De(this,ht,Wp).call(this),ge(this,yi,t),!(ju.isServer()||kr(this.options.enabled,L(this,it))===!1||!qp(L(this,yi))||L(this,yi)===0)&&ge(this,hl,il.setInterval(()=>{(this.options.refetchIntervalInBackground||Zg.isFocused())&&De(this,ht,hu).call(this)},L(this,yi)))},Xp=function(){De(this,ht,Gp).call(this),De(this,ht,Yp).call(this,De(this,ht,Kp).call(this))},Jp=function(){L(this,fl)&&(il.clearTimeout(L(this,fl)),ge(this,fl,void 0))},Wp=function(){L(this,hl)&&(il.clearInterval(L(this,hl)),ge(this,hl,void 0))},eg=function(){const t=L(this,Hn).getQueryCache().build(L(this,Hn),this.options);if(t===L(this,it))return;const n=L(this,it);ge(this,it,t),ge(this,Mu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Yw=function(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(L(this,zn))}),L(this,Hn).getQueryCache().notify({query:L(this,it),type:"observerResultsUpdated"})})},Mw);function oA(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function c1(e,t){return oA(e,t)||e.state.data!==void 0&&tg(e,t,t.refetchOnMount)}function tg(e,t,n){if(kr(t.enabled,e)!==!1&&ji(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Xg(e,t)}return!1}function d1(e,t,n,a){return(e!==t||kr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Xg(e,n)}function Xg(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(ji(t.staleTime,e))}function uA(e,t){return!ku(e.getCurrentResult(),t)}function f1(e){return{onFetch:(t,n)=>{var y,g,b,S,k;const a=t.options,l=(b=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,o=((S=t.state.data)==null?void 0:S.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const C=z=>{nA(z,()=>t.signal,()=>j=!0)},E=Hw(t.options,t.fetchOptions),A=async(z,I,M)=>{if(j)return Promise.reject();if(I==null&&z.pages.length)return Promise.resolve(z);const D=(()=>{const ne={client:t.client,queryKey:t.queryKey,pageParam:I,direction:M?"backward":"forward",meta:t.options.meta};return C(ne),ne})(),U=await E(D),{maxPages:W}=t.options,H=M?tA:eA;return{pages:H(z.pages,U,W),pageParams:H(z.pageParams,I,W)}};if(l&&o.length){const z=l==="backward",I=z?cA:h1,M={pages:o,pageParams:c},O=I(a,M);f=await A(M,O,z)}else{const z=e??o.length;do{const I=m===0?c[0]??a.initialPageParam:h1(a,f);if(m>0&&I==null)break;f=await A(f,I),m++}while(m<z)}return f};t.options.persister?t.fetchFn=()=>{var j,C;return(C=(j=t.options).persister)==null?void 0:C.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function h1(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function cA(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var Iu,qr,Cn,ml,Hr,ci,Lw,dA=(Lw=class extends Qw{constructor(t){super();we(this,Hr);we(this,Iu);we(this,qr);we(this,Cn);we(this,ml);ge(this,Iu,t.client),this.mutationId=t.mutationId,ge(this,Cn,t.mutationCache),ge(this,qr,[]),this.state=t.state||Xw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,qr).includes(t)||(L(this,qr).push(t),this.clearGcTimeout(),L(this,Cn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ge(this,qr,L(this,qr).filter(n=>n!==t)),this.scheduleGc(),L(this,Cn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,qr).length||(this.state.status==="pending"?this.scheduleGc():L(this,Cn).remove(this))}continue(){var t;return((t=L(this,ml))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,y,g,b,S,k,j,C,E,A,z,I,M,O,D;const n=()=>{De(this,Hr,ci).call(this,{type:"continue"})},a={client:L(this,Iu),meta:this.options.meta,mutationKey:this.options.mutationKey};ge(this,ml,Vw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(U,W)=>{De(this,Hr,ci).call(this,{type:"failed",failureCount:U,error:W})},onPause:()=>{De(this,Hr,ci).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,Cn).canRun(this)}));const l=this.state.status==="pending",o=!L(this,ml).canStart();try{if(l)n();else{De(this,Hr,ci).call(this,{type:"pending",variables:t,isPaused:o}),L(this,Cn).config.onMutate&&await L(this,Cn).config.onMutate(t,this,a);const W=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));W!==this.state.context&&De(this,Hr,ci).call(this,{type:"pending",context:W,variables:t,isPaused:o})}const U=await L(this,ml).start();return await((h=(m=L(this,Cn).config).onSuccess)==null?void 0:h.call(m,U,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,U,t,this.state.context,a)),await((S=(b=L(this,Cn).config).onSettled)==null?void 0:S.call(b,U,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,U,null,t,this.state.context,a)),De(this,Hr,ci).call(this,{type:"success",data:U}),U}catch(U){try{await((E=(C=L(this,Cn).config).onError)==null?void 0:E.call(C,U,t,this.state.context,this,a))}catch(W){Promise.reject(W)}try{await((z=(A=this.options).onError)==null?void 0:z.call(A,U,t,this.state.context,a))}catch(W){Promise.reject(W)}try{await((M=(I=L(this,Cn).config).onSettled)==null?void 0:M.call(I,void 0,U,this.state.variables,this.state.context,this,a))}catch(W){Promise.reject(W)}try{await((D=(O=this.options).onSettled)==null?void 0:D.call(O,void 0,U,t,this.state.context,a))}catch(W){Promise.reject(W)}throw De(this,Hr,ci).call(this,{type:"error",error:U}),U}finally{L(this,Cn).runNext(this)}}},Iu=new WeakMap,qr=new WeakMap,Cn=new WeakMap,ml=new WeakMap,Hr=new WeakSet,ci=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Bt.batch(()=>{L(this,qr).forEach(a=>{a.onMutationUpdate(t)}),L(this,Cn).notify({mutation:this,type:"updated",action:t})})},Lw);function Xw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ja,Dr,Uu,Iw,fA=(Iw=class extends kl{constructor(t={}){super();we(this,ja);we(this,Dr);we(this,Uu);this.config=t,ge(this,ja,new Set),ge(this,Dr,new Map),ge(this,Uu,0)}build(t,n,a){const l=new dA({client:t,mutationCache:this,mutationId:++vd(this,Uu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){L(this,ja).add(t);const n=bd(t);if(typeof n=="string"){const a=L(this,Dr).get(n);a?a.push(t):L(this,Dr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,ja).delete(t)){const n=bd(t);if(typeof n=="string"){const a=L(this,Dr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&L(this,Dr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=bd(t);if(typeof n=="string"){const a=L(this,Dr).get(n),l=a==null?void 0:a.find(o=>o.state.status==="pending");return!l||l===t}else return!0}runNext(t){var a;const n=bd(t);if(typeof n=="string"){const l=(a=L(this,Dr).get(n))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Bt.batch(()=>{L(this,ja).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,ja).clear(),L(this,Dr).clear()})}getAll(){return Array.from(L(this,ja))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>i1(n,a))}findAll(t={}){return this.getAll().filter(n=>i1(t,n))}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Bt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Nn))))}},ja=new WeakMap,Dr=new WeakMap,Uu=new WeakMap,Iw);function bd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ca,vi,Zn,Ea,_a,Pd,ng,Uw,hA=(Uw=class extends kl{constructor(n,a){super();we(this,_a);we(this,Ca);we(this,vi);we(this,Zn);we(this,Ea);ge(this,Ca,n),this.setOptions(a),this.bindMethods(),De(this,_a,Pd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var l;const a=this.options;this.options=L(this,Ca).defaultMutationOptions(n),ku(this.options,a)||L(this,Ca).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,Zn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&pl(a.mutationKey)!==pl(this.options.mutationKey)?this.reset():((l=L(this,Zn))==null?void 0:l.state.status)==="pending"&&L(this,Zn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=L(this,Zn))==null||n.removeObserver(this)}onMutationUpdate(n){De(this,_a,Pd).call(this),De(this,_a,ng).call(this,n)}getCurrentResult(){return L(this,vi)}reset(){var n;(n=L(this,Zn))==null||n.removeObserver(this),ge(this,Zn,void 0),De(this,_a,Pd).call(this),De(this,_a,ng).call(this)}mutate(n,a){var l;return ge(this,Ea,a),(l=L(this,Zn))==null||l.removeObserver(this),ge(this,Zn,L(this,Ca).getMutationCache().build(L(this,Ca),this.options)),L(this,Zn).addObserver(this),L(this,Zn).execute(n)}},Ca=new WeakMap,vi=new WeakMap,Zn=new WeakMap,Ea=new WeakMap,_a=new WeakSet,Pd=function(){var a;const n=((a=L(this,Zn))==null?void 0:a.state)??Xw();ge(this,vi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ng=function(n){Bt.batch(()=>{var a,l,o,c,f,m,h,y;if(L(this,Ea)&&this.hasListeners()){const g=L(this,vi).variables,b=L(this,vi).context,S={client:L(this,Ca),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=L(this,Ea)).onSuccess)==null||l.call(a,n.data,g,b,S)}catch(k){Promise.reject(k)}try{(c=(o=L(this,Ea)).onSettled)==null||c.call(o,n.data,null,g,b,S)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=L(this,Ea)).onError)==null||m.call(f,n.error,g,b,S)}catch(k){Promise.reject(k)}try{(y=(h=L(this,Ea)).onSettled)==null||y.call(h,void 0,n.error,g,b,S)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(L(this,vi))})})},Uw);function m1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function mA(e,t,n){const a=e.slice(0);return a[t]=n,a}var Us,ir,Ps,Bs,wr,bi,Pu,Bu,$u,Fu,wn,rg,ag,ig,lg,sg,Pw,pA=(Pw=class extends kl{constructor(t,n,a){super();we(this,wn);we(this,Us);we(this,ir);we(this,Ps);we(this,Bs);we(this,wr);we(this,bi);we(this,Pu);we(this,Bu);we(this,$u);we(this,Fu,[]);ge(this,Us,t),ge(this,Bs,a),ge(this,Ps,[]),ge(this,wr,[]),ge(this,ir,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&L(this,wr).forEach(t=>{t.subscribe(n=>{De(this,wn,lg).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,L(this,wr).forEach(t=>{t.destroy()})}setQueries(t,n){ge(this,Ps,t),ge(this,Bs,n),Bt.batch(()=>{const a=L(this,wr),l=De(this,wn,ig).call(this,L(this,Ps));l.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=l.map(g=>g.observer),c=o.map(g=>g.getCurrentResult()),f=a.length!==o.length,m=o.some((g,b)=>g!==a[b]),h=f||m,y=h?!0:c.some((g,b)=>{const S=L(this,ir)[b];return!S||!ku(g,S)});!h&&!y||(h&&(ge(this,Fu,l),ge(this,wr,o)),ge(this,ir,c),this.hasListeners()&&(h&&(m1(a,o).forEach(g=>{g.destroy()}),m1(o,a).forEach(g=>{g.subscribe(b=>{De(this,wn,lg).call(this,g,b)})})),De(this,wn,sg).call(this)))})}getCurrentResult(){return L(this,ir)}getQueries(){return L(this,wr).map(t=>t.getCurrentQuery())}getObservers(){return L(this,wr)}getOptimisticResult(t,n){const a=De(this,wn,ig).call(this,t),l=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[l,c=>De(this,wn,ag).call(this,c??l,n,o),()=>De(this,wn,rg).call(this,l,a)]}},Us=new WeakMap,ir=new WeakMap,Ps=new WeakMap,Bs=new WeakMap,wr=new WeakMap,bi=new WeakMap,Pu=new WeakMap,Bu=new WeakMap,$u=new WeakMap,Fu=new WeakMap,wn=new WeakSet,rg=function(t,n){return n.map((a,l)=>{const o=t[l];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{n.forEach(f=>{f.observer.trackProp(c)})})})},ag=function(t,n,a){if(n){const l=L(this,$u),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((c,f)=>c!==l[f]));return(!L(this,bi)||L(this,ir)!==L(this,Bu)||o||n!==L(this,Pu))&&(ge(this,Pu,n),ge(this,Bu,L(this,ir)),a!==void 0&&ge(this,$u,a),ge(this,bi,Qg(L(this,bi),n(t)))),L(this,bi)}return t},ig=function(t){const n=new Map;L(this,wr).forEach(l=>{const o=l.options.queryHash;if(!o)return;const c=n.get(o);c?c.push(l):n.set(o,[l])});const a=[];return t.forEach(l=>{var m;const o=L(this,Us).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new Yg(L(this,Us),o);a.push({defaultedQueryOptions:o,observer:f})}),a},lg=function(t,n){const a=L(this,wr).indexOf(t);a!==-1&&(ge(this,ir,mA(L(this,ir),a,n)),De(this,wn,sg).call(this))},sg=function(){var t;if(this.hasListeners()){const n=L(this,bi),a=De(this,wn,rg).call(this,L(this,ir),L(this,Fu)),l=De(this,wn,ag).call(this,a,(t=L(this,Bs))==null?void 0:t.combine);n!==l&&Bt.batch(()=>{this.listeners.forEach(o=>{o(L(this,ir))})})}},Pw),Zr,Bw,gA=(Bw=class extends kl{constructor(t={}){super();we(this,Zr);this.config=t,ge(this,Zr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??Vg(l,n);let c=this.get(o);return c||(c=new sA({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(c)),c}add(t){L(this,Zr).has(t.queryHash)||(L(this,Zr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=L(this,Zr).get(t.queryHash);n&&(t.destroy(),n===t&&L(this,Zr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Zr).get(t)}getAll(){return[...L(this,Zr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>a1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>a1(t,a)):n}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Zr=new WeakMap,Bw),Pt,xi,Si,$s,Fs,wi,qs,Hs,$w,yA=($w=class{constructor(e={}){we(this,Pt);we(this,xi);we(this,Si);we(this,$s);we(this,Fs);we(this,wi);we(this,qs);we(this,Hs);ge(this,Pt,e.queryCache||new gA),ge(this,xi,e.mutationCache||new fA),ge(this,Si,e.defaultOptions||{}),ge(this,$s,new Map),ge(this,Fs,new Map),ge(this,wi,0)}mount(){vd(this,wi)._++,L(this,wi)===1&&(ge(this,qs,Zg.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Pt).onFocus())})),ge(this,Hs,Gd.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Pt).onOnline())})))}unmount(){var e,t;vd(this,wi)._--,L(this,wi)===0&&((e=L(this,qs))==null||e.call(this),ge(this,qs,void 0),(t=L(this,Hs))==null||t.call(this),ge(this,Hs,void 0))}isFetching(e){return L(this,Pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,xi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Pt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=L(this,Pt).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ji(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return L(this,Pt).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),l=L(this,Pt).get(a.queryHash),o=l==null?void 0:l.state.data,c=X2(t,o);if(c!==void 0)return L(this,Pt).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Bt.batch(()=>L(this,Pt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Pt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=L(this,Pt);Bt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=L(this,Pt);return Bt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Bt.batch(()=>L(this,Pt).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(Nn).catch(Nn)}invalidateQueries(e,t={}){return Bt.batch(()=>(L(this,Pt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=Bt.batch(()=>L(this,Pt).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(Nn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(Nn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=L(this,Pt).build(this,t);return n.isStaleByTime(ji(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nn).catch(Nn)}fetchInfiniteQuery(e){return e.behavior=f1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nn).catch(Nn)}ensureInfiniteQueryData(e){return e.behavior=f1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Gd.isOnline()?L(this,xi).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Pt)}getMutationCache(){return L(this,xi)}getDefaultOptions(){return L(this,Si)}setDefaultOptions(e){ge(this,Si,e)}setQueryDefaults(e,t){L(this,$s).set(pl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,$s).values()],n={};return t.forEach(a=>{wu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){L(this,Fs).set(pl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,Fs).values()],n={};return t.forEach(a=>{wu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,Si).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Vg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Gg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,Si).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,Pt).clear(),L(this,xi).clear()}},Pt=new WeakMap,xi=new WeakMap,Si=new WeakMap,$s=new WeakMap,Fs=new WeakMap,wi=new WeakMap,qs=new WeakMap,Hs=new WeakMap,$w),Jw=x.createContext(void 0),kn=e=>{const t=x.useContext(Jw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vA=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Jw.Provider,{value:e,children:t})),Ww=x.createContext(!1),ek=()=>x.useContext(Ww);Ww.Provider;function bA(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xA=x.createContext(bA()),tk=()=>x.useContext(xA),nk=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Kg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},rk=e=>{x.useEffect(()=>{e.clearReset()},[e])},ak=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Kg(n,[e.error,a])),ik=e=>{if(e.suspense){const n=l=>l==="static"?l:Math.max(l??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...l)=>n(a(...l)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},SA=(e,t)=>e.isLoading&&e.isFetching&&!t,og=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ug=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wA({queries:e,...t},n){const a=kn(),l=ek(),o=tk(),c=x.useMemo(()=>e.map(j=>{const C=a.defaultQueryOptions(j);return C._optimisticResults=l?"isRestoring":"optimistic",C}),[e,a,l]);c.forEach(j=>{ik(j);const C=a.getQueryCache().get(j.queryHash);nk(j,o,C)}),rk(o);const[f]=x.useState(()=>new pA(a,c,t)),[m,h,y]=f.getOptimisticResult(c,t.combine),g=!l&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(j=>g?f.subscribe(Bt.batchCalls(j)):Nn,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const S=m.some((j,C)=>og(c[C],j))?m.flatMap((j,C)=>{const E=c[C];if(E&&og(E,j)){const A=new Yg(a,E);return ug(E,A,o)}return[]}):[];if(S.length>0)throw Promise.all(S);const k=m.find((j,C)=>{const E=c[C];return E&&ak({result:j,errorResetBoundary:o,throwOnError:E.throwOnError,query:a.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(k!=null&&k.error)throw k.error;return h(y())}function kA(e,t,n){var b,S,k,j;const a=ek(),l=tk(),o=kn(),c=o.defaultQueryOptions(e);(S=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||S.call(b,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",ik(c),nk(c,l,f),rk(l);const m=!o.getQueryCache().get(c.queryHash),[h]=x.useState(()=>new t(o,c)),y=h.getOptimisticResult(c),g=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(C=>{const E=g?h.subscribe(Bt.batchCalls(C)):Nn;return h.updateResult(),E},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(c)},[c,h]),og(c,y))throw ug(c,h,l);if(ak({result:y,errorResetBoundary:l,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,c,y),c.experimental_prefetchInRender&&!ju.isServer()&&SA(y,a)){const C=m?ug(c,h,l):f==null?void 0:f.promise;C==null||C.catch(Nn).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?y:h.trackResult(y)}function qe(e,t){return kA(e,Yg)}function bt(e,t){const n=kn(),[a]=x.useState(()=>new hA(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(c=>a.subscribe(Bt.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((c,f)=>{a.mutate(c,f).catch(Nn)},[a]);if(l.error&&Kg(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:o,mutateAsync:l.mutate}}/**
50
+ * react-router v7.13.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var p1="popstate";function g1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jA(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=o||a.location;return cg("",{pathname:c,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,l){return typeof l=="string"?l:Cu(l)}return EA(t,n,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Cr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function CA(){return Math.random().toString(36).substring(2,10)}function y1(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function cg(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Js(t):t,state:n,key:t&&t.key||a||CA(),unstable_mask:l}}function Cu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Js(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function EA(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,c=l.history,f="POP",m=null,h=y();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let C=y(),E=C==null?null:C-h;h=C,m&&m({action:f,location:j.location,delta:E})}function b(C,E){f="PUSH";let A=g1(C)?C:cg(j.location,C,E);h=y()+1;let z=y1(A,h),I=j.createHref(A.unstable_mask||A);try{c.pushState(z,"",I)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;l.location.assign(I)}o&&m&&m({action:f,location:j.location,delta:1})}function S(C,E){f="REPLACE";let A=g1(C)?C:cg(j.location,C,E);h=y();let z=y1(A,h),I=j.createHref(A.unstable_mask||A);c.replaceState(z,"",I),o&&m&&m({action:f,location:j.location,delta:0})}function k(C){return NA(C)}let j={get action(){return f},get location(){return e(l,c)},listen(C){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(p1,g),m=C,()=>{l.removeEventListener(p1,g),m=null}},createHref(C){return t(l,C)},createURL:k,encodeLocation(C){let E=k(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:b,replace:S,go(C){return c.go(C)}};return j}function NA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),At(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Cu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function lk(e,t,n="/"){return _A(e,t,n,!1)}function _A(e,t,n,a){let l=typeof t=="string"?Js(t):t,o=Aa(l.pathname||"/",n);if(o==null)return null;let c=sk(e);AA(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=BA(o);f=UA(c[m],h,a)}return f}function sk(e,t=[],n=[],a="",l=!1){let o=(c,f,m=l,h)=>{let y={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;At(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=Gr([a,y.relativePath]),b=n.concat(y);c.children&&c.children.length>0&&(At(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),sk(c.children,t,b,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:LA(g,c.index),routesMeta:b})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))o(c,f);else for(let h of ok(c.path))o(c,f,!0,h)}),t}function ok(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return l?[o,""]:[o];let c=ok(a.join("/")),f=[];return f.push(...c.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function AA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:IA(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var TA=/^:[\w-]+$/,RA=3,zA=2,OA=1,DA=10,MA=-2,v1=e=>e==="*";function LA(e,t){let n=e.split("/"),a=n.length;return n.some(v1)&&(a+=MA),t&&(a+=zA),n.filter(l=>!v1(l)).reduce((l,o)=>l+(TA.test(o)?RA:o===""?OA:DA),a)}function IA(e,t){return e.length===t.length&&e.slice(0,-1).every((a,l)=>a===t[l])?e[e.length-1]-t[t.length-1]:0}function UA(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",c=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=Kd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Kd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),c.push({params:l,pathname:Gr([o,g.pathname]),pathnameBase:HA(Gr([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=Gr([o,g.pathnameBase]))}return c}function Kd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=PA(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],c=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";c=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const S=f[b];return g&&!S?h[y]=void 0:h[y]=(S||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function PA(e,t=!1,n=!0){Cr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,m,h,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function BA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Aa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var $A=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function FA(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Js(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=b1(n.substring(1),"/"):o=b1(n,t)):o=t,{pathname:o,search:ZA(a),hash:VA(l)}}function b1(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function np(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function qA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Jg(e){let t=qA(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function hf(e,t,n,a=!1){let l;typeof e=="string"?l=Js(e):(l={...e},At(!l.pathname||!l.pathname.includes("?"),np("?","pathname","search",l)),At(!l.pathname||!l.pathname.includes("#"),np("#","pathname","hash",l)),At(!l.search||!l.search.includes("#"),np("#","search","hash",l)));let o=e===""||l.pathname==="",c=o?"/":l.pathname,f;if(c==null)f=n;else{let g=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=FA(l,f),h=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var Gr=e=>e.join("/").replace(/\/\/+/g,"/"),HA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ZA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,VA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,QA=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function GA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function KA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var uk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ck(e,t){let n=e;if(typeof n!="string"||!$A.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(uk)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Aa(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:l=!0}catch{Cr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var dk=["POST","PUT","PATCH","DELETE"];new Set(dk);var YA=["GET",...dk];new Set(YA);var Ws=x.createContext(null);Ws.displayName="DataRouter";var mf=x.createContext(null);mf.displayName="DataRouterState";var XA=x.createContext(!1),fk=x.createContext({isTransitioning:!1});fk.displayName="ViewTransition";var JA=x.createContext(new Map);JA.displayName="Fetchers";var WA=x.createContext(null);WA.displayName="Await";var ur=x.createContext(null);ur.displayName="Navigation";var qu=x.createContext(null);qu.displayName="Location";var Er=x.createContext({outlet:null,matches:[],isDataRoute:!1});Er.displayName="Route";var Wg=x.createContext(null);Wg.displayName="RouteError";var hk="REACT_ROUTER_ERROR",eT="REDIRECT",tT="ROUTE_ERROR_RESPONSE";function nT(e){if(e.startsWith(`${hk}:${eT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function rT(e){if(e.startsWith(`${hk}:${tT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new QA(t.status,t.statusText,t.data)}catch{}}function aT(e,{relative:t}={}){At(eo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(ur),{hash:l,pathname:o,search:c}=Hu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Gr([n,o])),a.createHref({pathname:f,search:c,hash:l})}function eo(){return x.useContext(qu)!=null}function Dn(){return At(eo(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(qu).location}var mk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function pk(e){x.useContext(ur).static||x.useLayoutEffect(e)}function cn(){let{isDataRoute:e}=x.useContext(Er);return e?bT():iT()}function iT(){At(eo(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Ws),{basename:t,navigator:n}=x.useContext(ur),{matches:a}=x.useContext(Er),{pathname:l}=Dn(),o=JSON.stringify(Jg(a)),c=x.useRef(!1);return pk(()=>{c.current=!0}),x.useCallback((m,h={})=>{if(Cr(c.current,mk),!c.current)return;if(typeof m=="number"){n.go(m);return}let y=hf(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Gr([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var lT=x.createContext(null);function sT(e){let t=x.useContext(Er).outlet;return x.useMemo(()=>t&&x.createElement(lT.Provider,{value:e},t),[t,e])}function gk(){let{matches:e}=x.useContext(Er),t=e[e.length-1];return t?t.params:{}}function Hu(e,{relative:t}={}){let{matches:n}=x.useContext(Er),{pathname:a}=Dn(),l=JSON.stringify(Jg(n));return x.useMemo(()=>hf(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function oT(e,t){return yk(e,t)}function yk(e,t,n){var C;At(eo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(ur),{matches:l}=x.useContext(Er),o=l[l.length-1],c=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let E=h&&h.path||"";bk(f,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=Dn(),g;if(t){let E=typeof t=="string"?Js(t):t;At(m==="/"||((C=E.pathname)==null?void 0:C.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${E.pathname}" was given in the \`location\` prop.`),g=E}else g=y;let b=g.pathname||"/",S=b;if(m!=="/"){let E=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=lk(e,{pathname:S});Cr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Cr(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=hT(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},c,E.params),pathname:Gr([m,a.encodeLocation?a.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:Gr([m,a.encodeLocation?a.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),l,n);return t&&j?x.createElement(qu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function uT(){let e=vT(),t=GA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:o},"ErrorBoundary")," or"," ",x.createElement("code",{style:o},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:l},n):null,c)}var cT=x.createElement(uT,null),vk=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=rT(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(Er.Provider,{value:this.props.routeContext},x.createElement(Wg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(dT,{error:e},t):t}};vk.contextType=XA;var rp=new WeakMap;function dT({children:e,error:t}){let{basename:n}=x.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=nT(t.digest);if(a){let l=rp.get(t);if(l)throw l;let o=ck(a.location,n);if(uk&&!rp.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw rp.set(t,c),c}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function fT({routeContext:e,match:t,children:n}){let a=x.useContext(Ws);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Er.Provider,{value:e},n)}function hT(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,o=a==null?void 0:a.errors;if(o!=null){let y=l.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);At(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let c=!1,f=-1;if(n&&a){c=a.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:b,errors:S}=a,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!S||S[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(c=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(y,g)=>{var b,S;m(y,{location:a.location,params:((S=(b=a.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:KA(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let S,k=!1,j=null,C=null;a&&(S=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||cT,c&&(f<0&&b===0?(bk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,C=null):f===b&&(k=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,b+1)),A=()=>{let z;return S?z=j:k?z=C:g.route.Component?z=x.createElement(g.route.Component,null):g.route.element?z=g.route.element:z=y,x.createElement(fT,{match:g,routeContext:{outlet:y,matches:E,isDataRoute:a!=null},children:z})};return a&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(vk,{location:a.location,revalidation:a.revalidation,component:j,error:S,children:A(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):A()},null)}function ey(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mT(e){let t=x.useContext(Ws);return At(t,ey(e)),t}function pT(e){let t=x.useContext(mf);return At(t,ey(e)),t}function gT(e){let t=x.useContext(Er);return At(t,ey(e)),t}function ty(e){let t=gT(e),n=t.matches[t.matches.length-1];return At(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function yT(){return ty("useRouteId")}function vT(){var a;let e=x.useContext(Wg),t=pT("useRouteError"),n=ty("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function bT(){let{router:e}=mT("useNavigate"),t=ty("useNavigate"),n=x.useRef(!1);return pk(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{Cr(n.current,mk),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var x1={};function bk(e,t,n){!t&&!x1[e]&&(x1[e]=!0,Cr(!1,n))}x.memo(xT);function xT({routes:e,future:t,state:n,isStatic:a,onError:l}){return yk(e,void 0,{state:n,isStatic:a,onError:l})}function pf({to:e,replace:t,state:n,relative:a}){At(eo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(ur);Cr(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=x.useContext(Er),{pathname:c}=Dn(),f=cn(),m=hf(e,Jg(o),c,a==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function dg(e){return sT(e.context)}function rr(e){At(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ST({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:c}){At(!eo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:c,future:{}}),[f,l,o,c]);typeof n=="string"&&(n=Js(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:S="default",unstable_mask:k}=n,j=x.useMemo(()=>{let C=Aa(h,f);return C==null?null:{location:{pathname:C,search:y,hash:g,state:b,key:S,unstable_mask:k},navigationType:a}},[f,h,y,g,b,S,a,k]);return Cr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:x.createElement(ur.Provider,{value:m},x.createElement(qu.Provider,{children:t,value:j}))}function wT({children:e,location:t}){return oT(fg(e),t)}function fg(e,t=[]){let n=[];return x.Children.forEach(e,(a,l)=>{if(!x.isValidElement(a))return;let o=[...t,l];if(a.type===x.Fragment){n.push.apply(n,fg(a.props.children,o));return}At(a.type===rr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),At(!a.props.index||!a.props.children,"An index route cannot have child routes.");let c={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(c.children=fg(a.props.children,o)),n.push(c)}),n}var Bd="get",$d="application/x-www-form-urlencoded";function gf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function kT(e){return gf(e)&&e.tagName.toLowerCase()==="button"}function jT(e){return gf(e)&&e.tagName.toLowerCase()==="form"}function CT(e){return gf(e)&&e.tagName.toLowerCase()==="input"}function ET(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NT(e,t){return e.button===0&&(!t||t==="_self")&&!ET(e)}function hg(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(l=>[n,l]):[[n,a]])},[]))}function _T(e,t){let n=hg(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var xd=null;function AT(){if(xd===null)try{new FormData(document.createElement("form"),0),xd=!1}catch{xd=!0}return xd}var TT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ap(e){return e!=null&&!TT.has(e)?(Cr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$d}"`),null):e}function RT(e,t){let n,a,l,o,c;if(jT(e)){let f=e.getAttribute("action");a=f?Aa(f,t):null,n=e.getAttribute("method")||Bd,l=ap(e.getAttribute("enctype"))||$d,o=new FormData(e)}else if(kT(e)||CT(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(a=m?Aa(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Bd,l=ap(e.getAttribute("formenctype"))||ap(f.getAttribute("enctype"))||$d,o=new FormData(f,e),!AT()){let{name:h,type:y,value:g}=e;if(y==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,g)}}else{if(gf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Bd,a=null,l=$d,c=e}return o&&l==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ny(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zT(e,t,n,a){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:t&&Aa(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function OT(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function DT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function MT(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let c=await OT(o,n);return c.links?c.links():[]}return[]}));return PT(a.flat(1).filter(DT).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function S1(e,t,n,a,l,o){let c=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var y;return n[h].pathname!==m.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>c(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var g;let y=a.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(c(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function LT(e,t,{includeHydrateFallback:n}={}){return IT(e.map(a=>{let l=t.routes[a.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function IT(e){return[...new Set(e)]}function UT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function PT(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(UT(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function xk(){let e=x.useContext(Ws);return ny(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function BT(){let e=x.useContext(mf);return ny(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ry=x.createContext(void 0);ry.displayName="FrameworkContext";function Sk(){let e=x.useContext(ry);return ny(e,"You must render this element inside a <HydratedRouter> element"),e}function $T(e,t){let n=x.useContext(ry),[a,l]=x.useState(!1),[o,c]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=E=>{E.forEach(A=>{c(A.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[a]);let S=()=>{l(!0)},k=()=>{l(!1),c(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:au(f,S),onBlur:au(m,k),onMouseEnter:au(h,S),onMouseLeave:au(y,k),onTouchStart:au(g,S)}]:[!1,b,{}]}function au(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function FT({page:e,...t}){let{router:n}=xk(),a=x.useMemo(()=>lk(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(HT,{page:e,matches:a,...t}):null}function qT(e){let{manifest:t,routeModules:n}=Sk(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return MT(e,t,n).then(c=>{o||l(c)}),()=>{o=!0}},[e,t,n]),a}function HT({page:e,matches:t,...n}){let a=Dn(),{future:l,manifest:o,routeModules:c}=Sk(),{basename:f}=xk(),{loaderData:m,matches:h}=BT(),y=x.useMemo(()=>S1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=x.useMemo(()=>S1(e,t,h,o,a,"assets"),[e,t,h,o,a]),b=x.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,C=!1;if(t.forEach(A=>{var I;let z=o.routes[A.route.id];!z||!z.hasLoader||(!y.some(M=>M.route.id===A.route.id)&&A.route.id in m&&((I=c[A.route.id])!=null&&I.shouldRevalidate)||z.hasClientLoader?C=!0:j.add(A.route.id))}),j.size===0)return[];let E=zT(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&E.searchParams.set("_routes",t.filter(A=>j.has(A.route.id)).map(A=>A.route.id).join(",")),[E.pathname+E.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,c]),S=x.useMemo(()=>LT(g,o),[g,o]),k=qT(g);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),S.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:C})=>x.createElement("link",{key:j,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function ZT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var VT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{VT&&(window.__reactRouterVersion="7.13.1")}catch{}function QT({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=jA({window:a,v5Compat:!0}));let o=l.current,[c,f]=x.useState({action:o.action,location:o.location}),m=x.useCallback(h=>{n===!1?f(h):x.startTransition(()=>f(h))},[n]);return x.useLayoutEffect(()=>o.listen(m),[o,m]),x.createElement(ST,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var wk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zu=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:c,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:S,...k},j){let{basename:C,navigator:E,unstable_useTransitions:A}=x.useContext(ur),z=typeof y=="string"&&wk.test(y),I=ck(y,C);y=I.to;let M=aT(y,{relative:l}),O=Dn(),D=null;if(f){let ie=hf(f,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);C!=="/"&&(ie.pathname=ie.pathname==="/"?C:Gr([C,ie.pathname])),D=E.createHref(ie)}let[U,W,H]=$T(a,k),ne=YT(y,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:A});function X(ie){t&&t(ie),ie.defaultPrevented||ne(ie)}let be=!(I.isExternal||o),fe=x.createElement("a",{...k,...H,href:(be?D:void 0)||I.absoluteURL||M,onClick:be?X:t,ref:ZT(j,W),target:h,"data-discover":!z&&n==="render"?"true":void 0});return U&&!z?x.createElement(x.Fragment,null,fe,x.createElement(FT,{page:M})):fe});Zu.displayName="Link";var kk=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:c,viewTransition:f,children:m,...h},y){let g=Hu(c,{relative:h.relative}),b=Dn(),S=x.useContext(mf),{navigator:k,basename:j}=x.useContext(ur),C=S!=null&&tR(g)&&f===!0,E=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,A=b.pathname,z=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;n||(A=A.toLowerCase(),z=z?z.toLowerCase():null,E=E.toLowerCase()),z&&j&&(z=Aa(z,j)||z);const I=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let M=A===E||!l&&A.startsWith(E)&&A.charAt(I)==="/",O=z!=null&&(z===E||!l&&z.startsWith(E)&&z.charAt(E.length)==="/"),D={isActive:M,isPending:O,isTransitioning:C},U=M?t:void 0,W;typeof a=="function"?W=a(D):W=[a,M?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let H=typeof o=="function"?o(D):o;return x.createElement(Zu,{...h,"aria-current":U,className:W,ref:y,style:H,to:c,viewTransition:f},typeof m=="function"?m(D):m)});kk.displayName="NavLink";var GT=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:c=Bd,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:j}=x.useContext(ur),C=WT(),E=eR(f,{relative:h}),A=c.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&wk.test(f),I=M=>{if(m&&m(M),M.defaultPrevented)return;M.preventDefault();let O=M.nativeEvent.submitter,D=(O==null?void 0:O.getAttribute("formmethod"))||c,U=()=>C(O||M.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>U()):U()};return x.createElement("form",{ref:k,method:A,action:E,onSubmit:a?m:I,...S,"data-discover":!z&&e==="render"?"true":void 0})});GT.displayName="Form";function KT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jk(e){let t=x.useContext(Ws);return At(t,KT(e)),t}function YT(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=cn(),g=Dn(),b=Hu(e,{relative:c});return x.useCallback(S=>{if(NT(S,t)){S.preventDefault();let k=n!==void 0?n:Cu(g)===Cu(b),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[g,y,b,n,a,l,t,e,o,c,f,m,h])}function yf(e){Cr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(hg(e)),n=x.useRef(!1),a=Dn(),l=x.useMemo(()=>_T(a.search,n.current?null:t.current),[a.search]),o=cn(),c=x.useCallback((f,m)=>{const h=hg(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,c]}var XT=0,JT=()=>`__${String(++XT)}__`;function WT(){let{router:e}=jk("useSubmit"),{basename:t}=x.useContext(ur),n=yT(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,c={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=RT(o,t);if(c.navigate===!1){let b=c.fetcherKey||JT();await a(b,n,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await l(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,l,t,n])}function eR(e,{relative:t}={}){let{basename:n}=x.useContext(ur),a=x.useContext(Er);At(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...Hu(e||".",{relative:t})},c=Dn();if(e==null){o.search=c.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Gr([n,o.pathname])),Cu(o)}function tR(e,{relative:t}={}){let n=x.useContext(fk);At(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=jk("useViewTransitionState"),l=Hu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Aa(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Aa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Kd(l.pathname,c)!=null||Kd(l.pathname,o)!=null}const nR="/api/v1";async function rR(e,t){const n=await fetch(`${nR}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok){const a=await n.text();let l;try{l=JSON.parse(a).error??a}catch{l=a}throw new Error(l)}return await n.json()}const Ck="/api/v1",ay="first-tree-hub:tokens";function iy(){const e=localStorage.getItem(ay);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function mg(e){localStorage.setItem(ay,JSON.stringify(e))}function Ek(){localStorage.removeItem(ay)}class Vu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let iu=null;async function aR(e){return iu||(iu=(async()=>{try{const t=await fetch(`${Ck}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!t.ok)return null;const n=await t.json(),a={accessToken:n.accessToken,refreshToken:n.refreshToken??e};return mg(a),a}catch{return null}finally{iu=null}})(),iu)}async function Sd(e,t){const{method:n="GET",body:a}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${Ck}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=iy();let c=await l(o==null?void 0:o.accessToken);if(c.status===401&&(o!=null&&o.refreshToken)){const f=await aR(o.refreshToken);f&&(c=await l(f.accessToken))}if(!c.ok){c.status===401&&(Ek(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await c.text();let m,h;try{const y=JSON.parse(f);m=y.error??f,Array.isArray(y.details)&&(h=y.details.filter(g=>typeof g=="object"&&g!==null&&Array.isArray(g.path)))}catch{m=f}throw new Vu(c.status,m,h)}if(c.status!==204)return await c.json()}const ke={get:e=>Sd(e),post:(e,t)=>Sd(e,{method:"POST",body:t}),patch:(e,t)=>Sd(e,{method:"PATCH",body:t}),delete:e=>Sd(e,{method:"DELETE"})},Nk=x.createContext(null);function iR({children:e}){const[t,n]=x.useState(()=>!!iy()),[a,l]=x.useState(null),[o,c]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(null),[S,k]=x.useState(null),j=x.useCallback(()=>{Ek(),n(!1),l(null),c(null),m(null),y(null),b(null),k(null)},[]),C=x.useCallback(async()=>{var z;try{const I=await ke.get("/me");l(I.member.role),c(I.member.id),m(I.member.agentId),y(I.member.organizationId),b(I.user??null),k(((z=I.wizard)==null?void 0:z.step)??null)}catch{}},[]),E=x.useCallback(async(z,I)=>{const M=await rR(z,I);mg({accessToken:M.accessToken,refreshToken:M.refreshToken}),n(!0),await C()},[C]),A=x.useCallback(async z=>{mg(z),n(!0),await C()},[C]);return x.useEffect(()=>{t&&!a&&C()},[t,a,C]),x.useEffect(()=>{const z=()=>j();return window.addEventListener("auth:logout",z),()=>window.removeEventListener("auth:logout",z)},[j]),u.jsx(Nk.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,organizationId:h,user:g,wizardStep:S,login:E,adoptTokens:A,refreshMe:C,logout:j},children:e})}function Qt(){const e=x.useContext(Nk);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const lR="modulepreload",sR=function(e){return"/"+e},w1={},oR=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=c(n.map(h=>{if(h=sR(h),h in w1)return;w1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":lR,y||(b.as="script"),b.crossOrigin="",b.href=h,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((S,k)=>{b.addEventListener("load",S),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})},uR=x.lazy(()=>oR(()=>import("./index-FAu90ACE.js"),[]).then(e=>({default:e.LandingPage}))),cR=()=>u.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function dR(){const{isAuthenticated:e}=Qt(),t=Dn();return e?u.jsx(dg,{}):t.pathname==="/"?u.jsx(x.Suspense,{fallback:u.jsx(cR,{}),children:u.jsx(uR,{})}):u.jsx(pf,{to:"/login",replace:!0,state:{from:t}})}/**
61
+ * @license lucide-react v0.577.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const _k=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/**
66
+ * @license lucide-react v0.577.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const fR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71
+ * @license lucide-react v0.577.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const hR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());/**
76
+ * @license lucide-react v0.577.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const k1=e=>{const t=hR(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
81
+ * @license lucide-react v0.577.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */var mR={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"};/**
86
+ * @license lucide-react v0.577.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const pR=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
91
+ * @license lucide-react v0.577.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const gR=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},m)=>x.createElement("svg",{ref:m,...mR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:_k("lucide",l),...!o&&!pR(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,y])=>x.createElement(h,y)),...Array.isArray(o)?o:[o]]));/**
96
+ * @license lucide-react v0.577.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const lt=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(gR,{ref:o,iconNode:t,className:_k(`lucide-${fR(k1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=k1(e),n};/**
101
+ * @license lucide-react v0.577.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const yR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ly=lt("arrow-left",yR);/**
106
+ * @license lucide-react v0.577.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const vR=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],bR=lt("bell",vR);/**
111
+ * @license lucide-react v0.577.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const xR=[["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"}]],SR=lt("bot",xR);/**
116
+ * @license lucide-react v0.577.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const wR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Yr=lt("check",wR);/**
121
+ * @license lucide-react v0.577.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const kR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ak=lt("chevron-down",kR);/**
126
+ * @license lucide-react v0.577.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const jR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],CR=lt("chevron-right",jR);/**
131
+ * @license lucide-react v0.577.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const ER=[["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"}]],sy=lt("copy",ER);/**
136
+ * @license lucide-react v0.577.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const NR=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],_R=lt("eye-off",NR);/**
141
+ * @license lucide-react v0.577.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const AR=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],TR=lt("eye",AR);/**
146
+ * @license lucide-react v0.577.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const RR=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Tk=lt("github",RR);/**
151
+ * @license lucide-react v0.577.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const zR=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],OR=lt("layout-dashboard",zR);/**
156
+ * @license lucide-react v0.577.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const DR=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],pg=lt("link-2",DR);/**
161
+ * @license lucide-react v0.577.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const MR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],LR=lt("loader-circle",MR);/**
166
+ * @license lucide-react v0.577.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const IR=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Rk=lt("lock",IR);/**
171
+ * @license lucide-react v0.577.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const UR=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],PR=lt("log-out",UR);/**
176
+ * @license lucide-react v0.577.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const BR=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],oy=lt("message-square",BR);/**
181
+ * @license lucide-react v0.577.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const $R=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],FR=lt("moon",$R);/**
186
+ * @license lucide-react v0.577.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const qR=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],HR=lt("paperclip",qR);/**
191
+ * @license lucide-react v0.577.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const ZR=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],VR=lt("pause",ZR);/**
196
+ * @license lucide-react v0.577.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const QR=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Qu=lt("pencil",QR);/**
201
+ * @license lucide-react v0.577.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const GR=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],zk=lt("play",GR);/**
206
+ * @license lucide-react v0.577.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const KR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xr=lt("plus",KR);/**
211
+ * @license lucide-react v0.577.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const YR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vf=lt("search",YR);/**
216
+ * @license lucide-react v0.577.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const XR=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],JR=lt("send",XR);/**
221
+ * @license lucide-react v0.577.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const WR=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ez=lt("settings",WR);/**
226
+ * @license lucide-react v0.577.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const tz=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],nz=lt("sparkles",tz);/**
231
+ * @license lucide-react v0.577.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const rz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],az=lt("square",rz);/**
236
+ * @license lucide-react v0.577.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const iz=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],lz=lt("sun",iz);/**
241
+ * @license lucide-react v0.577.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const sz=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Zs=lt("trash-2",sz);/**
246
+ * @license lucide-react v0.577.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const oz=[["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"}]],uy=lt("triangle-alert",oz);/**
251
+ * @license lucide-react v0.577.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const uz=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],cz=lt("undo-2",uz);/**
256
+ * @license lucide-react v0.577.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const dz=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],fz=lt("unplug",dz);/**
261
+ * @license lucide-react v0.577.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const hz=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],mz=lt("user-plus",hz);/**
266
+ * @license lucide-react v0.577.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const pz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Eu=lt("x",pz);/**
271
+ * @license lucide-react v0.577.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const gz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],yz=lt("zap",gz);function Ok(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=Ok(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Dk(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Ok(e))&&(a&&(a+=" "),a+=t);return a}const vz=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},bz=(e,t)=>({classGroupId:e,validator:t}),Mk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Yd="-",j1=[],xz="arbitrary..",Sz=e=>{const t=kz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return wz(c);const f=c.split(Yd),m=f[0]===""&&f.length>1?1:0;return Lk(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=a[c],h=n[c];return m?h?vz(h,m):m:h||j1}return n[c]||j1}}},Lk=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Lk(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const f=t===0?e.join(Yd):e.slice(t).join(Yd),m=c.length;for(let h=0;h<m;h++){const y=c[h];if(y.validator(f))return y.classGroupId}},wz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?xz+a:void 0})(),kz=e=>{const{theme:t,classGroups:n}=e;return jz(n,t)},jz=(e,t)=>{const n=Mk();for(const a in e){const l=e[a];cy(l,n,a,t)}return n},cy=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];Cz(c,t,n,a)}},Cz=(e,t,n,a)=>{if(typeof e=="string"){Ez(e,t,n);return}if(typeof e=="function"){Nz(e,t,n,a);return}_z(e,t,n,a)},Ez=(e,t,n)=>{const a=e===""?t:Ik(t,e);a.classGroupId=n},Nz=(e,t,n,a)=>{if(Az(e)){cy(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(bz(n,e))},_z=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[f,m]=l[c];cy(m,Ik(t,f),n,a)}},Ik=(e,t)=>{let n=e;const a=t.split(Yd),l=a.length;for(let o=0;o<l;o++){const c=a[o];let f=n.nextPart.get(c);f||(f=Mk(),n.nextPart.set(c,f)),n=f}return n},Az=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Tz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return l(o,c),c},set(o,c){o in n?n[o]=c:l(o,c)}}},gg="!",C1=":",Rz=[],E1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),zz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const C=l[j];if(c===0&&f===0){if(C===C1){o.push(l.slice(m,j)),m=j+1;continue}if(C==="/"){h=j;continue}}C==="["?c++:C==="]"?c--:C==="("?f++:C===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,S=!1;g.endsWith(gg)?(b=g.slice(0,-1),S=!0):g.startsWith(gg)&&(b=g.slice(1),S=!0);const k=h&&h>m?h-m:void 0;return E1(o,S,b,k)};if(t){const l=t+C1,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):E1(Rz,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Oz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const c=n[o],f=c[0]==="[",m=t.has(c);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(c)):l.push(c)}return l.length>0&&(l.sort(),a.push(...l)),a}},Dz=e=>({cache:Tz(e.cacheSize),parseClassName:zz(e),sortModifiers:Oz(e),...Sz(e)}),Mz=/\s+/,Lz=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],f=e.trim().split(Mz);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let C=!!j,E=a(C?k.substring(0,j):k);if(!E){if(!C){m=y+(m.length>0?" "+m:m);continue}if(E=a(k),!E){m=y+(m.length>0?" "+m:m);continue}C=!1}const A=b.length===0?"":b.length===1?b[0]:o(b).join(":"),z=S?A+gg:A,I=z+E;if(c.indexOf(I)>-1)continue;c.push(I);const M=l(E,C);for(let O=0;O<M.length;++O){const D=M[O];c.push(z+D)}m=y+(m.length>0?" "+m:m)}return m},Iz=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=Uk(n))&&(l&&(l+=" "),l+=a);return l},Uk=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Uk(e[a]))&&(n&&(n+=" "),n+=t);return n},Uz=(e,...t)=>{let n,a,l,o;const c=m=>{const h=t.reduce((y,g)=>g(y),e());return n=Dz(h),a=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const y=Lz(m,n);return l(m,y),y};return o=c,(...m)=>o(Iz(...m))},Pz=[],rn=e=>{const t=n=>n[e]||Pz;return t.isThemeGetter=!0,t},Pk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$z=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fz=/\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$/,qz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Hz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,si=e=>Bz.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),oi=e=>!!e&&Number.isInteger(Number(e)),ip=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),Sa=e=>$z.test(e),$k=()=>!0,Vz=e=>Fz.test(e)&&!qz.test(e),dy=()=>!1,Qz=e=>Hz.test(e),Gz=e=>Zz.test(e),Kz=e=>!Ce(e)&&!Ee(e),Yz=e=>zi(e,Hk,dy),Ce=e=>Pk.test(e),rl=e=>zi(e,Zk,Vz),N1=e=>zi(e,a3,Ke),Xz=e=>zi(e,Qk,$k),Jz=e=>zi(e,Vk,dy),_1=e=>zi(e,Fk,dy),Wz=e=>zi(e,qk,Gz),wd=e=>zi(e,Gk,Qz),Ee=e=>Bk.test(e),lu=e=>jl(e,Zk),e3=e=>jl(e,Vk),A1=e=>jl(e,Fk),t3=e=>jl(e,Hk),n3=e=>jl(e,qk),kd=e=>jl(e,Gk,!0),r3=e=>jl(e,Qk,!0),zi=(e,t,n)=>{const a=Pk.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},jl=(e,t,n=!1)=>{const a=Bk.exec(e);return a?a[1]?t(a[1]):n:!1},Fk=e=>e==="position"||e==="percentage",qk=e=>e==="image"||e==="url",Hk=e=>e==="length"||e==="size"||e==="bg-size",Zk=e=>e==="length",a3=e=>e==="number",Vk=e=>e==="family-name",Qk=e=>e==="number"||e==="weight",Gk=e=>e==="shadow",i3=()=>{const e=rn("color"),t=rn("font"),n=rn("text"),a=rn("font-weight"),l=rn("tracking"),o=rn("leading"),c=rn("breakpoint"),f=rn("container"),m=rn("spacing"),h=rn("radius"),y=rn("shadow"),g=rn("inset-shadow"),b=rn("text-shadow"),S=rn("drop-shadow"),k=rn("blur"),j=rn("perspective"),C=rn("aspect"),E=rn("ease"),A=rn("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...I(),Ee,Ce],O=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],U=()=>[Ee,Ce,m],W=()=>[si,"full","auto",...U()],H=()=>[oi,"none","subgrid",Ee,Ce],ne=()=>["auto",{span:["full",oi,Ee,Ce]},oi,Ee,Ce],X=()=>[oi,"auto",Ee,Ce],be=()=>["auto","min","max","fr",Ee,Ce],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...U()],ae=()=>[si,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],K=()=>[si,"screen","full","dvw","lvw","svw","min","max","fit",...U()],he=()=>[si,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],T=()=>[e,Ee,Ce],B=()=>[...I(),A1,_1,{position:[Ee,Ce]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",t3,Yz,{size:[Ee,Ce]}],F=()=>[ip,lu,rl],J=()=>["","none","full",h,Ee,Ce],ue=()=>["",Ke,lu,rl],xe=()=>["solid","dashed","dotted","double"],Le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Se=()=>[Ke,ip,A1,_1],Ct=()=>["","none",k,Ee,Ce],te=()=>["none",Ke,Ee,Ce],Te=()=>["none",Ke,Ee,Ce],Ue=()=>[Ke,Ee,Ce],Fe=()=>[si,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Sa],breakpoint:[Sa],color:[$k],container:[Sa],"drop-shadow":[Sa],ease:["in","out","in-out"],font:[Kz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Sa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Sa],shadow:[Sa],spacing:["px",Ke],text:[Sa],"text-shadow":[Sa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",si,Ce,Ee,C]}],container:["container"],columns:[{columns:[Ke,Ce,Ee,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:W()}],"inset-x":[{"inset-x":W()}],"inset-y":[{"inset-y":W()}],start:[{"inset-s":W(),start:W()}],end:[{"inset-e":W(),end:W()}],"inset-bs":[{"inset-bs":W()}],"inset-be":[{"inset-be":W()}],top:[{top:W()}],right:[{right:W()}],bottom:[{bottom:W()}],left:[{left:W()}],visibility:["visible","invisible","collapse"],z:[{z:[oi,"auto",Ee,Ce]}],basis:[{basis:[si,"full","auto",f,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,si,"auto","initial","none",Ce]}],grow:[{grow:["",Ke,Ee,Ce]}],shrink:[{shrink:["",Ke,Ee,Ce]}],order:[{order:[oi,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":be()}],"auto-rows":[{"auto-rows":be()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mbs:[{mbs:Z()}],mbe:[{mbe:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[f,"screen",...ae()]}],"min-w":[{"min-w":[f,"screen","none",...ae()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...ae()]}],h:[{h:["screen","lh",...ae()]}],"min-h":[{"min-h":["screen","lh","none",...ae()]}],"max-h":[{"max-h":["screen","lh",...ae()]}],"font-size":[{text:["base",n,lu,rl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,r3,Xz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ip,Ce]}],"font-family":[{font:[e3,Jz,t]}],"font-features":[{"font-features":[Ce]}],"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:[l,Ee,Ce]}],"line-clamp":[{"line-clamp":[Ke,"none",Ee,N1]}],leading:[{leading:[o,...U()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ee,rl]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oi,Ee,Ce],radial:["",Ee,Ce],conic:[oi,Ee,Ce]},n3,Wz]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ee,Ce]}],"outline-w":[{outline:["",Ke,lu,rl]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",y,kd,wd]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",g,kd,wd]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Ke,rl]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",b,kd,wd]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Ke,Ee,Ce]}],"mix-blend":[{"mix-blend":[...Le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":Se()}],"mask-image-linear-to-pos":[{"mask-linear-to":Se()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":Se()}],"mask-image-t-to-pos":[{"mask-t-to":Se()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":Se()}],"mask-image-r-to-pos":[{"mask-r-to":Se()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":Se()}],"mask-image-b-to-pos":[{"mask-b-to":Se()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":Se()}],"mask-image-l-to-pos":[{"mask-l-to":Se()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":Se()}],"mask-image-x-to-pos":[{"mask-x-to":Se()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":Se()}],"mask-image-y-to-pos":[{"mask-y-to":Se()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":Se()}],"mask-image-radial-to-pos":[{"mask-radial-to":Se()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":Se()}],"mask-image-conic-to-pos":[{"mask-conic-to":Se()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Ct()}],brightness:[{brightness:[Ke,Ee,Ce]}],contrast:[{contrast:[Ke,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",S,kd,wd]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Ke,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Ke,Ee,Ce]}],invert:[{invert:["",Ke,Ee,Ce]}],saturate:[{saturate:[Ke,Ee,Ce]}],sepia:[{sepia:["",Ke,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Ct()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",E,Ee,Ce]}],delay:[{delay:[Ke,Ee,Ce]}],animate:[{animate:["none",A,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ee,Ce]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Ue()}],"skew-x":[{"skew-x":Ue()}],"skew-y":[{"skew-y":Ue()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",Ee,Ce]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Ke,lu,rl,N1]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},l3=Uz(i3);function _e(...e){return l3(Dk(e))}function Ei(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e)):"—"}function s3(e){return ke.delete(`/clients/${encodeURIComponent(e)}`)}function Gu(){return ke.get("/admin/agents/activity")}function Ni(){return ke.get("/clients")}function Kk(e){return ke.get(`/clients/${e}`)}function o3(e){return ke.post(`/clients/${e}/disconnect`)}function Yk(){return ke.post("/connect-tokens")}const Xk=(e,t)=>["session",e,t],Xd=e=>["agent-sessions",e];function u3(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.toolUseId!="string"||typeof t.name!="string"||t.status!=="pending"&&t.status!=="ok"&&t.status!=="error"?null:{toolUseId:t.toolUseId,name:t.name,args:t.args,status:t.status,durationMs:typeof t.durationMs=="number"?t.durationMs:void 0,resultPreview:typeof t.resultPreview=="string"?t.resultPreview:void 0}}function c3(e){if(typeof e!="object"||e===null)return null;const t=e;return t.source!=="sdk"&&t.source!=="runtime"&&t.source!=="tool"||typeof t.message!="string"?null:{source:t.source,message:t.message}}function d3(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function to(e,t){const n=new URLSearchParams;t!=null&&t.state&&n.set("state",t.state),t!=null&&t.runtimeState&&n.set("runtimeState",t.runtimeState);const a=n.toString();return ke.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function f3(e,t,n){const a=new URLSearchParams;a.set("limit",String(n.limit)),(n==null?void 0:n.cursor)!==void 0&&a.set("cursor",String(n.cursor)),n!=null&&n.direction&&a.set("direction",n.direction);const l=a.toString();return ke.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function h3(e,t){return ke.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function m3(e,t){return ke.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var T1=1,p3=.9,g3=.8,y3=.17,lp=.1,sp=.999,v3=.9999,b3=.99,x3=/[\\\/_+.#"@\[\(\{&]/,S3=/[\\\/_+.#"@\[\(\{&]/g,w3=/[\s-]/,Jk=/[\s-]/g;function yg(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?T1:b3;var f=`${l},${o}`;if(c[f]!==void 0)return c[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,b,S,k;h>=0;)g=yg(e,t,n,a,h+1,o+1,c),g>y&&(h===l?g*=T1:x3.test(e.charAt(h-1))?(g*=g3,S=e.slice(l,h-1).match(S3),S&&l>0&&(g*=Math.pow(sp,S.length))):w3.test(e.charAt(h-1))?(g*=p3,k=e.slice(l,h-1).match(Jk),k&&l>0&&(g*=Math.pow(sp,k.length))):(g*=y3,l>0&&(g*=Math.pow(sp,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=v3)),(g<lp&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=yg(e,t,n,a,h+1,o+2,c),b*lp>g&&(g=b*lp)),g>y&&(y=g),h=n.indexOf(m,h+1);return c[f]=y,y}function R1(e){return e.toLowerCase().replace(Jk," ")}function k3(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,yg(e,t,R1(e),R1(t),0,0,{})}function Ci(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function z1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _i(...e){return t=>{let n=!1;const a=e.map(l=>{const o=z1(l,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let l=0;l<a.length;l++){const o=a[l];typeof o=="function"?o():z1(e[l],null)}}}}function Cl(...e){return x.useCallback(_i(...e),e)}function j3(e,t){const n=x.createContext(t),a=o=>{const{children:c,...f}=o,m=x.useMemo(()=>f,Object.values(f));return u.jsx(n.Provider,{value:m,children:c})};a.displayName=e+"Provider";function l(o){const c=x.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function C3(e,t=[]){let n=[];function a(o,c){const f=x.createContext(c),m=n.length;n=[...n,c];const h=g=>{var E;const{scope:b,children:S,...k}=g,j=((E=b==null?void 0:b[e])==null?void 0:E[m])||f,C=x.useMemo(()=>k,Object.values(k));return u.jsx(j.Provider,{value:C,children:S})};h.displayName=o+"Provider";function y(g,b){var j;const S=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(S);if(k)return k;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(c=>x.createContext(c));return function(f){const m=(f==null?void 0:f[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,E3(l,...t)]}function E3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const c=a.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Nu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},N3=Hg[" useId ".trim().toString()]||(()=>{}),_3=0;function Na(e){const[t,n]=x.useState(N3());return Nu(()=>{n(a=>a??String(_3++))},[e]),t?`radix-${t}`:""}var A3=Hg[" useInsertionEffect ".trim().toString()]||Nu;function T3({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,c]=R3({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=x.useRef(e!==void 0);x.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${f?"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.`),y.current=f},[f,a])}const h=x.useCallback(y=>{var g;if(f){const b=z3(y)?y(e):y;b!==e&&((g=c.current)==null||g.call(c,b))}else o(y)},[f,e,o,c]);return[m,h]}function R3({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return A3(()=>{o.current=t},[t]),x.useEffect(()=>{var c;l.current!==n&&((c=o.current)==null||c.call(o,n),l.current=n)},[n,l]),[n,a,o]}function z3(e){return typeof e=="function"}var fy=Fw();const O3=ff(fy);function Wk(e){const t=D3(e),n=x.forwardRef((a,l)=>{const{children:o,...c}=a,f=x.Children.toArray(o),m=f.find(L3);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function D3(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const c=U3(l),f=I3(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var M3=Symbol("radix.slottable");function L3(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===M3}function I3(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function U3(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var P3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=P3.reduce((e,t)=>{const n=Wk(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function B3(e,t){e&&fy.flushSync(()=>e.dispatchEvent(t))}function _u(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function $3(e,t=globalThis==null?void 0:globalThis.document){const n=_u(e);x.useEffect(()=>{const a=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var F3="DismissableLayer",vg="dismissableLayer.update",q3="dismissableLayer.pointerDownOutside",H3="dismissableLayer.focusOutside",O1,ej=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tj=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:c,onDismiss:f,...m}=e,h=x.useContext(ej),[y,g]=x.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=x.useState({}),k=Cl(t,D=>g(D)),j=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=j.indexOf(C),A=y?j.indexOf(y):-1,z=h.layersWithOutsidePointerEventsDisabled.size>0,I=A>=E,M=Q3(D=>{const U=D.target,W=[...h.branches].some(H=>H.contains(U));!I||W||(l==null||l(D),c==null||c(D),D.defaultPrevented||f==null||f())},b),O=G3(D=>{const U=D.target;[...h.branches].some(H=>H.contains(U))||(o==null||o(D),c==null||c(D),D.defaultPrevented||f==null||f())},b);return $3(D=>{A===h.layers.size-1&&(a==null||a(D),!D.defaultPrevented&&f&&(D.preventDefault(),f()))},b),x.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(O1=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),D1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=O1)}},[y,b,n,h]),x.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),D1())},[y,h]),x.useEffect(()=>{const D=()=>S({});return document.addEventListener(vg,D),()=>document.removeEventListener(vg,D)},[]),u.jsx(Ta.div,{...m,ref:k,style:{pointerEvents:z?I?"auto":"none":void 0,...e.style},onFocusCapture:Ci(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ci(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ci(e.onPointerDownCapture,M.onPointerDownCapture)})});tj.displayName=F3;var Z3="DismissableLayerBranch",V3=x.forwardRef((e,t)=>{const n=x.useContext(ej),a=x.useRef(null),l=Cl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ta.div,{...e,ref:l})});V3.displayName=Z3;function Q3(e,t=globalThis==null?void 0:globalThis.document){const n=_u(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){nj(q3,n,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function G3(e,t=globalThis==null?void 0:globalThis.document){const n=_u(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&nj(H3,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function D1(){const e=new CustomEvent(vg);document.dispatchEvent(e)}function nj(e,t,n,{discrete:a}){const l=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?B3(l,o):l.dispatchEvent(o)}var op="focusScope.autoFocusOnMount",up="focusScope.autoFocusOnUnmount",M1={bubbles:!1,cancelable:!0},K3="FocusScope",rj=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...c}=e,[f,m]=x.useState(null),h=_u(l),y=_u(o),g=x.useRef(null),b=Cl(t,j=>m(j)),S=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(z){if(S.paused||!f)return;const I=z.target;f.contains(I)?g.current=I:di(g.current,{select:!0})},C=function(z){if(S.paused||!f)return;const I=z.relatedTarget;I!==null&&(f.contains(I)||di(g.current,{select:!0}))},E=function(z){if(document.activeElement===document.body)for(const M of z)M.removedNodes.length>0&&di(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",C);const A=new MutationObserver(E);return f&&A.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",C),A.disconnect()}}},[a,f,S.paused]),x.useEffect(()=>{if(f){I1.add(S);const j=document.activeElement;if(!f.contains(j)){const E=new CustomEvent(op,M1);f.addEventListener(op,h),f.dispatchEvent(E),E.defaultPrevented||(Y3(tO(aj(f)),{select:!0}),document.activeElement===j&&di(f))}return()=>{f.removeEventListener(op,h),setTimeout(()=>{const E=new CustomEvent(up,M1);f.addEventListener(up,y),f.dispatchEvent(E),E.defaultPrevented||di(j??document.body,{select:!0}),f.removeEventListener(up,y),I1.remove(S)},0)}}},[f,h,y,S]);const k=x.useCallback(j=>{if(!n&&!a||S.paused)return;const C=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,E=document.activeElement;if(C&&E){const A=j.currentTarget,[z,I]=X3(A);z&&I?!j.shiftKey&&E===I?(j.preventDefault(),n&&di(z,{select:!0})):j.shiftKey&&E===z&&(j.preventDefault(),n&&di(I,{select:!0})):E===A&&j.preventDefault()}},[n,a,S.paused]);return u.jsx(Ta.div,{tabIndex:-1,...c,ref:b,onKeyDown:k})});rj.displayName=K3;function Y3(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(di(a,{select:t}),document.activeElement!==n)return}function X3(e){const t=aj(e),n=L1(t,e),a=L1(t.reverse(),e);return[n,a]}function aj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function L1(e,t){for(const n of e)if(!J3(n,{upTo:t}))return n}function J3(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function W3(e){return e instanceof HTMLInputElement&&"select"in e}function di(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&W3(e)&&t&&e.select()}}var I1=eO();function eO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=U1(e,t),e.unshift(t)},remove(t){var n;e=U1(e,t),(n=e[0])==null||n.resume()}}}function U1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function tO(e){return e.filter(t=>t.tagName!=="A")}var nO="Portal",ij=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);Nu(()=>o(!0),[]);const c=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?O3.createPortal(u.jsx(Ta.div,{...a,ref:t}),c):null});ij.displayName=nO;function rO(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var bf=e=>{const{present:t,children:n}=e,a=aO(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=Cl(a.ref,iO(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};bf.displayName="Presence";function aO(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[f,m]=rO(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=jd(a.current);o.current=f==="mounted"?h:"none"},[f]),Nu(()=>{const h=a.current,y=l.current;if(y!==e){const b=o.current,S=jd(h);e?m("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Nu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=S=>{const j=jd(a.current).includes(CSS.escape(S.animationName));if(S.target===t&&j&&(m("ANIMATION_END"),!l.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},b=S=>{S.target===t&&(o.current=jd(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function jd(e){return(e==null?void 0:e.animationName)||"none"}function iO(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cp=0;function lO(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??P1()),document.body.insertAdjacentElement("beforeend",e[1]??P1()),cp++,()=>{cp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cp--}},[])}function P1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Vr=function(){return Vr=Object.assign||function(t){for(var n,a=1,l=arguments.length;a<l;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vr.apply(this,arguments)};function lj(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]]);return n}function sO(e,t,n){if(n||arguments.length===2)for(var a=0,l=t.length,o;a<l;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var Fd="right-scroll-bar-position",qd="width-before-scroll-bar",oO="with-scroll-bars-hidden",uO="--removed-body-scroll-bar-size";function dp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function cO(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var l=n.value;l!==a&&(n.value=a,n.callback(a,l))}}}})[0];return n.callback=t,n.facade}var dO=typeof window<"u"?x.useLayoutEffect:x.useEffect,B1=new WeakMap;function fO(e,t){var n=cO(null,function(a){return e.forEach(function(l){return dp(l,a)})});return dO(function(){var a=B1.get(n);if(a){var l=new Set(a),o=new Set(e),c=n.current;l.forEach(function(f){o.has(f)||dp(f,null)}),o.forEach(function(f){l.has(f)||dp(f,c)})}B1.set(n,e)},[e]),n}function hO(e){return e}function mO(e,t){t===void 0&&(t=hO);var n=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var c=t(o,a);return n.push(c),function(){n=n.filter(function(f){return f!==c})}},assignSyncMedium:function(o){for(a=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var c=[];if(n.length){var f=n;n=[],f.forEach(o),c=n}var m=function(){var y=c;c=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){c.push(y),h()},filter:function(y){return c=c.filter(y),n}}}};return l}function pO(e){e===void 0&&(e={});var t=mO(null);return t.options=Vr({async:!0,ssr:!1},e),t}var sj=function(e){var t=e.sideCar,n=lj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return x.createElement(a,Vr({},n))};sj.isSideCarExport=!0;function gO(e,t){return e.useMedium(t),sj}var oj=pO(),fp=function(){},xf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:fp,onWheelCapture:fp,onTouchMoveCapture:fp}),l=a[0],o=a[1],c=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,S=e.noRelative,k=e.noIsolation,j=e.inert,C=e.allowPinchZoom,E=e.as,A=E===void 0?"div":E,z=e.gapMode,I=lj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,O=fO([n,t]),D=Vr(Vr({},I),l);return x.createElement(x.Fragment,null,y&&x.createElement(M,{sideCar:oj,removeScrollBar:h,shards:g,noRelative:S,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:z}),c?x.cloneElement(x.Children.only(f),Vr(Vr({},D),{ref:O})):x.createElement(A,Vr({},D,{className:m,ref:O}),f))});xf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xf.classNames={fullWidth:qd,zeroRight:Fd};var yO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function vO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=yO();return t&&e.setAttribute("nonce",t),e}function bO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var SO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=vO())&&(bO(t,n),xO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wO=function(){var e=SO();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uj=function(){var e=wO(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},kO={left:0,top:0,right:0,gap:0},hp=function(e){return parseInt(e||"",10)||0},jO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[hp(n),hp(a),hp(l)]},CO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kO;var t=jO(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},EO=uj(),Ns="data-scroll-locked",NO=function(e,t,n,a){var l=e.left,o=e.top,c=e.right,f=e.gap;return n===void 0&&(n="margin"),`
276
+ .`.concat(oO,` {
277
+ overflow: hidden `).concat(a,`;
278
+ padding-right: `).concat(f,"px ").concat(a,`;
279
+ }
280
+ body[`).concat(Ns,`] {
281
+ overflow: hidden `).concat(a,`;
282
+ overscroll-behavior: contain;
283
+ `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
284
+ padding-left: `.concat(l,`px;
285
+ padding-top: `).concat(o,`px;
286
+ padding-right: `).concat(c,`px;
287
+ margin-left:0;
288
+ margin-top:0;
289
+ margin-right: `).concat(f,"px ").concat(a,`;
290
+ `),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
291
+ }
292
+
293
+ .`).concat(Fd,` {
294
+ right: `).concat(f,"px ").concat(a,`;
295
+ }
296
+
297
+ .`).concat(qd,` {
298
+ margin-right: `).concat(f,"px ").concat(a,`;
299
+ }
300
+
301
+ .`).concat(Fd," .").concat(Fd,` {
302
+ right: 0 `).concat(a,`;
303
+ }
304
+
305
+ .`).concat(qd," .").concat(qd,` {
306
+ margin-right: 0 `).concat(a,`;
307
+ }
308
+
309
+ body[`).concat(Ns,`] {
310
+ `).concat(uO,": ").concat(f,`px;
311
+ }
312
+ `)},$1=function(){var e=parseInt(document.body.getAttribute(Ns)||"0",10);return isFinite(e)?e:0},_O=function(){x.useEffect(function(){return document.body.setAttribute(Ns,($1()+1).toString()),function(){var e=$1()-1;e<=0?document.body.removeAttribute(Ns):document.body.setAttribute(Ns,e.toString())}},[])},AO=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;_O();var o=x.useMemo(function(){return CO(l)},[l]);return x.createElement(EO,{styles:NO(o,!t,l,n?"":"!important")})},bg=!1;if(typeof window<"u")try{var Cd=Object.defineProperty({},"passive",{get:function(){return bg=!0,!0}});window.addEventListener("test",Cd,Cd),window.removeEventListener("test",Cd,Cd)}catch{bg=!1}var ms=bg?{passive:!1}:!1,TO=function(e){return e.tagName==="TEXTAREA"},cj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!TO(e)&&n[t]==="visible")},RO=function(e){return cj(e,"overflowY")},zO=function(e){return cj(e,"overflowX")},F1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=dj(e,a);if(l){var o=fj(e,a),c=o[1],f=o[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},OO=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},DO=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},dj=function(e,t){return e==="v"?RO(t):zO(t)},fj=function(e,t){return e==="v"?OO(t):DO(t)},MO=function(e,t){return e==="h"&&t==="rtl"?-1:1},LO=function(e,t,n,a,l){var o=MO(e,window.getComputedStyle(t).direction),c=o*a,f=n.target,m=t.contains(f),h=!1,y=c>0,g=0,b=0;do{if(!f)break;var S=fj(e,f),k=S[0],j=S[1],C=S[2],E=j-C-o*k;(k||E)&&dj(e,f)&&(g+=E,b+=k);var A=f.parentNode;f=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(y&&Math.abs(g)<1||!y&&Math.abs(b)<1)&&(h=!0),h},Ed=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},q1=function(e){return[e.deltaX,e.deltaY]},H1=function(e){return e&&"current"in e?e.current:e},IO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},UO=function(e){return`
313
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
314
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
315
+ `)},PO=0,ps=[];function BO(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(PO++)[0],o=x.useState(uj)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=sO([e.lockRef.current],(e.shards||[]).map(H1),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var E=Ed(j),A=n.current,z="deltaX"in j?j.deltaX:A[0]-E[0],I="deltaY"in j?j.deltaY:A[1]-E[1],M,O=j.target,D=Math.abs(z)>Math.abs(I)?"h":"v";if("touches"in j&&D==="h"&&O.type==="range")return!1;var U=window.getSelection(),W=U&&U.anchorNode,H=W?W===O||W.contains(O):!1;if(H)return!1;var ne=F1(D,O);if(!ne)return!0;if(ne?M=D:(M=D==="v"?"h":"v",ne=F1(D,O)),!ne)return!1;if(!a.current&&"changedTouches"in j&&(z||I)&&(a.current=M),!M)return!0;var X=a.current||M;return LO(X,C,j,X==="h"?z:I)},[]),m=x.useCallback(function(j){var C=j;if(!(!ps.length||ps[ps.length-1]!==o)){var E="deltaY"in C?q1(C):Ed(C),A=t.current.filter(function(M){return M.name===C.type&&(M.target===C.target||C.target===M.shadowParent)&&IO(M.delta,E)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var z=(c.current.shards||[]).map(H1).filter(Boolean).filter(function(M){return M.contains(C.target)}),I=z.length>0?f(C,z[0]):!c.current.noIsolation;I&&C.cancelable&&C.preventDefault()}}},[]),h=x.useCallback(function(j,C,E,A){var z={name:j,delta:C,target:E,should:A,shadowParent:$O(E)};t.current.push(z),setTimeout(function(){t.current=t.current.filter(function(I){return I!==z})},1)},[]),y=x.useCallback(function(j){n.current=Ed(j),a.current=void 0},[]),g=x.useCallback(function(j){h(j.type,q1(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,Ed(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return ps.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,ms),document.addEventListener("touchmove",m,ms),document.addEventListener("touchstart",y,ms),function(){ps=ps.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,ms),document.removeEventListener("touchmove",m,ms),document.removeEventListener("touchstart",y,ms)}},[]);var S=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:UO(l)}):null,S?x.createElement(AO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $O(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const FO=gO(oj,BO);var hj=x.forwardRef(function(e,t){return x.createElement(xf,Vr({},e,{ref:t,sideCar:FO}))});hj.classNames=xf.classNames;var qO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},gs=new WeakMap,Nd=new WeakMap,_d={},mp=0,mj=function(e){return e&&(e.host||mj(e.parentNode))},HO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=mj(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ZO=function(e,t,n,a){var l=HO(t,Array.isArray(e)?e:[e]);_d[n]||(_d[n]=new WeakMap);var o=_d[n],c=[],f=new Set,m=new Set(l),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};l.forEach(h);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))y(b);else try{var S=b.getAttribute(a),k=S!==null&&S!=="false",j=(gs.get(b)||0)+1,C=(o.get(b)||0)+1;gs.set(b,j),o.set(b,C),c.push(b),j===1&&k&&Nd.set(b,!0),C===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(E){console.error("aria-hidden: cannot operate on ",b,E)}})};return y(t),f.clear(),mp++,function(){c.forEach(function(g){var b=gs.get(g)-1,S=o.get(g)-1;gs.set(g,b),o.set(g,S),b||(Nd.has(g)||g.removeAttribute(a),Nd.delete(g)),S||g.removeAttribute(n)}),mp--,mp||(gs=new WeakMap,gs=new WeakMap,Nd=new WeakMap,_d={})}},VO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=qO(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),ZO(a,l,n,"aria-hidden")):function(){return null}},Sf="Dialog",[pj]=C3(Sf),[QO,Lr]=pj(Sf),gj=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:c=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,y]=T3({prop:a,defaultProp:l??!1,onChange:o,caller:Sf});return u.jsx(QO,{scope:t,triggerRef:f,contentRef:m,contentId:Na(),titleId:Na(),descriptionId:Na(),open:h,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};gj.displayName=Sf;var yj="DialogTrigger",vj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(yj,n),o=Cl(t,l.triggerRef);return u.jsx(Ta.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":py(l.open),...a,ref:o,onClick:Ci(e.onClick,l.onOpenToggle)})});vj.displayName=yj;var hy="DialogPortal",[GO,bj]=pj(hy,{forceMount:void 0}),xj=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Lr(hy,t);return u.jsx(GO,{scope:t,forceMount:n,children:x.Children.map(a,c=>u.jsx(bf,{present:n||o.open,children:u.jsx(ij,{asChild:!0,container:l,children:c})}))})};xj.displayName=hy;var Jd="DialogOverlay",Sj=x.forwardRef((e,t)=>{const n=bj(Jd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(Jd,e.__scopeDialog);return o.modal?u.jsx(bf,{present:a||o.open,children:u.jsx(YO,{...l,ref:t})}):null});Sj.displayName=Jd;var KO=Wk("DialogOverlay.RemoveScroll"),YO=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Jd,n);return u.jsx(hj,{as:KO,allowPinchZoom:!0,shards:[l.contentRef],children:u.jsx(Ta.div,{"data-state":py(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),gl="DialogContent",wj=x.forwardRef((e,t)=>{const n=bj(gl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(gl,e.__scopeDialog);return u.jsx(bf,{present:a||o.open,children:o.modal?u.jsx(XO,{...l,ref:t}):u.jsx(JO,{...l,ref:t})})});wj.displayName=gl;var XO=x.forwardRef((e,t)=>{const n=Lr(gl,e.__scopeDialog),a=x.useRef(null),l=Cl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return VO(o)},[]),u.jsx(kj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ci(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ci(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&o.preventDefault()}),onFocusOutside:Ci(e.onFocusOutside,o=>o.preventDefault())})}),JO=x.forwardRef((e,t)=>{const n=Lr(gl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return u.jsx(kj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,f;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),kj=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...c}=e,f=Lr(gl,n),m=x.useRef(null),h=Cl(t,m);return lO(),u.jsxs(u.Fragment,{children:[u.jsx(rj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:u.jsx(tj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":py(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(WO,{titleId:f.titleId}),u.jsx(tD,{contentRef:m,descriptionId:f.descriptionId})]})]})}),my="DialogTitle",jj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(my,n);return u.jsx(Ta.h2,{id:l.titleId,...a,ref:t})});jj.displayName=my;var Cj="DialogDescription",Ej=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Cj,n);return u.jsx(Ta.p,{id:l.descriptionId,...a,ref:t})});Ej.displayName=Cj;var Nj="DialogClose",_j=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Nj,n);return u.jsx(Ta.button,{type:"button",...a,ref:t,onClick:Ci(e.onClick,()=>l.onOpenChange(!1))})});_j.displayName=Nj;function py(e){return e?"open":"closed"}var Aj="DialogTitleWarning",[BH,Tj]=j3(Aj,{contentName:gl,titleName:my,docsSlug:"dialog"}),WO=({titleId:e})=>{const t=Tj(Aj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
316
+
317
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
318
+
319
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},eD="DialogDescriptionWarning",tD=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tj(eD).contentName}}.`;return x.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Rj=gj,nD=vj,zj=xj,Oj=Sj,Dj=wj,rD=jj,aD=Ej,iD=_j,lD=Symbol.for("react.lazy"),Wd=Hg[" use ".trim().toString()];function sD(e){return typeof e=="object"&&e!==null&&"then"in e}function Mj(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===lD&&"_payload"in e&&sD(e._payload)}function Lj(e){const t=uD(e),n=x.forwardRef((a,l)=>{let{children:o,...c}=a;Mj(o)&&typeof Wd=="function"&&(o=Wd(o._payload));const f=x.Children.toArray(o),m=f.find(dD);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var oD=Lj("Slot");function uD(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(Mj(l)&&typeof Wd=="function"&&(l=Wd(l._payload)),x.isValidElement(l)){const c=hD(l),f=fD(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cD=Symbol("radix.slottable");function dD(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cD}function fD(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function hD(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ra=mD.reduce((e,t)=>{const n=Lj(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),su='[cmdk-group=""]',pp='[cmdk-group-items=""]',pD='[cmdk-group-heading=""]',Ij='[cmdk-item=""]',Z1=`${Ij}:not([aria-disabled="true"])`,xg="cmdk-item-select",xs="data-value",gD=(e,t,n)=>k3(e,t,n),Uj=x.createContext(void 0),Ku=()=>x.useContext(Uj),Pj=x.createContext(void 0),gy=()=>x.useContext(Pj),Bj=x.createContext(void 0),$j=x.forwardRef((e,t)=>{let n=Ss(()=>{var $,_;return{search:"",value:(_=($=e.value)!=null?$:e.defaultValue)!=null?_:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=Ss(()=>new Set),l=Ss(()=>new Map),o=Ss(()=>new Map),c=Ss(()=>new Set),f=Fj(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:S,loop:k,disablePointerSelection:j=!1,vimBindings:C=!0,...E}=e,A=Na(),z=Na(),I=Na(),M=x.useRef(null),O=ND();yl(()=>{if(y!==void 0){let $=y.trim();n.current.value=$,D.emit()}},[y]),yl(()=>{O(6,be)},[]);let D=x.useMemo(()=>({subscribe:$=>(c.current.add($),()=>c.current.delete($)),snapshot:()=>n.current,setState:($,_,F)=>{var J,ue,xe,Le;if(!Object.is(n.current[$],_)){if(n.current[$]=_,$==="search")X(),H(),O(1,ne);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Se=document.getElementById(I);Se?Se.focus():(J=document.getElementById(A))==null||J.focus()}if(O(7,()=>{var Se;n.current.selectedItemId=(Se=fe())==null?void 0:Se.id,D.emit()}),F||O(5,be),((ue=f.current)==null?void 0:ue.value)!==void 0){let Se=_??"";(Le=(xe=f.current).onValueChange)==null||Le.call(xe,Se);return}}D.emit()}},emit:()=>{c.current.forEach($=>$())}}),[]),U=x.useMemo(()=>({value:($,_,F)=>{var J;_!==((J=o.current.get($))==null?void 0:J.value)&&(o.current.set($,{value:_,keywords:F}),n.current.filtered.items.set($,W(_,F)),O(2,()=>{H(),D.emit()}))},item:($,_)=>(a.current.add($),_&&(l.current.has(_)?l.current.get(_).add($):l.current.set(_,new Set([$]))),O(3,()=>{X(),H(),n.current.value||ne(),D.emit()}),()=>{o.current.delete($),a.current.delete($),n.current.filtered.items.delete($);let F=fe();O(4,()=>{X(),(F==null?void 0:F.getAttribute("id"))===$&&ne(),D.emit()})}),group:$=>(l.current.has($)||l.current.set($,new Set),()=>{o.current.delete($),l.current.delete($)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:A,inputId:I,labelId:z,listInnerRef:M}),[]);function W($,_){var F,J;let ue=(J=(F=f.current)==null?void 0:F.filter)!=null?J:gD;return $?ue($,n.current.search,_):0}function H(){if(!n.current.search||f.current.shouldFilter===!1)return;let $=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(J=>{let ue=l.current.get(J),xe=0;ue.forEach(Le=>{let Se=$.get(Le);xe=Math.max(Se,xe)}),_.push([J,xe])});let F=M.current;ie().sort((J,ue)=>{var xe,Le;let Se=J.getAttribute("id"),Ct=ue.getAttribute("id");return((xe=$.get(Ct))!=null?xe:0)-((Le=$.get(Se))!=null?Le:0)}).forEach(J=>{let ue=J.closest(pp);ue?ue.appendChild(J.parentElement===ue?J:J.closest(`${pp} > *`)):F.appendChild(J.parentElement===F?J:J.closest(`${pp} > *`))}),_.sort((J,ue)=>ue[1]-J[1]).forEach(J=>{var ue;let xe=(ue=M.current)==null?void 0:ue.querySelector(`${su}[${xs}="${encodeURIComponent(J[0])}"]`);xe==null||xe.parentElement.appendChild(xe)})}function ne(){let $=ie().find(F=>F.getAttribute("aria-disabled")!=="true"),_=$==null?void 0:$.getAttribute(xs);D.setState("value",_||void 0)}function X(){var $,_,F,J;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let xe of a.current){let Le=(_=($=o.current.get(xe))==null?void 0:$.value)!=null?_:"",Se=(J=(F=o.current.get(xe))==null?void 0:F.keywords)!=null?J:[],Ct=W(Le,Se);n.current.filtered.items.set(xe,Ct),Ct>0&&ue++}for(let[xe,Le]of l.current)for(let Se of Le)if(n.current.filtered.items.get(Se)>0){n.current.filtered.groups.add(xe);break}n.current.filtered.count=ue}function be(){var $,_,F;let J=fe();J&&((($=J.parentElement)==null?void 0:$.firstChild)===J&&((F=(_=J.closest(su))==null?void 0:_.querySelector(pD))==null||F.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function fe(){var $;return($=M.current)==null?void 0:$.querySelector(`${Ij}[aria-selected="true"]`)}function ie(){var $;return Array.from((($=M.current)==null?void 0:$.querySelectorAll(Z1))||[])}function Z($){let _=ie()[$];_&&D.setState("value",_.getAttribute(xs))}function ae($){var _;let F=fe(),J=ie(),ue=J.findIndex(Le=>Le===F),xe=J[ue+$];(_=f.current)!=null&&_.loop&&(xe=ue+$<0?J[J.length-1]:ue+$===J.length?J[0]:J[ue+$]),xe&&D.setState("value",xe.getAttribute(xs))}function K($){let _=fe(),F=_==null?void 0:_.closest(su),J;for(;F&&!J;)F=$>0?CD(F,su):ED(F,su),J=F==null?void 0:F.querySelector(Z1);J?D.setState("value",J.getAttribute(xs)):ae($)}let he=()=>Z(ie().length-1),T=$=>{$.preventDefault(),$.metaKey?he():$.altKey?K(1):ae(1)},B=$=>{$.preventDefault(),$.metaKey?Z(0):$.altKey?K(-1):ae(-1)};return x.createElement(Ra.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:$=>{var _;(_=E.onKeyDown)==null||_.call(E,$);let F=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||F))switch($.key){case"n":case"j":{C&&$.ctrlKey&&T($);break}case"ArrowDown":{T($);break}case"p":case"k":{C&&$.ctrlKey&&B($);break}case"ArrowUp":{B($);break}case"Home":{$.preventDefault(),Z(0);break}case"End":{$.preventDefault(),he();break}case"Enter":{$.preventDefault();let J=fe();if(J){let ue=new Event(xg);J.dispatchEvent(ue)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:AD},m),wf(e,$=>x.createElement(Pj.Provider,{value:D},x.createElement(Uj.Provider,{value:U},$))))}),yD=x.forwardRef((e,t)=>{var n,a;let l=Na(),o=x.useRef(null),c=x.useContext(Bj),f=Ku(),m=Fj(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;yl(()=>{if(!h)return f.item(l,c==null?void 0:c.id)},[h]);let y=qj(l,o,[e.value,e.children,o],e.keywords),g=gy(),b=Ai(O=>O.value&&O.value===y.current),S=Ai(O=>h||f.filter()===!1?!0:O.search?O.filtered.items.get(l)>0:!0);x.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(xg,k),()=>O.removeEventListener(xg,k)},[S,e.onSelect,e.disabled]);function k(){var O,D;j(),(D=(O=m.current).onSelect)==null||D.call(O,y.current)}function j(){g.setState("value",y.current,!0)}if(!S)return null;let{disabled:C,value:E,onSelect:A,forceMount:z,keywords:I,...M}=e;return x.createElement(Ra.div,{ref:_i(o,t),...M,id:l,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!b,"data-disabled":!!C,"data-selected":!!b,onPointerMove:C||f.getDisablePointerSelection()?void 0:j,onClick:C?void 0:k},e.children)}),vD=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=Na(),f=x.useRef(null),m=x.useRef(null),h=Na(),y=Ku(),g=Ai(S=>l||y.filter()===!1?!0:S.search?S.filtered.groups.has(c):!0);yl(()=>y.group(c),[]),qj(c,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:c,forceMount:l}),[l]);return x.createElement(Ra.div,{ref:_i(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),wf(e,S=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(Bj.Provider,{value:b},S))))}),bD=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Ai(c=>!c.search);return!n&&!o?null:x.createElement(Ra.div,{ref:_i(l,t),...a,"cmdk-separator":"",role:"separator"})}),xD=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=gy(),c=Ai(h=>h.search),f=Ai(h=>h.selectedItemId),m=Ku();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Ra.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:l?e.value:c,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),SD=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),c=x.useRef(null),f=Ai(h=>h.selectedItemId),m=Ku();return x.useEffect(()=>{if(c.current&&o.current){let h=c.current,y=o.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let S=h.offsetHeight;y.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),x.createElement(Ra.div,{ref:_i(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},wf(e,h=>x.createElement("div",{ref:_i(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),wD=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...f}=e;return x.createElement(Rj,{open:n,onOpenChange:a},x.createElement(zj,{container:c},x.createElement(Oj,{"cmdk-overlay":"",className:l}),x.createElement(Dj,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement($j,{ref:t,...f}))))}),kD=x.forwardRef((e,t)=>Ai(n=>n.filtered.count===0)?x.createElement(Ra.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),jD=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Ra.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},wf(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),Qn=Object.assign($j,{List:SD,Item:yD,Input:xD,Group:vD,Separator:bD,Dialog:wD,Empty:kD,Loading:jD});function CD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ED(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Fj(e){let t=x.useRef(e);return yl(()=>{t.current=e}),t}var yl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Ss(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ai(e){let t=gy(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function qj(e,t,n,a=[]){let l=x.useRef(),o=Ku();return yl(()=>{var c;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(c=t.current)==null||c.setAttribute(xs,f),l.current=f}),l}var ND=()=>{let[e,t]=x.useState(),n=Ss(()=>new Map);return yl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function _D(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function wf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(_D(t),{ref:t.ref},n(t.props.children)):n(t)}var AD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const zt=Rj,TD=nD,RD=zj,Hj=x.forwardRef(({className:e,...t},n)=>u.jsx(Oj,{ref:n,className:_e("fixed inset-0 z-50 bg-overlay-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Hj.displayName="DialogOverlay";const Tt=x.forwardRef(({className:e,children:t,...n},a)=>u.jsxs(RD,{children:[u.jsx(Hj,{}),u.jsxs(Dj,{ref:a,className:_e("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%] rounded-lg",e),...n,children:[t,u.jsxs(iD,{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:[u.jsx(Eu,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Tt.displayName="DialogContent";function $t({className:e,...t}){return u.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function en({className:e,...t}){return u.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const Ot=x.forwardRef(({className:e,...t},n)=>u.jsx(rD,{ref:n,className:_e("text-subtitle leading-none tracking-tight",e),...t}));Ot.displayName="DialogTitle";const Yu=x.forwardRef(({className:e,...t},n)=>u.jsx(aD,{ref:n,className:_e("text-body text-muted-foreground",e),...t}));Yu.displayName="DialogDescription";const Zj=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn,{ref:n,className:_e("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Zj.displayName=Qn.displayName;function zD({open:e,onOpenChange:t,children:n}){return u.jsx(zt,{open:e,onOpenChange:t,children:u.jsx(Tt,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(Zj,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})})}const Vj=x.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(vf,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Qn.Input,{ref:n,className:_e("flex h-11 w-full rounded-md bg-transparent py-3 text-body outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Vj.displayName=Qn.Input.displayName;const Qj=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.List,{ref:n,className:_e("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Qj.displayName=Qn.List.displayName;const Gj=x.forwardRef((e,t)=>u.jsx(Qn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Gj.displayName=Qn.Empty.displayName;const Hd=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Group,{ref:n,className:_e("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-caption [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Hd.displayName=Qn.Group.displayName;const Sg=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Separator,{ref:n,className:_e("-mx-1 h-px bg-border",e),...t}));Sg.displayName=Qn.Separator.displayName;const Zd=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Item,{ref:n,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Zd.displayName=Qn.Item.displayName;function Xu(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.type&&t.set("type",e.type);const n=t.toString();return ke.get(`/admin/agents${n?`?${n}`:""}`)}function OD(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return ke.get(`/admin/agents/all${n?`?${n}`:""}`)}function Kj(e){return ke.get(`/admin/agents/${encodeURIComponent(e)}`)}function DD(e){return ke.post("/admin/agents",e)}function MD(e){return ke.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function V1(e,t){return ke.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function LD(e,t){return ke.patch(`/admin/agents/${encodeURIComponent(e)}/rebind`,t)}function ID(e){return ke.delete(`/admin/agents/${encodeURIComponent(e)}`)}function UD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function PD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function BD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function El(){const{data:e}=qe({queryKey:["agents","name-map"],queryFn:()=>Xu({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,n.displayName);return n=>n?t.get(n)??n:"—"},[e])}function yy(){const{data:e}=qe({queryKey:["agents","name-map"],queryFn:()=>Xu({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,{name:n.name,displayName:n.displayName});return n=>n?t.get(n)??null:null},[e])}const $D=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function FD({open:e,onOpenChange:t}){const n=cn(),a=El(),{data:l}=qe({queryKey:["activity"],queryFn:Gu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=qe({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await to(y.agentId);for(const b of g)h.push({agentId:y.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return u.jsxs(zD,{open:e,onOpenChange:t,children:[u.jsx(Vj,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(Qj,{children:[u.jsx(Gj,{children:"No results"}),o.length>0&&u.jsx(Hd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return u.jsxs(Zd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[u.jsx(SR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:y}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(Sg,{}),u.jsx(Hd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return u.jsxs(Zd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[u.jsx(oy,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:g}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),u.jsx(Sg,{}),u.jsx(Hd,{heading:"Pages",children:$D.map(h=>u.jsxs(Zd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[u.jsx(OR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:h.label})]},h.path))})]})]})}function qD(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function HD(){var a;const{user:e}=Qt(),{data:t}=qe({queryKey:["clients"],queryFn:Ni,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=qD(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const ZD=160;function VD(){const e=cn(),{rows:t,firstHostname:n}=HD();if(t.length===0)return null;const a=t.length>1,l=a?`${t.length} computers disconnected. Click to manage.`:`${n??"Your computer"} is disconnected. Click to manage.`;return u.jsxs("button",{type:"button",onClick:()=>e("/clients"),title:l,"aria-label":l,className:"inline-flex items-center cursor-pointer text-body font-medium",style:{gap:8,height:26,padding:"0 var(--sp-2_5) 0 var(--sp-2_25)",borderRadius:999,border:0,outline:"var(--hairline) solid color-mix(in oklch, var(--state-error) 38%, transparent)",outlineOffset:-1,background:"color-mix(in oklch, var(--state-error) 14%, transparent)",color:"color-mix(in oklch, var(--state-error) 80%, var(--fg))",minWidth:0},children:[u.jsx(QD,{}),a?u.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[u.jsx("span",{className:"font-semibold",children:t.length})," computers disconnected"]}):u.jsxs("span",{className:"inline-flex items-center",style:{gap:5,minWidth:0},children:[u.jsx("span",{className:"mono text-label font-medium",style:{maxWidth:ZD,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"color-mix(in oklch, var(--state-error) 60%, var(--fg))"},children:n??"computer"}),u.jsx("span",{style:{flexShrink:0},children:"disconnected"})]})]})}function QD(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:8,height:8,flexShrink:0,display:"inline-block"},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-error)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-error)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]})}function vl(e){return u.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),u.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),u.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),u.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),u.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),u.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function wg(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.severity&&t.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&t.set("read",String(e.read)),e!=null&&e.agentId&&t.set("agentId",e.agentId);const n=t.toString();return ke.get(`/admin/notifications${n?`?${n}`:""}`)}function Yj(e){return ke.post(`/admin/notifications/${e}/read`)}function GD(){return ke.post("/admin/notifications/read-all")}const KD={agent_error:"Error",session_error:"Error",agent_blocked:"Blocked",agent_stale:"Stale",agent_disconnected:"Disconnected",agent_connected:"Connected",agent_needs_decision:"Decision",session_completed:"Completed"};function YD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function Xj({notification:e,onClick:t,clickable:n}){const a=(KD[e.type]??e.type).toString(),l=YD(e.severity),o=n??!0;return u.jsxs("button",{type:"button",onClick:t,className:_e("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:c=>{o&&(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{c.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[u.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[u.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:Ei(e.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function XD(){var S;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=cn(),c=kn(),{data:f}=qe({queryKey:["notifications","bell"],queryFn:()=>wg({limit:8}),refetchInterval:1e4}),{data:m}=qe({queryKey:["notifications","unread-count"],queryFn:()=>wg({read:!1,limit:100}),refetchInterval:1e4}),h=((S=m==null?void 0:m.items)==null?void 0:S.length)??0,y=h>0,g=x.useCallback(async k=>{k.read||(Yj(k.id).catch(()=>{}),c.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,c]),b=x.useCallback(async()=>{a(null);try{await GD(),await c.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[c]);return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{type:"button",onClick:()=>t(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[u.jsx(bR,{className:"h-4 w-4"}),y&&u.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium text-label",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)"},children:h>99?"99+":h})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),u.jsxs("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50",style:{width:320,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6,boxShadow:"var(--shadow-md)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&u.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_5) var(--sp-3)",color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:n}),u.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(f!=null&&f.items)||f.items.length===0?u.jsx("div",{className:"text-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-4_5) 0"},children:"No notifications"}):f.items.map(k=>u.jsx(Xj,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}const Jj="onboarding:joinPath",JD="onboarding:bannerDismissed";function Wj(e){typeof window>"u"||window.sessionStorage.setItem(Jj,e)}const Q1=Jj,gp=JD,eC=x.createContext(null);function WD({children:e}){const{wizardStep:t,isAuthenticated:n}=Qt(),[a,l]=x.useState(!1),[o,c]=x.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(gp)==="1"),[f,m]=x.useState(()=>{const S=typeof window<"u"?window.sessionStorage.getItem(Q1):null;return S==="solo"||S==="invite"?S:null});x.useEffect(()=>{t==="completed"&&(l(!1),window.sessionStorage.removeItem(Q1),window.localStorage.removeItem(gp),m(null),c(!1))},[t]);const h=x.useCallback(()=>l(!0),[]),y=x.useCallback(()=>l(!1),[]),g=x.useCallback(()=>{window.localStorage.setItem(gp,"1"),c(!0)},[]),b=x.useMemo(()=>({modalOpen:a,openModal:h,closeModal:y,bannerVisible:n&&t!==null&&t!=="completed"&&!o,dismissBanner:g,joinPath:f,step:t}),[a,h,y,n,t,o,g,f]);return u.jsx(eC.Provider,{value:b,children:e})}function vy(){const e=x.useContext(eC);return e||{modalOpen:!1,openModal:()=>{},closeModal:()=>{},bannerVisible:!1,dismissBanner:()=>{},joinPath:null,step:null}}function eM(){const{bannerVisible:e,openModal:t,dismissBanner:n}=vy();return e?u.jsxs("aside",{role:"status","aria-label":"Onboarding tip",className:"shrink-0 flex items-center justify-between",style:{height:44,padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx(nz,{className:"h-3.5 w-3.5",style:{color:"var(--primary)"}}),u.jsx("span",{className:"text-body",style:{color:"var(--fg)"},children:"Set up your first agent"})]}),u.jsxs("div",{className:"flex items-center",style:{gap:4},children:[u.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center text-body font-medium transition-colors",style:{padding:"var(--sp-1) var(--sp-2_5)",borderRadius:"var(--radius-input)",background:"var(--primary)",color:"var(--primary-foreground)"},onMouseEnter:a=>{a.currentTarget.style.opacity="0.9"},onMouseLeave:a=>{a.currentTarget.style.opacity="1"},children:"Get started"}),u.jsx("button",{type:"button",onClick:n,"aria-label":"Dismiss",className:"inline-flex items-center justify-center transition-colors",style:{width:28,height:28,borderRadius:"var(--radius-input)",color:"var(--fg-3)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--bg-hover)",a.currentTarget.style.color="var(--fg)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent",a.currentTarget.style.color="var(--fg-3)"},children:u.jsx(Eu,{className:"h-3.5 w-3.5"})})]})]}):null}function tM(e){return ke.get(`/admin/chats/${encodeURIComponent(e)}`)}function nM(e,t){return ke.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function G1(e,t){return ke.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function rM(e,t){return ke.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function aM(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const l=a.result;if(typeof l!="string"){n(new Error("Unexpected FileReader result"));return}const o=l.indexOf(",");t(o>=0?l.slice(o+1):l)},a.onerror=()=>n(a.error??new Error("FileReader error")),a.readAsDataURL(e)})}function tC(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function iM(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit)),t!=null&&t.cursor&&n.set("cursor",t.cursor);const a=n.toString();return ke.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const K1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Y1=Dk,lM=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return Y1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,c=Object.keys(l).map(h=>{const y=n==null?void 0:n[h],g=o==null?void 0:o[h];if(y===null)return null;const b=K1(y)||K1(g);return l[h][b]}),f=n&&Object.entries(n).reduce((h,y)=>{let[g,b]=y;return b===void 0||(h[g]=b),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,y)=>{let{class:g,className:b,...S}=y;return Object.entries(S).every(k=>{let[j,C]=k;return Array.isArray(C)?C.includes({...o,...f}[j]):{...o,...f}[j]===C})?[...h,g,b]:h},[]);return Y1(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},sM=lM("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-input)] text-body font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 text-label",xs:"h-7 rounded-[var(--radius-chip)] px-2.5 text-label gap-1.5",lg:"h-10 px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),me=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?oD:"button";return u.jsx(c,{className:_e(sM({variant:t,size:n,className:e})),ref:o,...l})});me.displayName="Button";const oM=1500;function nC({command:e,expiresInSeconds:t,phase:n,copyLabel:a={idle:"Copy",done:"Copied"},waitingText:l="Waiting for your computer to connect…",successContent:o,errorContent:c,caption:f="Single-use · regenerates the previous one."}){const[m,h]=x.useState(!1),y=async()=>{e&&(await navigator.clipboard.writeText(e),h(!0),setTimeout(()=>h(!1),oM))},g=t!==void 0?Math.max(1,Math.round(t/60)):null;return u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[u.jsx("pre",{className:"mono text-label flex-1",style:{margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",minWidth:0},title:e??"",children:e?u.jsxs(u.Fragment,{children:[e,g!==null&&u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",g,"m"]})]}):"Generating token…"}),u.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:y,disabled:!e,style:{alignSelf:"flex-start"},children:[m?u.jsx(Yr,{className:"h-3.5 w-3.5"}):u.jsx(sy,{className:"h-3.5 w-3.5"}),m?a.done:a.idle]})]}),f&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:f}),n==="waiting"&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-blocked) 35%, var(--fg))"},children:[u.jsx(uM,{}),l]}),n==="success"&&o&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-idle) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-idle) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-idle) 45%, var(--fg))"},children:[u.jsx(Yr,{className:"h-3.5 w-3.5",style:{flexShrink:0}}),u.jsx("span",{style:{minWidth:0},children:o})]}),n==="error"&&c&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:c})]})}function uM(){return u.jsx("span",{"aria-hidden":"true",style:{width:12,height:12,flexShrink:0,borderRadius:"50%",border:"var(--hairline-bold) solid color-mix(in oklch, var(--state-blocked) 30%, transparent)",borderTopColor:"var(--state-blocked)",animation:"spin 0.85s linear infinite"}})}const xt=x.forwardRef(({className:e,type:t,...n},a)=>u.jsx("input",{type:t,className:_e("flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));xt.displayName="Input";var cM="Label",rC=x.forwardRef((e,t)=>u.jsx(Ra.label,{...e,ref:t,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));rC.displayName=cM;var dM=rC;const nt=x.forwardRef(({className:e,...t},n)=>u.jsx(dM,{ref:n,className:_e("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));nt.displayName="Label";function fM(){var O;const{modalOpen:e,closeModal:t,joinPath:n,step:a}=vy(),{refreshMe:l,organizationId:o}=Qt(),c=cn(),[f,m]=x.useState([]),[h,y]=x.useState(""),[g,b]=x.useState("name"),[S,k]=x.useState(null),[j,C]=x.useState(null);x.useEffect(()=>{e&&(y(""),b("name"),k(null),C(null))},[e]),x.useEffect(()=>{e&&(async()=>{try{const D=await ke.get("/me/organizations");m(D)}catch{}})()},[e]);const E=((O=f.find(D=>D.id===o))==null?void 0:O.displayName)??"",A=n==="invite"&&E?`You've joined ${E}.`:"Set up your first agent",z=x.useCallback(async D=>{b("creating"),C(null);try{const U=D.trim(),W=await ke.post("/admin/agents",{name:U,type:"autonomous_agent",displayName:U}),H=await tC(W.uuid);await l(),t(),c(`/?a=${encodeURIComponent(W.uuid)}&c=${encodeURIComponent(H.id)}`,{replace:!0})}catch(U){C(U instanceof Error?U.message:"Failed to create agent"),b("name")}},[l,t,c]),I=async D=>{D.preventDefault(),h.trim()&&(a==="connect"?b("connect"):await z(h))};x.useEffect(()=>{if(g!=="connect"||S)return;let D=!1;return(async()=>{try{const U=await ke.post("/connect-tokens",{});D||k(U.token)}catch(U){D||C(U instanceof Error?U.message:"Failed to generate connect token")}})(),()=>{D=!0}},[g,S]),x.useEffect(()=>{if(g!=="connect")return;let D=!1;const W=setInterval(async()=>{D||await l()},3e3);return()=>{D=!0,clearInterval(W)}},[g,l]),x.useEffect(()=>{g==="connect"&&a==="create_agent"&&h.trim()&&z(h)},[g,a,h,z]);const M=S?`npm install -g @agent-team-foundation/first-tree-hub
320
+ first-tree-hub connect ${S}`:null;return u.jsx(zt,{open:e,onOpenChange:D=>!D&&t(),children:u.jsxs(Tt,{children:[u.jsxs($t,{children:[u.jsx(Ot,{children:A}),u.jsx(Yu,{children:g==="name"?"What should we call your agent?":g==="connect"?`Connect a computer to run "${h.trim()}".`:"Setting things up…"})]}),j&&g!=="connect"&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:j}),g==="name"&&u.jsxs("form",{className:"space-y-3",onSubmit:I,children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"onboarding-agent-name",children:"Agent name"}),u.jsx(xt,{id:"onboarding-agent-name",value:h,onChange:D=>y(D.target.value),placeholder:"my-first-agent",autoFocus:!0})]}),u.jsx(me,{type:"submit",className:"w-full",disabled:!h.trim(),children:"Continue"})]}),g==="connect"&&u.jsx(nC,{command:M,phase:j?"error":"waiting",copyLabel:{idle:"Copy commands",done:"Copied"},waitingText:"Waiting for your computer to check in…",errorContent:j,caption:null}),g==="creating"&&u.jsx("p",{className:"text-body text-muted-foreground",children:"Creating your agent…"})]})})}function hM(){if(typeof window>"u")return"light";const e=window.localStorage.getItem("theme");return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function mM(){const[e,t]=x.useState(hM);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),u.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:e==="dark"?u.jsx(lz,{className:"h-4 w-4"}):u.jsx(FR,{className:"h-4 w-4"})})}function pM(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function X1({src:e,name:t,size:n=28,className:a}){const l=`${n}px`;return e?u.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",display:"block"}}):u.jsx("span",{className:a,role:"img","aria-label":t,style:{width:l,height:l,borderRadius:"50%",background:"var(--accent)",color:"var(--bg-raised)",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,userSelect:"none"},children:u.jsx("span",{className:"text-subtitle font-semibold",children:pM(t)})})}function gM({action:e,onClose:t}){const n=e!==null;return u.jsx(zt,{open:n,onOpenChange:a=>!a&&t(),children:u.jsxs(Tt,{children:[u.jsxs($t,{children:[u.jsx(Ot,{children:e==="join"?"Join a team":"Create a new team"}),u.jsx(Yu,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&u.jsx(vM,{onDone:t}),e==="join"&&u.jsx(bM,{onDone:t})]})})}function yM(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function vM({onDone:e}){const{adoptTokens:t}=Qt(),n=cn(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{y.preventDefault();const g=a.trim();if(g){m(!0),c(null);try{const b=await ke.post("/me/organizations",{name:yM(g),displayName:g});await t(b.tokens),e(),n("/",{replace:!0})}catch(b){c(b instanceof Error?b.message:"Failed to create team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(xt,{id:"team-display-name","aria-label":"Team name",value:a,onChange:y=>l(y.target.value),placeholder:"Acme Robotics",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function bM({onDone:e}){const{adoptTokens:t}=Qt(),n=cn(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{if(y.preventDefault(),!!a.trim()){m(!0),c(null);try{const g=a.trim(),b=/\/invite\/([^/?#]+)/.exec(g),S=(b==null?void 0:b[1])??g,k=await ke.post("/me/organizations/join",{token:S});await t(k.tokens),e(),n("/",{replace:!0})}catch(g){c(g instanceof Error?g.message:"Failed to join team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(xt,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:y=>l(y.target.value),placeholder:"abc123… or https://hub/invite/abc123",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function xM(){var A;const{organizationId:e,user:t,adoptTokens:n,logout:a}=Qt(),l=cn(),[o,c]=x.useState([]),[f,m]=x.useState(!1),[h,y]=x.useState(null),g=x.useRef(null);x.useEffect(()=>{(async()=>{try{const z=await ke.get("/me/organizations");c(z)}catch{}})()},[]),x.useEffect(()=>{const z=M=>{f&&g.current&&!g.current.contains(M.target)&&m(!1)},I=M=>{f&&M.key==="Escape"&&m(!1)};return window.addEventListener("mousedown",z),window.addEventListener("keydown",I),()=>{window.removeEventListener("mousedown",z),window.removeEventListener("keydown",I)}},[f]);const b=(t==null?void 0:t.displayName)??"User",S=(t==null?void 0:t.username)??"",k=(t==null?void 0:t.avatarUrl)??null,j=async z=>{if(z===e){m(!1);return}try{const I=await ke.post("/auth/switch-org",{organizationId:z});await n(I),m(!1),l("/",{replace:!0})}catch{}},C=()=>{m(!1),y("create")},E=()=>{m(!1),y("join")};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:g,className:"relative","data-testid":"user-menu",children:[u.jsx("button",{type:"button","aria-label":`User menu, ${b}`,"aria-haspopup":"menu","aria-expanded":f,onClick:()=>m(z=>!z),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:f?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:u.jsx(X1,{src:k,name:b,size:28})}),f&&u.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[u.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[u.jsx(X1,{src:k,name:b,size:32}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:b}),S&&S!==b&&u.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",S]})]})]}),o.length>0&&u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Team"}),o.length===1?u.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:u.jsx(Yr,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"truncate",children:(A=o[0])==null?void 0:A.displayName})]}):u.jsx("div",{children:o.map(z=>u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void j(z.id),className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:z.id===e?u.jsx(Yr,{className:"h-3.5 w-3.5"}):null}),u.jsx("span",{className:"truncate",children:z.displayName})]},z.id))})]}),u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:C,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(Xr,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Create new team"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:E,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(mz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Join with invite link"})]})]}),u.jsxs("div",{className:"py-1",children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),l("/settings")},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(ez,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Settings"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),a()},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(PR,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Sign out"})]})]})]})]}),u.jsx(gM,{action:h,onClose:()=>y(null)})]})}const J1=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}],SM={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function wM(){const{role:e}=Qt(),t=e==="admin",[n,a]=x.useState(!1),l=t?[...J1,SM]:J1,o=Dn(),c=o.pathname==="/"||o.search.includes("a=");return x.useEffect(()=>{const f=m=>{(m.metaKey||m.ctrlKey)&&m.key.toLowerCase()==="k"&&(m.preventDefault(),a(h=>!h))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]),u.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[u.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"1fr auto 1fr",gap:"var(--sp-3)",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3_5)",justifySelf:"start",minWidth:0},children:[u.jsxs("span",{className:"flex items-center",style:{gap:10,flexShrink:0},children:[u.jsx(vl,{width:16,height:18,style:{color:"var(--fg)"}}),u.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",u.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),u.jsx(VD,{})]}),u.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:l.map(f=>u.jsx(kk,{to:f.to,end:f.end,style:{pointerEvents:"auto"},className:({isActive:m})=>_e("inline-flex items-center transition-colors",m?"":"hover:text-[var(--fg)]"),children:({isActive:m})=>u.jsxs("span",{className:"inline-flex items-center text-subtitle font-medium",style:{padding:"var(--sp-1_5) var(--sp-3)",gap:6,borderRadius:5,color:m?"var(--fg)":"var(--fg-3)",background:m?"var(--bg-hover)":"transparent"},children:[f.label,m&&u.jsx("span",{className:"kbd",children:f.kbd})]})},f.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6,justifySelf:"end"},children:[u.jsxs("button",{type:"button",onClick:()=>a(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors text-body",style:{gap:8,padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)"},onMouseEnter:f=>{f.currentTarget.style.color="var(--fg)"},onMouseLeave:f=>{f.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(vf,{className:"h-4 w-4"}),u.jsx("span",{children:"Jump to…"}),u.jsx("span",{className:"kbd",children:"⌘K"})]}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(XD,{}),u.jsx(mM,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(xM,{})]})]}),u.jsx(eM,{}),u.jsx(FD,{open:n,onOpenChange:a}),u.jsx(fM,{}),c?u.jsx(dg,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:u.jsx(dg,{})})})]})}function se(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=c.prototype,y=Object.keys(h);for(let g=0;g<y.length;g++){const b=y[g];b in f||(f[b]=h[b].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function c(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class _s extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class aC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const iC={};function Ti(e){return iC}function lC(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,l])=>t.indexOf(+a)===-1).map(([a,l])=>l)}function kg(e,t){return typeof t=="bigint"?t.toString():t}function kf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function by(e){return e==null}function xy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function kM(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let l=(a.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,c=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return c%f/10**o}const W1=Symbol("evaluating");function ft(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==W1)return a===void 0&&(a=W1,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function Nl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Oi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function eS(e){return JSON.stringify(e)}function jM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const sC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Au(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const CM=kf(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Vs(e){if(Au(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Au(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function oC(e){return Vs(e)?{...e}:Array.isArray(e)?[...e]:e}const EM=new Set(["string","number","symbol"]);function Qs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Di(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(a._zod.parent=e),a}function Ae(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function NM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _M={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function AM(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Oi(e._zod.def,{get shape(){const c={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(c[f]=n.shape[f])}return Nl(this,"shape",c),c},checks:[]});return Di(e,o)}function TM(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Oi(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete c[f]}return Nl(this,"shape",c),c},checks:[]});return Di(e,o)}function RM(e,t){if(!Vs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const c in t)if(Object.getOwnPropertyDescriptor(o,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Oi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Nl(this,"shape",o),o}});return Di(e,l)}function zM(e,t){if(!Vs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Nl(this,"shape",a),a}});return Di(e,n)}function OM(e,t){const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Nl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Di(e,n)}function DM(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Oi(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return Nl(this,"shape",m),m},checks:[]});return Di(t,c)}function MM(e,t,n){const a=Oi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const c in n){if(!(c in o))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(o[c]=new e({type:"nonoptional",innerType:l[c]}))}else for(const c in l)o[c]=new e({type:"nonoptional",innerType:l[c]});return Nl(this,"shape",o),o}});return Di(t,a)}function ks(e,t=0){var n;if(e.aborted===!0)return!0;for(let a=t;a<e.issues.length;a++)if(((n=e.issues[a])==null?void 0:n.continue)!==!0)return!0;return!1}function js(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Ad(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ri(e,t,n){var l,o,c,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=Ad((c=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:c.call(o,e))??Ad((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??Ad((m=n.customError)==null?void 0:m.call(n,e))??Ad((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";a.message=y}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function Sy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const uC=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cC=se("$ZodError",uC),dC=se("$ZodError",uC,{Parent:Error});function LM(e,t=n=>n.message){const n={},a=[];for(const l of e.issues)l.path.length>0?(n[l.path[0]]=n[l.path[0]]||[],n[l.path[0]].push(t(l))):a.push(t(l));return{formErrors:a,fieldErrors:n}}function IM(e,t=n=>n.message){const n={_errors:[]},a=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>a({issues:c}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let c=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(o))):c[m]=c[m]||{_errors:[]},c=c[m],f++}}};return a(e),n}const wy=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new _s;if(c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ti())));throw sC(f,l==null?void 0:l.callee),f}return c.value},ky=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ti())));throw sC(f,l==null?void 0:l.callee),f}return c.value},jf=e=>(t,n,a)=>{const l=a?{...a,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},l);if(o instanceof Promise)throw new _s;return o.issues.length?{success:!1,error:new(e??cC)(o.issues.map(c=>Ri(c,l,Ti())))}:{success:!0,data:o.value}},UM=jf(dC),Cf=e=>async(t,n,a)=>{const l=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(c=>Ri(c,l,Ti())))}:{success:!0,data:o.value}},PM=Cf(dC),BM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return wy(e)(t,n,l)},$M=e=>(t,n,a)=>wy(e)(t,n,a),FM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ky(e)(t,n,l)},qM=e=>async(t,n,a)=>ky(e)(t,n,a),HM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return jf(e)(t,n,l)},ZM=e=>(t,n,a)=>jf(e)(t,n,a),VM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Cf(e)(t,n,l)},QM=e=>async(t,n,a)=>Cf(e)(t,n,a),GM=/^[cC][^\s-]{8,}$/,KM=/^[0-9a-z]+$/,YM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,XM=/^[0-9a-vA-V]{20}$/,JM=/^[A-Za-z0-9]{27}$/,WM=/^[a-zA-Z0-9_-]{21}$/,e4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,t4=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tS=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,n4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,r4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function a4(){return new RegExp(r4,"u")}const i4=/^(?:(?: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])$/,l4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,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])\/([0-9]|[1-2][0-9]|3[0-2])$/,o4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,u4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fC=/^[A-Za-z0-9_-]*$/,c4=/^\+[1-9]\d{6,14}$/,hC="(?:(?:\\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])))",d4=new RegExp(`^${hC}$`);function mC(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function f4(e){return new RegExp(`^${mC(e)}$`)}function h4(e){const t=mC({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${hC}T(?:${a})$`)}const m4=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},p4=/^-?\d+$/,pC=/^-?\d+(?:\.\d+)?$/,g4=/^(?:true|false)$/i,y4=/^[^A-Z]*$/,v4=/^[^a-z]*$/,Gn=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),gC={number:"number",bigint:"bigint",object:"date"},yC=se("$ZodCheckLessThan",(e,t)=>{Gn.init(e,t);const n=gC[typeof t.value];e._zod.onattach.push(a=>{const l=a._zod.bag,o=(t.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?l.maximum=t.value:l.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vC=se("$ZodCheckGreaterThan",(e,t)=>{Gn.init(e,t);const n=gC[typeof t.value];e._zod.onattach.push(a=>{const l=a._zod.bag,o=(t.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?l.minimum=t.value:l.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),b4=se("$ZodCheckMultipleOf",(e,t)=>{Gn.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):kM(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),x4=se("$ZodCheckNumberFormat",(e,t)=>{var c;Gn.init(e,t),t.format=t.format||"float64";const n=(c=t.format)==null?void 0:c.includes("int"),a=n?"int":"number",[l,o]=_M[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=l,m.maximum=o,n&&(m.pattern=p4)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}m<l&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!t.abort}),m>o&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),S4=se("$ZodCheckMaxLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!by(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const l=a.value;if(l.length<=t.maximum)return;const c=Sy(l);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),w4=se("$ZodCheckMinLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!by(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const l=a.value;if(l.length>=t.minimum)return;const c=Sy(l);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),k4=se("$ZodCheckLengthEquals",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!by(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=a=>{const l=a.value,o=l.length;if(o===t.length)return;const c=Sy(l),f=o>t.length;a.issues.push({origin:c,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Ef=se("$ZodCheckStringFormat",(e,t)=>{var n,a;Gn.init(e,t),e._zod.onattach.push(l=>{const o=l._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),j4=se("$ZodCheckRegex",(e,t)=>{Ef.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),C4=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=y4),Ef.init(e,t)}),E4=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=v4),Ef.init(e,t)}),N4=se("$ZodCheckIncludes",(e,t)=>{Gn.init(e,t);const n=Qs(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(a)}),e._zod.check=l=>{l.value.includes(t.includes,t.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:l.value,inst:e,continue:!t.abort})}}),_4=se("$ZodCheckStartsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`^${Qs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),A4=se("$ZodCheckEndsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`.*${Qs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),T4=se("$ZodCheckOverwrite",(e,t)=>{Gn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class R4{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
321
+ `).filter(c=>c),l=Math.min(...a.map(c=>c.length-c.trimStart().length)),o=a.map(c=>c.slice(l)).map(c=>" ".repeat(this.indent*2)+c);for(const c of o)this.content.push(c)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
322
+ `))}}const z4={major:4,minor:3,patch:6},Dt=se("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=z4;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const c of o._zod.onattach)c(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let y=ks(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const S=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new _s;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==S&&(y||(y=ks(f,S)))});else{if(f.issues.length===S)continue;y||(y=ks(f,S))}}return g?g.then(()=>f):f},c=(f,m,h)=>{if(ks(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new _s;return y.then(g=>e._zod.parse(g,h))}return e._zod.parse(y,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const y=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return y instanceof Promise?y.then(g=>c(g,f,m)):c(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new _s;return h.then(y=>o(y,a,m))}return o(h,a,m)}}ft(e,"~standard",()=>({validate:o=>{var c;try{const f=UM(e,o);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return PM(e,o).then(m=>{var h;return m.success?{value:m.data}:{issues:(h=m.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),jy=se("$ZodString",(e,t)=>{var n;Dt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??m4(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Rt=se("$ZodStringFormat",(e,t)=>{Ef.init(e,t),jy.init(e,t)}),O4=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=t4),Rt.init(e,t)}),D4=se("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tS(a))}else t.pattern??(t.pattern=tS());Rt.init(e,t)}),M4=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=n4),Rt.init(e,t)}),L4=se("$ZodURL",(e,t)=>{Rt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),l=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=l.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),I4=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=a4()),Rt.init(e,t)}),U4=se("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=WM),Rt.init(e,t)}),P4=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=GM),Rt.init(e,t)}),B4=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=KM),Rt.init(e,t)}),$4=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=YM),Rt.init(e,t)}),F4=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=XM),Rt.init(e,t)}),q4=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=JM),Rt.init(e,t)}),H4=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=h4(t)),Rt.init(e,t)}),Z4=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=d4),Rt.init(e,t)}),V4=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=f4(t)),Rt.init(e,t)}),Q4=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=e4),Rt.init(e,t)}),G4=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=i4),Rt.init(e,t),e._zod.bag.format="ipv4"}),K4=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=l4),Rt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Y4=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=s4),Rt.init(e,t)}),X4=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=o4),Rt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;if(!o)throw new Error;const c=Number(o);if(`${c}`!==o)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function bC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const J4=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=u4),Rt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{bC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function W4(e){if(!fC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return bC(n)}const e5=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=fC),Rt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{W4(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),t5=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=c4),Rt.init(e,t)});function n5(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const l=JSON.parse(atob(a));return!("typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const r5=se("$ZodJWT",(e,t)=>{Rt.init(e,t),e._zod.check=n=>{n5(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),xC=se("$ZodNumber",(e,t)=>{Dt.init(e,t),e._zod.pattern=e._zod.bag.pattern??pC,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const l=n.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return n;const o=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...o?{received:o}:{}}),n}}),a5=se("$ZodNumberFormat",(e,t)=>{x4.init(e,t),xC.init(e,t)}),i5=se("$ZodBoolean",(e,t)=>{Dt.init(e,t),e._zod.pattern=g4,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const l=n.value;return typeof l=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),n}}),l5=se("$ZodUnknown",(e,t)=>{Dt.init(e,t),e._zod.parse=n=>n}),s5=se("$ZodNever",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function nS(e,t,n){e.issues.length&&t.issues.push(...js(n,e.issues)),t.value[n]=e.value}const o5=se("$ZodArray",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let c=0;c<l.length;c++){const f=l[c],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>nS(h,n,c))):nS(m,n,c)}return o.length?Promise.all(o).then(()=>n):n}});function ef(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...js(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function SC(e){var a,l,o,c;const t=Object.keys(e.shape);for(const f of t)if(!((c=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=NM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function wC(e,t,n,a,l,o){const c=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,y=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){c.push(g);continue}const b=m.run({value:t[g],issues:[]},a);b instanceof Promise?e.push(b.then(S=>ef(S,n,g,t,y))):ef(b,n,g,t,y)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const u5=se("$ZodObject",(e,t)=>{Dt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=kf(()=>SC(t));ft(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const l=Au,o=t.catchall;let c;e._zod.parse=(f,m)=>{c??(c=a.value);const h=f.value;if(!l(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const y=[],g=c.shape;for(const b of c.keys){const S=g[b],k=S._zod.optout==="optional",j=S._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(C=>ef(C,f,b,h,k))):ef(j,f,b,h,k)}return o?wC(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),c5=se("$ZodObjectJIT",(e,t)=>{u5.init(e,t);const n=e._zod.parse,a=kf(()=>SC(t)),l=b=>{var z;const S=new R4(["shape","payload","ctx"]),k=a.value,j=I=>{const M=eS(I);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};S.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const I of k.keys)C[I]=`key_${E++}`;S.write("const newResult = {};");for(const I of k.keys){const M=C[I],O=eS(I),D=b[I],U=((z=D==null?void 0:D._zod)==null?void 0:z.optout)==="optional";S.write(`const ${M} = ${j(I)};`),U?S.write(`
323
+ if (${M}.issues.length) {
324
+ if (${O} in input) {
325
+ payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
326
+ ...iss,
327
+ path: iss.path ? [${O}, ...iss.path] : [${O}]
328
+ })));
329
+ }
330
+ }
331
+
332
+ if (${M}.value === undefined) {
333
+ if (${O} in input) {
334
+ newResult[${O}] = undefined;
335
+ }
336
+ } else {
337
+ newResult[${O}] = ${M}.value;
338
+ }
339
+
340
+ `):S.write(`
341
+ if (${M}.issues.length) {
342
+ payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
343
+ ...iss,
344
+ path: iss.path ? [${O}, ...iss.path] : [${O}]
345
+ })));
346
+ }
347
+
348
+ if (${M}.value === undefined) {
349
+ if (${O} in input) {
350
+ newResult[${O}] = undefined;
351
+ }
352
+ } else {
353
+ newResult[${O}] = ${M}.value;
354
+ }
355
+
356
+ `)}S.write("payload.value = newResult;"),S.write("return payload;");const A=S.compile();return(I,M)=>A(b,I,M)};let o;const c=Au,f=!iC.jitless,h=f&&CM.value,y=t.catchall;let g;e._zod.parse=(b,S)=>{g??(g=a.value);const k=b.value;return c(k)?f&&h&&(S==null?void 0:S.async)===!1&&S.jitless!==!0?(o||(o=l(t.shape)),b=o(b,S),y?wC([],k,b,S,g,e):b):n(b,S):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function rS(e,t,n,a){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const l=e.filter(o=>!ks(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(c=>Ri(c,a,Ti())))}),t)}const kC=se("$ZodUnion",(e,t)=>{Dt.init(e,t),ft(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),ft(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),ft(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),ft(e._zod,"pattern",()=>{if(t.options.every(l=>l._zod.pattern)){const l=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${l.map(o=>xy(o.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return a(l,o);let c=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),c=!0;else{if(h.issues.length===0)return h;f.push(h)}}return c?Promise.all(f).then(m=>rS(m,l,e,o)):rS(f,l,e,o)}}),d5=se("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,kC.init(e,t);const n=e._zod.parse;ft(e._zod,"propValues",()=>{const l={};for(const o of t.options){const c=o._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(c)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=kf(()=>{var c;const l=t.options,o=new Map;for(const f of l){const m=(c=f._zod.propValues)==null?void 0:c[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const c=l.value;if(!Au(c))return l.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),l;const f=a.value.get(c==null?void 0:c[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),l)}}),f5=se("$ZodIntersection",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),c=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||c instanceof Promise?Promise.all([o,c]).then(([m,h])=>aS(n,m,h)):aS(n,o,c)}});function jg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Vs(e)&&Vs(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const c=jg(e[o],t[o]);if(!c.valid)return{valid:!1,mergeErrorPath:[o,...c.mergeErrorPath]};l[o]=c.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const l=e[a],o=t[a],c=jg(l,o);if(!c.valid)return{valid:!1,mergeErrorPath:[a,...c.mergeErrorPath]};n.push(c.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function aS(e,t,n){const a=new Map;let l;for(const f of t.issues)if(f.code==="unrecognized_keys"){l??(l=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const o=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&l&&e.issues.push({...l,keys:o}),ks(e))return e;const c=jg(t.value,n.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const h5=se("$ZodRecord",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Vs(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],c=t.keyType._zod.values;if(c){n.value={};const f=new Set;for(const h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const y=t.valueType._zod.run({value:l[h],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...js(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...js(h,y.issues)),n.value[h]=y.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&pC.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},a);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>Ri(g,a,Ti())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:l[f],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...js(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...js(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),m5=se("$ZodEnum",(e,t)=>{Dt.init(e,t);const n=lC(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>EM.has(typeof l)).map(l=>typeof l=="string"?Qs(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const c=l.value;return a.has(c)||l.issues.push({code:"invalid_value",values:n,input:c,inst:e}),l}}),p5=se("$ZodLiteral",(e,t)=>{if(Dt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Qs(a):a?Qs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,l)=>{const o=a.value;return n.has(o)||a.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),a}}),g5=se("$ZodTransform",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new aC(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(c=>(n.value=c,n));if(l instanceof Promise)throw new _s;return n.value=l,n}});function iS(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const jC=se("$ZodOptional",(e,t)=>{Dt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ft(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xy(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>iS(o,n.value)):iS(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),y5=se("$ZodExactOptional",(e,t)=>{jC.init(e,t),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),v5=se("$ZodNullable",(e,t)=>{Dt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xy(n.source)}|null)$`):void 0}),ft(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),b5=se("$ZodDefault",(e,t)=>{Dt.init(e,t),e._zod.optin="optional",ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>lS(o,t)):lS(l,t)}});function lS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const x5=se("$ZodPrefault",(e,t)=>{Dt.init(e,t),e._zod.optin="optional",ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),S5=se("$ZodNonOptional",(e,t)=>{Dt.init(e,t),ft(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>sS(o,e)):sS(l,e)}});function sS(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const w5=se("$ZodCatch",(e,t)=>{Dt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(c=>Ri(c,a,Ti()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ri(o,a,Ti()))},input:n.value}),n.issues=[]),n)}}),k5=se("$ZodPipe",(e,t)=>{Dt.init(e,t),ft(e._zod,"values",()=>t.in._zod.values),ft(e._zod,"optin",()=>t.in._zod.optin),ft(e._zod,"optout",()=>t.out._zod.optout),ft(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const o=t.out._zod.run(n,a);return o instanceof Promise?o.then(c=>Td(c,t.in,a)):Td(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>Td(o,t.out,a)):Td(l,t.out,a)}});function Td(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const j5=se("$ZodReadonly",(e,t)=>{Dt.init(e,t),ft(e._zod,"propValues",()=>t.innerType._zod.propValues),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),ft(e._zod,"optout",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optout}),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(oS):oS(l)}});function oS(e){return e.value=Object.freeze(e.value),e}const C5=se("$ZodCustom",(e,t)=>{Gn.init(e,t),Dt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,l=t.fn(a);if(l instanceof Promise)return l.then(o=>uS(o,n,a,e));uS(l,n,a,e)}});function uS(e,t,n,a){if(!e){const l={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(l.params=a._zod.def.params),t.issues.push(Tu(l))}}var cS;class E5{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const l={...a,...this._map.get(t)};return Object.keys(l).length?l:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function N5(){return new E5}(cS=globalThis).__zod_globalRegistry??(cS.__zod_globalRegistry=N5());const mu=globalThis.__zod_globalRegistry;function _5(e,t){return new e({type:"string",...Ae(t)})}function A5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ae(t)})}function dS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(t)})}function T5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(t)})}function R5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(t)})}function z5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(t)})}function O5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(t)})}function D5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ae(t)})}function M5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(t)})}function L5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(t)})}function I5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(t)})}function U5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(t)})}function P5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(t)})}function B5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(t)})}function $5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(t)})}function F5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(t)})}function q5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(t)})}function H5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(t)})}function Z5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(t)})}function V5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(t)})}function Q5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(t)})}function G5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(t)})}function K5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(t)})}function Y5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(t)})}function X5(e,t){return new e({type:"string",format:"date",check:"string_format",...Ae(t)})}function J5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ae(t)})}function W5(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ae(t)})}function eL(e,t){return new e({type:"number",checks:[],...Ae(t)})}function tL(e,t){return new e({type:"number",coerce:!0,checks:[],...Ae(t)})}function nL(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(t)})}function rL(e,t){return new e({type:"boolean",...Ae(t)})}function aL(e){return new e({type:"unknown"})}function iL(e,t){return new e({type:"never",...Ae(t)})}function fS(e,t){return new yC({check:"less_than",...Ae(t),value:e,inclusive:!1})}function yp(e,t){return new yC({check:"less_than",...Ae(t),value:e,inclusive:!0})}function hS(e,t){return new vC({check:"greater_than",...Ae(t),value:e,inclusive:!1})}function vp(e,t){return new vC({check:"greater_than",...Ae(t),value:e,inclusive:!0})}function mS(e,t){return new b4({check:"multiple_of",...Ae(t),value:e})}function CC(e,t){return new S4({check:"max_length",...Ae(t),maximum:e})}function tf(e,t){return new w4({check:"min_length",...Ae(t),minimum:e})}function EC(e,t){return new k4({check:"length_equals",...Ae(t),length:e})}function lL(e,t){return new j4({check:"string_format",format:"regex",...Ae(t),pattern:e})}function sL(e){return new C4({check:"string_format",format:"lowercase",...Ae(e)})}function oL(e){return new E4({check:"string_format",format:"uppercase",...Ae(e)})}function uL(e,t){return new N4({check:"string_format",format:"includes",...Ae(t),includes:e})}function cL(e,t){return new _4({check:"string_format",format:"starts_with",...Ae(t),prefix:e})}function dL(e,t){return new A4({check:"string_format",format:"ends_with",...Ae(t),suffix:e})}function no(e){return new T4({check:"overwrite",tx:e})}function fL(e){return no(t=>t.normalize(e))}function hL(){return no(e=>e.trim())}function mL(){return no(e=>e.toLowerCase())}function pL(){return no(e=>e.toUpperCase())}function gL(){return no(e=>jM(e))}function yL(e,t,n){return new e({type:"array",element:t,...Ae(n)})}function vL(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ae(n)})}function bL(e){const t=xL(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Tu(a,n.value,t._zod.def));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),n.issues.push(Tu(l))}},e(n.value,n)));return t}function xL(e,t){const n=new Gn({check:"custom",...Ae(t)});return n._zod.check=e,n}function NC(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??mu,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Wt(e,t,n={path:[],schemaPath:[]}){var y,g;var a;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)c.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,b);else{const k=c.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const S=e._zod.parent;S&&(c.ref||(c.ref=S),Wt(S,t,b),t.seen.get(S).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&Rn(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&c.schema._prefault&&((a=c.schema).default??(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function _C(e,t){var c,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const y of e.seen.entries()){const g=(c=e.metadataRegistry.get(y[0]))==null?void 0:c.id;if(g){const b=a.get(g);if(b&&b!==y[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(g,y[0])}}const l=y=>{var j;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const C=(j=e.external.registry.get(y[0]))==null?void 0:j.id,E=e.external.uri??(z=>z);if(C)return{ref:E(C)};const A=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=A,{defId:A,ref:`${E("__shared")}#/${g}/${A}`}}if(y[1]===n)return{ref:"#"};const S=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:S+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:b,defId:S}=l(y);g.def={...g.schema},S&&(g.defId=S);const k=g.schema;for(const j in k)delete k[j];k.$ref=b};if(e.cycles==="throw")for(const y of e.seen.entries()){const g=y[1];if(g.cycle)throw new Error(`Cycle detected: #/${(f=g.cycle)==null?void 0:f.join("/")}/<root>
357
+
358
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const g=y[1];if(t===y[0]){o(y);continue}if(e.external){const S=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&S){o(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){o(y);continue}if(g.cycle){o(y);continue}if(g.count>1&&e.reused==="ref"){o(y);continue}}}function AC(e,t){var c,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,b={...g},S=y.ref;if(y.ref=null,S){a(S);const j=e.seen.get(S),C=j.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(C)):Object.assign(g,C),Object.assign(g,b),h._zod.parent===S)for(const A in g)A==="$ref"||A==="allOf"||A in b||delete g[A];if(C.$ref&&j.def)for(const A in g)A==="$ref"||A==="allOf"||A in j.def&&JSON.stringify(g[A])===JSON.stringify(j.def[A])&&delete g[A]}const k=h._zod.parent;if(k&&k!==S){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const C in g)C==="$ref"||C==="allOf"||C in j.def&&JSON.stringify(g[C])===JSON.stringify(j.def[C])&&delete g[C]}e.override({zodSchema:h,jsonSchema:g,path:y.path??[]})};for(const h of[...e.seen.entries()].reverse())a(h[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const y=h[1];y.def&&y.defId&&(o[y.defId]=y.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:nf(t,"input",e.processors),output:nf(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Rn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return Rn(a.element,n);if(a.type==="set")return Rn(a.valueType,n);if(a.type==="lazy")return Rn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return Rn(a.innerType,n);if(a.type==="intersection")return Rn(a.left,n)||Rn(a.right,n);if(a.type==="record"||a.type==="map")return Rn(a.keyType,n)||Rn(a.valueType,n);if(a.type==="pipe")return Rn(a.in,n)||Rn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(Rn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(Rn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(Rn(l,n))return!0;return!!(a.rest&&Rn(a.rest,n))}return!1}const SL=(e,t={})=>n=>{const a=NC({...n,processors:t});return Wt(e,a),_C(a,e),AC(a,e)},nf=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},c=NC({...l??{},target:o,io:t,processors:n});return Wt(e,c),_C(c,e),AC(c,e)},wL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},kL=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:c,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof c=="number"&&(l.maxLength=c),f&&(l.format=wL[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const y=[...m];y.length===1?l.pattern=y[0].source:y.length>1&&(l.allOf=[...y.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},jL=(e,t,n,a)=>{const l=n,{minimum:o,maximum:c,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=y,l.exclusiveMinimum=!0):l.exclusiveMinimum=y),typeof o=="number"&&(l.minimum=o,typeof y=="number"&&t.target!=="draft-04"&&(y>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof c=="number"&&(l.maximum=c,typeof h=="number"&&t.target!=="draft-04"&&(h<=c?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},CL=(e,t,n,a)=>{n.type="boolean"},EL=(e,t,n,a)=>{n.not={}},NL=(e,t,n,a)=>{},_L=(e,t,n,a)=>{const l=e._zod.def,o=lC(l.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},AL=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const c of l.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(c))}else o.push(c);if(o.length!==0)if(o.length===1){const c=o[0];n.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[c]:n.const=c}else o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),o.every(c=>typeof c=="boolean")&&(n.type="boolean"),o.every(c=>c===null)&&(n.type="null"),n.enum=o},TL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},RL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},zL=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:c,maximum:f}=e._zod.bag;typeof c=="number"&&(l.minItems=c),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Wt(o.element,t,{...a,path:[...a.path,"items"]})},OL=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const c=o.shape;for(const y in c)l.properties[y]=Wt(c[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(c)),m=new Set([...f].filter(y=>{const g=o.shape[y]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=Wt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},DL=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,c=l.options.map((f,m)=>Wt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=c:n.anyOf=c},ML=(e,t,n,a)=>{const l=e._zod.def,o=Wt(l.left,t,{...a,path:[...a.path,"allOf",0]}),c=Wt(l.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(c)?c.allOf:[c]];n.allOf=m},LL=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const c=o.keyType,f=c._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=Wt(o.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});l.patternProperties={};for(const g of m)l.patternProperties[g.source]=y}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(l.propertyNames=Wt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Wt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=c._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},IL=(e,t,n,a)=>{const l=e._zod.def,o=Wt(l.innerType,t,a),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},UL=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},PL=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},BL=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},$L=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let c;try{c=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},FL=(e,t,n,a)=>{const l=e._zod.def,o=t.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;Wt(o,t,a);const c=t.seen.get(e);c.ref=o},qL=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},TC=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},HL=se("ZodISODateTime",(e,t)=>{H4.init(e,t),Lt.init(e,t)});function ZL(e){return Y5(HL,e)}const VL=se("ZodISODate",(e,t)=>{Z4.init(e,t),Lt.init(e,t)});function QL(e){return X5(VL,e)}const GL=se("ZodISOTime",(e,t)=>{V4.init(e,t),Lt.init(e,t)});function KL(e){return J5(GL,e)}const YL=se("ZodISODuration",(e,t)=>{Q4.init(e,t),Lt.init(e,t)});function XL(e){return W5(YL,e)}const JL=(e,t)=>{cC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>IM(e,n)},flatten:{value:n=>LM(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,kg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,kg,2)}},isEmpty:{get(){return e.issues.length===0}}})},Nr=se("ZodError",JL,{Parent:Error}),WL=wy(Nr),eI=ky(Nr),tI=jf(Nr),nI=Cf(Nr),rI=BM(Nr),aI=$M(Nr),iI=FM(Nr),lI=qM(Nr),sI=HM(Nr),oI=ZM(Nr),uI=VM(Nr),cI=QM(Nr),Mt=se("ZodType",(e,t)=>(Dt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nf(e,"input"),output:nf(e,"output")}}),e.toJSONSchema=SL(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Oi(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Di(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>WL(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>tI(e,n,a),e.parseAsync=async(n,a)=>eI(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>nI(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>rI(e,n,a),e.decode=(n,a)=>aI(e,n,a),e.encodeAsync=async(n,a)=>iI(e,n,a),e.decodeAsync=async(n,a)=>lI(e,n,a),e.safeEncode=(n,a)=>sI(e,n,a),e.safeDecode=(n,a)=>oI(e,n,a),e.safeEncodeAsync=async(n,a)=>uI(e,n,a),e.safeDecodeAsync=async(n,a)=>cI(e,n,a),e.refine=(n,a)=>e.check(n6(n,a)),e.superRefine=n=>e.check(r6(n)),e.overwrite=n=>e.check(no(n)),e.optional=()=>yS(e),e.exactOptional=()=>qI(e),e.nullable=()=>vS(e),e.nullish=()=>yS(vS(e)),e.nonoptional=n=>KI(e,n),e.array=()=>Vn(e),e.or=n=>OC([e,n]),e.and=n=>UI(e,n),e.transform=n=>Eg(e,DC(n)),e.default=n=>VI(e,n),e.prefault=n=>GI(e,n),e.catch=n=>XI(e,n),e.pipe=n=>Eg(e,n),e.readonly=()=>e6(e),e.describe=n=>{const a=e.clone();return mu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=mu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return mu.get(e);const a=e.clone();return mu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),RC=se("_ZodString",(e,t)=>{jy.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>kL(e,a,l);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(lL(...a)),e.includes=(...a)=>e.check(uL(...a)),e.startsWith=(...a)=>e.check(cL(...a)),e.endsWith=(...a)=>e.check(dL(...a)),e.min=(...a)=>e.check(tf(...a)),e.max=(...a)=>e.check(CC(...a)),e.length=(...a)=>e.check(EC(...a)),e.nonempty=(...a)=>e.check(tf(1,...a)),e.lowercase=a=>e.check(sL(a)),e.uppercase=a=>e.check(oL(a)),e.trim=()=>e.check(hL()),e.normalize=(...a)=>e.check(fL(...a)),e.toLowerCase=()=>e.check(mL()),e.toUpperCase=()=>e.check(pL()),e.slugify=()=>e.check(gL())}),dI=se("ZodString",(e,t)=>{jy.init(e,t),RC.init(e,t),e.email=n=>e.check(A5(fI,n)),e.url=n=>e.check(D5(hI,n)),e.jwt=n=>e.check(K5(_I,n)),e.emoji=n=>e.check(M5(mI,n)),e.guid=n=>e.check(dS(pS,n)),e.uuid=n=>e.check(T5(Rd,n)),e.uuidv4=n=>e.check(R5(Rd,n)),e.uuidv6=n=>e.check(z5(Rd,n)),e.uuidv7=n=>e.check(O5(Rd,n)),e.nanoid=n=>e.check(L5(pI,n)),e.guid=n=>e.check(dS(pS,n)),e.cuid=n=>e.check(I5(gI,n)),e.cuid2=n=>e.check(U5(yI,n)),e.ulid=n=>e.check(P5(vI,n)),e.base64=n=>e.check(V5(CI,n)),e.base64url=n=>e.check(Q5(EI,n)),e.xid=n=>e.check(B5(bI,n)),e.ksuid=n=>e.check($5(xI,n)),e.ipv4=n=>e.check(F5(SI,n)),e.ipv6=n=>e.check(q5(wI,n)),e.cidrv4=n=>e.check(H5(kI,n)),e.cidrv6=n=>e.check(Z5(jI,n)),e.e164=n=>e.check(G5(NI,n)),e.datetime=n=>e.check(ZL(n)),e.date=n=>e.check(QL(n)),e.time=n=>e.check(KL(n)),e.duration=n=>e.check(XL(n))});function R(e){return _5(dI,e)}const Lt=se("ZodStringFormat",(e,t)=>{Rt.init(e,t),RC.init(e,t)}),fI=se("ZodEmail",(e,t)=>{M4.init(e,t),Lt.init(e,t)}),pS=se("ZodGUID",(e,t)=>{O4.init(e,t),Lt.init(e,t)}),Rd=se("ZodUUID",(e,t)=>{D4.init(e,t),Lt.init(e,t)}),hI=se("ZodURL",(e,t)=>{L4.init(e,t),Lt.init(e,t)}),mI=se("ZodEmoji",(e,t)=>{I4.init(e,t),Lt.init(e,t)}),pI=se("ZodNanoID",(e,t)=>{U4.init(e,t),Lt.init(e,t)}),gI=se("ZodCUID",(e,t)=>{P4.init(e,t),Lt.init(e,t)}),yI=se("ZodCUID2",(e,t)=>{B4.init(e,t),Lt.init(e,t)}),vI=se("ZodULID",(e,t)=>{$4.init(e,t),Lt.init(e,t)}),bI=se("ZodXID",(e,t)=>{F4.init(e,t),Lt.init(e,t)}),xI=se("ZodKSUID",(e,t)=>{q4.init(e,t),Lt.init(e,t)}),SI=se("ZodIPv4",(e,t)=>{G4.init(e,t),Lt.init(e,t)}),wI=se("ZodIPv6",(e,t)=>{K4.init(e,t),Lt.init(e,t)}),kI=se("ZodCIDRv4",(e,t)=>{Y4.init(e,t),Lt.init(e,t)}),jI=se("ZodCIDRv6",(e,t)=>{X4.init(e,t),Lt.init(e,t)}),CI=se("ZodBase64",(e,t)=>{J4.init(e,t),Lt.init(e,t)}),EI=se("ZodBase64URL",(e,t)=>{e5.init(e,t),Lt.init(e,t)}),NI=se("ZodE164",(e,t)=>{t5.init(e,t),Lt.init(e,t)}),_I=se("ZodJWT",(e,t)=>{r5.init(e,t),Lt.init(e,t)}),Cy=se("ZodNumber",(e,t)=>{xC.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>jL(e,a,l),e.gt=(a,l)=>e.check(hS(a,l)),e.gte=(a,l)=>e.check(vp(a,l)),e.min=(a,l)=>e.check(vp(a,l)),e.lt=(a,l)=>e.check(fS(a,l)),e.lte=(a,l)=>e.check(yp(a,l)),e.max=(a,l)=>e.check(yp(a,l)),e.int=a=>e.check(gS(a)),e.safe=a=>e.check(gS(a)),e.positive=a=>e.check(hS(0,a)),e.nonnegative=a=>e.check(vp(0,a)),e.negative=a=>e.check(fS(0,a)),e.nonpositive=a=>e.check(yp(0,a)),e.multipleOf=(a,l)=>e.check(mS(a,l)),e.step=(a,l)=>e.check(mS(a,l)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ge(e){return eL(Cy,e)}const AI=se("ZodNumberFormat",(e,t)=>{a5.init(e,t),Cy.init(e,t)});function gS(e){return nL(AI,e)}const TI=se("ZodBoolean",(e,t)=>{i5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>CL(e,n,a)});function Jr(e){return rL(TI,e)}const RI=se("ZodUnknown",(e,t)=>{l5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>NL()});function St(){return aL(RI)}const zI=se("ZodNever",(e,t)=>{s5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EL(e,n,a)});function OI(e){return iL(zI,e)}const DI=se("ZodArray",(e,t)=>{o5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>zL(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(tf(n,a)),e.nonempty=n=>e.check(tf(1,n)),e.max=(n,a)=>e.check(CC(n,a)),e.length=(n,a)=>e.check(EC(n,a)),e.unwrap=()=>e.element});function Vn(e,t){return yL(DI,e,t)}const MI=se("ZodObject",(e,t)=>{c5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>OL(e,n,a,l),ft(e,"shape",()=>t.shape),e.keyof=()=>Qe(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:St()}),e.loose=()=>e.clone({...e._zod.def,catchall:St()}),e.strict=()=>e.clone({...e._zod.def,catchall:OI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>RM(e,n),e.safeExtend=n=>zM(e,n),e.merge=n=>OM(e,n),e.pick=n=>AM(e,n),e.omit=n=>TM(e,n),e.partial=(...n)=>DM(MC,e,n[0]),e.required=(...n)=>MM(LC,e,n[0])});function de(e,t){const n={type:"object",shape:e??{},...Ae(t)};return new MI(n)}const zC=se("ZodUnion",(e,t)=>{kC.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>DL(e,n,a,l),e.options=t.options});function OC(e,t){return new zC({type:"union",options:e,...Ae(t)})}const LI=se("ZodDiscriminatedUnion",(e,t)=>{zC.init(e,t),d5.init(e,t)});function Ey(e,t,n){return new LI({type:"union",options:t,discriminator:e,...Ae(n)})}const II=se("ZodIntersection",(e,t)=>{f5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>ML(e,n,a,l)});function UI(e,t){return new II({type:"intersection",left:e,right:t})}const PI=se("ZodRecord",(e,t)=>{h5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>LL(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Ft(e,t,n){return new PI({type:"record",keyType:e,valueType:t,...Ae(n)})}const Cg=se("ZodEnum",(e,t)=>{m5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>_L(e,a,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,l)=>{const o={};for(const c of a)if(n.has(c))o[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Cg({...t,checks:[],...Ae(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const c of a)if(n.has(c))delete o[c];else throw new Error(`Key ${c} not found in enum`);return new Cg({...t,checks:[],...Ae(l),entries:o})}});function Qe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Cg({type:"enum",entries:n,...Ae(t)})}const BI=se("ZodLiteral",(e,t)=>{p5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>AL(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function an(e,t){return new BI({type:"literal",values:Array.isArray(e)?e:[e],...Ae(t)})}const $I=se("ZodTransform",(e,t)=>{g5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>RL(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new aC(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Tu(o,n.value,t));else{const c=o;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=n.value),c.inst??(c.inst=e),n.issues.push(Tu(c))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function DC(e){return new $I({type:"transform",transform:e})}const MC=se("ZodOptional",(e,t)=>{jC.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>TC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function yS(e){return new MC({type:"optional",innerType:e})}const FI=se("ZodExactOptional",(e,t)=>{y5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>TC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function qI(e){return new FI({type:"optional",innerType:e})}const HI=se("ZodNullable",(e,t)=>{v5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>IL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function vS(e){return new HI({type:"nullable",innerType:e})}const ZI=se("ZodDefault",(e,t)=>{b5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>PL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VI(e,t){return new ZI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():oC(t)}})}const QI=se("ZodPrefault",(e,t)=>{x5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>BL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function GI(e,t){return new QI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():oC(t)}})}const LC=se("ZodNonOptional",(e,t)=>{S5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>UL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function KI(e,t){return new LC({type:"nonoptional",innerType:e,...Ae(t)})}const YI=se("ZodCatch",(e,t)=>{w5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>$L(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function XI(e,t){return new YI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JI=se("ZodPipe",(e,t)=>{k5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>FL(e,n,a,l),e.in=t.in,e.out=t.out});function Eg(e,t){return new JI({type:"pipe",in:e,out:t})}const WI=se("ZodReadonly",(e,t)=>{j5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>qL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function e6(e){return new WI({type:"readonly",innerType:e})}const t6=se("ZodCustom",(e,t)=>{C5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>TL(e,n)});function n6(e,t={}){return vL(t6,e,t)}function r6(e){return bL(e)}function a6(e,t){return Eg(DC(e),t)}const bp={custom:"custom"};function Nf(e){return tL(Cy,e)}const i6=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function l6(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function s6(e,t){const n=l6(e),a=new Map;for(const o of t)o.name&&a.set(o.name.toLowerCase(),o.agentId);if(a.size===0)return[];const l=new Set;for(const o of n.matchAll(i6)){const c=o[1];if(!c)continue;const f=a.get(c.toLowerCase());f&&l.add(f)}return[...l]}const o6=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,bS="/";function IC(e){return!e||typeof e!="string"||e.length>256||!o6.test(e)?"/":e}const u6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},UC=Qe(["feishu","slack","kael"]),PC=Qe(["active","inactive"]);de({platform:UC,agentId:R().min(1),credentials:Ft(R(),St()),status:PC.default("active")});de({agentId:R().min(1).optional(),credentials:Ft(R(),St()).optional(),status:PC.optional()});de({id:Ge(),platform:R(),agentId:R(),hasCredentials:Jr(),status:R(),createdAt:R(),updatedAt:R()});const c6=Qe(["code","reverse_token","oauth","manual"]);de({appId:R().min(1),appSecret:R().min(1)});de({platform:UC,externalUserId:R().min(1),agentId:R().min(1),boundVia:c6.default("manual"),displayName:R().max(200).optional()});de({id:Ge(),platform:R(),externalUserId:R(),agentId:R(),boundVia:R().nullable(),displayName:R().nullable(),createdAt:R()});de({feishuUserId:R().min(1),displayName:R().max(200).optional()});de({configId:Ge(),platform:R(),agentId:R(),appId:R(),connected:Jr(),lastActiveAt:R().nullable()});const BC=Qe(["online","offline"]),$C=Qe(["idle","working","blocked","error"]);Qe(["active","suspended","evicted"]);const d6=Qe(["active","suspended"]);de({chatId:R().min(1),state:d6});de({runtimeState:$C});de({agentId:R().min(1),runtimeType:R().max(50),runtimeVersion:R().max(50).optional()});Qe(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);de({agentId:R(),status:BC,connectedAt:R().nullable(),lastSeenAt:R(),clientId:R().nullable().optional(),runtimeType:R().nullable().optional(),runtimeVersion:R().nullable().optional(),runtimeState:$C.nullable().optional(),activeSessions:Ge().int().nullable().optional(),totalSessions:Ge().int().nullable().optional(),runtimeUpdatedAt:R().nullable().optional()});de({total:Ge().int(),running:Ge().int(),byState:de({idle:Ge().int(),working:Ge().int(),blocked:Ge().int(),error:Ge().int()}),clients:Ge().int()});const rf={CLAUDE_CODE:"claude-code",CODEX:"codex"},_f=Qe(["claude-code","codex"]),f6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Af=Qe(["human","personal_assistant","autonomous_agent"]),xS={PRIVATE:"private",ORGANIZATION:"organization"},Ny=Qe(["private","organization"]),h6=Qe(["admin-api","portal"]);Qe(["active","suspended"]);const Ng=/^[a-z0-9][a-z0-9_-]{0,63}$/,Cs=64,m6=["admin","agent","first-tree","hub","me","null","system","undefined"],p6=new Set(m6);function _g(e){return p6.has(e)}de({name:R().min(1).max(64).regex(Ng,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!_g(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:Af,displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).optional(),organizationId:R().max(100).optional(),source:h6.optional(),visibility:Ny.optional(),metadata:Ft(R(),St()).optional(),managerId:R().optional(),clientId:R().min(1).max(100).optional(),runtimeProvider:_f.optional()});de({type:Af.optional(),displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).nullable().optional(),visibility:Ny.optional(),metadata:Ft(R(),St()).optional(),managerId:R().nullable().optional(),clientId:R().min(1).max(100).nullable().optional()});de({clientId:R().min(1).max(100),runtimeProvider:_f,force:Jr().optional()});de({uuid:R(),name:R().nullable(),organizationId:R(),type:Af,displayName:R(),delegateMention:R().nullable(),inboxId:R(),status:R(),source:R().nullable().optional(),visibility:Ny,metadata:Ft(R(),St()),managerId:R().nullable(),clientId:R().nullable(),runtimeProvider:_f,presenceStatus:BC.optional(),createdAt:R(),updatedAt:R()});de({repo:R().nullable(),branch:R().nullable()});de({type:an("agent:pinned"),agentId:R(),name:R().nullable(),displayName:R(),agentType:Af,runtimeProvider:_f});const g6=32e3,_y=/^[a-z0-9][a-z0-9_-]{0,63}$/i,y6=/^[A-Z][A-Z0-9_]*$/,v6=de({append:R().max(g6).default("")}),b6=de({name:R().regex(_y,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:an("stdio"),command:R().min(1),args:Vn(R()).optional()}),x6=de({name:R().regex(_y,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:an("http"),url:R().url(),headers:Ft(R(),R()).optional()}),S6=de({name:R().regex(_y,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:an("sse"),url:R().url(),headers:Ft(R(),R()).optional()}),w6=Ey("transport",[b6,x6,S6]),k6=de({key:R().regex(y6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:R(),sensitive:Jr().default(!1)}),j6=de({url:R().min(1),ref:R().min(1).optional(),localPath:R().min(1).optional()}),Tf=de({prompt:v6.default({append:""}),model:R().default("opus"),mcpServers:Vn(w6).default([]),env:Vn(k6).default([]),gitRepos:Vn(j6).default([])}),C6=Tf.extend({kind:an("claude-code")}),E6=Tf.extend({kind:an("codex")}),N6=Ey("kind",[C6,E6]),_6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,c)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:bp.custom,path:["mcpServers",c,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,c)=>{a.has(o.key)&&t.addIssue({code:bp.custom,path:["env",c,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,c)=>{const f=o.localPath??lf(o.url);f&&(l.has(f)&&t.addIssue({code:bp.custom,path:["gitRepos",c,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},FC=a6(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,N6).superRefine((e,t)=>{_6(e,t)}),A6=de({agentId:R(),version:Ge().int().positive(),payload:FC,updatedAt:R(),updatedBy:R()});de({expectedVersion:Ge().int().positive(),payload:Tf.partial()});de({payload:Tf.partial()});de({current:A6,next:FC,diff:Vn(de({path:R(),op:Qe(["add","remove","replace"]),before:St().optional(),after:St().optional()}))});const af="***";function lf(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}de({username:R().min(1),password:R().min(1)});de({accessToken:R(),refreshToken:R()});de({refreshToken:R().min(1)});de({token:R().min(1)});de({token:R(),expiresIn:Ge(),command:R()});const T6=Qe(["direct","group","thread"]);de({type:T6,topic:R().max(500).optional(),participantIds:Vn(R()).min(1),metadata:Ft(R(),St()).optional()});const qC=de({agentId:R(),role:R(),mode:R(),joinedAt:R()});qC.extend({name:R().nullable(),displayName:R(),type:R()});const R6=de({id:R(),organizationId:R(),type:R(),topic:R().nullable(),lifecyclePolicy:R().nullable().optional(),metadata:Ft(R(),St()),createdAt:R(),updatedAt:R()});R6.extend({participants:Vn(qC)});de({topic:R().trim().max(500).nullable()});de({agentId:R().min(1),mode:Qe(["full","mention_only"]).default("full")});de({agentId:R().min(1)});const z6=Qe(["connected","disconnected"]);de({id:R(),userId:R().nullable(),status:z6,sdkVersion:R().max(50).nullable(),hostname:R().max(100).nullable(),os:R().max(50).nullable(),agentCount:Ge().int().min(0),connectedAt:R().nullable(),lastSeenAt:R(),metadata:Ft(R(),St()).nullable()});const O6=de({wsInboxDeliver:Jr().default(!1)}).partial();de({clientId:R().min(1).max(100),hostname:R().max(100).optional(),os:R().max(50).optional(),sdkVersion:R().max(50).optional(),wireCapabilities:O6.optional()});const D6=Qe(["ok","missing","unauthenticated","error"]),M6=Qe(["api_key","oauth","auth_json","none"]),L6=de({state:D6,available:Jr(),authenticated:Jr(),sdkVersion:R().nullable().optional(),authMethod:M6,error:R().nullable().optional(),detectedAt:R()}),I6=Ft(R(),L6);de({capabilities:I6});de({limit:Nf().int().min(1).max(100).default(20),cursor:R().optional()});const U6=["image/png","image/jpeg","image/gif","image/webp"],Ay=Qe(U6);de({data:R().min(1),mimeType:Ay,filename:R().min(1),size:Ge().int().nonnegative().optional(),imageId:R().uuid().optional()});de({imageId:R().uuid(),mimeType:Ay,filename:R().min(1),size:Ge().int().nonnegative().optional()});de({type:an("image_payload"),imageId:R().uuid(),chatId:R(),base64:R().min(1),mimeType:Ay,filename:R().min(1),size:Ge().int().nonnegative().optional()});const Ty=Qe(["hub_ui","cli","feishu","github","api"]),HC=Qe(["text","markdown","card","reference","file","task"]);de({format:HC.default("text"),content:St(),metadata:Ft(R(),St()).optional(),inReplyTo:R().optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Ty.optional()});de({format:HC.default("text"),content:St(),metadata:Ft(R(),St()).optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Ty.optional()});const P6=de({id:R(),chatId:R(),senderId:R(),format:R(),content:St(),metadata:Ft(R(),St()),replyToInbox:R().nullable(),replyToChat:R().nullable(),inReplyTo:R().nullable(),source:Ty.nullable(),createdAt:R()}),B6=de({senderId:R(),chatId:R(),replyToChat:R().nullable()}).nullable(),$6=Qe(["full","mention_only"]),F6=de({id:R(),senderId:R(),format:R(),content:St(),metadata:Ft(R(),St()).default({}),createdAt:R()}),ZC=P6.extend({configVersion:Ge().int().positive(),recipientMode:$6.default("full"),inReplyToSnapshot:B6.default(null),precedingMessages:Vn(F6).default([])});Qe(["pending","delivered","acked","failed"]);const q6=de({id:Ge(),inboxId:R(),messageId:R(),chatId:R().nullable(),status:R(),retryCount:Ge(),createdAt:R(),deliveredAt:R().nullable(),ackedAt:R().nullable()});q6.extend({message:ZC});de({limit:Nf().int().min(1).max(50).default(10)});de({type:an("inbox:deliver"),entryId:Ge().int().nonnegative(),inboxId:R().min(1),chatId:R().nullable(),message:ZC}).passthrough();de({type:an("inbox:ack"),entryId:Ge().int().nonnegative()});const H6=7;de({organizationId:R(),organizationName:R(),organizationDisplayName:R(),role:R(),expiresAt:R().nullable()});de({id:R(),organizationId:R(),token:R(),inviteUrl:R(),role:R(),createdAt:R(),expiresAt:R().nullable()});de({token:R().min(1)});de({}).optional();Qe(["connect","create_agent","completed"]);de({id:R(),name:R(),displayName:R(),role:Qe(["admin","member"])});de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:R().min(1).max(200)});de({organizationId:R().min(1)});const Z6={ADMIN:"admin",MEMBER:"member"},Ry=Qe(["admin","member"]),V6=de({id:R(),userId:R(),organizationId:R(),agentId:R(),role:Ry,createdAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),role:Ry.default("member")});de({role:Ry.optional(),displayName:R().min(1).max(200).optional()});V6.extend({username:R(),displayName:R(),password:R()});const Q6=Qe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),VC=Qe(["high","medium","low"]);de({id:R(),organizationId:R(),type:Q6,severity:VC,agentId:R().nullable(),chatId:R().nullable(),message:R(),read:Jr(),createdAt:R()});de({limit:Nf().int().min(1).max(100).default(20),cursor:R().optional(),severity:VC.optional(),read:Qe(["true","false"]).transform(e=>e==="true").optional(),agentId:R().optional()});de({next:R().max(256).optional()});de({code:R().min(1),state:R().min(1)});de({githubId:R().min(1),login:R().min(1),email:R().email().optional(),displayName:R().optional(),next:R().max(256).optional()});const QC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!QC.test(e),"Name must not be a UUID format"),displayName:R().min(1).max(200),maxAgents:Ge().int().min(0).default(0),maxMessagesPerMinute:Ge().int().min(0).default(0),features:Ft(R(),St()).default({})});de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!QC.test(e),"Name must not be a UUID format").optional(),displayName:R().min(1).max(200).optional(),maxAgents:Ge().int().min(0).optional(),maxMessagesPerMinute:Ge().int().min(0).optional(),features:Ft(R(),St()).optional()});de({id:R(),name:R(),displayName:R(),maxAgents:Ge(),maxMessagesPerMinute:Ge(),features:Ft(R(),St()),createdAt:R(),updatedAt:R()});const G6=de({workingCount:Ge().int().nonnegative(),errorMask:Jr()}),K6=de({type:an("pulse:tick"),organizationId:R(),agents:Ft(R(),Vn(G6).length(32))}),Y6=Qe(["tool_call","error","assistant_text","thinking","turn_end"]),GC=de({toolUseId:R(),name:R(),args:St(),status:Qe(["pending","ok","error"]),durationMs:Ge().int().nonnegative().optional(),resultPreview:R().max(400).optional()}),KC=de({source:Qe(["sdk","runtime","tool"]),message:R().max(2e3)}),YC=de({text:R().max(8e3)}),XC=de({}),JC=de({status:Qe(["success","error"])}),X6=Ey("kind",[de({kind:an("tool_call"),payload:GC}),de({kind:an("error"),payload:KC}),de({kind:an("assistant_text"),payload:YC}),de({kind:an("thinking"),payload:XC}),de({kind:an("turn_end"),payload:JC})]);de({id:R(),agentId:R(),chatId:R(),seq:Ge().int().positive(),kind:Y6,payload:OC([GC,KC,YC,XC,JC]),createdAt:R()});de({agentId:R(),chatId:R(),event:X6});de({agentId:R(),chatId:R()});de({type:an("session:reconcile"),agentId:R().min(1),chatIds:Vn(R().min(1)).max(500)});de({type:an("session:reconcile:result"),agentId:R().min(1),staleChatIds:Vn(R().min(1))});const J6=de({organizationId:R(),agentCount:Ge(),chatCount:Ge(),messageCount:Ge()});de({totalAgents:Ge(),totalChats:Ge(),totalMessages:Ge(),byOrganization:Vn(J6)});de({key:R(),value:St(),updatedAt:R()});Ft(R(),St());const ki={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Vd={[ki.INBOX_TIMEOUT_SECONDS]:300,[ki.MAX_RETRY_COUNT]:3,[ki.POLLING_INTERVAL_SECONDS]:5,[ki.PRESENCE_CLEANUP_SECONDS]:60},Ru=Qe(["pending","assigned","working","completed","failed","cancelled"]),SS=Qe(["agent","admin"]),W6=Qe(["assigned","status_changed","cancelled"]);de({taskId:R(),event:W6,title:R(),body:R().default(""),status:Ru,fromStatus:Ru.optional(),originRef:R().nullable().optional()});const eU=de({title:R().min(1).max(500),body:R().optional(),assigneeAgentId:R().optional(),originRef:R().max(500).optional(),metadata:Ft(R(),St()).optional()});eU.extend({organizationId:R().optional()});de({status:Qe(["working","completed","failed"]),result:R().optional()});de({assigneeAgentId:R().nullable().optional(),status:Ru.optional(),result:R().optional()});de({chatId:R().min(1)});const tU=de({id:R(),organizationId:R(),title:R(),body:R(),status:Ru,assigneeAgentId:R().nullable(),createdByType:SS,createdById:R(),originRef:R().nullable(),result:R().nullable(),metadata:Ft(R(),St()),createdAt:R(),updatedAt:R(),cancelledAt:R().nullable(),cancelledByType:SS.nullable(),cancelledById:R().nullable()}),nU=de({taskId:R(),chatId:R(),linkedByAgentId:R().nullable(),linkedAt:R()});tU.extend({chats:Vn(nU)});de({status:Ru.optional(),assigneeAgentId:R().optional(),originRef:R().optional(),limit:Nf().int().min(1).max(100).default(20),cursor:R().optional()});const rU=Qe(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);de({taskId:R(),signal:rU,reason:R()});const aU=Qe(["active","suspended"]);de({id:R(),username:R(),displayName:R(),avatarUrl:R().nullable(),status:aU,createdAt:R(),updatedAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),password:R().min(8).max(200)});de({displayName:R().min(1).max(200).optional(),password:R().min(8).max(200).optional()});de({type:an("auth"),token:R().min(1)});const iU=de({wsInboxDeliver:Jr().default(!1)}).partial();de({type:an("server:welcome"),serverCommandVersion:R().min(1),serverTimeMs:Ge().int().nonnegative(),capabilities:iU.optional()}).passthrough();const WC=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function lU(e){const t=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const n of Object.values(e))for(let a=0;a<32&&a<n.length;a++){const l=n[a],o=t[a];!l||!o||(o.workingCount+=l.workingCount,o.errorMask=o.errorMask||l.errorMask)}return t}const sU=2e3,oU=3e4;let fi=null,sf=!1,xp=0,yu=null;const Ag=new Set;let pu=null,Es=0;function uU(e){for(const t of Ag)try{t(e)}catch{}pu&&(e.type==="notification"?pu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(pu.invalidateQueries({queryKey:["activity"]}),pu.invalidateQueries({queryKey:["sessions"]})))}function eE(){const e=iy();if(!(e!=null&&e.accessToken))return;const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${e.accessToken}`,a=new WebSocket(n);fi=a,a.onmessage=l=>{if(a===fi)try{const o=JSON.parse(l.data);uU(o)}catch{}},a.onopen=()=>{a===fi&&(xp=0)},a.onclose=()=>{if(a!==fi||(fi=null,sf||Es===0))return;xp++;const l=Math.min(sU*2**(xp-1),oU);yu=setTimeout(()=>{yu=null,!sf&&Es>0&&eE()},l)}}function cU(){sf=!0,yu&&(clearTimeout(yu),yu=null),fi&&(fi.close(1e3,"unmount"),fi=null)}function tE(e){const{onMessage:t,enabled:n=!0}=e??{},a=kn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{pu=a},[a]),x.useEffect(()=>{if(!n)return;const o=c=>{var f;return(f=l.current)==null?void 0:f.call(l,c)};return Ag.add(o),Es++,Es===1&&(sf=!1,eE()),()=>{Ag.delete(o),Es--,Es===0&&cU()}},[n])}const nE=x.createContext({aggregated:WC,agents:{},receivedAtMs:null,stale:!0});function dU({children:e}){const[t,n]=x.useState({aggregated:WC,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());tE({onMessage:c=>{const f=K6.safeParse(c);f.success&&n({aggregated:lU(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const c=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(c)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return u.jsx(nE.Provider,{value:o,children:e})}function fU(){return x.useContext(nE)}function Rf({title:e,subtitle:t,right:n,className:a,style:l,...o}){return u.jsxs("div",{className:_e("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-3) var(--sp-5) var(--sp-2_5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)",...l},...o,children:[u.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),u.jsx("div",{style:{flex:1}}),n]})}function rE({className:e,style:t,...n}){return u.jsx("div",{className:_e("flex items-end",e),style:{gap:2,height:34,padding:"0 var(--sp-5)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",...t},...n})}function aE({active:e,onClick:t,children:n}){return u.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 bg-transparent text-body font-medium",style:{padding:"var(--sp-1_75) var(--sp-3)",marginBottom:-1,borderBottom:`var(--hairline-bold) solid ${e?"var(--accent)":"transparent"}`,color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",transition:"color 0.12s"},onMouseEnter:a=>{e||(a.currentTarget.style.color="var(--fg)")},onMouseLeave:a=>{e||(a.currentTarget.style.color="var(--fg-3)")},children:n})}const hU={neutral:{bg:"var(--bg-sunken)",fg:"var(--fg-2)",bd:"var(--border)"},accent:{bg:"var(--accent-bg)",fg:"var(--accent-dim)",bd:"color-mix(in oklch, var(--accent) 30%, transparent)"},warn:{bg:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},error:{bg:"color-mix(in oklch, var(--state-error) 14%, transparent)",fg:"var(--state-error)",bd:"color-mix(in oklch, var(--state-error) 30%, transparent)"},outline:{bg:"transparent",fg:"var(--fg-3)",bd:"var(--border)"},idle:{bg:"color-mix(in oklch, var(--state-idle) 14%, transparent)",fg:"var(--state-idle)",bd:"color-mix(in oklch, var(--state-idle) 30%, transparent)"},working:{bg:"color-mix(in oklch, var(--state-working) 14%, transparent)",fg:"var(--state-working)",bd:"color-mix(in oklch, var(--state-working) 30%, transparent)"},blocked:{bg:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},offline:{bg:"color-mix(in oklch, var(--state-offline) 14%, transparent)",fg:"var(--state-offline)",bd:"color-mix(in oklch, var(--state-offline) 30%, transparent)"}};function Sn({tone:e="neutral",className:t,style:n,...a}){const l=hU[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return u.jsx("span",{className:_e("mono inline-flex items-center uppercase text-caption leading-[1.6]",t),style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",...o},...a})}const bl=x.forwardRef(({className:e,...t},n)=>u.jsx("table",{ref:n,className:_e("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));bl.displayName="DenseTable";const xl=x.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:e,...t}));xl.displayName="DenseTableHeader";const Sl=x.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:e,...t}));Sl.displayName="DenseTableBody";const sr=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>u.jsx("tr",{ref:o,className:_e("transition-colors",e),"data-interactive":t?"":void 0,"data-selected":n?"":void 0,style:{background:n?"var(--bg-active)":void 0,cursor:t?"pointer":void 0,...a},...l}));sr.displayName="DenseTableRow";const $e=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("th",{ref:a,className:_e("mono text-left uppercase text-eyebrow whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border)",...t},...n}));$e.displayName="DenseTableHead";const Ie=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("td",{ref:a,className:_e("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ie.displayName="DenseTableCell";const ln=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));ln.displayName="Panel";const _r=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e("flex items-center justify-between gap-3",e),style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));_r.displayName="PanelHeader";const Ar=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Ar.displayName="PanelTitle";const Wr=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Wr.displayName="PanelBody";function Gs({children:e,right:t,className:n,style:a,...l}){return u.jsxs("div",{className:_e("mono flex items-center justify-between uppercase text-eyebrow",n),style:{padding:"var(--sp-1_75) var(--sp-3_5)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)",...a},...l,children:[u.jsx("span",{children:e}),t]})}function Ju({className:e,style:t,...n}){return u.jsx("span",{className:_e("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function zy(){return ke.get("/members")}function mU(e){return ke.post("/members",e)}function pU(e,t){return ke.patch(`/members/${encodeURIComponent(e)}`,t)}function gU(e){return ke.delete(`/members/${encodeURIComponent(e)}`)}function Oy(){const{data:e}=qe({queryKey:["members","name-map"],queryFn:zy,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.id,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function yU(){const e=cn(),t=Oy(),{data:n,isLoading:a,error:l}=qe({queryKey:["admin-all-agents"],queryFn:()=>OD({limit:100})});return u.jsxs("div",{children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-2_5)"},children:"Every agent in the organization — including private agents owned by other members. Use this view to troubleshoot or reassign."}),u.jsxs(ln,{children:[u.jsxs(Gs,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]}):!n||n.items.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):u.jsxs(bl,{children:[u.jsx(xl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Display name"}),u.jsx($e,{children:"Agent name"}),u.jsx($e,{children:"Type"}),u.jsx($e,{children:"Visibility"}),u.jsx($e,{children:"Owner"}),u.jsx($e,{children:"Status"}),u.jsx($e,{children:"Created"})]})}),u.jsx(Sl,{children:n.items.map(o=>u.jsxs(sr,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"font-medium",children:o.displayName})}),u.jsx(Ie,{children:o.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",o.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:o.uuid.slice(0,8)})}),u.jsx(Ie,{children:u.jsx(Sn,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),u.jsx(Ie,{children:u.jsx(Sn,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),u.jsx(Ie,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),u.jsx(Ie,{children:u.jsx(Sn,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(o.createdAt)})]},o.uuid))})]})]})]})}const ro=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));ro.displayName="Card";const ao=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));ao.displayName="CardHeader";const Wu=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("text-subtitle leading-none",e),...t}));Wu.displayName="CardTitle";const iE=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("text-body text-muted-foreground",e),...t}));iE.displayName="CardDescription";const io=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));io.displayName="CardContent";const vU=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));vU.displayName="CardFooter";function bU(e){const t=new Date(e),n=Date.now(),a=t.getTime()-n;if(a<=0)return`expired ${t.toLocaleDateString()}`;const l=Math.ceil(a/(1440*60*1e3));return`expires ${l===1?"in less than a day":`in ${l} days`} · ${t.toLocaleDateString()}`}function xU(){const{organizationId:e}=Qt(),[t,n]=x.useState(null),[a,l]=x.useState(null),[o,c]=x.useState(!1),[f,m]=x.useState(!1);x.useEffect(()=>{e&&(async()=>{try{const y=await ke.get(`/admin/organizations/${e}/invitations`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){c(!0),l(null);try{const y=await ke.post(`/admin/organizations/${e}/invitations/rotate`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to rotate invite link")}finally{c(!1)}}};return u.jsxs(ro,{children:[u.jsxs(ao,{children:[u.jsx(Wu,{children:"Invite link"}),u.jsxs(iE,{children:["Anyone with this link can join your team as a member. Links expire after ",H6," days; rotating revokes the old link instantly and resets the timer."]})]}),u.jsxs(io,{className:"space-y-3",children:[a&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),u.jsx(me,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),u.jsx(me,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),u.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${bU(t.expiresAt)}`:" · no expiry"]})]}):u.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}const lE=Object.values(Z6);function SU(e,t){const n=(e==null?void 0:e.trim())||t,a=n.split(/[\s._-]+/).filter(Boolean);if(a.length>=2){const l=a[0]??"",o=a[1]??"";return`${l[0]??""}${o[0]??""}`.toUpperCase()}return n.slice(0,2).toUpperCase()}function wU(){const e=kn(),{memberId:t}=Qt(),[n,a]=x.useState(!1),[l,o]=x.useState({username:"",displayName:"",role:"member"}),[c,f]=x.useState(null),[m,h]=x.useState(null),{data:y,isLoading:g,error:b}=qe({queryKey:["members"],queryFn:zy}),S=bt({mutationFn:()=>mU({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:A=>{e.invalidateQueries({queryKey:["members"]}),f(A.password)}}),k=bt({mutationFn:gU,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function C(A){A.preventDefault(),S.mutate()}function E(A){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(A)}return u.jsxs(u.Fragment,{children:[u.jsxs(ln,{children:[u.jsxs(Gs,{right:u.jsxs(zt,{open:n,onOpenChange:A=>A?a(!0):j(),children:[u.jsx(TD,{asChild:!0,children:u.jsxs(me,{size:"xs",className:"normal-case tracking-normal",children:[u.jsx(Xr,{className:"h-3 w-3"}),"Add member"]})}),u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:c?"Member Created":"Create Member"})}),c?u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),u.jsxs("div",{className:"flex items-center gap-2 rounded-md p-3",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("code",{className:"flex-1 text-body mono",children:c}),u.jsx(me,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(c),title:"Copy password",children:u.jsx(sy,{className:"h-4 w-4"})})]}),u.jsx(en,{children:u.jsx(me,{onClick:j,children:"Done"})})]}):u.jsxs("form",{onSubmit:C,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"member-username",children:"Username"}),u.jsx(xt,{id:"member-username",type:"text",value:l.username,onChange:A=>o({...l,username:A.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"member-name",children:"Display Name"}),u.jsx(xt,{id:"member-name",value:l.displayName,onChange:A=>o({...l,displayName:A.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"member-role",children:"Role"}),u.jsx("select",{id:"member-role",value:l.role,onChange:A=>o({...l,role:A.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:lE.map(A=>u.jsx("option",{value:A,children:A},A))})]}),S.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:S.error.message}),u.jsx(en,{children:u.jsx(me,{type:"submit",disabled:S.isPending,children:S.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(y==null?void 0:y.length)??0]}),g?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",b instanceof Error?b.message:"Unknown error"]}):(y==null?void 0:y.length)===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):u.jsxs(bl,{children:[u.jsx(xl,{children:u.jsxs(sr,{children:[u.jsx($e,{style:{width:30}}),u.jsx($e,{children:"Username"}),u.jsx($e,{children:"Name"}),u.jsx($e,{children:"Role"}),u.jsx($e,{children:"Created"}),u.jsx($e,{style:{width:1}})]})}),u.jsx(Sl,{children:y==null?void 0:y.map(A=>{const z=t===A.id;return u.jsxs(sr,{children:[u.jsx(Ie,{children:u.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:z?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:z?"var(--accent-dim)":"var(--fg-2)"},children:SU(A.displayName,A.username)})}),u.jsxs(Ie,{children:[u.jsx("span",{className:"mono font-medium",children:A.username}),z&&u.jsx(Ju,{style:{marginLeft:6},children:"you"})]}),u.jsx(Ie,{style:{color:"var(--fg-2)"},children:A.displayName}),u.jsx(Ie,{children:u.jsx(Sn,{tone:A.role==="admin"?"accent":"neutral",children:A.role})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(A.createdAt)}),u.jsx(Ie,{style:{whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-0.5 justify-end",children:[u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:A.id,username:A.username,displayName:A.displayName,role:A.role}),title:"Edit",children:u.jsx(Qu,{className:"h-3.5 w-3.5"})}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>E(A.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:u.jsx(Zs,{className:"h-3.5 w-3.5"})})]})})]},A.id)})})]})]}),u.jsx(kU,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function kU({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,c]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),c(e.role),m(null))},[e]);const h=bt({mutationFn:async()=>{if(!e)throw new Error("No target");const b={};return a.trim()&&a!==e.displayName&&(b.displayName=a.trim()),o!==e.role&&(b.role=o),Object.keys(b).length===0?e:pU(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function y(b){b.preventDefault(),h.mutate()}const g=e!==null;return u.jsx(zt,{open:g,onOpenChange:b=>b?void 0:t(),children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:"Edit Member"})}),e&&u.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Username"}),u.jsx(xt,{value:e.username,disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"edit-member-display",children:"Display Name"}),u.jsx(xt,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"edit-member-role",children:"Role"}),u.jsx("select",{id:"edit-member-role",value:o,onChange:b=>c(b.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:lE.map(b=>u.jsx("option",{value:b,children:b},b))}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function jU(){return ke.get("/admin/system/config")}function CU(e){return ke.patch("/admin/system/config",e)}function EU(e){return ke.get(`/admin/organizations/${encodeURIComponent(e)}`)}function NU(e,t){return ke.patch(`/admin/organizations/${encodeURIComponent(e)}`,t)}function _U(){return ke.post("/me/organizations/leave")}function AU(){const{organizationId:e}=Qt(),t=kn(),n=qe({queryKey:["organization",e],queryFn:()=>e?EU(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=x.useState(""),[o,c]=x.useState(""),[f,m]=x.useState(!1);x.useEffect(()=>{n.data&&(l(n.data.displayName),c(n.data.name))},[n.data]);const h=bt({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const g={},b=a.trim(),S=o.trim();return b&&b!==n.data.displayName&&(g.displayName=b),S&&S!==n.data.name&&(g.name=S),Object.keys(g).length===0?Promise.resolve(n.data):NU(e,g)},onSuccess:g=>{t.setQueryData(["organization",e],g),t.invalidateQueries({queryKey:["me-organizations"]}),m(!0),setTimeout(()=>m(!1),2e3)}}),y=g=>{g.preventDefault(),h.mutate()};return u.jsxs(ln,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"Team identity"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[f&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsxs(me,{type:"submit",form:"team-identity-form",size:"xs",disabled:h.isPending||!n.data,children:[u.jsx(Yr,{className:"h-3 w-3"}),h.isPending?"Saving…":"Save"]})]})]}),u.jsx(Wr,{children:n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):u.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[u.jsx(wS,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:a,onChange:l}),u.jsx(wS,{label:"URL slug",hint:"Lowercase letters, digits, hyphens. Used in invite URLs.",value:o,onChange:g=>c(g.toLowerCase()),mono:!0,pattern:"[a-z0-9][a-z0-9-]*"}),h.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h.error.message})]})})]})}function wS({label:e,hint:t,value:n,onChange:a,mono:l,pattern:o}){return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),u.jsx("input",{value:n,onChange:c=>a(c.target.value),pattern:o,className:`w-full outline-none text-body ${l?"mono":""}`,style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]})}const sE=[{key:ki.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:ki.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:ki.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:ki.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],kS=sE.map(e=>e.key);function TU(){const e=kn(),{data:t,isLoading:n}=qe({queryKey:["system-config"],queryFn:jU}),[a,l]=x.useState({}),[o,c]=x.useState(!1);x.useEffect(()=>{if(!t)return;const y={};for(const g of kS){const b=t[g]??Vd[g]??"";y[g]=String(b)}l(y)},[t]);const f=bt({mutationFn:()=>{const y={};for(const[g,b]of Object.entries(a)){const S=b.trim();if(S==="")y[g]=Vd[g]??0;else{const k=Number(S);y[g]=Number.isNaN(k)?S:k}}return CU(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),c(!0),setTimeout(()=>c(!1),2e3)}});function m(){const y={};for(const g of kS)y[g]=String(Vd[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return u.jsxs("div",{className:"space-y-4",children:[u.jsx(AU,{}),u.jsx("form",{onSubmit:h,children:u.jsxs(ln,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"System configuration"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsx(me,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),u.jsxs(me,{type:"submit",size:"xs",disabled:f.isPending,children:[u.jsx(Yr,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),u.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?u.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):sE.map(y=>u.jsx(RU,{field:y,value:a[y.key]??"",onChange:g=>l({...a,[y.key]:g})},y.key)),f.error instanceof Error&&u.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})]})}function RU({field:e,value:t,onChange:n}){const a=String(Vd[e.key]??"—");return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),u.jsxs(Ju,{style:{marginTop:4,display:"block"},children:["default"," ",u.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx("input",{value:t,onChange:l=>n(l.target.value),className:"w-full outline-none mono text-body",style:{padding:`var(--sp-1_25) ${e.unit?56:10}px var(--sp-1_25) var(--sp-2_5)`,background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}}),e.unit&&u.jsx("span",{className:"mono text-caption",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)",pointerEvents:"none"},children:e.unit})]})]})}const jS=[{key:"members",label:"Members"},{key:"invite",label:"Invite link"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function zU(){const{role:e}=Qt(),t=Dn(),n=cn();if(e===null)return u.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return u.jsx(pf,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=jS.some(c=>c.key===a)?a:"members",o=c=>{n({hash:c},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(Rf,{title:"Admin",subtitle:"Organization-wide controls"}),u.jsx(rE,{children:jS.map(c=>u.jsx(aE,{active:l===c.key,onClick:()=>o(c.key),children:c.label},c.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&u.jsx(wU,{}),l==="invite"&&u.jsx(xU,{}),l==="all-agents"&&u.jsx(yU,{}),l==="settings"&&u.jsx(TU,{})]})]})}function OU(e){return ke.get(`/admin/agents/${e}/config`)}function DU(e,t){return ke.patch(`/admin/agents/${e}/config`,t)}function MU(e,t){return ke.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function LU(e){return ke.get(`/admin/agents/${e}/client-status`)}function IU({className:e,style:t,...n}){return u.jsx("div",{className:_e("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function UU({onClick:e,children:t}){return u.jsx("button",{type:"button",onClick:e,className:"bg-transparent border-0 p-0 cursor-pointer",style:{color:"var(--fg-3)",textDecoration:"none",font:"inherit"},onMouseEnter:n=>{n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--fg-3)"},children:t})}function PU(){return u.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function BU({children:e,mono:t}){return u.jsx("span",{className:_e("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function Kr({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?u.jsxs("span",{className:_e("shrink-0",n),style:a,role:"img","aria-label":"working",children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?u.jsx("span",{className:_e("shrink-0",n),style:{...a,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:u.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?u.jsx("span",{className:_e("shrink-0",n),style:{...a,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?u.jsx("span",{className:_e("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:_e("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function $U(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Ks({state:e,className:t}){const n=e!==null&&$U(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return u.jsxs("span",{className:_e("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[u.jsx(Kr,{state:n,size:7}),n]})}function zd({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function FU({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?u.jsx("div",{className:"sticky z-20 flex items-center justify-between gap-3 backdrop-blur",style:{top:0,padding:"var(--sp-1_75) var(--sp-5)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[u.jsxs("span",{children:["Runs on ",u.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),u.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function qU(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),c=t.displayName||t.name||t.uuid;return u.jsxs("section",{id:"ad-danger",style:{background:"color-mix(in oklch, var(--state-error) 6%, var(--bg-raised))",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[u.jsx(uy,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),u.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),u.jsxs("div",{children:[t.status==="active"?u.jsx(Sp,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):u.jsx(Sp,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(Sp,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(me,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[u.jsx(Zs,{className:"h-3 w-3"}),"Delete"]})})]}),u.jsx(HU,{open:l,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),u.jsx(ZU,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function Sp(e){return u.jsxs("div",{className:"flex items-start justify-between gap-4 text-body",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid color-mix(in oklch, var(--state-error) 14%, transparent)"},children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),u.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),u.jsx("div",{children:e.action})]})}function HU({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return u.jsx(zt,{open:e,onOpenChange:t,children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsxs(Ot,{children:['Suspend "',n,'"?']})}),u.jsx("div",{className:"space-y-3",children:u.jsx("p",{className:"text-body",style:{color:"var(--fg-2)"},children:"Runtime binds and HTTP calls will be refused while the agent is suspended. Active sessions end on their next message. You can reactivate later from this same page."})}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function ZU({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,c]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return u.jsx(zt,{open:e,onOpenChange:m=>{t(m),m||c("")},children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsxs(Ot,{children:['Delete "',n,'"?']})}),u.jsxs("form",{onSubmit:f,className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",u.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),u.jsx(xt,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const VU={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-success-soft text-success"},modified:{label:"changed",tone:"bg-warn-soft text-warn"},deleted:{label:"will be removed on save",tone:"bg-error-soft text-error"}};function Dy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const c=VU[e],f=e==="deleted";return u.jsxs("div",{className:_e("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[u.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),c.label&&u.jsx("span",{className:_e("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",c.tone),children:c.label}),!o&&(f?u.jsxs(me,{size:"sm",variant:"ghost",onClick:a,children:[u.jsx(cz,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[u.jsx(Qu,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Edit"})]}),u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[u.jsx(Zs,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function QU(e){const[t,n]=x.useState(null),[a,l]=x.useState(()=>new Set),o=f=>l(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h}),c=e.items.filter(f=>f.status!=="deleted").length;return u.jsxs(ln,{children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["Environment variables (",c,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Xr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Wr,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(f=>{const m=f.value.sensitive,h=f.value.value===af,y=m&&!h&&!!f.value.value,g=a.has(f.key);let b;return m?y&&g?b=f.value.value:b="••••••":b=f.value.value||u.jsx("em",{children:"(empty)"}),u.jsxs(Dy,{status:f.status,onEdit:()=>n({mode:"edit",key:f.key,initial:f.value}),onDelete:()=>e.onDelete(f.key),onUndo:()=>e.onUndoDelete(f.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono font-medium",children:f.value.key}),u.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&u.jsx(Rk,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&u.jsx("button",{type:"button",onClick:()=>y&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:y?g?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":g?"Hide value":"Reveal value",disabled:!y,style:{padding:0,opacity:y?1:.4},children:g?u.jsx(_R,{className:"h-3.5 w-3.5"}):u.jsx(TR,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&u.jsx(GU,{open:!!t,onOpenChange:f=>!f&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:f=>{t.mode==="edit"?e.onUpdate(t.key,f):e.onAdd(f),n(null)}})]})}function GU({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.key)??""),[f,m]=x.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=x.useState((n==null?void 0:n.sensitive)??!1),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),y((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function S(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=af),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return u.jsx(zt,{open:e,onOpenChange:t,children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:n?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:S,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"env-key",children:"Key"}),u.jsx(xt,{id:"env-key",value:o,onChange:k=>c(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&u.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"env-value",children:"Value"}),u.jsx(xt,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),u.jsxs("label",{className:"flex items-center gap-2 text-body",children:[u.jsx("input",{type:"checkbox",checked:h,onChange:k=>y(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function KU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(ln,{children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["Git repositories (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Xr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Wr,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??lf(l.value.url);return u.jsxs(Dy,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&u.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),u.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&u.jsx(YU,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenPaths:e.otherPaths(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function YU({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.url)??""),[f,m]=x.useState((n==null?void 0:n.ref)??""),[h,y]=x.useState((n==null?void 0:n.localPath)??""),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function S(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const C=h.trim()||lf(j);if(C&&a.has(C)){b(`Another repo already occupies local path "${C}".`);return}const E={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(E)}return u.jsx(zt,{open:e,onOpenChange:t,children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:n?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:S,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"git-url",children:"URL"}),u.jsx(xt,{id:"git-url",value:o,onChange:k=>c(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(xt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(xt,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:lf(o)||"repo-name",className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function oE({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:c,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return u.jsx("span",{className:_e("mono text-label",o),style:{color:"var(--fg-4)",...c},title:f,children:l});const y=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,b=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?u.jsxs("span",{className:_e("inline-flex flex-col leading-tight",o),style:{gap:1,...c},title:y??void 0,children:[h&&u.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):u.jsxs("span",{className:_e("inline-flex items-baseline gap-1.5",o),style:c,title:y??void 0,children:[h&&u.jsx("span",{style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function XU({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=yy(),o=Oy(),c=e.metadata,f=c==null?void 0:c.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(b=>typeof b=="string"):[],y=e.managerId?o(e.managerId):null,g=e.delegateMention?l(e.delegateMention):null;return u.jsxs(ln,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"Profile"}),e.status==="active"&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[u.jsx(Qu,{className:"h-3 w-3"})," Edit"]})]}),u.jsxs(Wr,{className:"text-body space-y-1",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&u.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsxs("span",{className:"text-muted-foreground",children:["delegate ",u.jsx(oE,{name:g.name,displayName:g.displayName})]})]})]}),u.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsxs("span",{children:["owner ",u.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-foreground",children:m})]}),u.jsxs("span",{children:["type ",u.jsx(Sn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),u.jsxs("span",{children:["visibility"," ",u.jsx(Sn,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&u.jsxs("span",{children:["domains"," ",u.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>u.jsx(Sn,{tone:"outline",children:b},b))})]})]})]}),u.jsx(JU,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function JU({agent:e,open:t,onOpenChange:n,onSave:a}){var I;const{memberId:l,role:o}=Qt(),[c,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[y,g]=x.useState(e.visibility),[b,S]=x.useState(!1),[k,j]=x.useState(null);x.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const C=e.type==="human",E=o==="admin"||e.managerId===l,A=qe({queryKey:["agents-for-delegate"],queryFn:async()=>(await Xu({limit:100})).items.filter(O=>O.type==="personal_assistant"&&O.status==="active"),enabled:t&&C});async function z(M){M.preventDefault(),j(null);const O=c.trim();if(!O){j("Display name is required.");return}S(!0);try{const D={displayName:O,delegateMention:m||null};y!==e.visibility&&(D.visibility=y),await a(D),n(!1)}catch(D){j(D instanceof Error?D.message:String(D))}finally{S(!1)}}return u.jsx(zt,{open:t,onOpenChange:n,children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:z,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Agent name"}),u.jsx(xt,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"id-display",children:"Display Name"}),u.jsx(xt,{id:"id-display",value:c,onChange:M=>f(M.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"id-visibility",children:"Visibility"}),u.jsxs("select",{id:"id-visibility",value:y,onChange:M=>g(M.target.value),disabled:!E,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[u.jsx("option",{value:xS.PRIVATE,children:"Private — only the manager"}),u.jsx("option",{value:xS.ORGANIZATION,children:"Organization — all members"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:E?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),C&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.jsxs("select",{id:"id-delegate",value:m,onChange:M=>h(M.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"None"}),(I=A.data)==null?void 0:I.map(M=>u.jsx("option",{value:M.uuid,children:M.displayName?`${M.displayName} (@${M.name??M.uuid})`:M.name?`@${M.name}`:M.uuid},M.uuid))]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&u.jsx("p",{className:"text-body text-destructive",children:k}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function WU(e){return e==="working"?"accent":e==="error"?"error":"outline"}function eP(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(ln,{children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["MCP servers (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Xr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Wr,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>{const o=l.status==="deleted"||!e.toolHealth?"unknown":e.toolHealth(l.value.name);return u.jsxs(Dy,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[u.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),u.jsx("span",{className:"font-medium font-mono",children:l.value.name}),u.jsx(Sn,{tone:WU(o),children:o}),u.jsx("span",{className:"text-caption text-muted-foreground truncate",children:tP(l.value)})]},l.key)})}),t&&u.jsx(nP,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenNames:e.otherNames(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function tP(e){var t;if(e.transport==="stdio"){const n=(t=e.args)!=null&&t.length?` ${e.args.join(" ")}`:"";return`${e.command}${n}`}return e.url}function nP({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=x.useState((n==null?void 0:n.name)??""),[h,y]=x.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,b]=x.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[S,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,C]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((n==null?void 0:n.transport)==="stdio"?n.command:""),b((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),C(null))},[e,n]);function E(A){if(A.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){C("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){C(`Another MCP server is already named "${f}".`);return}let z;if(o==="stdio"){if(!h.trim()){C("stdio transport requires a command.");return}const I=g.trim().split(/\s+/).filter(M=>M.length>0);z={name:f,transport:"stdio",command:h.trim(),...I.length?{args:I}:{}}}else{const I=S.trim();try{new URL(I)}catch{C("URL is not valid.");return}z={name:f,transport:o,url:I}}l(z)}return u.jsx(zt,{open:e,onOpenChange:t,children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:n?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:E,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:o,onChange:A=>c(A.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"mcp-name",children:"Name"}),u.jsx(xt,{id:"mcp-name",value:f,onChange:A=>m(A.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"mcp-command",children:"Command"}),u.jsx(xt,{id:"mcp-command",value:h,onChange:A=>y(A.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(xt,{id:"mcp-args",value:g,onChange:A=>b(A.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"mcp-url",children:"URL"}),u.jsx(xt,{id:"mcp-url",value:S,onChange:A=>k(A.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&u.jsx("p",{className:"text-body text-destructive",children:j}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const rP=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],aP=[{value:"gpt-5.5",label:"gpt-5.5",hint:"latest"},{value:"gpt-5.4",label:"gpt-5.4"},{value:"gpt-5.4-mini",label:"gpt-5.4-mini",hint:"fastest"},{value:"gpt-5.3-codex",label:"gpt-5.3-codex",hint:"coding-specialized"},{value:"gpt-5.2",label:"gpt-5.2"}],iP={"claude-code":rP,codex:aP},lP={"claude-code":"Choose which Claude model powers this agent. Aliases (opus / sonnet / haiku) follow the CLI's latest-in-family mapping and may shift across releases. Applies to new sessions immediately; active sessions switch on their next message. Unset falls back to the operator's local ~/.claude/settings.json model preference, then the CLI default.",codex:"Pick a Codex model. Slugs come from the Codex CLI bundled with @openai/codex-sdk; ChatGPT-account auth currently only accepts gpt-5.5, while API-key auth accepts the wider set. Applies to new sessions immediately; active sessions switch on their next message. Unset lets the codex CLI choose a model that matches the user's auth mode."},sP={value:"",label:"(unset — inherits local)"};function oP({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const c=e!==t,f=iP[o],m=x.useMemo(()=>{const h=[sP,...f];return e!==""&&!f.some(y=>y.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return u.jsxs(ln,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["Model",c&&u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})]}),c&&u.jsx(me,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),u.jsxs(Wr,{className:"space-y-2",children:[u.jsx(uP,{items:m,value:e,onChange:n,disabled:l}),u.jsx("p",{className:"text-caption text-muted-foreground",children:lP[o]})]})]})}function uP({items:e,value:t,onChange:n,disabled:a}){const[l,o]=x.useState(!1),[c,f]=x.useState(null),m=x.useRef(null),h=x.useRef(null),y=e.find(b=>b.value===t)??e[0],g=x.useCallback(()=>{const b=m.current;if(!b)return;const S=b.getBoundingClientRect();f({top:S.bottom+4,left:S.left,width:S.width})},[]);return x.useLayoutEffect(()=>{l&&g()},[l,g]),x.useEffect(()=>{if(!l)return;const b=j=>{var E,A;const C=j.target;(E=m.current)!=null&&E.contains(C)||(A=h.current)!=null&&A.contains(C)||o(!1)},S=j=>{var C;j.key==="Escape"&&(o(!1),(C=m.current)==null||C.focus())},k=()=>g();return document.addEventListener("pointerdown",b),document.addEventListener("keydown",S),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",S),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[l,g]),u.jsxs("div",{className:"max-w-md",children:[u.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(b=>!b),className:"mono flex h-9 w-full items-center justify-between rounded-[var(--radius-input)] border border-input bg-transparent pl-3 pr-2 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 hover:border-ring transition-colors cursor-pointer","aria-haspopup":"listbox","aria-expanded":l,children:[u.jsx("span",{className:"truncate",style:{color:(y==null?void 0:y.value)===""?"var(--fg-3)":void 0},children:(y==null?void 0:y.label)??t}),u.jsx(Ak,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&c&&fy.createPortal(u.jsx("div",{ref:h,className:"fixed z-50 overflow-hidden rounded-[var(--radius-input)] py-1",style:{top:c.top,left:c.left,width:c.width,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",boxShadow:"var(--shadow-md)",maxHeight:280,overflowY:"auto"},children:e.map(b=>{const S=b.value===t;return u.jsxs("button",{type:"button",onClick:()=>{n(b.value),o(!1)},className:"mono flex w-full items-center gap-2 cursor-pointer px-3 py-1.5 text-body text-left hover:bg-accent/40 transition-colors focus-visible:outline-none focus-visible:bg-accent/40",style:{background:S?"var(--bg-hover)":void 0,color:b.value===""?"var(--fg-3)":void 0},children:[u.jsx(Yr,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:S?"visible":"hidden",color:"var(--state-idle)"}}),u.jsx("span",{className:"flex-1 truncate",children:b.label}),b.hint&&u.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:b.hint})]},b.value||"__unset")})}),document.body)]})}function cP(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const dP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hP={};function CS(e,t){return(hP.jsx?fP:dP).test(e)}const mP=/[ \t\n\f\r]/g;function pP(e){return typeof e=="object"?e.type==="text"?ES(e.value):!1:ES(e)}function ES(e){return e.replace(mP,"")===""}class ec{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}ec.prototype.normal={};ec.prototype.property={};ec.prototype.space=void 0;function uE(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new ec(n,a,t)}function Tg(e){return e.toLowerCase()}class Kn{constructor(t,n){this.attribute=n,this.property=t}}Kn.prototype.attribute="";Kn.prototype.booleanish=!1;Kn.prototype.boolean=!1;Kn.prototype.commaOrSpaceSeparated=!1;Kn.prototype.commaSeparated=!1;Kn.prototype.defined=!1;Kn.prototype.mustUseProperty=!1;Kn.prototype.number=!1;Kn.prototype.overloadedBoolean=!1;Kn.prototype.property="";Kn.prototype.spaceSeparated=!1;Kn.prototype.space=void 0;let gP=0;const Ve=_l(),Jt=_l(),Rg=_l(),pe=_l(),jt=_l(),As=_l(),ar=_l();function _l(){return 2**++gP}const zg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Jt,commaOrSpaceSeparated:ar,commaSeparated:As,number:pe,overloadedBoolean:Rg,spaceSeparated:jt},Symbol.toStringTag,{value:"Module"})),wp=Object.keys(zg);class My extends Kn{constructor(t,n,a,l){let o=-1;if(super(t,n),NS(this,"space",l),typeof a=="number")for(;++o<wp.length;){const c=wp[o];NS(this,wp[o],(a&zg[c])===zg[c])}}}My.prototype.defined=!0;function NS(e,t,n){n&&(e[t]=n)}function lo(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new My(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Tg(a)]=a,n[Tg(o.attribute)]=a}return new ec(t,n,e.space)}const cE=lo({properties:{ariaActiveDescendant:null,ariaAtomic:Jt,ariaAutoComplete:null,ariaBusy:Jt,ariaChecked:Jt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:jt,ariaCurrent:null,ariaDescribedBy:jt,ariaDetails:null,ariaDisabled:Jt,ariaDropEffect:jt,ariaErrorMessage:null,ariaExpanded:Jt,ariaFlowTo:jt,ariaGrabbed:Jt,ariaHasPopup:null,ariaHidden:Jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jt,ariaLevel:pe,ariaLive:null,ariaModal:Jt,ariaMultiLine:Jt,ariaMultiSelectable:Jt,ariaOrientation:null,ariaOwns:jt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Jt,ariaReadOnly:Jt,ariaRelevant:null,ariaRequired:Jt,ariaRoleDescription:jt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Jt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function dE(e,t){return t in e?e[t]:t}function fE(e,t){return dE(e,t.toLowerCase())}const yP=lo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:As,acceptCharset:jt,accessKey:jt,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:jt,autoFocus:Ve,autoPlay:Ve,blocking:jt,capture:null,charSet:null,checked:Ve,cite:null,className:jt,cols:pe,colSpan:null,content:null,contentEditable:Jt,controls:Ve,controlsList:jt,coords:pe|As,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:Rg,draggable:Jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:jt,height:pe,hidden:Rg,high:pe,href:null,hrefLang:null,htmlFor:jt,httpEquiv:jt,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:jt,itemRef:jt,itemScope:Ve,itemType:jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ve,optimum:pe,pattern:null,ping:jt,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:jt,required:Ve,reversed:Ve,rows:pe,rowSpan:pe,sandbox:jt,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Jt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Jt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:fE}),vP=lo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ar,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:jt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:As,g2:As,glyphName:As,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:ar,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ar,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ar,rev:ar,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ar,requiredFeatures:ar,requiredFonts:ar,requiredFormats:ar,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:ar,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ar,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ar,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dE}),hE=lo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),mE=lo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fE}),pE=lo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),bP={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},xP=/[A-Z]/g,_S=/-[a-z]/g,SP=/^data[-\w.:]+$/i;function wP(e,t){const n=Tg(t);let a=t,l=Kn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&SP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(_S,jP);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!_S.test(o)){let c=o.replace(xP,kP);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=My}return new l(a,t)}function kP(e){return"-"+e.toLowerCase()}function jP(e){return e.charAt(1).toUpperCase()}const CP=uE([cE,yP,hE,mE,pE],"html"),Ly=uE([cE,vP,hE,mE,pE],"svg");function EP(e){return e.join(" ").trim()}var ys={},kp,AS;function NP(){if(AS)return kp;AS=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
359
+ `,h="/",y="*",g="",b="comment",S="declaration";function k(C,E){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];E=E||{};var A=1,z=1;function I(fe){var ie=fe.match(t);ie&&(A+=ie.length);var Z=fe.lastIndexOf(m);z=~Z?fe.length-Z:z+fe.length}function M(){var fe={line:A,column:z};return function(ie){return ie.position=new O(fe),W(),ie}}function O(fe){this.start=fe,this.end={line:A,column:z},this.source=E.source}O.prototype.content=C;function D(fe){var ie=new Error(E.source+":"+A+":"+z+": "+fe);if(ie.reason=fe,ie.filename=E.source,ie.line=A,ie.column=z,ie.source=C,!E.silent)throw ie}function U(fe){var ie=fe.exec(C);if(ie){var Z=ie[0];return I(Z),C=C.slice(Z.length),ie}}function W(){U(n)}function H(fe){var ie;for(fe=fe||[];ie=ne();)ie!==!1&&fe.push(ie);return fe}function ne(){var fe=M();if(!(h!=C.charAt(0)||y!=C.charAt(1))){for(var ie=2;g!=C.charAt(ie)&&(y!=C.charAt(ie)||h!=C.charAt(ie+1));)++ie;if(ie+=2,g===C.charAt(ie-1))return D("End of comment missing");var Z=C.slice(2,ie-2);return z+=2,I(Z),C=C.slice(ie),z+=2,fe({type:b,comment:Z})}}function X(){var fe=M(),ie=U(a);if(ie){if(ne(),!U(l))return D("property missing ':'");var Z=U(o),ae=fe({type:S,property:j(ie[0].replace(e,g)),value:Z?j(Z[0].replace(e,g)):g});return U(c),ae}}function be(){var fe=[];H(fe);for(var ie;ie=X();)ie!==!1&&(fe.push(ie),H(fe));return fe}return W(),be()}function j(C){return C?C.replace(f,g):g}return kp=k,kp}var TS;function _P(){if(TS)return ys;TS=1;var e=ys&&ys.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(ys,"__esModule",{value:!0}),ys.default=n;const t=e(NP());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof l=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:y}=m;f?l(h,y,m):y&&(o=o||{},o[h]=y)}),o}return ys}var ou={},RS;function AP(){if(RS)return ou;RS=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},m=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,c))};return ou.camelCase=m,ou}var uu,zS;function TP(){if(zS)return uu;zS=1;var e=uu&&uu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(_P()),n=AP();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(c[(0,n.camelCase)(f,o)]=m)}),c}return a.default=a,uu=a,uu}var RP=TP();const zP=ff(RP),gE=yE("end"),Iy=yE("start");function yE(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function OP(e){const t=Iy(e),n=gE(e);if(t&&n)return{start:t,end:n}}function vu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?OS(e.position):"start"in e||"end"in e?OS(e):"line"in e||"column"in e?Og(e):""}function Og(e){return DS(e&&e.line)+":"+DS(e&&e.column)}function OS(e){return Og(e&&e.start)+"-"+Og(e&&e.end)}function DS(e){return e&&typeof e=="number"?e:1}class An extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=vu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}An.prototype.file="";An.prototype.name="";An.prototype.reason="";An.prototype.message="";An.prototype.stack="";An.prototype.column=void 0;An.prototype.line=void 0;An.prototype.ancestors=void 0;An.prototype.cause=void 0;An.prototype.fatal=void 0;An.prototype.place=void 0;An.prototype.ruleId=void 0;An.prototype.source=void 0;const Uy={}.hasOwnProperty,DP=new Map,MP=/[A-Z]/g,LP=new Set(["table","tbody","thead","tfoot","tr"]),IP=new Set(["td","th"]),vE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function UP(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=VP(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=ZP(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ly:CP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=bE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function bE(e,t,n){if(t.type==="element")return PP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return BP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return FP(e,t,n);if(t.type==="mdxjsEsm")return $P(e,t);if(t.type==="root")return qP(e,t,n);if(t.type==="text")return HP(e,t)}function PP(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Ly,e.schema=l),e.ancestors.push(t);const o=SE(e,t.tagName,!1),c=QP(e,t);let f=By(e,t);return LP.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!pP(m):!0})),xE(e,c,o,t),Py(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function BP(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}zu(e,t.position)}function $P(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zu(e,t.position)}function FP(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Ly,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:SE(e,t.name,!0),c=GP(e,t),f=By(e,t);return xE(e,c,o,t),Py(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function qP(e,t,n){const a={};return Py(a,By(e,t)),e.create(t,e.Fragment,a,n)}function HP(e,t){return t.value}function xE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Py(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ZP(e,t,n){return a;function a(l,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function VP(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),m=Iy(a);return t(l,o,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function QP(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Uy.call(t.properties,l)){const o=KP(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&IP.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function GP(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else zu(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else zu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function By(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:DP;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;c=m+"-"+h,l.set(m,h+1)}}const f=bE(e,o,c);f!==void 0&&n.push(f)}return n}function KP(e,t,n){const a=wP(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?cP(n):EP(n)),a.property==="style"){let l=typeof n=="object"?n:YP(e,String(n));return e.stylePropertyNameCase==="css"&&(l=XP(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?bP[a.property]||a.property:a.attribute,n]}}function YP(e,t){try{return zP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new An("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=vE+"#cannot-parse-style-attribute",l}}function SE(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const f=CS(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=CS(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Uy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);zu(e)}function zu(e,t){const n=new An("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=vE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function XP(e){const t={};let n;for(n in e)Uy.call(e,n)&&(t[JP(n)]=e[n]);return t}function JP(e){let t=e.replace(MP,WP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function WP(e){return"-"+e.toLowerCase()}const jp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},e9={};function $y(e,t){const n=e9,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return wE(e,a,l)}function wE(e,t,n){if(t9(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return MS(e.children,t,n)}return Array.isArray(e)?MS(e,t,n):""}function MS(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=wE(e[l],t,n);return a.join("")}function t9(e){return!!(e&&typeof e=="object")}const LS=document.createElement("i");function Fy(e){const t="&"+e+";";LS.innerHTML=t;const n=LS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function or(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function jr(e,t){return e.length>0?(or(e,e.length,0,t),e):t}const IS={}.hasOwnProperty;function kE(e){const t={};let n=-1;for(;++n<e.length;)n9(t,e[n]);return t}function n9(e,t){let n;for(n in t){const l=(IS.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){IS.call(l,c)||(l[c]=[]);const f=o[c];r9(l[c],Array.isArray(f)?f:f?[f]:[])}}}function r9(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);or(e,0,0,a)}function jE(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Mr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const On=Mi(/[A-Za-z]/),_n=Mi(/[\dA-Za-z]/),a9=Mi(/[#-'*+\--9=?A-Z^-~]/);function of(e){return e!==null&&(e<32||e===127)}const Dg=Mi(/\d/),i9=Mi(/[\dA-Fa-f]/),l9=Mi(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function kt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const zf=Mi(new RegExp("\\p{P}|\\p{S}","u")),wl=Mi(/\s/);function Mi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function so(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&_n(e.charCodeAt(n+1))&&_n(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function st(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return We(m)?(e.enter(n),f(m)):t(m)}function f(m){return We(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const s9={tokenize:o9};function o9(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),st(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return ze(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const u9={tokenize:c9},US={tokenize:d9};function c9(e){const t=this,n=[];let a=0,l,o,c;return f;function f(z){if(a<n.length){const I=n[a];return t.containerState=I[1],e.attempt(I[0].continuation,m,h)(z)}return h(z)}function m(z){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&A();const I=t.events.length;let M=I,O;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){O=t.events[M][1].end;break}E(a);let D=I;for(;D<t.events.length;)t.events[D][1].end={...O},D++;return or(t.events,M+1,0,t.events.slice(I)),t.events.length=D,h(z)}return f(z)}function h(z){if(a===n.length){if(!l)return b(z);if(l.currentConstruct&&l.currentConstruct.concrete)return k(z);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(US,y,g)(z)}function y(z){return l&&A(),E(a),b(z)}function g(z){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,k(z)}function b(z){return t.containerState={},e.attempt(US,S,k)(z)}function S(z){return a++,n.push([t.currentConstruct,t.containerState]),b(z)}function k(z){if(z===null){l&&A(),E(0),e.consume(z);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(z)}function j(z){if(z===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(z);return}return ze(z)?(e.consume(z),C(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(z),j)}function C(z,I){const M=t.sliceStream(z);if(I&&M.push(null),z.previous=o,o&&(o.next=z),o=z,l.defineSkip(z.start),l.write(M),t.parser.lazy[z.start.line]){let O=l.events.length;for(;O--;)if(l.events[O][1].start.offset<c&&(!l.events[O][1].end||l.events[O][1].end.offset>c))return;const D=t.events.length;let U=D,W,H;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(W){H=t.events[U][1].end;break}W=!0}for(E(a),O=D;O<t.events.length;)t.events[O][1].end={...H},O++;or(t.events,U+1,0,t.events.slice(D)),t.events.length=O}}function E(z){let I=n.length;for(;I-- >z;){const M=n[I];t.containerState=M[1],M[0].exit.call(t,e)}n.length=z}function A(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function d9(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ys(e){if(e===null||kt(e)||wl(e))return 1;if(zf(e))return 2}function Of(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Mg={name:"attention",resolveAll:f9,tokenize:h9};function f9(e,t){let n=-1,a,l,o,c,f,m,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},b={...e[n][1].start};PS(g,-m),PS(b,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=jr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=jr(h,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=jr(h,Of(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=jr(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,h=jr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,or(e,a-1,n-a+3,h),n=a+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function h9(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Ys(a);let o;return c;function c(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),y=Ys(m),g=!y||y===2&&l||n.includes(m),b=!l||l===2&&y||n.includes(a);return h._open=!!(o===42?g:g&&(l||!b)),h._close=!!(o===42?b:b&&(y||!g)),t(m)}}function PS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const m9={name:"autolink",tokenize:p9};function p9(e,t,n){let a=0;return l;function l(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(S){return On(S)?(e.consume(S),c):S===64?n(S):h(S)}function c(S){return S===43||S===45||S===46||_n(S)?(a=1,f(S)):h(S)}function f(S){return S===58?(e.consume(S),a=0,m):(S===43||S===45||S===46||_n(S))&&a++<32?(e.consume(S),f):(a=0,h(S))}function m(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):S===null||S===32||S===60||of(S)?n(S):(e.consume(S),m)}function h(S){return S===64?(e.consume(S),y):a9(S)?(e.consume(S),h):n(S)}function y(S){return _n(S)?g(S):n(S)}function g(S){return S===46?(e.consume(S),a=0,y):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):b(S)}function b(S){if((S===45||_n(S))&&a++<63){const k=S===45?b:g;return e.consume(S),k}return n(S)}}const tc={partial:!0,tokenize:g9};function g9(e,t,n){return a;function a(o){return We(o)?st(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||ze(o)?t(o):n(o)}}const CE={continuation:{tokenize:v9},exit:b9,name:"blockQuote",tokenize:y9};function y9(e,t,n){const a=this;return l;function l(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return We(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function v9(e,t,n){const a=this;return l;function l(c){return We(c)?st(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(CE,t,n)(c)}}function b9(e){e.exit("blockQuote")}const EE={name:"characterEscape",tokenize:x9};function x9(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return l9(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const NE={name:"characterReference",tokenize:S9};function S9(e,t,n){const a=this;let l=0,o,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=_n,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=i9,y):(e.enter("characterReferenceValue"),o=7,c=Dg,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return c===_n&&!Fy(a.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&l++<o?(e.consume(g),y):n(g)}}const BS={partial:!0,tokenize:k9},$S={concrete:!0,name:"codeFenced",tokenize:w9};function w9(e,t,n){const a=this,l={partial:!0,tokenize:M};let o=0,c=0,f;return m;function m(O){return h(O)}function h(O){const D=a.events[a.events.length-1];return o=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(O)}function y(O){return O===f?(c++,e.consume(O),y):c<3?n(O):(e.exit("codeFencedFenceSequence"),We(O)?st(e,g,"whitespace")(O):g(O))}function g(O){return O===null||ze(O)?(e.exit("codeFencedFence"),a.interrupt?t(O):e.check(BS,j,I)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||ze(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(O)):We(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),st(e,S,"whitespace")(O)):O===96&&O===f?n(O):(e.consume(O),b)}function S(O){return O===null||ze(O)?g(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||ze(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(O)):O===96&&O===f?n(O):(e.consume(O),k)}function j(O){return e.attempt(l,I,C)(O)}function C(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),E}function E(O){return o>0&&We(O)?st(e,A,"linePrefix",o+1)(O):A(O)}function A(O){return O===null||ze(O)?e.check(BS,j,I)(O):(e.enter("codeFlowValue"),z(O))}function z(O){return O===null||ze(O)?(e.exit("codeFlowValue"),A(O)):(e.consume(O),z)}function I(O){return e.exit("codeFenced"),t(O)}function M(O,D,U){let W=0;return H;function H(ie){return O.enter("lineEnding"),O.consume(ie),O.exit("lineEnding"),ne}function ne(ie){return O.enter("codeFencedFence"),We(ie)?st(O,X,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ie):X(ie)}function X(ie){return ie===f?(O.enter("codeFencedFenceSequence"),be(ie)):U(ie)}function be(ie){return ie===f?(W++,O.consume(ie),be):W>=c?(O.exit("codeFencedFenceSequence"),We(ie)?st(O,fe,"whitespace")(ie):fe(ie)):U(ie)}function fe(ie){return ie===null||ze(ie)?(O.exit("codeFencedFence"),D(ie)):U(ie)}}}function k9(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const Cp={name:"codeIndented",tokenize:C9},j9={partial:!0,tokenize:E9};function C9(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),st(e,o,"linePrefix",5)(h)}function o(h){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):ze(h)?e.attempt(j9,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||ze(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function E9(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):ze(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):st(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):ze(c)?l(c):n(c)}}const N9={name:"codeText",previous:A9,resolve:_9,tokenize:T9};function _9(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function A9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function T9(e,t,n){let a=0,l,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):ze(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||ze(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),l++,y):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class R9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&cu(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),cu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);cu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);cu(this.left,n.reverse())}}}function cu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _E(e){const t={};let n=-1,a,l,o,c,f,m,h;const y=new R9(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(a=y.get(n),n&&a[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,z9(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(a),y.splice(l,n-l+1,f))}}return or(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function z9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],h={};let y,g,b=-1,S=n,k=0,j=0;const C=[j];for(;S;){for(;e.get(++l)[1]!==S;);o.push(l),S._tokenizer||(y=a.sliceStream(S),S.next||y.push(null),g&&c.defineSkip(S.start),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=S,S=S.next}for(S=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(j=b+1,C.push(j),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(c.events=[],S?(S._tokenizer=void 0,S.previous=void 0):C.pop(),b=C.length;b--;){const E=f.slice(C[b],C[b+1]),A=o.pop();m.push([A,A+E.length-1]),e.splice(A,2,E)}for(m.reverse(),b=-1;++b<m.length;)h[k+m[b][0]]=k+m[b][1],k+=m[b][1]-m[b][0]-1;return h}const O9={resolve:M9,tokenize:L9},D9={partial:!0,tokenize:I9};function M9(e){return _E(e),e}function L9(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):ze(f)?e.check(D9,c,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function I9(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),st(e,o,"linePrefix")}function o(c){if(c===null||ze(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function AE(e,t,n,a,l,o,c,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(E){return E===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(E),e.exit(o),b):E===null||E===32||E===41||of(E)?n(E):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(E))}function b(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),S(E))}function S(E){return E===62?(e.exit("chunkString"),e.exit(f),b(E)):E===null||E===60||ze(E)?n(E):(e.consume(E),E===92?k:S)}function k(E){return E===60||E===62||E===92?(e.consume(E),S):S(E)}function j(E){return!y&&(E===null||E===41||kt(E))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(E)):y<h&&E===40?(e.consume(E),y++,j):E===41?(e.consume(E),y--,j):E===null||E===32||E===40||of(E)?n(E):(e.consume(E),E===92?C:j)}function C(E){return E===40||E===41||E===92?(e.consume(E),j):j(E)}}function TE(e,t,n,a,l,o){const c=this;let f=0,m;return h;function h(S){return e.enter(a),e.enter(l),e.consume(S),e.exit(l),e.enter(o),y}function y(S){return f>999||S===null||S===91||S===93&&!m||S===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(S):S===93?(e.exit(o),e.enter(l),e.consume(S),e.exit(l),e.exit(a),t):ze(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||S===91||S===93||ze(S)||f++>999?(e.exit("chunkString"),y(S)):(e.consume(S),m||(m=!We(S)),S===92?b:g)}function b(S){return S===91||S===92||S===93?(e.consume(S),f++,g):g(S)}}function RE(e,t,n,a,l,o){let c;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),c=b===40?41:b,m):n(b)}function m(b){return b===c?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===c?(e.exit(o),m(c)):b===null?n(b):ze(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),st(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===c||b===null||ze(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===c||b===92?(e.consume(b),y):y(b)}}function bu(e,t){let n;return a;function a(l){return ze(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):We(l)?st(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const U9={name:"definition",tokenize:B9},P9={partial:!0,tokenize:$9};function B9(e,t,n){const a=this;let l;return o;function o(S){return e.enter("definition"),c(S)}function c(S){return TE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function f(S){return l=Mr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),m):n(S)}function m(S){return kt(S)?bu(e,h)(S):h(S)}function h(S){return AE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function y(S){return e.attempt(P9,g,g)(S)}function g(S){return We(S)?st(e,b,"whitespace")(S):b(S)}function b(S){return S===null||ze(S)?(e.exit("definition"),a.parser.defined.push(l),t(S)):n(S)}}function $9(e,t,n){return a;function a(f){return kt(f)?bu(e,l)(f):n(f)}function l(f){return RE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return We(f)?st(e,c,"whitespace")(f):c(f)}function c(f){return f===null||ze(f)?t(f):n(f)}}const F9={name:"hardBreakEscape",tokenize:q9};function q9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const H9={name:"headingAtx",resolve:Z9,tokenize:V9};function Z9(e,t){let n=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},or(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function V9(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&a++<6?(e.consume(y),c):y===null||kt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||ze(y)?(e.exit("atxHeading"),t(y)):We(y)?st(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||kt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const Q9=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],FS=["pre","script","style","textarea"],G9={concrete:!0,name:"htmlFlow",resolveTo:X9,tokenize:J9},K9={partial:!0,tokenize:e8},Y9={partial:!0,tokenize:W9};function X9(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function J9(e,t,n){const a=this;let l,o,c,f,m;return h;function h(_){return y(_)}function y(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),g}function g(_){return _===33?(e.consume(_),b):_===47?(e.consume(_),o=!0,j):_===63?(e.consume(_),l=3,a.interrupt?t:T):On(_)?(e.consume(_),c=String.fromCharCode(_),C):n(_)}function b(_){return _===45?(e.consume(_),l=2,S):_===91?(e.consume(_),l=5,f=0,k):On(_)?(e.consume(_),l=4,a.interrupt?t:T):n(_)}function S(_){return _===45?(e.consume(_),a.interrupt?t:T):n(_)}function k(_){const F="CDATA[";return _===F.charCodeAt(f++)?(e.consume(_),f===F.length?a.interrupt?t:X:k):n(_)}function j(_){return On(_)?(e.consume(_),c=String.fromCharCode(_),C):n(_)}function C(_){if(_===null||_===47||_===62||kt(_)){const F=_===47,J=c.toLowerCase();return!F&&!o&&FS.includes(J)?(l=1,a.interrupt?t(_):X(_)):Q9.includes(c.toLowerCase())?(l=6,F?(e.consume(_),E):a.interrupt?t(_):X(_)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(_):o?A(_):z(_))}return _===45||_n(_)?(e.consume(_),c+=String.fromCharCode(_),C):n(_)}function E(_){return _===62?(e.consume(_),a.interrupt?t:X):n(_)}function A(_){return We(_)?(e.consume(_),A):H(_)}function z(_){return _===47?(e.consume(_),H):_===58||_===95||On(_)?(e.consume(_),I):We(_)?(e.consume(_),z):H(_)}function I(_){return _===45||_===46||_===58||_===95||_n(_)?(e.consume(_),I):M(_)}function M(_){return _===61?(e.consume(_),O):We(_)?(e.consume(_),M):z(_)}function O(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),m=_,D):We(_)?(e.consume(_),O):U(_)}function D(_){return _===m?(e.consume(_),m=null,W):_===null||ze(_)?n(_):(e.consume(_),D)}function U(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||kt(_)?M(_):(e.consume(_),U)}function W(_){return _===47||_===62||We(_)?z(_):n(_)}function H(_){return _===62?(e.consume(_),ne):n(_)}function ne(_){return _===null||ze(_)?X(_):We(_)?(e.consume(_),ne):n(_)}function X(_){return _===45&&l===2?(e.consume(_),Z):_===60&&l===1?(e.consume(_),ae):_===62&&l===4?(e.consume(_),B):_===63&&l===3?(e.consume(_),T):_===93&&l===5?(e.consume(_),he):ze(_)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(K9,$,be)(_)):_===null||ze(_)?(e.exit("htmlFlowData"),be(_)):(e.consume(_),X)}function be(_){return e.check(Y9,fe,$)(_)}function fe(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ie}function ie(_){return _===null||ze(_)?be(_):(e.enter("htmlFlowData"),X(_))}function Z(_){return _===45?(e.consume(_),T):X(_)}function ae(_){return _===47?(e.consume(_),c="",K):X(_)}function K(_){if(_===62){const F=c.toLowerCase();return FS.includes(F)?(e.consume(_),B):X(_)}return On(_)&&c.length<8?(e.consume(_),c+=String.fromCharCode(_),K):X(_)}function he(_){return _===93?(e.consume(_),T):X(_)}function T(_){return _===62?(e.consume(_),B):_===45&&l===2?(e.consume(_),T):X(_)}function B(_){return _===null||ze(_)?(e.exit("htmlFlowData"),$(_)):(e.consume(_),B)}function $(_){return e.exit("htmlFlow"),t(_)}}function W9(e,t,n){const a=this;return l;function l(c){return ze(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function e8(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(tc,t,n)}}const t8={name:"htmlText",tokenize:n8};function n8(e,t,n){const a=this;let l,o,c;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),M):T===63?(e.consume(T),z):On(T)?(e.consume(T),U):n(T)}function h(T){return T===45?(e.consume(T),y):T===91?(e.consume(T),o=0,k):On(T)?(e.consume(T),A):n(T)}function y(T){return T===45?(e.consume(T),S):n(T)}function g(T){return T===null?n(T):T===45?(e.consume(T),b):ze(T)?(c=g,ae(T)):(e.consume(T),g)}function b(T){return T===45?(e.consume(T),S):g(T)}function S(T){return T===62?Z(T):T===45?b(T):g(T)}function k(T){const B="CDATA[";return T===B.charCodeAt(o++)?(e.consume(T),o===B.length?j:k):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),C):ze(T)?(c=j,ae(T)):(e.consume(T),j)}function C(T){return T===93?(e.consume(T),E):j(T)}function E(T){return T===62?Z(T):T===93?(e.consume(T),E):j(T)}function A(T){return T===null||T===62?Z(T):ze(T)?(c=A,ae(T)):(e.consume(T),A)}function z(T){return T===null?n(T):T===63?(e.consume(T),I):ze(T)?(c=z,ae(T)):(e.consume(T),z)}function I(T){return T===62?Z(T):z(T)}function M(T){return On(T)?(e.consume(T),O):n(T)}function O(T){return T===45||_n(T)?(e.consume(T),O):D(T)}function D(T){return ze(T)?(c=D,ae(T)):We(T)?(e.consume(T),D):Z(T)}function U(T){return T===45||_n(T)?(e.consume(T),U):T===47||T===62||kt(T)?W(T):n(T)}function W(T){return T===47?(e.consume(T),Z):T===58||T===95||On(T)?(e.consume(T),H):ze(T)?(c=W,ae(T)):We(T)?(e.consume(T),W):Z(T)}function H(T){return T===45||T===46||T===58||T===95||_n(T)?(e.consume(T),H):ne(T)}function ne(T){return T===61?(e.consume(T),X):ze(T)?(c=ne,ae(T)):We(T)?(e.consume(T),ne):W(T)}function X(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,be):ze(T)?(c=X,ae(T)):We(T)?(e.consume(T),X):(e.consume(T),fe)}function be(T){return T===l?(e.consume(T),l=void 0,ie):T===null?n(T):ze(T)?(c=be,ae(T)):(e.consume(T),be)}function fe(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||kt(T)?W(T):(e.consume(T),fe)}function ie(T){return T===47||T===62||kt(T)?W(T):n(T)}function Z(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function ae(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),K}function K(T){return We(T)?st(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):he(T)}function he(T){return e.enter("htmlTextData"),c(T)}}const qy={name:"labelEnd",resolveAll:l8,resolveTo:s8,tokenize:o8},r8={tokenize:u8},a8={tokenize:c8},i8={tokenize:d8};function l8(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&or(e,0,e.length,n),e}function s8(e,t){let n=e.length,a=0,l,o,c,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=jr(f,e.slice(o+1,o+a+3)),f=jr(f,[["enter",y,t]]),f=jr(f,Of(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=jr(f,[["exit",y,t],e[c-2],e[c-1],["exit",h,t]]),f=jr(f,e.slice(c+1)),f=jr(f,[["exit",m,t]]),or(e,o,e.length,f),e}function o8(e,t,n){const a=this;let l=a.events.length,o,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(b){return o?o._inactive?g(b):(c=a.parser.defined.includes(Mr(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),m):n(b)}function m(b){return b===40?e.attempt(r8,y,c?y:g)(b):b===91?e.attempt(a8,y,c?h:g)(b):c?y(b):g(b)}function h(b){return e.attempt(i8,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function u8(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return kt(g)?bu(e,o)(g):o(g)}function o(g){return g===41?y(g):AE(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return kt(g)?bu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?RE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return kt(g)?bu(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function c8(e,t,n){const a=this;return l;function l(f){return TE.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Mr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function d8(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const f8={name:"labelStartImage",resolveAll:qy.resolveAll,tokenize:h8};function h8(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const m8={name:"labelStartLink",resolveAll:qy.resolveAll,tokenize:p8};function p8(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Ep={name:"lineEnding",tokenize:g8};function g8(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),st(e,t,"linePrefix")}}const Qd={name:"thematicBreak",tokenize:y8};function y8(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||ze(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),We(h)?st(e,f,"whitespace")(h):f(h))}}const qn={continuation:{tokenize:S8},exit:k8,name:"list",tokenize:x8},v8={partial:!0,tokenize:j8},b8={partial:!0,tokenize:w8};function x8(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(S){const k=a.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||S===a.containerState.marker:Dg(S)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check(Qd,n,h)(S):h(S);if(!a.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(S)}return n(S)}function m(S){return Dg(S)&&++c<10?(e.consume(S),m):(!a.interrupt||c<2)&&(a.containerState.marker?S===a.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),h(S)):n(S)}function h(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||S,e.check(tc,a.interrupt?n:y,e.attempt(v8,b,g))}function y(S){return a.containerState.initialBlankLine=!0,o++,b(S)}function g(S){return We(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),b):n(S)}function b(S){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(S)}}function S8(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(tc,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,st(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!We(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(b8,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,st(e,e.attempt(qn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function w8(e,t,n){const a=this;return st(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function k8(e){e.exit(this.containerState.type)}function j8(e,t,n){const a=this;return st(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!We(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const qS={name:"setextUnderline",resolveTo:C8,tokenize:E8};function C8(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function E8(e,t,n){const a=this;let l;return o;function o(h){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),l=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),We(h)?st(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||ze(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const N8={tokenize:_8};function _8(e){const t=this,n=e.attempt(tc,a,e.attempt(this.parser.constructs.flowInitial,l,st(e,e.attempt(this.parser.constructs.flow,l,e.attempt(O9,l)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const A8={resolveAll:OE()},T8=zE("string"),R8=zE("text");function zE(e){return{resolveAll:OE(e==="text"?z8:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,f);return c;function c(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),m}function m(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),m)}function h(y){if(y===null)return!0;const g=l[y];let b=-1;if(g)for(;++b<g.length;){const S=g[b];if(!S.previous||S.previous.call(a,a.previous))return!0}return!1}}}function OE(e){return t;function t(n,a){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,a):n}}function z8(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,c=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const O8={42:qn,43:qn,45:qn,48:qn,49:qn,50:qn,51:qn,52:qn,53:qn,54:qn,55:qn,56:qn,57:qn,62:CE},D8={91:U9},M8={[-2]:Cp,[-1]:Cp,32:Cp},L8={35:H9,42:Qd,45:[qS,Qd],60:G9,61:qS,95:Qd,96:$S,126:$S},I8={38:NE,92:EE},U8={[-5]:Ep,[-4]:Ep,[-3]:Ep,33:f8,38:NE,42:Mg,60:[m9,t8],91:m8,92:[F9,EE],93:qy,95:Mg,96:N9},P8={null:[Mg,A8]},B8={null:[42,95]},$8={null:[]},F8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:B8,contentInitial:D8,disable:$8,document:O8,flow:L8,flowInitial:M8,insideSpan:P8,string:I8,text:U8},Symbol.toStringTag,{value:"Module"}));function q8(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let c=[],f=[];const m={attempt:D(M),check:D(O),consume:A,enter:z,exit:I,interrupt:D(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:S,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(ne){return c=jr(c,ne),C(),c[c.length-1]!==null?[]:(U(t,0),h.events=Of(o,h.events,h),h.events)}function b(ne,X){return Z8(S(ne),X)}function S(ne){return H8(c,ne)}function k(){const{_bufferIndex:ne,_index:X,line:be,column:fe,offset:ie}=a;return{_bufferIndex:ne,_index:X,line:be,column:fe,offset:ie}}function j(ne){l[ne.line]=ne.column,H()}function C(){let ne;for(;a._index<c.length;){const X=c[a._index];if(typeof X=="string")for(ne=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ne&&a._bufferIndex<X.length;)E(X.charCodeAt(a._bufferIndex));else E(X)}}function E(ne){y=y(ne)}function A(ne){ze(ne)?(a.line++,a.column=1,a.offset+=ne===-3?2:1,H()):ne!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=ne}function z(ne,X){const be=X||{};return be.type=ne,be.start=k(),h.events.push(["enter",be,h]),f.push(be),be}function I(ne){const X=f.pop();return X.end=k(),h.events.push(["exit",X,h]),X}function M(ne,X){U(ne,X.from)}function O(ne,X){X.restore()}function D(ne,X){return be;function be(fe,ie,Z){let ae,K,he,T;return Array.isArray(fe)?$(fe):"tokenize"in fe?$([fe]):B(fe);function B(ue){return xe;function xe(Le){const Se=Le!==null&&ue[Le],Ct=Le!==null&&ue.null,te=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ct)?Ct:Ct?[Ct]:[]];return $(te)(Le)}}function $(ue){return ae=ue,K=0,ue.length===0?Z:_(ue[K])}function _(ue){return xe;function xe(Le){return T=W(),he=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?J():ue.tokenize.call(X?Object.assign(Object.create(h),X):h,m,F,J)(Le)}}function F(ue){return ne(he,T),ie}function J(ue){return T.restore(),++K<ae.length?_(ae[K]):Z}}}function U(ne,X){ne.resolveAll&&!o.includes(ne)&&o.push(ne),ne.resolve&&or(h.events,X,h.events.length-X,ne.resolve(h.events.slice(X),h)),ne.resolveTo&&(h.events=ne.resolveTo(h.events,h))}function W(){const ne=k(),X=h.previous,be=h.currentConstruct,fe=h.events.length,ie=Array.from(f);return{from:fe,restore:Z};function Z(){a=ne,h.previous=X,h.currentConstruct=be,h.events.length=fe,f=ie,H()}}function H(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function H8(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function Z8(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
360
+ `;break}case-3:{c=`\r
361
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function V8(e){const a={constructs:kE([F8,...(e||{}).extensions||[]]),content:l(s9),defined:[],document:l(u9),flow:l(N8),lazy:{},string:l(T8),text:l(R8)};return a;function l(o){return c;function c(f){return q8(a,o,f)}}}function Q8(e){for(;!_E(e););return e}const HS=/[\0\t\n\r]/g;function G8(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const m=[];let h,y,g,b,S;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(HS.lastIndex=g,h=HS.exec(o),b=h&&h.index!==void 0?h.index:o.length,S=o.charCodeAt(b),!h){t=o.slice(g);break}if(S===10&&g===b&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<b&&(m.push(o.slice(g,b)),e+=b-g),S){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}g=b+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const K8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Y8(e){return e.replace(K8,X8)}function X8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return jE(n.slice(o?2:1),o?16:10)}return Fy(n)||e}const DE={}.hasOwnProperty;function J8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),W8(n)(Q8(V8(n).document().write(G8()(e,t,!0))))}function W8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Da),autolinkProtocol:W,autolinkEmail:W,atxHeading:o(qt),blockQuote:o(Ct),characterEscape:W,characterReference:W,codeFenced:o(te),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(te,c),codeText:o(Te,c),codeTextData:W,data:W,codeFlowValue:W,definition:o(Ue),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Fe),hardBreakEscape:o(dn),hardBreakTrailing:o(dn),htmlFlow:o(Oa,c),htmlFlowData:W,htmlText:o(Oa,c),htmlTextData:W,image:o(Al),label:c,link:o(Da),listItem:o(ta),listItemValue:b,listOrdered:o(Ma,g),listUnordered:o(Ma),paragraph:o(oo),reference:_,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(qt),strong:o(uo),thematicBreak:o(co)},exit:{atxHeading:m(),atxHeadingSequence:M,autolink:m(),autolinkEmail:Se,autolinkProtocol:Le,blockQuote:m(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ue,characterReference:xe,codeFenced:m(C),codeFencedFence:j,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:H,codeIndented:m(E),codeText:m(ie),codeTextData:H,data:H,definition:m(),definitionDestinationString:I,definitionLabelString:A,definitionTitleString:z,emphasis:m(),hardBreakEscape:m(X),hardBreakTrailing:m(X),htmlFlow:m(be),htmlFlowData:H,htmlText:m(fe),htmlTextData:H,image:m(ae),label:he,labelText:K,lineEnding:ne,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:F,resourceDestinationString:T,resourceTitleString:B,resource:$,setextHeading:m(U),setextHeadingLineSequence:D,setextHeadingText:O,strong:m(),thematicBreak:m()}};ME(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(le){let ye={type:"root",children:[]};const Me={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:y,data:n},Pe=[];let rt=-1;for(;++rt<le.length;)if(le[rt][1].type==="listOrdered"||le[rt][1].type==="listUnordered")if(le[rt][0]==="enter")Pe.push(rt);else{const hn=Pe.pop();rt=l(le,hn,rt)}for(rt=-1;++rt<le.length;){const hn=t[le[rt][0]];DE.call(hn,le[rt][1].type)&&hn[le[rt][1].type].call(Object.assign({sliceSerialize:le[rt][2].sliceSerialize},Me),le[rt][1])}if(Me.tokenStack.length>0){const hn=Me.tokenStack[Me.tokenStack.length-1];(hn[1]||ZS).call(Me,void 0,hn[0])}for(ye.position={start:ui(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:ui(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)ye=t.transforms[rt](ye)||ye;return ye}function l(le,ye,Me){let Pe=ye-1,rt=-1,hn=!1,cr,tn,Ht,mn;for(;++Pe<=Me;){const dt=le[Pe];switch(dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dt[0]==="enter"?rt++:rt--,mn=void 0;break}case"lineEndingBlank":{dt[0]==="enter"&&(cr&&!mn&&!rt&&!Ht&&(Ht=Pe),mn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:mn=void 0}if(!rt&&dt[0]==="enter"&&dt[1].type==="listItemPrefix"||rt===-1&&dt[0]==="exit"&&(dt[1].type==="listUnordered"||dt[1].type==="listOrdered")){if(cr){let Tr=Pe;for(tn=void 0;Tr--;){const Mn=le[Tr];if(Mn[1].type==="lineEnding"||Mn[1].type==="lineEndingBlank"){if(Mn[0]==="exit")continue;tn&&(le[tn][1].type="lineEndingBlank",hn=!0),Mn[1].type="lineEnding",tn=Tr}else if(!(Mn[1].type==="linePrefix"||Mn[1].type==="blockQuotePrefix"||Mn[1].type==="blockQuotePrefixWhitespace"||Mn[1].type==="blockQuoteMarker"||Mn[1].type==="listItemIndent"))break}Ht&&(!tn||Ht<tn)&&(cr._spread=!0),cr.end=Object.assign({},tn?le[tn][1].start:dt[1].end),le.splice(tn||Pe,0,["exit",cr,dt[2]]),Pe++,Me++}if(dt[1].type==="listItemPrefix"){const Tr={type:"listItem",_spread:!1,start:Object.assign({},dt[1].start),end:void 0};cr=Tr,le.splice(Pe,0,["enter",Tr,dt[2]]),Pe++,Me++,Ht=void 0,mn=!0}}}return le[ye][1]._spread=hn,Me}function o(le,ye){return Me;function Me(Pe){f.call(this,le(Pe),Pe),ye&&ye.call(this,Pe)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(le,ye,Me){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ye,Me||void 0]),le.position={start:ui(ye.start),end:void 0}}function m(le){return ye;function ye(Me){le&&le.call(this,Me),h.call(this,Me)}}function h(le,ye){const Me=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==le.type&&(ye?ye.call(this,le,Pe[0]):(Pe[1]||ZS).call(this,le,Pe[0]));else throw new Error("Cannot close `"+le.type+"` ("+vu({start:le.start,end:le.end})+"): it’s not open");Me.position.end=ui(le.end)}function y(){return $y(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(le){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function S(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=le}function k(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=le}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/(\r?\n|\r)$/g,"")}function A(le){const ye=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ye,Me.identifier=Mr(this.sliceSerialize(le)).toLowerCase()}function z(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function I(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function M(le){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Me=this.sliceSerialize(le).length;ye.depth=Me}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function D(le){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function W(le){const Me=this.stack[this.stack.length-1].children;let Pe=Me[Me.length-1];(!Pe||Pe.type!=="text")&&(Pe=fn(),Pe.position={start:ui(le.start),end:void 0},Me.push(Pe)),this.stack.push(Pe)}function H(le){const ye=this.stack.pop();ye.value+=this.sliceSerialize(le),ye.position.end=ui(le.end)}function ne(le){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=ye.children[ye.children.length-1];Me.position.end=ui(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(W.call(this,le),H.call(this,le))}function X(){this.data.atHardBreak=!0}function be(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function fe(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function ie(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function Z(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function ae(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function K(le){const ye=this.sliceSerialize(le),Me=this.stack[this.stack.length-2];Me.label=Y8(ye),Me.identifier=Mr(ye).toLowerCase()}function he(){const le=this.stack[this.stack.length-1],ye=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Pe=le.children;Me.children=Pe}else Me.alt=ye}function T(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function B(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function $(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function F(le){const ye=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ye,Me.identifier=Mr(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function J(le){this.data.characterReferenceType=le.type}function ue(le){const ye=this.sliceSerialize(le),Me=this.data.characterReferenceType;let Pe;Me?(Pe=jE(ye,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=Fy(ye);const rt=this.stack[this.stack.length-1];rt.value+=Pe}function xe(le){const ye=this.stack.pop();ye.position.end=ui(le.end)}function Le(le){H.call(this,le);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(le)}function Se(le){H.call(this,le);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(le)}function Ct(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function Te(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Fe(){return{type:"emphasis",children:[]}}function qt(){return{type:"heading",depth:0,children:[]}}function dn(){return{type:"break"}}function Oa(){return{type:"html",value:""}}function Al(){return{type:"image",title:null,url:"",alt:null}}function Da(){return{type:"link",title:null,url:"",children:[]}}function Ma(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function ta(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function oo(){return{type:"paragraph",children:[]}}function uo(){return{type:"strong",children:[]}}function fn(){return{type:"text",value:""}}function co(){return{type:"thematicBreak"}}}function ui(e){return{line:e.line,column:e.column,offset:e.offset}}function ME(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?ME(e,a):eB(e,a)}}function eB(e,t){let n;for(n in t)if(DE.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function ZS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+vu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is still open")}function tB(e){const t=this;t.parser=n;function n(a){return J8(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function nB(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function rB(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
362
+ `}]}function aB(e,t){const n=t.value?t.value+`
363
+ `:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function iB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=so(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,f+=1,e.footnoteCounts.set(a,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function oB(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function LE(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function cB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return LE(e,t);const l={src:so(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function dB(e,t){const n={src:so(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function fB(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function hB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return LE(e,t);const l={href:so(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function mB(e,t){const n={href:so(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function pB(e,t,n){const a=e.all(t),l=n?gB(n):IE(t),o={},c=[];if(typeof t.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const y=a[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
364
+ `}),y.type==="element"&&y.tagName==="p"&&!l?c.push(...y.children):c.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
365
+ `});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function gB(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=IE(n[a])}return t}function IE(e){const t=e.spread;return t??e.children.length>1}function yB(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const c=a[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function vB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SB(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),l.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Iy(t.children[1]),m=gE(t.children[t.children.length-1]);f&&m&&(c.position={start:f,end:m}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function wB(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,f=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],b={},S=c?c[m]:void 0;S&&(b.align=S);let k={type:"element",tagName:o,properties:b,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),h.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,y),e.applyData(t,y)}function kB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const VS=9,QS=32;function jB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(GS(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(GS(t.slice(l),l>0,!1)),o.join("")}function GS(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===VS||o===QS;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===VS||o===QS;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function CB(e,t){const n={type:"text",value:jB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function EB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const NB={blockquote:nB,break:rB,code:aB,delete:iB,emphasis:lB,footnoteReference:sB,heading:oB,html:uB,imageReference:cB,image:dB,inlineCode:fB,linkReference:hB,link:mB,listItem:pB,list:yB,paragraph:vB,root:bB,strong:xB,table:SB,tableCell:kB,tableRow:wB,text:CB,thematicBreak:EB,toml:Od,yaml:Od,definition:Od,footnoteDefinition:Od};function Od(){}const UE=-1,Df=0,xu=1,uf=2,Hy=3,Zy=4,Vy=5,Qy=6,PE=7,BE=8,KS=typeof self=="object"?self:globalThis,_B=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case Df:case UE:return n(c,l);case xu:{const f=n([],l);for(const m of c)f.push(a(m));return f}case uf:{const f=n({},l);for(const[m,h]of c)f[a(m)]=a(h);return f}case Hy:return n(new Date(c),l);case Zy:{const{source:f,flags:m}=c;return n(new RegExp(f,m),l)}case Vy:{const f=n(new Map,l);for(const[m,h]of c)f.set(a(m),a(h));return f}case Qy:{const f=n(new Set,l);for(const m of c)f.add(a(m));return f}case PE:{const{name:f,message:m}=c;return n(new KS[f](m),l)}case BE:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return n(new DataView(f),c)}}return n(new KS[o](c),l)};return a},YS=e=>_B(new Map,e)(0),vs="",{toString:AB}={},{keys:TB}=Object,du=e=>{const t=typeof e;if(t!=="object"||!e)return[Df,t];const n=AB.call(e).slice(8,-1);switch(n){case"Array":return[xu,vs];case"Object":return[uf,vs];case"Date":return[Hy,vs];case"RegExp":return[Zy,vs];case"Map":return[Vy,vs];case"Set":return[Qy,vs];case"DataView":return[xu,n]}return n.includes("Array")?[xu,n]:n.includes("Error")?[PE,n]:[uf,n]},Dd=([e,t])=>e===Df&&(t==="function"||t==="symbol"),RB=(e,t,n,a)=>{const l=(c,f)=>{const m=a.push(c)-1;return n.set(f,m),m},o=c=>{if(n.has(c))return n.get(c);let[f,m]=du(c);switch(f){case Df:{let y=c;switch(m){case"bigint":f=BE,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([UE],c)}return l([f,y],c)}case xu:{if(m){let b=c;return m==="DataView"?b=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(c)),l([m,[...b]],c)}const y=[],g=l([f,y],c);for(const b of c)y.push(o(b));return g}case uf:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const y=[],g=l([f,y],c);for(const b of TB(c))(e||!Dd(du(c[b])))&&y.push([o(b),o(c[b])]);return g}case Hy:return l([f,c.toISOString()],c);case Zy:{const{source:y,flags:g}=c;return l([f,{source:y,flags:g}],c)}case Vy:{const y=[],g=l([f,y],c);for(const[b,S]of c)(e||!(Dd(du(b))||Dd(du(S))))&&y.push([o(b),o(S)]);return g}case Qy:{const y=[],g=l([f,y],c);for(const b of c)(e||!Dd(du(b)))&&y.push(o(b));return g}}const{message:h}=c;return l([f,{name:m,message:h}],c)};return o},XS=(e,{json:t,lossy:n}={})=>{const a=[];return RB(!(t||n),!!t,new Map,a)(e),a},cf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?YS(XS(e,t)):structuredClone(e):(e,t)=>YS(XS(e,t));function zB(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function OB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function DB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||zB,a=e.options.footnoteBackLabel||OB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const y=e.all(h),g=String(h.identifier).toUpperCase(),b=so(g.toLowerCase());let S=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++S<=j;){k.length>0&&k.push({type:"text",value:" "});let A=typeof n=="string"?n:n(m,S);typeof A=="string"&&(A={type:"text",value:A}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,S),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const C=y[y.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const A=C.children[C.children.length-1];A&&A.type==="text"?A.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(h,E),f.push(E)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...cf(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
366
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
367
+ `}]}}const Mf=(function(e){if(e==null)return UB;if(typeof e=="function")return Lf(e);if(typeof e=="object")return Array.isArray(e)?MB(e):LB(e);if(typeof e=="string")return IB(e);throw new Error("Expected function, string, or object as test")});function MB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Mf(e[n]);return Lf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function LB(e){const t=e;return Lf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function IB(e){return Lf(t);function t(n){return n&&n.type===e}}function Lf(e){return t;function t(n,a,l){return!!(PB(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function UB(){return!0}function PB(e){return e!==null&&typeof e=="object"&&"type"in e}const $E=[],BB=!0,Lg=!1,$B="skip";function FE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=Mf(l),c=a?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const S=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(S?"<"+S+">":""))+")"})}return b;function b(){let S=$E,k,j,C;if((!t||o(m,h,y[y.length-1]||void 0))&&(S=FB(n(m,y)),S[0]===Lg))return S;if("children"in m&&m.children){const E=m;if(E.children&&S[0]!==$B)for(j=(a?E.children.length:-1)+c,C=y.concat(E);j>-1&&j<E.children.length;){const A=E.children[j];if(k=f(A,j,C)(),k[0]===Lg)return k;j=typeof k[1]=="number"?k[1]:j+c}}return S}}}function FB(e){return Array.isArray(e)?e:typeof e=="number"?[BB,e]:e==null?$E:[e]}function Gy(e,t,n,a){let l,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,l=n):(o=t,c=n,l=a),FE(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return c(m,g,y)}}const Ig={}.hasOwnProperty,qB={};function HB(e,t){const n=t||qB,a=new Map,l=new Map,o=new Map,c={...NB,...n.handlers},f={all:h,applyData:VB,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:ZB,wrap:GB};return Gy(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?a:l,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),f;function m(y,g){const b=y.type,S=f.handlers[b];if(Ig.call(f.handlers,b)&&S)return S(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...C}=y,E=cf(C);return E.children=f.all(y),E}return cf(y)}return(f.options.unknownHandler||QB)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let S=-1;for(;++S<b.length;){const k=f.one(b[S],y);if(k){if(S&&b[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=JS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=JS(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function ZB(e,t){e.position&&(t.position=OP(e))}function VB(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,cf(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function QB(e,t){const n=t.data||{},a="value"in t&&!(Ig.call(n,"hProperties")||Ig.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function GB(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
368
+ `});++a<e.length;)a&&n.push({type:"text",value:`
369
+ `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
370
+ `}),n}function JS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function WS(e,t){const n=HB(e,t),a=n.one(e,void 0),l=DB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
371
+ `},l),o}function KB(e,t){return e&&"run"in e?async function(n,a){const l=WS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return WS(n,{file:a,...e||t})}}function ew(e){if(e)throw e}var Np,tw;function YB(){if(tw)return Np;tw=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},c=function(h,y){n&&y.name==="__proto__"?n(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(a)return a(h,y).value}else return;return h[y]};return Np=function m(){var h,y,g,b,S,k,j=arguments[0],C=1,E=arguments.length,A=!1;for(typeof j=="boolean"&&(A=j,j=arguments[1]||{},C=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});C<E;++C)if(h=arguments[C],h!=null)for(y in h)g=f(j,y),b=f(h,y),j!==b&&(A&&b&&(o(b)||(S=l(b)))?(S?(S=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},c(j,{name:y,newValue:m(A,k,b)})):typeof b<"u"&&c(j,{name:y,newValue:b}));return j},Np}var XB=YB();const _p=ff(XB);function Ug(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function JB(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){c(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?WB(y,f)(...h):c(null,...h)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function WB(e,t){let n;return a;function a(...c){const f=e.length>c.length;let m;f&&c.push(l);try{m=e.apply(this,c)}catch(h){const y=h;if(f&&n)throw y;return l(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(c,...f){n||(n=!0,t(c,...f))}function o(c){l(null,c)}}const Fr={basename:e$,dirname:t$,extname:n$,join:r$,sep:"/"};function e$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nc(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function t$(e){if(nc(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function n$(e){nc(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function r$(...e){let t=-1,n;for(;++t<e.length;)nc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":a$(n)}function a$(e){nc(e);const t=e.codePointAt(0)===47;let n=i$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function i$(e,t){let n="",a=0,l=-1,o=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else f===46&&o>-1?o++:o=-1}return n}function nc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const l$={cwd:s$};function s$(){return"/"}function Pg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function o$(e){if(typeof e=="string")e=new URL(e);else if(!Pg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return u$(e)}function u$(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Ap=["history","path","basename","stem","extname","dirname"];class qE{constructor(t){let n;t?Pg(t)?n={path:t}:typeof t=="string"||c$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":l$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Ap.length;){const o=Ap[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)Ap.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Fr.basename(this.path):void 0}set basename(t){Rp(t,"basename"),Tp(t,"basename"),this.path=Fr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Fr.dirname(this.path):void 0}set dirname(t){nw(this.basename,"dirname"),this.path=Fr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Fr.extname(this.path):void 0}set extname(t){if(Tp(t,"extname"),nw(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Fr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Pg(t)&&(t=o$(t)),Rp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Fr.basename(this.path,this.extname):void 0}set stem(t){Rp(t,"stem"),Tp(t,"stem"),this.path=Fr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new An(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Tp(e,t){if(e&&e.includes(Fr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Fr.sep+"`")}function Rp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function c$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const d$=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),f$={}.hasOwnProperty;class Ky extends d${constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=JB()}copy(){const t=new Ky;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(_p(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Dp("data",this.frozen),this.namespace[t]=n,this):f$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Dp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Md(t),a=this.parser||this.Parser;return zp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),zp("process",this.parser||this.Parser),Op("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const f=Md(t),m=a.parse(f);a.run(m,f,function(y,g,b){if(y||!g||!b)return h(y);const S=g,k=a.stringify(S,b);p$(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?c(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),zp("processSync",this.parser||this.Parser),Op("processSync",this.compiler||this.Compiler),this.process(t,l),aw("processSync","process",n),a;function l(o,c){n=!0,ew(o),a=c}}run(t,n,a){rw(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,f){const m=Md(n);l.run(t,m,h);function h(y,g,b){const S=g||t;y?f(y):c?c(S):a(void 0,S,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),aw("runSync","run",a),l;function o(c,f){ew(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=Md(n),l=this.compiler||this.Compiler;return Op("stringify",l),rw(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Dp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;m(y,g)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(l.settings=_p(!0,l.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,y){let g=-1,b=-1;for(;++g<a.length;)if(a[g][0]===h){b=g;break}if(b===-1)a.push([h,...y]);else if(y.length>0){let[S,...k]=y;const j=a[b][1];Ug(j)&&Ug(S)&&(S=_p(!0,j,S)),a[b]=[h,S,...k]}}}}const h$=new Ky().freeze();function zp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Op(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Dp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rw(e){if(!Ug(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function aw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Md(e){return m$(e)?e:new qE(e)}function m$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function p$(e){return typeof e=="string"||g$(e)}function g$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const y$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",iw=[],lw={allowDangerousHtml:!0},v$=/^(https?|ircs?|mailto|xmpp)$/i,b$=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function x$(e){const t=S$(e),n=w$(e);return k$(t.runSync(t.parse(n),n),e)}function S$(e){const t=e.rehypePlugins||iw,n=e.remarkPlugins||iw,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lw}:lw;return h$().use(tB).use(n).use(KB,a).use(t)}function w$(e){const t=e.children||"",n=new qE;return typeof t=="string"&&(n.value=t),n}function k$(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||j$;for(const y of b$)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+y$+y.id,void 0);return Gy(e,h),UP(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return c?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let S;for(S in jp)if(Object.hasOwn(jp,S)&&Object.hasOwn(y.properties,S)){const k=y.properties[S],j=jp[S];(j===null||j.includes(y.tagName))&&(y.properties[S]=m(String(k||""),S,y))}}if(y.type==="element"){let S=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!S&&a&&typeof g=="number"&&(S=!a(y,g,b)),S&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function j$(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||v$.test(e.slice(0,t))?e:""}function C$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function HE(e,t,n){const l=Mf((n||{}).ignore||[]),o=E$(t);let c=-1;for(;++c<o.length;)FE(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const S=y[g],k=b?b.children:void 0;if(l(S,k?k.indexOf(S):void 0,b))return;b=S}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[c][0],S=o[c][1];let k=0;const C=g.children.indexOf(h);let E=!1,A=[];b.lastIndex=0;let z=b.exec(h.value);for(;z;){const I=z.index,M={index:z.index,input:z.input,stack:[...y,h]};let O=S(...z,M);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?b.lastIndex=I+1:(k!==I&&A.push({type:"text",value:h.value.slice(k,I)}),Array.isArray(O)?A.push(...O):O&&A.push(O),k=I+z[0].length,E=!0),!b.global)break;z=b.exec(h.value)}return E?(k<h.value.length&&A.push({type:"text",value:h.value.slice(k)}),g.children.splice(C,1,...A)):A=[h],C+A.length}}function E$(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([N$(l[0]),_$(l[1])])}return t}function N$(e){return typeof e=="string"?new RegExp(C$(e),"g"):e}function _$(e){return typeof e=="function"?e:function(){return e}}function A$(e){HE(e,[/\r?\n|\r/g,T$])}function T$(){return{type:"break"}}function R$(){return function(e){A$(e)}}function sw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}const Mp="phrasing",Lp=["autolink","link","image","label"];function z$(){return{transforms:[P$],enter:{literalAutolink:D$,literalAutolinkEmail:Ip,literalAutolinkHttp:Ip,literalAutolinkWww:Ip},exit:{literalAutolink:U$,literalAutolinkEmail:I$,literalAutolinkHttp:M$,literalAutolinkWww:L$}}}function O$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Lp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Lp},{character:":",before:"[ps]",after:"\\/",inConstruct:Mp,notInConstruct:Lp}]}}function D$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ip(e){this.config.enter.autolinkProtocol.call(this,e)}function M$(e){this.config.exit.autolinkProtocol.call(this,e)}function L$(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function I$(e){this.config.exit.autolinkEmail.call(this,e)}function U$(e){this.exit(e)}function P$(e){HE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,B$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),$$]],{ignore:["link","linkReference"]})}function B$(e,t,n,a,l){let o="";if(!ZE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!F$(n)))return!1;const c=q$(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function $$(e,t,n,a){return!ZE(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function F$(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function q$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=sw(e,"(");let o=sw(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function ZE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||wl(n)||zf(n))&&(!t||n!==47)}VE.peek=J$;function H$(){this.buffer()}function Z$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function V$(){this.buffer()}function Q$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function G$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function K$(e){this.exit(e)}function Y$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function X$(e){this.exit(e)}function J$(){return"["}function VE(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),c(),o+=l.move("]"),o}function W$(){return{enter:{gfmFootnoteCallString:H$,gfmFootnoteCall:Z$,gfmFootnoteDefinitionLabelString:V$,gfmFootnoteDefinition:Q$},exit:{gfmFootnoteCallString:G$,gfmFootnoteCall:K$,gfmFootnoteDefinitionLabelString:Y$,gfmFootnoteDefinition:X$}}}function eF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:VE},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const f=o.createTracker(c);let m=f.move("[^");const h=o.enter("footnoteDefinition"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),y(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
372
+ `:" ")+o.indentLines(o.containerFlow(a,f.current()),t?QE:tF))),h(),m}}function tF(e,t,n){return t===0?e:QE(e,t,n)}function QE(e,t,n){return(n?"":" ")+e}const nF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];GE.peek=sF;function rF(){return{canContainEols:["delete"],enter:{strikethrough:iF},exit:{strikethrough:lF}}}function aF(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nF}],handlers:{delete:GE}}}function iF(e){this.enter({type:"delete",children:[]},e)}function lF(e){this.exit(e)}function GE(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function sF(){return"~"}function oF(e){return e.length}function uF(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||oF,o=[],c=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],C=[];let E=-1;for(e[y].length>h&&(h=e[y].length);++E<e[y].length;){const A=cF(e[y][E]);if(n.alignDelimiters!==!1){const z=l(A);C[E]=z,(m[E]===void 0||z>m[E])&&(m[E]=z)}j.push(A)}c[y]=j,f[y]=C}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=ow(a[g]);else{const j=ow(a);for(;++g<h;)o[g]=j}g=-1;const b=[],S=[];for(;++g<h;){const j=o[g];let C="",E="";j===99?(C=":",E=":"):j===108?C=":":j===114&&(E=":");let A=n.alignDelimiters===!1?1:Math.max(1,m[g]-C.length-E.length);const z=C+"-".repeat(A)+E;n.alignDelimiters!==!1&&(A=C.length+A+E.length,A>m[g]&&(m[g]=A),S[g]=A),b[g]=z}c.splice(1,0,b),f.splice(1,0,S),y=-1;const k=[];for(;++y<c.length;){const j=c[y],C=f[y];g=-1;const E=[];for(;++g<h;){const A=j[g]||"";let z="",I="";if(n.alignDelimiters!==!1){const M=m[g]-(C[g]||0),O=o[g];O===114?z=" ".repeat(M):O===99?M%2?(z=" ".repeat(M/2+.5),I=" ".repeat(M/2-.5)):(z=" ".repeat(M/2),I=z):I=" ".repeat(M)}n.delimiterStart!==!1&&!g&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||g)&&E.push(" "),n.alignDelimiters!==!1&&E.push(z),E.push(A),n.alignDelimiters!==!1&&E.push(I),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&E.push("|")}k.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
373
+ `)}function cF(e){return e==null?"":String(e)}function ow(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function dF(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),fF);return l(),c}function fF(e,t,n){return">"+(n?"":" ")+e}function hF(e,t){return uw(e,t.inConstruct,!0)&&!uw(e,t.notInConstruct,!1)}function uw(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function cw(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
374
+ `&&hF(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
375
+ `}function mF(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>c&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function pF(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function gF(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function yF(e,t,n,a){const l=gF(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(pF(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,vF);return g(),b}const f=n.createTracker(a),m=l.repeat(Math.max(mF(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${c}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
376
+ `,encode:["`"],...f.current()})),g()}return y+=f.move(`
377
+ `),o&&(y+=f.move(o+`
378
+ `)),y+=f.move(m),h(),y}function vF(e,t,n){return(n?"":" ")+e}function Yy(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function bF(e,t,n,a){const l=Yy(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("definition");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
379
+ `,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),c(),h}function xF(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ou(e){return"&#x"+e.toString(16).toUpperCase()+";"}function df(e,t,n){const a=Ys(e),l=Ys(t);return a===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}KE.peek=SF;function KE(e,t,n,a){const l=xF(n),o=n.enter("emphasis"),c=n.createTracker(a),f=c.move(l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=df(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Ou(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=df(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+Ou(g));const S=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+S}function SF(e,t,n){return n.options.emphasis||"*"}function wF(e,t){let n=!1;return Gy(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Lg}),!!((!e.depth||e.depth<3)&&$y(e)&&(t.options.setext||n))}function kF(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(wF(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
380
+ `,after:`
381
+ `});return g(),y(),b+`
382
+ `+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
383
+ `))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
384
+ `,...o.current()});return/^[\t ]/.test(h)&&(h=Ou(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),f(),h}YE.peek=jF;function YE(e){return e.value||""}function jF(){return"<"}XE.peek=CF;function XE(e,t,n,a){const l=Yy(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),c(),h}function CF(){return"!"}JE.peek=EF;function JE(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function EF(){return"!"}WE.peek=NF;function WE(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],f=n.compilePattern(c);let m;if(c.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return l+a+l}function NF(){return"`"}function eN(e,t){const n=$y(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}tN.peek=_F;function tN(e,t,n,a){const l=Yy(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,m;if(eN(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=c.move(" "+l),h+=c.move(n.safe(e.title,{before:h,after:l,...c.current()})),h+=c.move(l),m()),h+=c.move(")"),f(),h}function _F(e,t,n){return eN(e,n)?"<":"["}nN.peek=AF;function nN(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function AF(){return"["}function Xy(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function TF(e){const t=Xy(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function RF(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function rN(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function zF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?RF(n):Xy(n);const f=e.ordered?c==="."?")":".":TF(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),rN(n)===c&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=f),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,l(),h}function OF(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function DF(e,t,n,a){const l=OF(n);let o=n.bulletCurrent||Xy(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(c-o.length)),f.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,b,S){return b?(S?"":" ".repeat(c))+g:(S?o:o+" ".repeat(c-o.length))+g}}function MF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const LF=Mf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function IF(e,t,n,a){return(e.children.some(function(c){return LF(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function UF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aN.peek=PF;function aN(e,t,n,a){const l=UF(n),o=n.enter("strong"),c=n.createTracker(a),f=c.move(l+l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=df(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Ou(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=df(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+Ou(g));const S=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+S}function PF(e,t,n){return n.options.strong||"*"}function BF(e,t,n,a){return n.safe(e.value,a)}function $F(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function FF(e,t,n){const a=(rN(n)+(n.options.ruleSpaces?" ":"")).repeat($F(n));return n.options.ruleSpaces?a.slice(0,-1):a}const iN={blockquote:dF,break:cw,code:yF,definition:bF,emphasis:KE,hardBreak:cw,heading:kF,html:YE,image:XE,imageReference:JE,inlineCode:WE,link:tN,linkReference:nN,list:zF,listItem:DF,paragraph:MF,root:IF,strong:aN,text:BF,thematicBreak:FF};function qF(){return{enter:{table:HF,tableData:dw,tableHeader:dw,tableRow:VF},exit:{codeText:QF,table:ZF,tableData:Up,tableHeader:Up,tableRow:Up}}}function HF(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function ZF(e){this.exit(e),this.data.inTable=void 0}function VF(e){this.enter({type:"tableRow",children:[]},e)}function Up(e){this.exit(e)}function dw(e){this.enter({type:"tableCell",children:[]},e)}function QF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,GF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function GF(e,t){return t==="|"?t:e}function KF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
385
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:c,tableCell:m,tableRow:f}};function c(S,k,j,C){return h(y(S,j,C),S.align)}function f(S,k,j,C){const E=g(S,j,C),A=h([E]);return A.slice(0,A.indexOf(`
386
+ `))}function m(S,k,j,C){const E=j.enter("tableCell"),A=j.enter("phrasing"),z=j.containerPhrasing(S,{...C,before:o,after:o});return A(),E(),z}function h(S,k){return uF(S,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(S,k,j){const C=S.children;let E=-1;const A=[],z=k.enter("table");for(;++E<C.length;)A[E]=g(C[E],k,j);return z(),A}function g(S,k,j){const C=S.children;let E=-1;const A=[],z=k.enter("tableRow");for(;++E<C.length;)A[E]=m(C[E],S,k,j);return z(),A}function b(S,k,j){let C=iN.inlineCode(S,k,j);return j.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function YF(){return{exit:{taskListCheckValueChecked:fw,taskListCheckValueUnchecked:fw,paragraph:JF}}}function XF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:WF}}}function fw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function JF(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){c=f;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function WF(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(c);let m=iN.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+c}}function eq(){return[z$(),W$(),rF(),qF(),YF()]}function tq(e){return{extensions:[O$(),eF(e),aF(),KF(e),XF()]}}const nq={tokenize:oq,partial:!0},lN={tokenize:uq,partial:!0},sN={tokenize:cq,partial:!0},oN={tokenize:dq,partial:!0},rq={tokenize:fq,partial:!0},uN={name:"wwwAutolink",tokenize:lq,previous:dN},cN={name:"protocolAutolink",tokenize:sq,previous:fN},za={name:"emailAutolink",tokenize:iq,previous:hN},ea={};function aq(){return{text:ea}}let al=48;for(;al<123;)ea[al]=za,al++,al===58?al=65:al===91&&(al=97);ea[43]=za;ea[45]=za;ea[46]=za;ea[95]=za;ea[72]=[za,cN];ea[104]=[za,cN];ea[87]=[za,uN];ea[119]=[za,uN];function iq(e,t,n){const a=this;let l,o;return c;function c(g){return!Bg(g)||!hN.call(a,a.previous)||Jy(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Bg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(rq,y,h)(g):g===45||g===95||_n(g)?(o=!0,e.consume(g),m):y(g)}function h(g){return e.consume(g),l=!0,m}function y(g){return o&&l&&On(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function lq(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!dN.call(a,a.previous)||Jy(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(nq,e.attempt(lN,e.attempt(sN,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function sq(e,t,n){const a=this;let l="",o=!1;return c;function c(g){return(g===72||g===104)&&fN.call(a,a.previous)&&!Jy(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(On(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(g),m}return n(g)}function m(g){return g===47?(e.consume(g),o?h:(o=!0,m)):n(g)}function h(g){return g===null||of(g)||kt(g)||wl(g)||zf(g)?n(g):e.attempt(lN,e.attempt(sN,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function oq(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function uq(e,t,n){let a,l,o;return c;function c(h){return h===46||h===95?e.check(oN,m,f)(h):h===null||kt(h)||wl(h)||h!==45&&zf(h)?m(h):(o=!0,e.consume(h),c)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),c}function m(h){return l||a||!o?n(h):t(h)}}function cq(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(oN,t,o)(c):c===null||kt(c)||wl(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function dq(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||kt(f)||wl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||kt(f)||wl(f)?t(f):a(f)}function o(f){return On(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):On(f)?(e.consume(f),c):n(f)}}function fq(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return _n(o)?n(o):t(o)}}function dN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||kt(e)}function fN(e){return!On(e)}function hN(e){return!(e===47||Bg(e))}function Bg(e){return e===43||e===45||e===46||e===95||_n(e)}function Jy(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const hq={tokenize:Sq,partial:!0};function mq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:vq,continuation:{tokenize:bq},exit:xq}},text:{91:{name:"gfmFootnoteCall",tokenize:yq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:pq,resolveTo:gq}}}}function pq(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!c||!c._balanced)return n(m);const h=Mr(a.sliceSerialize({start:c.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function gq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function yq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!c||g===null||g===91||kt(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Mr(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return kt(g)||(c=!0),o++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function vq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):n(k)}function y(k){if(c>999||k===93&&!f||k===null||k===91||kt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Mr(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return kt(k)||(f=!0),c++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),c++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),st(e,S,"gfmFootnoteDefinitionWhitespace")):n(k)}function S(k){return t(k)}}function bq(e,t,n){return e.check(tc,t,e.attempt(hq,t,n))}function xq(e){e.exit("gfmFootnoteDefinition")}function Sq(e,t,n){const a=this;return st(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function wq(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},b=[["enter",y,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",g,f]],S=f.parser.constructs.insideSpan.null;S&&or(b,b.length,0,Of(S,c.slice(h+1,m),f)),or(b,b.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",y,f]]),or(c,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,f,m){const h=this.previous,y=this.events;let g=0;return b;function b(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(c.enter("strikethroughSequenceTemporary"),S(k))}function S(k){const j=Ys(h);if(k===126)return g>1?m(k):(c.consume(k),g++,S);if(g<2&&!n)return m(k);const C=c.exit("strikethroughSequenceTemporary"),E=Ys(k);return C._open=!E||E===2&&!!j,C._close=!j||j===2&&!!E,f(k)}}}class kq{constructor(){this.map=[]}add(t,n,a){jq(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function jq(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function Cq(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function Eq(){return{flow:{null:{name:"table",tokenize:Nq,resolveAll:_q}}}}function Nq(e,t,n){const a=this;let l=0,o=0,c;return f;function f(H){let ne=a.events.length-1;for(;ne>-1;){const fe=a.events[ne][1].type;if(fe==="lineEnding"||fe==="linePrefix")ne--;else break}const X=ne>-1?a.events[ne][1].type:null,be=X==="tableHead"||X==="tableRow"?O:m;return be===O&&a.parser.lazy[a.now().line]?n(H):be(H)}function m(H){return e.enter("tableHead"),e.enter("tableRow"),h(H)}function h(H){return H===124||(c=!0,o+=1),y(H)}function y(H){return H===null?n(H):ze(H)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),S):n(H):We(H)?st(e,y,"whitespace")(H):(o+=1,c&&(c=!1,l+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g(H)))}function g(H){return H===null||H===124||kt(H)?(e.exit("data"),y(H)):(e.consume(H),H===92?b:g)}function b(H){return H===92||H===124?(e.consume(H),g):g(H)}function S(H){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(H):(e.enter("tableDelimiterRow"),c=!1,We(H)?st(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):k(H))}function k(H){return H===45||H===58?C(H):H===124?(c=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),j):M(H)}function j(H){return We(H)?st(e,C,"whitespace")(H):C(H)}function C(H){return H===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),E):H===45?(o+=1,E(H)):H===null||ze(H)?I(H):M(H)}function E(H){return H===45?(e.enter("tableDelimiterFiller"),A(H)):M(H)}function A(H){return H===45?(e.consume(H),A):H===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),z):(e.exit("tableDelimiterFiller"),z(H))}function z(H){return We(H)?st(e,I,"whitespace")(H):I(H)}function I(H){return H===124?k(H):H===null||ze(H)?!c||l!==o?M(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):M(H)}function M(H){return n(H)}function O(H){return e.enter("tableRow"),D(H)}function D(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),D):H===null||ze(H)?(e.exit("tableRow"),t(H)):We(H)?st(e,D,"whitespace")(H):(e.enter("data"),U(H))}function U(H){return H===null||H===124||kt(H)?(e.exit("data"),D(H)):(e.consume(H),H===92?W:U)}function W(H){return H===92||H===124?(e.consume(H),U):U(H)}}function _q(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,y,g;const b=new kq;for(;++n<e.length;){const S=e[n],k=S[1];S[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(hw(b,t,m,h,y),y=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",y,t]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=Ld(b,t,o,l,void 0,g),o=[0,0,0,0]),c[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=Ld(b,t,o,l,void 0,g)),o=c,c=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],g=Ld(b,t,o,l,n,g)):c[1]!==0&&(g=Ld(b,t,c,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&hw(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const S=t.events[n];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=Cq(t.events,n))}return e}function Ld(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ws(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ws(t.events,n[1]);if(o={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ws(t.events,n[2]),y=ws(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const b=t.events[n[2]],S=t.events[n[3]];if(b[1].end=Object.assign({},S[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return l!==void 0&&(o.end=Object.assign({},ws(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function hw(e,t,n,a,l){const o=[],c=ws(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function ws(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const Aq={name:"tasklistCheck",tokenize:Rq};function Tq(){return{text:{91:Aq}}}function Rq(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return kt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return ze(m)?t(m):We(m)?e.check({tokenize:zq},t,n)(m):n(m)}}function zq(e,t,n){return st(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function Oq(e){return kE([aq(),mq(),wq(e),Eq(),Tq()])}const Dq={};function Mq(e){const t=this,n=e||Dq,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(Oq(n)),o.push(eq()),c.push(tq(n))}function mN({children:e,className:t}){return u.jsx("div",{className:_e("prose prose-sm max-w-none leading-[1.55] text-[color:inherit]","prose-headings:text-current prose-p:text-current prose-li:text-current prose-strong:text-current prose-em:text-current prose-blockquote:text-current","prose-p:my-2 prose-headings:mt-3 prose-headings:mb-1.5 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 prose-pre:my-2 prose-blockquote:my-2 prose-hr:my-3","prose-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:u.jsx(x$,{remarkPlugins:[Mq,R$],children:e})})}function Lq({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,c]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),u.jsxs(ln,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["System prompt append",m&&u.jsx(Iq,{})]}),!o&&!l&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[u.jsx(Qu,{className:"h-3 w-3"})," Edit"]})]}),u.jsx(Wr,{children:o?u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),c(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{size:"xs",variant:"ghost",onClick:()=>{a(),c(!1)},disabled:!m,children:"Revert"}),u.jsx(me,{size:"xs",onClick:()=>c(!1),children:"Done"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):u.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?u.jsx(mN,{children:e}):u.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function Iq(){return u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})}const pN={"claude-code":"Claude Code",codex:"Codex"},Uq=[rf.CLAUDE_CODE,rf.CODEX];function Pq({open:e,onOpenChange:t,agent:n}){const a=kn(),l=n.clientId,o=n.runtimeProvider,[c,f]=x.useState(l),[m,h]=x.useState(o),[y,g]=x.useState(!1),S=qe({queryKey:["clients-rebind"],queryFn:Ni,enabled:e}).data??[],k=wA({queries:S.map(U=>({queryKey:["client-capabilities",U.id],queryFn:()=>Kk(U.id),enabled:e}))}),j=x.useMemo(()=>{const U=new Map;return k.forEach((W,H)=>{const ne=S[H];if(!ne)return;const X=W.data;X!=null&&X.capabilities&&U.set(ne.id,X.capabilities)}),U},[k,S]);x.useEffect(()=>{e||(f(l),h(o),g(!1))},[e,l,o]);const C=c?j.get(c)??null:null,E=(C==null?void 0:C[m])??null,A=!E||E.state==="missing"||E.state==="error",z=!!c&&(c!==l||m!==o)&&(!A||y),I=m!==o,M=c!==l,O=bt({mutationFn:()=>{if(!c)throw new Error("clientId required");return LD(n.uuid,{clientId:c,runtimeProvider:m,force:A&&y?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),D=O.error instanceof Vu||O.error instanceof Error?O.error.message:null;return u.jsx(zt,{open:e,onOpenChange:t,children:u.jsxs(Tt,{className:"max-w-lg",children:[u.jsx($t,{children:u.jsx(Ot,{children:"Re-bind agent"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["Currently:"," ",u.jsx("span",{className:"mono",children:$q(l,S,o)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Computer"}),u.jsx("select",{value:c??"",onChange:U=>f(U.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:S.map(U=>u.jsx("option",{value:U.id,children:Bq(U)},U.id))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Runtime"}),u.jsx("div",{className:"space-y-2",children:Uq.map(U=>{const W=(C==null?void 0:C[U])??null,H=!!W&&W.state!=="missing",ne=m===U;return u.jsxs("label",{className:ne?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":H?"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30":"flex items-start gap-3 rounded-md border border-border p-3 opacity-60",children:[u.jsx("input",{type:"radio",name:"rebind-runtime",checked:ne,onChange:()=>h(U),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:pN[U]}),u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:qq(W,U)})]})]},U)})})]}),(M||I)&&u.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-caption space-y-1",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:"Heads up:"})," active sessions on the previous computer are suspended at re-bind. Chat history is preserved."]}),I&&u.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),A&&u.jsxs("label",{className:"flex items-start gap-2 text-caption",style:{color:"var(--fg-2)"},children:[u.jsx("input",{type:"checkbox",checked:y,onChange:U=>g(U.target.checked),className:"mt-0.5"}),u.jsx("span",{children:"Override capability check — pick this if the destination computer is offline or the SDK was just installed and capabilities haven't refreshed yet."})]}),D&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:D})]}),u.jsxs(en,{children:[u.jsx(me,{variant:"outline",onClick:()=>t(!1),disabled:O.isPending,children:"Cancel"}),u.jsx(me,{onClick:()=>O.mutate(),disabled:!z||O.isPending,children:O.isPending?"Re-binding…":"Re-bind"})]})]})})}function Bq(e){return`${e.hostname??e.id} · ${e.status}`}function $q(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${pN[n]}`}const Fq={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function qq(e,t){if(!e)return"Not reported on this computer.";switch(e.state){case"ok":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, authenticated.`;case"unauthenticated":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, not authenticated. ${Fq[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const Hq={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function Zq(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return u.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 backdrop-blur",style:{padding:"var(--sp-3) var(--sp-6)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderTop:"var(--hairline) solid var(--border)"},children:u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx(Kr,{state:"blocked",size:8}),u.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),u.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>u.jsx("button",{type:"button",onClick:()=>e.onJumpTo(n),className:"text-caption transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",cursor:"pointer"},children:Hq[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&u.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[u.jsx(Yr,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),u.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&u.jsx(me,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(me,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),u.jsx(me,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(LR,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function Su(e){return`agent-cfg-${e}`}function fu({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:c}){return u.jsxs("section",{id:e,className:_e("space-y-3",o),...c,children:[u.jsxs("div",{className:"flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),u.jsx("div",{className:"space-y-3",children:l})]})}function Vq(){return u.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const Qq={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Re-bind via the agent's settings to switch computer or runtime."},codex:{name:"Codex",caption:"OpenAI's Codex CLI runtime. Re-bind via the agent's settings to switch computer or runtime."}};function Gq(e){const t=Qq[e.runtimeProvider];return u.jsxs("div",{className:"space-y-3",children:[u.jsx(Kq,{name:t.name,caption:t.caption,locked:!0}),u.jsx(Yq,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function Kq({name:e,caption:t,locked:n}){return u.jsxs(ln,{children:[u.jsx(_r,{children:u.jsxs(Ar,{children:["Where it runs",n&&u.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(Rk,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),u.jsxs(Wr,{className:"space-y-1 text-body",children:[u.jsxs("div",{className:"inline-flex items-center gap-2",children:[u.jsx(zk,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),u.jsx("span",{className:"font-medium",children:e})]}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function Yq(e){const t=!!e.computerLabel;return u.jsxs(ln,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[u.jsx(pg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onRebind,children:[u.jsx(pg,{className:"h-3 w-3"}),"Re-bind"]})]}),u.jsx(Wr,{className:"text-body",children:t?u.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"No computer bound. A computer claims this agent on its first WebSocket connect, or you can pick one manually via the button above."})})]})}function Xq(e){return e.isUnclaimed?"Saving: configuration stored; will apply when a computer claims this agent.":e.isOffline?"Saving: configuration stored; will apply when the computer reconnects.":e.activeSessions>0?`Saving: new chats use this immediately; ${e.activeSessions} active chat${e.activeSessions===1?"":"s"} switch on their next message.`:"Saving: new chats use this immediately."}function Jq(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function Wq(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Pp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function mw(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:Wq(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Bp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],c=new Set(o.map(h=>h.key)),f=Jq(n,c),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:mw(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:mw(f)}}),remove:a=>t(l=>{const c=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:c}}),undo:a=>t(l=>{const c=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:c}})}}function e7(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Pp(e.payload.mcpServers,"mcp"),env:Pp(e.payload.env,"env"),git:Pp(e.payload.gitRepos,"git")}}function t7(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(e7(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",c=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const z=[],I=U=>U.reduce((W,H)=>H.status==="unchanged"?W:W+1,0),M=I(a.mcp),O=I(a.env),D=I(a.git);return c&&z.push("prompt"),f&&z.push("model"),M>0&&z.push("mcp"),O>0&&z.push("env"),D>0&&z.push("git"),{anyDirty:z.length>0,dirtySections:z,counts:{prompt:c?1:0,model:f?1:0,mcp:M,env:O,git:D}}},[a,c,f]),h=x.useCallback(z=>{n(I=>I&&z(I))},[]),y=x.useCallback(z=>h(I=>({...I,promptAppend:z})),[h]),g=x.useCallback(()=>h(z=>({...z,promptAppend:l})),[h,l]),b=x.useCallback(z=>h(I=>({...I,model:z})),[h]),S=x.useCallback(()=>h(z=>({...z,model:o})),[h,o]),k=x.useMemo(()=>Bp("mcp",h),[h]),j=x.useMemo(()=>Bp("env",h),[h]),C=x.useMemo(()=>Bp("git",h),[h]),E=x.useCallback(()=>{n(null)},[]),A=x.useCallback(()=>{if(!t||!e)return{};const z={};c&&(z.prompt={append:t.promptAppend}),f&&(z.model=t.model);const I=m.counts.mcp>0,M=m.counts.env>0,O=m.counts.git>0;return I&&(z.mcpServers=t.mcp.filter(D=>D.status!=="deleted").map(D=>D.value)),M&&(z.env=t.env.filter(D=>D.status!=="deleted").map(D=>{const U=D.value;return U.sensitive&&U.value===af?{key:U.key,value:af,sensitive:!0}:U})),O&&(z.gitRepos=t.git.filter(D=>D.status!=="deleted").map(D=>D.value)),z},[t,e,c,f,m]);return{draft:a,summary:m,promptDirty:c,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:S,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:C.add,updateGit:C.update,deleteGit:C.remove,undoDeleteGit:C.undo,resetAll:E,buildPayloadPatch:A}}const En={overview:"ad-overview",setup:"ad-setup",prompt:Su("prompt"),tools:Su("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function n7(e){const t=[{key:"overview",label:"Profile",anchor:En.overview}];return e||t.push({key:"setup",label:"Setup",anchor:En.setup},{key:"prompt",label:"Prompt",anchor:En.prompt},{key:"tools",label:"Tools",anchor:En.tools},{key:"advanced",label:"Advanced",anchor:En.advanced}),t.push({key:"danger",label:"Danger zone",anchor:En.danger,divider:!0,danger:!0}),t}function r7(){var mn,dt,Tr,Mn,rc,Li,Ii,Ui,Ir,Pi,La,ac;const t=gk().uuid??"",n=cn(),a=kn(),l=qe({queryKey:["agent",t],queryFn:()=>Kj(t),enabled:!!t}),o=qe({queryKey:["agent-config",t],queryFn:()=>OU(t),enabled:!!t&&((mn=l.data)==null?void 0:mn.type)!=="human"}),c=qe({queryKey:["agent-client-status",t],queryFn:()=>LU(t),enabled:!!t&&((dt=l.data)==null?void 0:dt.type)!=="human"}),f=qe({queryKey:["agent-sessions-active",t],queryFn:()=>to(t,{state:"active"}),enabled:!!t&&((Tr=l.data)==null?void 0:Tr.type)!=="human"}),m=qe({queryKey:["clients"],queryFn:Ni,enabled:!!t&&((Mn=l.data)==null?void 0:Mn.type)!=="human",refetchInterval:3e4}),h=t7(o.data),[y,g]=x.useState(null),[b,S]=x.useState(null),[k,j]=x.useState(!1),C=bt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const ve=h.buildPayloadPatch();return DU(t,{expectedVersion:o.data.version,payload:ve})},onSuccess:ve=>{a.setQueryData(["agent-config",t],ve),g(null),S(null),j(!0)},onError:ve=>{if(j(!1),ve instanceof Vu&&ve.status===409){S("Someone else saved a newer version while you were editing."),g(null);return}g(ve instanceof Error?ve.message:String(ve))}});x.useEffect(()=>{if(!k)return;const ve=setTimeout(()=>j(!1),2500);return()=>clearTimeout(ve)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const E=x.useCallback(()=>{S(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),A=x.useCallback(ve=>{const Ye=document.getElementById(ve);Ye&&Ye.scrollIntoView({behavior:"smooth",block:"start"})},[]),z=bt({mutationFn:ve=>V1(t,ve),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),I=bt({mutationFn:()=>UD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),M=bt({mutationFn:()=>PD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),O=bt({mutationFn:()=>ID(t),onSuccess:()=>n("/agents")}),D=bt({mutationFn:()=>BD(t)}),[U,W]=x.useState(!1),[H,ne]=x.useState(""),[X,be]=x.useState(null),[fe,ie]=x.useState(!1),Z=qe({queryKey:["clients"],queryFn:Ni,enabled:U}),ae=bt({mutationFn:ve=>V1(t,{clientId:ve}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),W(!1),ne(""),be(null)},onError:ve=>be(ve instanceof Error?ve.message:String(ve))}),[K,he]=x.useState(!1),[T,B]=x.useState(null),$=bt({mutationFn:()=>MU(t,h.buildPayloadPatch()),onSuccess:ve=>{const Ye=ve.diff.length?ve.diff.map(pn=>`${pn.op} ${pn.path}`).join(`
387
+ `):"(no changes)";B(Ye)},onError:ve=>B(`Dry run failed: ${ve instanceof Error?ve.message:String(ve)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const ve=Ye=>{Ye.preventDefault(),Ye.returnValue=""};return window.addEventListener("beforeunload",ve),()=>window.removeEventListener("beforeunload",ve)},[h.summary.anyDirty]);const _=((rc=l.data)==null?void 0:rc.type)==="human",F=x.useMemo(()=>n7(_),[_]),J=x.useRef(null),[ue,xe]=x.useState(!1);x.useEffect(()=>{if(_)return;const ve=J.current;if(!ve||typeof IntersectionObserver>"u")return;const Ye=new IntersectionObserver(pn=>{const na=pn[0];na&&xe(!na.isIntersecting&&na.boundingClientRect.top<0)},{threshold:0});return Ye.observe(ve),()=>Ye.disconnect()},[_]);const[Le,Se]=x.useState(En.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const ve=[];for(const Ye of F){const pn=document.getElementById(Ye.anchor);if(!pn)continue;const na=new IntersectionObserver(fo=>{for(const ic of fo)ic.isIntersecting&&Se(Ye.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});na.observe(pn),ve.push(na)}return()=>{for(const Ye of ve)Ye.disconnect()}},[F]);const Ct=x.useMemo(()=>{const ve=new Set;for(const Ye of h.summary.dirtySections)Ye==="prompt"&&ve.add(En.prompt),Ye==="model"&&ve.add(En.setup),Ye==="mcp"&&ve.add(En.tools),(Ye==="env"||Ye==="git")&&ve.add(En.advanced);return ve},[h.summary.dirtySections]);if(l.isLoading)return u.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:u.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return u.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const te=l.data;if(!te)return u.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const Te=te.type==="human",Ue=c.data,Fe=((Li=f.data)==null?void 0:Li.length)??0,qt=!Te&&!(Ue!=null&&Ue.clientId),dn=!Te&&Ue?!Ue.online&&!!Ue.clientId:!1,Oa=te,Al=Oa.runtimeState??null,Da=Oa.runtimeType??null,Ma=Oa.totalSessions??null,ta=te.uuid.slice(0,8),oo=Xq({activeSessions:Fe,isUnclaimed:qt,isOffline:dn}),uo=h.draft.mcp.filter(ve=>ve.status!=="deleted"),fn=h.draft.env.filter(ve=>ve.status!=="deleted"),co=h.draft.git.filter(ve=>ve.status!=="deleted"),le=ve=>new Set(uo.filter(Ye=>Ye.key!==ve).map(Ye=>Ye.value.name.toLowerCase())),ye=ve=>new Set(fn.filter(Ye=>Ye.key!==ve).map(Ye=>Ye.value.key)),Me=ve=>new Set(co.filter(Ye=>Ye.key!==ve).map(Ye=>{const{value:pn}=Ye;return pn.localPath?pn.localPath:((pn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Pe={sessions:Ma??"—",active:Fe,runtime:Da??(Te?"human":"—"),model:((Ui=(Ii=o.data)==null?void 0:Ii.payload.model)==null?void 0:Ui.trim())||"—"},rt=(Ue==null?void 0:Ue.clientId)??null,hn=rt?((Ir=m.data)==null?void 0:Ir.find(ve=>ve.id===rt))??null:null,cr=rt?(hn==null?void 0:hn.hostname)??rt:null,tn=te.runtimeProvider??"claude-code",Ht=tn==="codex"?"Codex":"Claude Code";return u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:220,borderRight:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",padding:"var(--sp-3) 0"},children:[u.jsx(Ju,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),F.map(ve=>u.jsxs("div",{children:[ve.divider&&u.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),u.jsx(a7,{label:ve.label,active:Le===ve.anchor,danger:ve.danger??!1,dirty:Ct.has(ve.anchor),onClick:()=>A(ve.anchor)})]},ve.key))]}),u.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[u.jsxs(IU,{style:{marginBottom:"var(--sp-2)"},children:[u.jsx(UU,{onClick:()=>n("/agents"),children:"Agents"}),u.jsx(PU,{}),u.jsx(BU,{mono:!0,children:te.name??ta})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"inline-flex items-center justify-center",style:{width:36,height:36,borderRadius:"var(--radius-panel)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:u.jsx(vl,{width:18,height:20,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-title",title:`agt_${ta}`,children:te.displayName}),u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",te.name??ta]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[u.jsx(Sn,{tone:te.type==="autonomous_agent"?"accent":"neutral",children:te.type}),te.visibility&&u.jsx(Sn,{tone:te.visibility==="organization"?"accent":"outline",children:te.visibility}),(Ue==null?void 0:Ue.offlineSince)&&u.jsxs("span",{className:"mono",children:["offline since ",Ei(Ue.offlineSince)]})]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(Ks,{state:Al}),u.jsxs(me,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${te.uuid}`),children:[u.jsx(oy,{className:"h-3 w-3"})," Open chat"]}),!Te&&te.status==="active"&&u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>{D.reset(),D.mutate()},disabled:D.isPending,children:[u.jsx(zk,{className:"h-3 w-3"}),D.isPending?"Testing…":"Test"]})]})]}),u.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[u.jsx(zd,{label:"sessions",value:Pe.sessions}),u.jsx(zd,{label:"active",value:Pe.active,accent:typeof Pe.active=="number"&&Pe.active>0?"var(--accent)":void 0}),u.jsx(zd,{label:"runtime",value:Pe.runtime}),u.jsx(zd,{label:"model",value:Pe.model})]})]}),u.jsx("div",{ref:J,"aria-hidden":!0,style:{height:0}}),!Te&&u.jsx(FU,{runtimeLabel:Ht,computerLabel:cr,visible:ue}),u.jsxs("div",{className:"mx-auto",style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)",maxWidth:960,display:"flex",flexDirection:"column",gap:20},children:[(D.data||D.error)&&u.jsx(c7,{result:D.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>D.reset()}),u.jsx(fu,{anchorId:En.overview,title:"Profile",right:u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>n(`/settings?agent=${te.uuid}`),title:"Manage platform bindings in Settings",children:[u.jsx(pg,{className:"h-3 w-3"}),"Manage bindings"]}),children:u.jsx(XU,{agent:te,onSave:async ve=>{await z.mutateAsync(ve)}})}),!Te&&u.jsxs(u.Fragment,{children:[u.jsxs(fu,{anchorId:En.setup,title:"Setup",caption:((Pi=o.data)==null?void 0:Pi.version)!=null?u.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&u.jsxs(u.Fragment,{children:[" · ",u.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&u.jsx(Gq,{runtimeProvider:tn,computerLabel:cr,canBindComputer:qt&&te.status==="active",bindComputerPending:ae.isPending,onBindComputer:()=>W(!0),onRebind:te.clientId?()=>ie(!0):void 0,modelSlot:u.jsx(oP,{value:h.draft.model,baseline:((La=o.data)==null?void 0:La.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:te.status!=="active",provider:tn})})]}),u.jsx(fu,{anchorId:En.prompt,title:"Prompt",children:o.data?u.jsx(Lq,{value:h.draft.promptAppend,baseline:((ac=o.data)==null?void 0:ac.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:te.status!=="active"}):null}),u.jsx(fu,{anchorId:En.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?u.jsx(eP,{items:h.draft.mcp,otherNames:le,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:te.status!=="active"}):null}),u.jsx(fu,{anchorId:En.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{id:Su("env"),children:u.jsx(QU,{items:h.draft.env,otherKeys:ye,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:te.status!=="active"})}),u.jsx("div",{id:Su("git"),children:u.jsx(KU,{items:h.draft.git,otherPaths:Me,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:te.status!=="active"})}),T&&u.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:"var(--sp-2)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:T}),h.summary.anyDirty&&u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:u.jsx("button",{type:"button",onClick:()=>$.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:$.isPending,children:$.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),u.jsx(Vq,{}),u.jsx(qU,{agent:te,suspendPending:I.isPending,reactivatePending:M.isPending,deletePending:O.isPending,onSuspend:()=>I.mutate(),onReactivate:()=>M.mutate(),onDelete:()=>O.mutate()})]}),!Te&&u.jsx(Zq,{summary:h.summary,saveHint:oo,conflictMessage:b,errorMessage:y,saving:C.isPending,justSaved:k,onSave:()=>C.mutate(),onDiscard:()=>{h.summary.anyDirty&&he(!0)},onReloadRemote:E,onJumpTo:ve=>A(Su(ve))})]}),u.jsx(i7,{open:K,onOpenChange:he,title:"Discard unsaved changes?",description:"Your edits to Prompt / Model / Tools / Advanced will be reverted to the last saved baseline.",confirmLabel:"Discard changes",destructive:!0,onConfirm:()=>{h.resetAll(),g(null),S(null),he(!1)}}),u.jsx(zt,{open:U,onOpenChange:ve=>{W(ve),ve||(ne(""),be(null),ae.reset())},children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:"Bind computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick a computer you own to pin this agent to. The bind is one-shot — once set, moving the agent requires deleting and re-creating it on the target computer."}),Z.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):Z.error?u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",Z.error instanceof Error?Z.error.message:"Unknown"]}):u.jsx(l7,{clients:Z.data??[],selected:H,onSelect:ne}),X&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:X})]}),u.jsxs(en,{children:[u.jsx(me,{variant:"outline",onClick:()=>W(!1),children:"Cancel"}),u.jsx(me,{disabled:!H||ae.isPending,onClick:()=>{be(null),ae.mutate(H)},children:ae.isPending?"Binding…":"Bind"})]})]})}),u.jsx(Pq,{open:fe,onOpenChange:ie,agent:te})]})}function a7({label:e,active:t,danger:n,dirty:a,onClick:l}){return u.jsx("button",{type:"button",onClick:l,className:_e("block w-full text-left bg-transparent text-body transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t?"":"hover:bg-accent"),style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",border:"none",borderLeft:`var(--hairline-bold) solid ${t?"var(--accent)":"transparent"}`,background:t?"var(--bg-active)":"transparent",color:t?"var(--fg)":"var(--fg-3)",fontWeight:t?500:400},children:u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"flex-1 truncate",children:e}),a&&u.jsx("span",{role:"img","aria-label":"unsaved changes",style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-blocked)",flexShrink:0}}),n&&!a&&u.jsx("span",{"aria-hidden":!0,style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-error)",flexShrink:0}})]})})}function i7(e){return u.jsx(zt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function l7({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?u.jsxs("div",{className:"text-body",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:"var(--sp-2_5) var(--sp-3)",color:"var(--fg-3)"},children:["No connected computers available. Run"," ",u.jsx("code",{className:"mono text-label",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):u.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",margin:0,padding:0,listStyle:"none"},children:a.map(l=>{const o=l.id===t,c=l.status==="online"||l.status==="active";return u.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("button",{type:"button",onClick:()=>n(l.id),className:_e("w-full text-left flex items-center gap-3"),style:{padding:"var(--sp-2) var(--sp-3)",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[u.jsx("span",{className:_e("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:c?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),u.jsxs("span",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),u.jsxs("span",{className:"block mono truncate text-caption",style:{color:"var(--fg-4)"},children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const s7={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},o7={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},u7={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function c7({result:e,onDismiss:t}){const n=o7[e.status],a=u7[e.status],l=e.connection;return u.jsx("div",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderLeft:`var(--sp-0_75) solid ${n}`,borderRadius:"var(--radius-panel)",padding:"var(--sp-3) var(--sp-3_5)"},children:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Sn,{tone:a,children:s7[e.status]}),e.responseTime!=null&&u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[u.jsx("div",{children:l.runtimeState&&u.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?u.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):u.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&u.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&u.jsx("p",{className:"mono whitespace-pre-wrap text-label",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:8,maxHeight:160,overflow:"auto"},children:e.responseContent})]}),u.jsx(me,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function d7(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function f7({agent:e,open:t,onClose:n,onBound:a}){var g;const[l,o]=x.useState(!1),c=qe({queryKey:["connect-token",e.uuid],queryFn:()=>Yk(),enabled:t,staleTime:6e4}),f=qe({queryKey:["agent-poll",e.uuid],queryFn:()=>Kj(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});x.useEffect(()=>{const b=f.data;b!=null&&b.clientId&&a(b)},[f.data,a]);const m=((g=c.data)==null?void 0:g.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${d7(e.name)} --agent-id ${e.uuid} && `+m:m;function y(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return u.jsx(zt,{open:t,onOpenChange:b=>!b&&n(),children:u.jsxs(Tt,{className:"max-w-lg",children:[u.jsx($t,{children:u.jsx(Ot,{children:"Last step — connect your computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[u.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),u.jsx(me,{variant:"outline",size:"icon",className:"shrink-0",onClick:y,disabled:!h,children:l?u.jsx(Yr,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):u.jsx(sy,{className:"h-4 w-4"})})]}),u.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[u.jsx(Kr,{state:"working",size:8}),u.jsx("span",{children:"Waiting for your computer to connect…"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),u.jsx(en,{children:u.jsx(me,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const $p=200;function h7(e){if(!e||e.length===0)return{};const t={},n=["name","displayName","clientId"];for(const a of e){const l=a.path[0];if(typeof l=="string"&&n.includes(l)){const o=l;t[o]||(t[o]=a.message)}else t._root=a.message}return t}function pw(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,Cs)}function m7(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,Cs)}function p7(e){switch(e){case"taken":return"That agent name is already in use in this organization. Pick a different one.";case"reserved":return"That agent name is reserved — pick a different one.";case"invalid":return"Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_)."}}function g7({open:e,onOpenChange:t,onCreated:n}){const a=kn(),[l,o]=x.useState(""),[c,f]=x.useState(""),[m,h]=x.useState(!1),[y,g]=x.useState("claude-code"),[b,S]=x.useState("form"),[k,j]=x.useState([]),[C,E]=x.useState(null),[A,z]=x.useState(!1),[I,M]=x.useState({}),[O,D]=x.useState({status:"idle"});x.useEffect(()=>{e&&(o(""),f(""),h(!1),g("claude-code"),S("form"),j([]),E(null),z(!1),M({}),D({status:"idle"}))},[e]),x.useEffect(()=>{m||f(pw(l))},[l,m]);const U=x.useRef(0);x.useEffect(()=>{if(!e||!c){D({status:"idle"});return}if(!Ng.test(c)){D({status:"bad",reason:"invalid"});return}if(_g(c)){D({status:"bad",reason:"reserved"});return}const K=++U.current;D({status:"checking"});const he=window.setTimeout(()=>{MD(c).then(T=>{K===U.current&&(T.available?D({status:"ok"}):D({status:"bad",reason:T.reason}))}).catch(()=>{K===U.current&&D({status:"idle"})})},300);return()=>window.clearTimeout(he)},[c,e]);const W=bt({mutationFn:async K=>{const he=l.trim()||c.trim()||"Untitled assistant";return DD({name:c||void 0,type:"personal_assistant",displayName:he,clientId:K.clientId,runtimeProvider:y})},onSuccess:K=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),n(K,y)}}),H=x.useMemo(()=>{const K=W.error;if(!K)return{};if(K instanceof Vu){const he=h7(K.issues);return Object.keys(he).length>0?he:K.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:K.message}}return K instanceof Error?{_root:K.message}:{}},[W.error]),ne=O.status==="bad"?p7(O.reason):void 0,X={...ne?{name:ne}:{},...H,...I};function be(){const K={};return c?c.length>Cs?K.name=`Agent name must be at most ${Cs} characters (got ${c.length}).`:Ng.test(c)?_g(c)&&(K.name="That agent name is reserved — pick a different one."):K.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":l.trim().length>0&&(K.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),l.length>$p&&(K.displayName=`Display name must be at most ${$p} characters (got ${l.length}).`),K}async function fe(K){var T,B;K.preventDefault();const he=be();if(M(he),!(Object.keys(he).length>0)&&O.status!=="bad"){z(!0);try{const _=(await Ni()).filter(J=>J.status==="connected");if(_.length===0){W.mutate({clientId:void 0});return}if(_.length===1){W.mutate({clientId:(T=_[0])==null?void 0:T.id});return}const F=[..._].sort((J,ue)=>ue.lastSeenAt.localeCompare(J.lastSeenAt));j(F),E(((B=F[0])==null?void 0:B.id)??null),S("pick-computer")}catch{W.mutate({clientId:void 0})}finally{z(!1)}}}function ie(){C&&W.mutate({clientId:C})}const Z=O.status==="bad",ae=l.trim().length>0&&!Z&&!W.isPending&&!A;return b==="pick-computer"?u.jsx(zt,{open:e,onOpenChange:t,children:u.jsxs(Tt,{className:"max-w-lg",children:[u.jsx($t,{children:u.jsx(Ot,{children:"Choose a computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",u.jsx("span",{className:"font-medium",children:l||c})," ","should run:"]}),u.jsx("div",{className:"space-y-2",children:k.map(K=>{const he=C===K.id;return u.jsxs("label",{className:he?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"target-computer",checked:he,onChange:()=>E(K.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body font-medium truncate",children:K.hostname??K.id}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:[K.os??"unknown OS"," · last seen ",new Date(K.lastSeenAt).toLocaleString()]})]})]},K.id)})}),X.clientId&&u.jsx("p",{className:"text-body text-destructive",children:X.clientId}),X._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:X._root})]}),u.jsxs(en,{children:[u.jsx(me,{variant:"outline",onClick:()=>S("form"),disabled:W.isPending,children:"Back"}),u.jsx(me,{onClick:ie,disabled:!C||W.isPending,children:W.isPending?"Creating…":"Create"})]})]})}):u.jsx(zt,{open:e,onOpenChange:t,children:u.jsxs(Tt,{className:"max-w-lg",children:[u.jsx($t,{children:u.jsx(Ot,{children:"New Agent"})}),u.jsxs("form",{onSubmit:fe,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"new-agent-display-name",children:"Display name"}),u.jsx(xt,{id:"new-agent-display-name",value:l,onChange:K=>{o(K.target.value),I.displayName&&M(he=>({...he,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:$p,"aria-invalid":X.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),u.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"How teammates see this agent in chats and lists. Can be changed anytime."}),X.displayName&&u.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:X.displayName})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"new-agent-name",children:"Agent name"}),u.jsxs("div",{className:"flex items-stretch",children:[u.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center px-2 font-mono text-body text-muted-foreground border border-r-0 border-input rounded-l-[var(--radius-input)] bg-muted/40",children:"@"}),u.jsx(xt,{id:"new-agent-name",value:c,onChange:K=>{const he=m7(K.target.value);f(he),h(!0),I.name&&M(T=>({...T,name:void 0}))},onBlur:K=>{const he=pw(K.target.value);he!==c&&f(he)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:Cs,"aria-invalid":X.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),u.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Used in @mentions and CLI commands. Lowercase letters, digits, hyphens (-), and underscores (_). Up to"," ",Cs," characters. Permanent after creation."]}),c&&!X.name&&O.status!=="idle"&&u.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:O.status==="ok"?"var(--state-idle)":O.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[O.status==="checking"&&"Checking availability…",O.status==="ok"&&"Available."]}),X.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:X.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:y==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:y==="claude-code",onChange:()=>g("claude-code"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),u.jsx("div",{className:"text-caption text-muted-foreground",children:"Anthropic's Claude Code on the bound computer. (default)"})]})]}),u.jsxs("label",{className:y==="codex"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:y==="codex",onChange:()=>g("codex"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Codex"}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:["OpenAI Codex CLI on the bound computer. Run ",u.jsx("code",{children:"codex login"})," on the host once."]})]})]})]})]}),X._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:X._root}),u.jsx(en,{children:u.jsx(me,{type:"submit",disabled:!ae,children:A?"Checking computers…":W.isPending?"Creating…":"Create"})})]})]})})}function gu({active:e,count:t,warn:n,className:a,children:l,style:o,...c}){return u.jsxs("button",{type:"button",className:_e("mono inline-flex items-center gap-1 text-caption leading-[1.6]",a),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...c,children:[l,t!==void 0&&u.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const y7=Object.values(f6);function gw(e){return[...e].sort((t,n)=>{const a=(t.displayName||t.name||"").toLowerCase(),l=(n.displayName||n.name||"").toLowerCase();return a.localeCompare(l)})}function v7(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null}}function bs(e,t,n){var l;let a=0;for(const o of e)((l=t.get(o.uuid))==null?void 0:l.runtimeState)===n&&a++;return a}function b7(){const e=cn(),{memberId:t}=Qt(),[n,a]=x.useState(),[l,o]=x.useState(""),[c,f]=x.useState(!1),[m,h]=x.useState(null),[y,g]=x.useState("all"),[b,S]=x.useState(""),k=El(),j=yy(),C=Oy(),{data:E,isLoading:A,error:z}=qe({queryKey:["agents",n,l],queryFn:()=>Xu({limit:100,cursor:n,type:l||void 0})}),{data:I}=qe({queryKey:["activity"],queryFn:Gu,refetchInterval:1e4}),M=x.useMemo(()=>{const K=new Map;for(const he of(I==null?void 0:I.agents)??[])K.set(he.agentId,he);return K},[I==null?void 0:I.agents]),{myAgents:O,teamAgents:D}=x.useMemo(()=>{if(!(E!=null&&E.items))return{myAgents:[],teamAgents:[]};const K=[],he=[];for(const T of E.items)t&&T.managerId===t?K.push(T):he.push(T);return{myAgents:gw(K),teamAgents:gw(he)}},[E,t]),U=(E==null?void 0:E.items.length)??0,W=O.length,H=D.length,ne=x.useMemo(()=>((E==null?void 0:E.items)??[]).filter(K=>{var he;return((he=M.get(K.uuid))==null?void 0:he.runtimeState)==="working"}).length,[E==null?void 0:E.items,M]),X=x.useMemo(()=>((E==null?void 0:E.items)??[]).filter(K=>{var T;const he=(T=M.get(K.uuid))==null?void 0:T.runtimeState;return he==="blocked"||he==="error"}).length,[E==null?void 0:E.items,M]);function be(K){var T;const he=(T=M.get(K.uuid))==null?void 0:T.runtimeState;return y==="mine"?t!=null&&K.managerId===t:y==="running"?he==="working":y==="attn"?he==="blocked"||he==="error":!0}function fe(K){if(!b.trim())return!0;const he=b.toLowerCase(),T=K.delegateMention?k(K.delegateMention):"",B=C(K.managerId);return(K.name??"").toLowerCase().includes(he)||K.displayName.toLowerCase().includes(he)||T.toLowerCase().includes(he)||B.toLowerCase().includes(he)}const ie=O.filter(K=>be(K)&&fe(K)),Z=D.filter(K=>be(K)&&fe(K));function ae(K,he){if(f(!1),K.clientId){e(`/?a=${K.uuid}`);return}if(he==="claude-code"||he==="codex"){h(K);return}e(`/?a=${K.uuid}`)}return u.jsxs("div",{className:"-m-6",children:[u.jsx(Rf,{title:"Agents",subtitle:U>0?u.jsxs(u.Fragment,{children:[U," total · ",W," mine · ",H," team"]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(me,{size:"xs",onClick:()=>f(!0),children:[u.jsx(Xr,{className:"h-3 w-3"}),"New agent"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsxs("div",{className:"flex items-center gap-2.5 mb-3.5",style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("div",{className:"relative",style:{width:240},children:[u.jsx(vf,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),u.jsx("input",{value:b,onChange:K=>S(K.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2_5) var(--sp-1_25) var(--sp-7)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx(gu,{active:y==="all",count:U,onClick:()=>g("all"),children:"all"}),u.jsx(gu,{active:y==="mine",count:W,onClick:()=>g("mine"),children:"mine"}),u.jsx(gu,{active:y==="running",count:ne,onClick:()=>g("running"),children:"running"}),u.jsx(gu,{active:y==="attn",count:X,warn:!0,onClick:()=>g("attn"),children:"attn"})]}),u.jsx("div",{style:{flex:1}}),u.jsxs("select",{value:l,onChange:K=>{o(K.target.value),a(void 0)},className:"outline-none text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"},children:[u.jsx("option",{value:"",children:"all types"}),y7.map(K=>u.jsx("option",{value:K,children:K},K))]})]}),A?u.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):z?u.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",z instanceof Error?z.message:"Unknown error"]}):u.jsxs(u.Fragment,{children:[u.jsx(yw,{title:`My agents · ${ie.length}`,agents:ie,runtimeMap:M,resolveAgentIdentity:j,resolveMemberName:C,navigate:e,showOwner:!1,emptyLabel:O.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:u.jsx(vw,{items:[{state:"working",count:bs(O,M,"working")},{state:"blocked",count:bs(O,M,"blocked")},{state:"error",count:bs(O,M,"error")}]}),className:"mb-4"}),D.length>0&&u.jsx(yw,{title:`Team agents · ${Z.length}`,agents:Z,runtimeMap:M,resolveAgentIdentity:j,resolveMemberName:C,navigate:e,showOwner:!0,emptyLabel:"No agents match the current filter",breakdown:u.jsx(vw,{items:[{state:"working",count:bs(D,M,"working")},{state:"blocked",count:bs(D,M,"blocked")},{state:"error",count:bs(D,M,"error")}]})})]}),(E==null?void 0:E.nextCursor)&&u.jsx("div",{className:"flex justify-end mt-4",children:u.jsx(me,{variant:"outline",size:"xs",onClick:()=>a(E.nextCursor??void 0),children:"Next page"})})]}),u.jsx(g7,{open:c,onOpenChange:f,onCreated:ae}),m&&u.jsx(f7,{agent:m,open:m!==null,onClose:()=>{const K=m.uuid;h(null),e(`/?a=${K}`)},onBound:K=>{h(null),e(`/?a=${K.uuid}`)}})]})}function yw({title:e,agents:t,runtimeMap:n,resolveAgentIdentity:a,resolveMemberName:l,navigate:o,emptyLabel:c,breakdown:f,className:m,showOwner:h}){return u.jsxs(ln,{className:m,children:[u.jsx(Gs,{right:f,children:e}),t.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:c}):u.jsxs(bl,{children:[u.jsx(xl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Display name"}),u.jsx($e,{children:"Agent name"}),u.jsx($e,{children:"Type"}),u.jsx($e,{children:"Delegate"}),h&&u.jsx($e,{children:"Owner"}),u.jsx($e,{children:"Runtime"}),u.jsx($e,{children:"Status"}),u.jsx($e,{children:"Created"})]})}),u.jsx(Sl,{children:t.map(y=>u.jsx(x7,{agent:y,runtime:v7(y,n),resolveAgentIdentity:a,resolveMemberName:l,navigate:o,showOwner:h},y.uuid))})]})]})}function vw({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:u.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>u.jsxs("span",{className:"inline-flex items-center",children:[a>0&&u.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),u.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[u.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function x7({agent:e,runtime:t,resolveAgentIdentity:n,resolveMemberName:a,navigate:l,showOwner:o}){const{runtimeState:c}=t,f=c==="idle"||c==="working"||c==="blocked"||c==="error"||c==="offline",m=e.delegateMention?n(e.delegateMention):null;return u.jsxs(sr,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"font-medium",children:e.displayName})}),u.jsx(Ie,{children:e.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",e.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Ie,{children:u.jsx(Sn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),u.jsx(Ie,{children:e.delegateMention?u.jsx(oE,{name:(m==null?void 0:m.name)??null,displayName:(m==null?void 0:m.displayName)??null,tone:"accent"}):u.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),o&&u.jsx(Ie,{className:"text-label",style:{color:"var(--fg-2)"},children:a(e.managerId)}),u.jsx(Ie,{children:c&&f?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(Kr,{state:c,size:7}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:c})]}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Ie,{children:u.jsx(Sn,{tone:e.status==="active"?"accent":"outline",children:e.status})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(e.createdAt)})]})}function S7(){const{data:e}=qe({queryKey:["members","user-name-map"],queryFn:zy,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}const w7=3e3,k7=1200;function j7({open:e,onOpenChange:t}){const n=kn(),{user:a}=Qt(),[l,o]=x.useState("loading"),[c,f]=x.useState(null),[m,h]=x.useState(null),[y,g]=x.useState(null),b=x.useRef(new Set);return x.useEffect(()=>{if(!e){o("loading"),f(null),h(null),g(null),b.current=new Set;return}let S=!1;const k=(n.getQueryData(["clients"])??[]).map(j=>j.id);return b.current=new Set(k),(async()=>{try{const j=await Yk();if(S)return;f(j),o("waiting")}catch(j){if(S)return;h(j instanceof Error?j.message:"Failed to generate connect token"),o("error")}})(),()=>{S=!0}},[e,n]),x.useEffect(()=>{if(!e||l!=="waiting"||!a)return;const k=setInterval(async()=>{try{const j=await n.fetchQuery({queryKey:["clients"],queryFn:Ni}),C=b.current,E=j.find(A=>!C.has(A.id)&&A.status==="connected"&&A.userId===a.id);E&&(g(E.hostname??null),o("success"))}catch{}},w7);return()=>clearInterval(k)},[e,l,n,a]),x.useEffect(()=>{if(l!=="success")return;const S=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},k7);return()=>clearTimeout(S)},[l,t,n]),u.jsx(zt,{open:e,onOpenChange:t,children:u.jsxs(Tt,{children:[u.jsxs($t,{children:[u.jsx(Ot,{children:"Connect a new computer"}),u.jsx(Yu,{children:"Run this command on the machine you want to pair with this Hub."})]}),u.jsx(nC,{command:(c==null?void 0:c.command)??null,expiresInSeconds:c==null?void 0:c.expiresIn,phase:l,successContent:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold",children:y??"Computer"})," connected. Closing…"]}),errorContent:m}),u.jsx("div",{className:"flex justify-end",style:{gap:"var(--sp-2)"},children:u.jsx(me,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function C7(){const e=kn(),t=El(),n=S7(),{role:a}=Qt(),l=a==="admin",[o,c]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(null),[S,k]=x.useState(!1),{data:j}=qe({queryKey:["clients"],queryFn:Ni,refetchInterval:1e4}),{data:C}=qe({queryKey:["activity"],queryFn:Gu,refetchInterval:1e4}),E=bt({mutationFn:o3,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),A=bt({mutationFn:s3,onSuccess:()=>{y(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:D=>{D instanceof Vu?b(D.message):b(D instanceof Error?D.message:String(D))}}),z=x.useMemo(()=>{const D=new Map;for(const U of(C==null?void 0:C.agents)??[]){if(!U.clientId)continue;const W=D.get(U.clientId)??[];W.push(U),D.set(U.clientId,W)}return D},[C==null?void 0:C.agents]),I=D=>z.get(D)??[],M=(j??[]).filter(D=>D.status==="connected").length,O=(j??[]).reduce((D,U)=>D+U.agentCount,0);return u.jsxs("div",{className:"-m-6",children:[u.jsx(Rf,{title:"Computers",subtitle:j&&j.length>0?u.jsxs(u.Fragment,{children:[j.length," total · ",M," connected · ",O," agents bound"]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(me,{size:"xs",onClick:()=>k(!0),children:[u.jsx(Xr,{className:"h-3 w-3"}),"New Connection"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsx(j7,{open:S,onOpenChange:k}),h&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),I(h.id).length>0&&u.jsxs("div",{className:"mb-3 p-2 rounded",style:{background:"color-mix(in oklch, var(--state-blocked) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[u.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),u.jsx("ul",{className:"text-body space-y-0.5",children:I(h.id).map(D=>u.jsx("li",{className:"font-medium",children:t(D.agentId)},D.agentId))})]}),g&&u.jsx("div",{className:"mb-3 p-2 rounded text-body",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:g}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>{y(null),b(null)},children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>A.mutate(h.id),disabled:A.isPending,children:A.isPending?"Retiring…":"Retire"})]})]})}),f&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:I(f.id).length===0?u.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):I(f.id).map(D=>u.jsxs("li",{className:"text-body flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:t(D.agentId)}),u.jsx(Ks,{state:D.runtimeState})]},D.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>E.mutate(f.id),disabled:E.isPending,children:E.isPending?"Disconnecting…":"Disconnect"})]})]})}),!j||j.length===0?u.jsx(ln,{children:u.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers. Use the button above to generate a connect command."})}):u.jsxs(ln,{children:[u.jsxs(Gs,{right:u.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",j.length]}),u.jsxs(bl,{children:[u.jsx(xl,{children:u.jsxs(sr,{children:[u.jsx($e,{style:{width:16}}),u.jsx($e,{children:"Hostname"}),l&&u.jsx($e,{children:"Owner"}),u.jsx($e,{children:"OS"}),u.jsx($e,{children:"SDK"}),u.jsx($e,{children:"Agents"}),u.jsx($e,{children:"Connected"}),u.jsx($e,{children:"Status"}),u.jsx($e,{})]})}),u.jsx(Sl,{children:j.map(D=>{const U=o===D.id,W=I(D.id);return u.jsx(R7,{client:D,boundAgents:W,isExpanded:U,agentName:t,showOwner:l,ownerName:n,onToggle:()=>c(U?null:D.id),onDisconnect:()=>m(D),onRetire:()=>{b(null),y(D)}},D.id)})})]})]})]})]})}const E7={"claude-code":"Claude Code",codex:"Codex"},N7=[rf.CLAUDE_CODE,rf.CODEX],bw={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},_7={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function A7({clientId:e,enabled:t}){const{data:n,isLoading:a}=qe({queryKey:["client-capabilities",e],queryFn:()=>Kk(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return u.jsxs(u.Fragment,{children:[u.jsx(Ju,{style:{display:"block",marginBottom:6},children:"Runtimes"}),a&&!l?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l&&Object.keys(l).length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Capabilities not yet reported. Reconnect this computer to refresh."}):u.jsx("div",{className:"flex flex-col gap-1",children:N7.map(o=>u.jsx(T7,{provider:o,entry:l?l[o]??null:null},o))})]})}function T7({provider:e,entry:t}){const n=E7[e];if(!t)return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",bw[e]]})]});switch(t.state){case"ok":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-idle)"},children:["✓ ",t.sdkVersion?`v${t.sdkVersion} · `:"","authenticated (",t.authMethod,")"]})]});case"unauthenticated":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",_7[e]]})]});case"missing":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",bw[e]]})]});case"error":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function R7({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:c,onDisconnect:f,onRetire:m}){const h=l?9:8,y=e.status==="connected"?"idle":"offline";return u.jsxs(u.Fragment,{children:[u.jsxs(sr,{interactive:!0,selected:n,onClick:c,children:[u.jsx(Ie,{style:{width:16},children:u.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?u.jsx(Ak,{className:"h-3.5 w-3.5"}):u.jsx(CR,{className:"h-3.5 w-3.5"})})}),u.jsx(Ie,{className:"font-medium",children:e.hostname??"—"}),l&&u.jsx(Ie,{style:{color:"var(--fg-2)"},children:o(e.userId)}),u.jsx(Ie,{style:{color:"var(--fg-3)"},children:e.os??"—"}),u.jsx(Ie,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),u.jsx(Ie,{children:u.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?Ei(e.connectedAt):"—"}),u.jsx(Ie,{children:u.jsx(Ks,{state:y})}),u.jsx(Ie,{style:{width:1,whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-1 justify-end",children:[u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",onClick:g=>{g.stopPropagation(),f()},children:[u.jsx(fz,{className:"h-3 w-3"})," Disconnect"]}),u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:g=>{g.stopPropagation(),m()},children:[u.jsx(Zs,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&u.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[u.jsx(Ie,{}),u.jsxs(Ie,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[u.jsx(A7,{clientId:e.id,enabled:n}),u.jsxs(Ju,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):u.jsx("div",{className:"flex flex-col gap-1",children:t.map(g=>u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(g.agentId)}),u.jsx(Ks,{state:g.runtimeState}),g.activeSessions!==null&&u.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[g.activeSessions," / ",g.totalSessions??0," sessions"]})]},g.agentId))})]})]})]})}function z7(){const{token:e}=gk(),t=cn(),{isAuthenticated:n,adoptTokens:a}=Qt(),[l,o]=x.useState(null),[c,f]=x.useState(null),[m,h]=x.useState(!1),[y,g]=x.useState(null);if(x.useEffect(()=>{e&&(async()=>{try{const C=await fetch(`/api/v1/invite/${encodeURIComponent(e)}/preview`);if(!C.ok){f("This invitation is no longer valid");return}o(await C.json())}catch{f("Network error while loading invitation")}})()},[e]),x.useEffect(()=>{n&&(async()=>{try{const C=await ke.get("/me/organizations"),E=await ke.get("/me"),A=C.find(z=>z.id===E.member.organizationId);g((A==null?void 0:A.displayName)??null)}catch{}})()},[n]),!e)return u.jsx(xw,{message:"Bad invitation URL"});if(c)return u.jsx(xw,{message:"This invitation is no longer valid"});if(!l)return u.jsx(O7,{});const b=async()=>{h(!0);try{const C=await ke.post("/me/organizations/join",{token:e});await a(C.tokens),Wj("invite"),t("/",{replace:!0})}catch(C){f(C instanceof Error?C.message:"Failed to join team")}finally{h(!1)}},S=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,k=n&&y&&y!==l.organizationDisplayName,j=D7(l.expiresAt);return u.jsx(Wy,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsx(ao,{className:"text-center",children:u.jsxs(Wu,{className:"text-title",children:["You're invited to join",u.jsx("br",{}),l.organizationDisplayName]})}),u.jsxs(io,{className:"space-y-4",children:[k&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md p-3 text-label",style:{background:"var(--bg-sunken)",color:"var(--fg-2)"},children:[u.jsx(uy,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsxs("span",{children:["You'll switch from ",u.jsx("span",{className:"font-medium",children:y})," to"," ",u.jsx("span",{className:"font-medium",children:l.organizationDisplayName}),"."]})]}),n?u.jsx(me,{className:"w-full",disabled:m,onClick:b,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:S,children:[u.jsx(Tk,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),j&&u.jsx("p",{className:"text-center text-label",style:{color:j.urgent?"var(--destructive)":"var(--fg-3)"},children:j.text}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]})]})]})})}function Wy({children:e}){return u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Zu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(ly,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:e})]})}function O7(){return u.jsx(Wy,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mx-auto h-5 w-2/3 rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto mt-2 h-5 w-1/2 rounded-md",style:{background:"var(--bg-sunken)"}})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx("div",{className:"h-9 w-full rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto h-3 w-1/3 rounded-md",style:{background:"var(--bg-sunken)"}})]})]})})}function xw({message:e}){return u.jsx(Wy,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:u.jsx(uy,{className:"h-6 w-6"})}),u.jsx(Wu,{className:"text-title",children:e})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx("p",{className:"text-center text-body text-muted-foreground",children:"It may have expired or been revoked. Ask the team admin for a fresh link."}),u.jsx(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs(Zu,{to:"/",children:[u.jsx(ly,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function D7(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const n=t-Date.now();if(n<=0)return null;const a=Math.floor(n/6e4),l=Math.floor(a/60),o=Math.floor(l/24);return o>7?null:o>=1?{text:`Expires in ${o} ${o===1?"day":"days"}`,urgent:!1}:l>=1?{text:`Expires in ${l} ${l===1?"hour":"hours"}`,urgent:!0}:{text:`Expires in ${Math.max(1,a)} ${a===1?"minute":"minutes"}`,urgent:!0}}function M7(e){if(typeof e!="object"||e===null||!("from"in e))return null;const t=e.from;if(typeof t!="object"||t===null||!("pathname"in t)||typeof t.pathname!="string"||t.pathname==="/login")return null;const n="search"in t&&typeof t.search=="string"?t.search:"",a="hash"in t&&typeof t.hash=="string"?t.hash:"",l=`${t.pathname}${n}${a}`,o=IC(l);return o===bS&&l!==bS?null:o}function L7(){const{isAuthenticated:e}=Qt(),t=Dn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=M7(t.state)??"/",l=a==="/"?"/api/v1/auth/github/start":`/api/v1/auth/github/start?next=${encodeURIComponent(a)}`,o="/api/v1/auth/github/dev-callback?githubId=1&login=devuser&displayName=Dev+User";return e?u.jsx(pf,{to:a,replace:!0}):u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Zu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(ly,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:u.jsx(vl,{width:28,height:32})}),u.jsxs(Wu,{className:"text-title",children:["First Tree ",u.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:l,children:[u.jsx(Tk,{className:"h-4 w-4"}),"Continue with GitHub"]})}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]}),n&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[u.jsx("span",{className:"relative z-10 bg-card px-2",children:"localhost only"}),u.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),u.jsx(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs("a",{href:o,children:[u.jsx(yz,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function I7(){const e=cn(),{adoptTokens:t}=Qt(),[n,a]=x.useState(null);return x.useEffect(()=>{const l=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,o=new URLSearchParams(l),c=o.get("access"),f=o.get("refresh"),m=IC(o.get("next")),h=o.get("joinPath");if(!c||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&Wj(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:c,refreshToken:f}),e(m,{replace:!0})))()},[t,e]),u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}function U7(){return ke.get("/admin/adapter-mappings")}function P7(e){return ke.post("/admin/adapter-mappings",e)}function B7(e){return ke.delete(`/admin/adapter-mappings/${e}`)}function $7(){return ke.get("/admin/adapters/status")}function F7(){return ke.get("/admin/adapters")}function q7(e){return ke.post("/admin/adapters",e)}function H7(e,t){return ke.patch(`/admin/adapters/${e}`,t)}function Z7(e){return ke.delete(`/admin/adapters/${e}`)}const V7=Object.values(u6),Sw={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function ww(e){const[t,n]=x.useState(Sw),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...Sw,platform:e.initialPlatform??"feishu",status:e.initialStatus??"active"}),l(""))},[e.open,e.initialPlatform,e.initialStatus]);function o(f){if(f.preventDefault(),l(""),e.kind==="user"){if(!t.externalUserId)return;e.onSubmit({kind:"user-create",draft:{platform:t.platform,externalUserId:t.externalUserId,displayName:t.displayName||null}});return}if(t.platform==="feishu"){if(!e.editingId&&(!t.feishuAppId||!t.feishuAppSecret)){l("App ID and App Secret are required");return}}else if(t.platform==="kael"){if(!e.editingId&&(!t.kaelUserId||!t.kaelProjectId)){l("User ID and Project ID are required");return}}else{const h=t.credentialsJson.trim();if(!e.editingId&&!h){l("Credentials are required");return}if(h)try{JSON.parse(h)}catch{l("Invalid JSON");return}}const m=Q7(t);if(!e.editingId&&!m){l("Credentials are required");return}if(e.editingId)e.onSubmit({kind:"bot-update",status:t.status,...m?{credentials:m}:{}});else{if(!m)return;e.onSubmit({kind:"bot-create",draft:{platform:t.platform,status:t.status,credentials:m}})}}const c=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return u.jsx(zt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:c})}),u.jsxs("form",{onSubmit:o,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"binding-platform",children:"Platform"}),u.jsx("select",{id:"binding-platform",value:t.platform,onChange:f=>n({...t,platform:f.target.value}),disabled:!!e.editingId,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:V7.map(f=>u.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"binding-ext-id",children:"External user ID"}),u.jsx(xt,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"binding-name",children:"Display name (optional)"}),u.jsx(xt,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):u.jsxs(u.Fragment,{children:[t.platform==="feishu"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(nt,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(nt,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(nt,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(nt,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{id:"kael-project-id",value:t.kaelProjectId,onChange:f=>n({...t,kaelProjectId:f.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!e.editingId&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs(nt,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),u.jsx("textarea",{id:"binding-creds",value:t.credentialsJson,onChange:f=>n({...t,credentialsJson:f.target.value}),rows:4,className:"flex w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),a&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(nt,{htmlFor:"binding-status",children:"Status"}),u.jsxs("select",{id:"binding-status",value:t.status,onChange:f=>n({...t,status:f.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"active",children:"active"}),u.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function Q7(e){if(e.platform==="feishu")return!e.feishuAppId&&!e.feishuAppSecret||!e.feishuAppId||!e.feishuAppSecret?null:{app_id:e.feishuAppId,app_secret:e.feishuAppSecret};if(e.platform==="kael")return!e.kaelUserId&&!e.kaelProjectId||!e.kaelUserId||!e.kaelProjectId?null:{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId};const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function G7(){var _;const e=cn(),t=kn(),[n,a]=yf(),l=n.get("agent"),o=El(),c=qe({queryKey:["adapters"],queryFn:F7}),f=qe({queryKey:["adapter-mappings"],queryFn:U7}),m=qe({queryKey:["adapter-statuses"],queryFn:$7,refetchInterval:15e3}),y=((_=qe({queryKey:["agents","name-map"],queryFn:()=>Xu({limit:100}),staleTime:3e4}).data)==null?void 0:_.items)??[],g=x.useMemo(()=>{const F=new Map;for(const J of m.data??[])F.set(J.configId,J);return F},[m.data]),b=x.useMemo(()=>{const F=c.data??[];return l?F.filter(J=>J.agentId===l):F},[c.data,l]),S=x.useMemo(()=>{const F=f.data??[];return l?F.filter(J=>J.agentId===l):F},[f.data,l]),k=b.reduce((F,J)=>{var ue;return F+((ue=g.get(J.id))!=null&&ue.connected?1:0)},0),j=b.length-k,C=c.isLoading||f.isLoading,[E,A]=x.useState(null),[z,I]=x.useState(""),[M,O]=x.useState(null),[D,U]=x.useState(null),[W,H]=x.useState(null),[ne,X]=x.useState(null),be=bt({mutationFn:F=>q7({platform:F.platform,agentId:F.agentId,credentials:F.credentials,status:F.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),fe=bt({mutationFn:F=>{const J={status:F.status};return F.credentials&&(J.credentials=F.credentials),H7(F.id,J)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),ie=bt({mutationFn:Z7,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),Z=bt({mutationFn:F=>P7({platform:F.platform,externalUserId:F.externalUserId,agentId:F.agentId,boundVia:"manual",displayName:F.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),U(null)}}),ae=bt({mutationFn:B7,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function K(F){if(l){F==="bot"?O({agentId:l,editingId:null}):U({agentId:l});return}I(""),A({kind:F})}function he(){!E||!z||(E.kind==="bot"?O({agentId:z,editingId:null}):U({agentId:z}),A(null))}function T(F){if(M){if(F.kind==="bot-create")be.mutate({agentId:M.agentId,platform:F.draft.platform,status:F.draft.status,credentials:F.draft.credentials});else if(F.kind==="bot-update"){if(!M.editingId)return;fe.mutate({id:M.editingId,status:F.status,credentials:F.credentials})}}}function B(F){!D||F.kind!=="user-create"||Z.mutate({agentId:D.agentId,platform:F.draft.platform,externalUserId:F.draft.externalUserId,displayName:F.draft.displayName})}const $=l?y.find(F=>F.uuid===l):null;return u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Manage how external platforms (Feishu, Slack, Kael) reach your agents. Bot bindings hold encrypted credentials; user bindings map an external user to a human agent in this organization."}),l&&u.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[u.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),u.jsxs("span",{className:"inline-flex items-center gap-1.5 mono text-caption",style:{padding:"var(--sp-0_5) var(--sp-2)",borderRadius:"var(--radius-chip)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border)"},children:[($==null?void 0:$.displayName)??l,u.jsx("button",{type:"button",onClick:()=>{const F=new URLSearchParams(n);F.delete("agent"),a(F,{replace:!0})},"aria-label":"Clear filter",className:"inline-flex items-center justify-center hover:bg-accent rounded-full",style:{width:14,height:14,border:"none",background:"transparent",cursor:"pointer"},children:u.jsx(Eu,{className:"h-3 w-3"})})]})]}),u.jsxs(ln,{className:"mb-3.5",children:[u.jsxs(Gs,{right:u.jsxs("span",{className:"inline-flex items-center gap-2",children:[u.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[u.jsx(Kr,{state:"idle",size:6})," ",k," online"]}),u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(Kr,{state:"offline",size:6})," ",j," offline"]})]}),u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>K("bot"),children:[u.jsx(Xr,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),C?u.jsx(Id,{children:"Loading…"}):b.length?u.jsxs(bl,{children:[u.jsx(xl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Agent"}),u.jsx($e,{children:"Platform"}),u.jsx($e,{children:"Status"}),u.jsx($e,{children:"Connection"}),u.jsx($e,{children:"Created"}),u.jsx($e,{style:{width:96,textAlign:"right"}})]})}),u.jsx(Sl,{children:b.map(F=>{var ue;const J=((ue=g.get(F.id))==null?void 0:ue.connected)??!1;return u.jsxs(sr,{interactive:!0,onClick:()=>e(`/agents/${F.agentId}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"mono font-medium",children:o(F.agentId)})}),u.jsx(Ie,{children:u.jsx(Sn,{children:F.platform})}),u.jsx(Ie,{children:u.jsx(Sn,{tone:F.status==="active"?"accent":"outline",children:F.status})}),u.jsx(Ie,{children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[u.jsx(Kr,{state:J?"idle":"offline",size:7}),u.jsx("span",{style:{color:"var(--fg-3)"},children:J?"Online":"Offline"})]})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(F.createdAt)}),u.jsxs(Ie,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:xe=>xe.stopPropagation(),children:[u.jsx(me,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>O({agentId:F.agentId,editingId:F.id,initialPlatform:K7(F.platform),initialStatus:Y7(F.status)}),children:"Edit"}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>H(F.id),disabled:ie.isPending,title:"Delete",children:u.jsx(Zs,{className:"h-3.5 w-3.5"})})]})]},F.id)})})]}):u.jsx(Id,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),u.jsxs(ln,{children:[u.jsxs(Gs,{right:u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>K("user"),children:[u.jsx(Xr,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",S.length]}),C?u.jsx(Id,{children:"Loading…"}):S.length?u.jsxs(bl,{children:[u.jsx(xl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Agent"}),u.jsx($e,{children:"Platform"}),u.jsx($e,{children:"External user ID"}),u.jsx($e,{children:"Display name"}),u.jsx($e,{children:"Bound via"}),u.jsx($e,{children:"Created"}),u.jsx($e,{style:{width:32}})]})}),u.jsx(Sl,{children:S.map(F=>u.jsxs(sr,{interactive:!0,onClick:()=>e(`/agents/${F.agentId}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(F.agentId)})}),u.jsx(Ie,{children:u.jsx(Sn,{children:F.platform})}),u.jsx(Ie,{children:u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:F.externalUserId})}),u.jsx(Ie,{style:{color:"var(--fg-2)"},children:F.displayName??"—"}),u.jsx(Ie,{children:u.jsx(Sn,{tone:"outline",children:F.boundVia??"—"})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ei(F.createdAt)}),u.jsx(Ie,{onClick:J=>J.stopPropagation(),children:u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>X(F.id),disabled:ae.isPending,title:"Delete",children:u.jsx(Zs,{className:"h-3.5 w-3.5"})})})]},F.id))})]}):u.jsx(Id,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),u.jsx(X7,{open:E!=null,kind:(E==null?void 0:E.kind)??"bot",agents:y,agentId:z,onAgentChange:I,onCancel:()=>A(null),onConfirm:he}),u.jsx(ww,{open:M!=null,kind:"bot",editingId:(M==null?void 0:M.editingId)??null,initialPlatform:M==null?void 0:M.initialPlatform,initialStatus:M==null?void 0:M.initialStatus,agentLabel:M?o(M.agentId):"",pending:be.isPending||fe.isPending,errorMessage:(be.error??fe.error)instanceof Error?(be.error??fe.error).message:null,onOpenChange:F=>{F||(O(null),be.reset(),fe.reset())},onSubmit:T}),u.jsx(ww,{open:D!=null,kind:"user",editingId:null,agentLabel:D?o(D.agentId):"",pending:Z.isPending,errorMessage:Z.error instanceof Error?Z.error.message:null,onOpenChange:F=>{F||(U(null),Z.reset())},onSubmit:B}),u.jsx(kw,{open:W!=null,onOpenChange:F=>!F&&H(null),title:"Remove this bot binding?",description:"The bot will stop routing to this agent and any platform credentials stored here will be dropped.",confirmLabel:"Remove binding",pending:ie.isPending,onConfirm:()=>{W!=null&&(ie.mutate(W),H(null))}}),u.jsx(kw,{open:ne!=null,onOpenChange:F=>!F&&X(null),title:"Remove this binding?",description:"The external user will stop routing to this agent. You can add the mapping again later.",confirmLabel:"Remove binding",pending:ae.isPending,onConfirm:()=>{ne!=null&&(ae.mutate(ne),X(null))}})]})}function K7(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function Y7(e){return e==="inactive"?"inactive":"active"}function Id({children:e}){return u.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function X7(e){const t=e.kind==="user"?e.agents.filter(n=>n.type==="human"&&n.status==="active"):e.agents.filter(n=>n.type!=="human"&&n.status==="active");return u.jsx(zt,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),u.jsxs("select",{value:e.agentId,onChange:n=>e.onAgentChange(n.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>u.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),u.jsxs(en,{children:[u.jsx(me,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),u.jsx(me,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function kw(e){return u.jsx(zt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function J7(){const{organizationId:e,adoptTokens:t,logout:n}=Qt(),[a,l]=x.useState([]),[o,c]=x.useState(!1),[f,m]=x.useState(!1),[h,y]=x.useState(null);x.useEffect(()=>{(async()=>{try{const k=await ke.get("/me/organizations");l(k)}catch{}})()},[]);const g=a.find(k=>k.id===e),b=(g==null?void 0:g.displayName)??"this team",S=async()=>{m(!0),y(null);try{await _U();const j=(await ke.get("/me/organizations").catch(()=>[])).find(C=>C.id!==e);if(j){const C=await ke.post("/auth/switch-org",{organizationId:j.id});await t(C)}else n()}catch(k){y(k instanceof Error?k.message:"Failed to leave team"),m(!1)}};return u.jsxs(u.Fragment,{children:[u.jsxs(ln,{children:[u.jsx(_r,{children:u.jsx(Ar,{children:"Membership"})}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-4) var(--sp-4)"},children:[u.jsxs("div",{className:"text-body",style:{color:"var(--fg)"},children:["You're a member of ",u.jsx("span",{className:"font-medium",children:b}),"."]}),u.jsx("div",{className:"text-label text-muted-foreground",style:{marginTop:4},children:"Leaving removes your access immediately. Your agents stay in the team for history; you can re-join later if an admin shares an invite link."}),u.jsx("div",{style:{marginTop:"var(--sp-3)"},children:u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>c(!0),disabled:f,children:f?"Leaving…":"Leave team"})}),h&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h})]})]}),u.jsx(zt,{open:o,onOpenChange:k=>!f&&c(k),children:u.jsxs(Tt,{children:[u.jsxs($t,{children:[u.jsxs(Ot,{children:["Leave ",b,"?"]}),u.jsx(Yu,{children:"You'll lose access to this team's agents and chats. Your historical messages stay, but you won't be able to read or send new ones until an admin re-invites you."})]}),u.jsxs(en,{children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>c(!1),disabled:f,children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>void S(),disabled:f,children:f?"Leaving…":"Leave team"})]})]})})]})}const jw=[{key:"bindings",label:"Bindings"},{key:"membership",label:"Membership"}];function W7(){const e=Dn(),t=cn(),n=e.hash.replace("#",""),a=jw.some(o=>o.key===n)?n:"bindings",l=o=>{t({hash:o},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(Rf,{title:"Settings",subtitle:"Per-member controls"}),u.jsx(rE,{children:jw.map(o=>u.jsx(aE,{active:a===o.key,onClick:()=>l(o.key),children:o.label},o.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[a==="bindings"&&u.jsx(G7,{}),a==="membership"&&u.jsx(J7,{})]})]})}const eH="first-tree-hub-images",tH=1,Xs="images";let Ud=null;function gN(){return Ud||(Ud=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(eH,tH);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Xs)||n.createObjectStore(Xs,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Ud)}async function nH(e){const t=await gN();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Xs,"readwrite"),o=l.objectStore(Xs),c={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(c),l.oncomplete=()=>n(),l.onerror=()=>a(l.error??new Error("Image storage write failed")),l.onabort=()=>a(l.error??new Error("Image storage write aborted"))})}async function rH(e){const t=await gN();return t?new Promise(n=>{const o=t.transaction(Xs,"readonly").objectStore(Xs).get(e);o.onsuccess=()=>{const c=o.result;if(!c){n(null);return}n({base64:c.base64,mimeType:c.mimeType})},o.onerror=()=>n(null)}):null}function aH(e,t){if(t<=0||t>e.length)return null;let n=t-1;for(;n>=0;){const l=e[n];if(l===void 0)return null;if(l==="@")break;if(!/[A-Za-z0-9_-]/.test(l))return null;n--}if(n<0||e[n]!=="@")return null;if(n>0){const l=e[n-1];if(l!==void 0&&/[A-Za-z0-9_.@-]/.test(l))return null}const a=e.slice(n+1,t).toLowerCase();return{triggerIndex:n,query:a}}function iH(e,t){if(!t)return[...e].sort((a,l)=>(a.displayName??a.name??"").localeCompare(l.displayName??l.name??"")).slice(0,8);const n=[];for(const a of e){const l=(a.name??"").toLowerCase(),o=(a.displayName??"").toLowerCase();let c=1/0;l.startsWith(t)?c=0:o.startsWith(t)?c=1:o.includes(t)&&(c=2),c!==1/0&&n.push({c:a,score:c})}return n.sort((a,l)=>a.score-l.score||(a.c.displayName??"").localeCompare(l.c.displayName??"")),n.slice(0,8).map(a=>a.c)}function lH(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),c=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${c}${m}`,y=l.length+c.length+(f?1:0);return{text:h,cursor:y}}function sH({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,c]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:aH(e,t),[e,t,l]),y=x.useMemo(()=>h?iH(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{c(0)},[g]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,S=h!==null&&y.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(E){if(!h)return;const A=lH(e,h,t,E);A&&a(A)}return{trigger:S?h:null,results:S?y:[],highlightIndex:o,handleKey:E=>{if(!S||!h)return!1;if(E.key==="ArrowDown")return E.preventDefault(),c(A=>y.length===0?0:(A+1)%y.length),!0;if(E.key==="ArrowUp")return E.preventDefault(),c(A=>y.length===0?0:(A-1+y.length)%y.length),!0;if(E.key==="Enter"||E.key==="Tab"){const A=y[o]??y[0];return A?(E.preventDefault(),j(A),!0):!1}return E.key==="Escape"?(E.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function oH({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:l}){const o=x.useRef(null);return x.useEffect(()=>{var m;const f=(m=o.current)==null?void 0:m.querySelector(`[data-mention-index="${n}"]`);f==null||f.scrollIntoView({block:"nearest"})},[n]),!e||t.length===0||!l.current?null:u.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:_e("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,right:0,background:"var(--bg-raised)",borderColor:"var(--border)"},children:t.map((f,m)=>{const h=m===n;return u.jsxs("button",{type:"button",role:"option","aria-selected":h,"data-mention-index":m,onMouseDown:y=>{y.preventDefault(),a(f)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:h?"var(--accent-dim)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer"},children:[u.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&u.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function yN(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function uH(e){let t=-1;for(const l of e)l.kind==="turn_end"&&l.seq>t&&(t=l.seq);const n=e.filter(l=>l.kind==="turn_end"?!1:l.kind==="error"?!0:l.seq>t),a=new Map;for(const l of n){if(l.kind!=="tool_call")continue;const o=Cw(l.payload);if(!o)continue;const c=a.get(o)??-1;l.seq>c&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=Cw(l.payload);return o?a.get(o)===l.seq:!0})}function Cw(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function If(e){const t=new Date(e),n=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),a=l=>{var o;return((o=n.find(c=>c.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function vN(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function cH(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Ew(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function dH({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function fH({agentId:e,chatId:t,session:n}){const a=kn(),[,l]=yf(),[o,c]=x.useState(!1),[f,m]=x.useState(null),h=Xk(e,t),y=Xd(e),g=C=>{a.setQueryData(h,E=>E&&{...E,state:C}),a.setQueryData(y,E=>E&&E.map(A=>A.chatId===t?{...A,state:C}:A))},b=bt({mutationFn:()=>h3(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const C=a.getQueryData(h),E=a.getQueryData(y);return g("suspended"),{previousSession:C,previousList:E}},onError:(C,E,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(y,A.previousList)},onSuccess:C=>{g(C.state)}}),S=bt({mutationFn:()=>m3(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const C=a.getQueryData(h),E=a.getQueryData(y);return a.setQueryData(y,A=>A&&A.filter(z=>z.chatId!==t)),{previousSession:C,previousList:E}},onError:(C,E,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(y,A.previousList),m(C instanceof Error?C.message:"Terminate failed")},onSuccess:(C,E,A)=>{if(C.state!=="evicted"){A!=null&&A.previousList&&a.setQueryData(y,A.previousList),g(C.state),m(`Session is ${C.state}; terminate only applies to suspended sessions.`);return}m(null),c(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",background:"var(--bg-sunken)"},children:[k&&u.jsxs("button",{type:"button",onClick:()=>b.mutate(),disabled:b.isPending,className:"inline-flex items-center transition-colors text-label",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--fg-2)",borderRadius:"var(--radius-input)"},onMouseEnter:C=>C.currentTarget.style.background="var(--bg-hover)",onMouseLeave:C=>C.currentTarget.style.background="transparent",children:[u.jsx(VR,{className:"h-3 w-3"})," Suspend",u.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&u.jsxs("button",{type:"button",onClick:()=>{m(null),c(!0)},disabled:S.isPending,className:"inline-flex items-center transition-colors text-label font-semibold",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:"var(--radius-input)"},onMouseEnter:C=>C.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:C=>C.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[u.jsx(az,{className:"h-3 w-3"})," Terminate"]})]}),u.jsx(hH,{open:o,onOpenChange:C=>{S.isPending||c(C),C||m(null)},session:n,chatId:t,error:f,pending:S.isPending,onConfirm:()=>S.mutate()})]})}function hH(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:c,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return u.jsx(zt,{open:t,onOpenChange:n,children:u.jsxs(Tt,{children:[u.jsx($t,{children:u.jsx(Ot,{children:"Terminate session?"})}),u.jsxs("form",{onSubmit:m,className:"space-y-4",children:[u.jsx("p",{className:"text-body text-muted-foreground",children:"Ending this session is permanent. It is removed from the workspace and cannot be resumed. Chat history is preserved; a new message will start a fresh session."}),u.jsxs("div",{className:"mono text-label",style:{padding:"var(--sp-2) var(--sp-2_5)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",display:"grid",gap:4},children:[u.jsxs("span",{children:["chat: ",u.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&u.jsxs("span",{children:["last activity: ",vN(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&u.jsxs("span",{children:["messages: ",a.messageCount]})]}),c&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:c}),u.jsxs(en,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),u.jsx(me,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function mH({event:e}){const t=u3(e.payload);if(!t)return null;const n=t.status==="error",a=t.status==="pending",l=n?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":a?"using":"used";return u.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[a?u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:l,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):u.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),u.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?Ew(t.args):void 0,children:[u.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",u.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?u.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",Ew(t.args),")"]}):null,t.durationMs!==void 0&&!a?u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",cH(t.durationMs)]}):null]})]})}function pH({event:e,agentNameFn:t,agentId:n}){const a=d3(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[u.jsx(bN,{name:l,isSelf:!1}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:If(e.createdAt)}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function gH({event:e}){return u.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),u.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:If(e.createdAt)})]})}function yH({event:e}){const t=c3(e.payload),n=If(e.createdAt);return u.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2_5)",borderLeft:"var(--hairline-bold) solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 var(--radius-input) var(--radius-input) 0"},children:[u.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),u.jsx("div",{className:"text-label",style:{marginTop:2,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function bN({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return u.jsx("div",{className:"mono text-eyebrow font-bold",style:{width:20,height:20,borderRadius:"var(--radius-input)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"var(--hairline) solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?n:u.jsx(vl,{width:9,height:10,style:{color:"var(--accent)"}})})}function vH({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[u.jsx(bN,{name:a,isSelf:l}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:If(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(dH,{msg:e,myAgentId:t})})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&bH(e.content)?u.jsx("img",{src:`data:${e.content.mimeType};base64,${e.content.data}`,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):e.format==="file"&&xH(e.content)?u.jsx(SH,{content:e.content}):e.format==="text"?u.jsx(mN,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):u.jsx("pre",{className:"mono text-label",style:{background:"var(--bg-sunken)",padding:8,borderRadius:"var(--radius-input)",overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function bH(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.data=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")}function xH(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.imageId=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")&&typeof t.filename=="string"}function SH({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return rH(e.imageId).then(l=>{a||n(l?{kind:"hit",src:`data:${l.mimeType};base64,${l.base64}`}:{kind:"miss"})}),()=>{a=!0}},[e.imageId]),t.kind==="hit"?u.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?u.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):u.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function wH({agentId:e,chatId:t}){var Ct;const n=kn(),a=El(),l=yy(),{agentId:o}=Qt(),[c,f]=x.useState(""),[m,h]=x.useState(0),[y,g]=x.useState([]),[b,S]=x.useState(!1),[k,j]=x.useState(null),C=x.useRef(null),E=x.useRef(null),A=x.useRef(null),z=x.useRef(!1);x.useEffect(()=>{z.current=!1},[t]);const{data:I}=qe({queryKey:["chat-messages",t],queryFn:()=>iM(t,{limit:50}),refetchInterval:5e3}),{data:M}=qe({queryKey:["session-events",e,t],queryFn:()=>f3(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:O}=qe({queryKey:Xk(e,t),queryFn:()=>to(e).then(te=>te.find(Te=>Te.chatId===t)??null),refetchInterval:5e3}),{data:D}=qe({queryKey:["chat-detail",t],queryFn:()=>tM(t),enabled:!!t}),U=bt({mutationFn:te=>G1(t,te),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Xd(e)})}}),W=x.useCallback(te=>{const Ue=te.filter(dn=>dn.type.startsWith("image/"));if(Ue.length===0)return;const Fe=Ue.find(dn=>dn.size>5242880);if(Fe){j(`Image too large (${(Fe.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const qt=Ue.map(dn=>({id:crypto.randomUUID(),file:dn,previewUrl:URL.createObjectURL(dn)}));g(dn=>[...dn,...qt]),j(null)},[]),H=x.useCallback(te=>{g(Te=>{const Ue=Te.find(Fe=>Fe.id===te);return Ue&&URL.revokeObjectURL(Ue.previewUrl),Te.filter(Fe=>Fe.id!==te)})},[]),ne=async()=>{const te=c.trim(),Te=y;if(!(!te&&Te.length===0)&&!b&&!(F&&J.length===0)){if(Te.length>0){S(!0),j(null);try{for(const Ue of Te){const Fe=await aM(Ue.file),qt=crypto.randomUUID();await nH({imageId:qt,base64:Fe,mimeType:Ue.file.type}),await rM(t,{data:Fe,mimeType:Ue.file.type,filename:Ue.file.name,size:Ue.file.size,imageId:qt}),URL.revokeObjectURL(Ue.previewUrl)}g([]),te&&await G1(t,te),f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Xd(e)})}catch(Ue){j(Ue instanceof Error?Ue.message:"Failed to send image")}finally{S(!1)}return}U.mutate(te)}},[X,be]=x.useState(!1),[fe,ie]=x.useState(""),Z=x.useRef(null);x.useEffect(()=>{var te;X&&((te=Z.current)==null||te.focus())},[X]);const ae=bt({mutationFn:te=>nM(t,te),onSuccess:()=>{be(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),K=()=>{const te=fe.trim();ae.mutate(te.length>0?te:null)},he=x.useMemo(()=>{const te=(I==null?void 0:I.items)??[],Te=uH((M==null?void 0:M.items)??[]),Ue=[...te.map(Fe=>({kind:"message",at:Fe.createdAt,key:`m-${Fe.id}`,data:Fe})),...Te.map(Fe=>({kind:"event",at:Fe.createdAt,key:`e-${Fe.id}`,data:Fe}))];return Ue.sort((Fe,qt)=>Fe.at.localeCompare(qt.at)),Ue},[I,M]),T=he.length;x.useEffect(()=>{var te;T>0&&((te=A.current)==null||te.scrollIntoView({behavior:"smooth"}))},[T]);const B=D!=null&&D.participants?D.participants.map(te=>{const Te=a(te.agentId);return`@${Te.length>20?`${Te.slice(0,17)}…`:Te}`}).join(" "):`@${a(e)}`,$=a(e),_=x.useMemo(()=>{var Ue;const te=((Ue=D==null?void 0:D.participants)==null?void 0:Ue.map(Fe=>Fe.agentId))??[e],Te=[];for(const Fe of te){if(Fe===o)continue;const qt=l(Fe);!qt||!qt.name||Te.push({agentId:Fe,name:qt.name,displayName:qt.displayName})}return Te},[D==null?void 0:D.participants,e,l,o]),F=x.useMemo(()=>{if(!D)return!1;if(D.type==="group")return!0;const te=D.participants.some(Te=>Te.agentId===o);return D.type==="direct"&&!te&&D.participants.length>=2},[D,o]),J=x.useMemo(()=>{if(!F)return[];const te=_.map(Te=>({agentId:Te.agentId,name:Te.name}));return s6(c,te)},[c,_,F]),ue=sH({value:c,cursor:m,candidates:_,disabled:U.isPending||b,onSelect:te=>{f(te.text),h(te.cursor),requestAnimationFrame(()=>{const Te=E.current;Te&&(Te.focus(),Te.setSelectionRange(te.cursor,te.cursor))})}}),xe=(O==null?void 0:O.runtimeState)??"idle",Le=yN((O==null?void 0:O.runtimeState)??null,e?"connected":null),Se=(O==null?void 0:O.messageCount)??((Ct=I==null?void 0:I.items)==null?void 0:Ct.length)??0;return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx(Kr,{state:Le,size:8}),X?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:Z,value:fe,onChange:te=>ie(te.target.value),onKeyDown:te=>{te.key==="Enter"?(te.preventDefault(),K()):te.key==="Escape"&&(te.preventDefault(),be(!1))},disabled:ae.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none text-subtitle",style:{flex:1,minWidth:0,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),u.jsx("button",{type:"button",onClick:K,disabled:ae.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:u.jsx(Yr,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>be(!1),disabled:ae.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:u.jsx(Eu,{className:"h-3.5 w-3.5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(D==null?void 0:D.topic)||(O==null?void 0:O.summary)||`Chat · ${t.slice(0,8)}`}),u.jsx("button",{type:"button",onClick:()=>{ie((D==null?void 0:D.topic)??""),be(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:te=>te.currentTarget.style.color="var(--fg-2)",onMouseLeave:te=>te.currentTarget.style.color="var(--fg-4)",children:u.jsx(Qu,{className:"h-3 w-3"})})]}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)",padding:"var(--hairline) var(--sp-1_25)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)"},children:t})]}),u.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[u.jsx("span",{className:"mono",children:B}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["started ",vN((O==null?void 0:O.startedAt)??null)]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[Se," msgs"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["runtime"," ",u.jsx("span",{className:"mono",style:{color:Le==="error"?"var(--state-error)":"var(--fg-2)"},children:xe})]})]})]}),u.jsx(fH,{agentId:e,chatId:t,session:O??null})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[T===0&&u.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[u.jsx(oy,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),u.jsx("div",{className:"flex flex-col",style:{gap:4},children:he.map(te=>{if(te.kind==="event"){const Te=te.data;switch(Te.kind){case"tool_call":return u.jsx(mH,{event:Te},te.key);case"assistant_text":return u.jsx(pH,{event:Te,agentId:e,agentNameFn:a},te.key);case"thinking":return u.jsx(gH,{event:Te},te.key);case"error":return u.jsx(yH,{event:Te},te.key);default:return null}}return u.jsx(vH,{msg:te.data,myAgentId:o,agentNameFn:a},te.key)})}),u.jsx("div",{ref:A})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:te=>te.preventDefault(),onDrop:te=>{te.preventDefault(),W(Array.from(te.dataTransfer.files))},children:[y.length>0&&u.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:y.map(te=>u.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[u.jsx("img",{src:te.previewUrl,alt:te.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),u.jsx("button",{type:"button",onClick:()=>H(te.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"var(--color-overlay-scrim)",border:"none",color:"var(--bg-raised)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:u.jsx(Eu,{className:"h-2 w-2"})})]},te.id))}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(oH,{trigger:ue.trigger,results:ue.results,highlightIndex:ue.highlightIndex,anchorRef:E,onPick:ue.pick}),u.jsx("textarea",{ref:E,value:c,onChange:te=>{f(te.target.value),h(te.target.selectionStart??te.target.value.length)},onSelect:te=>{h(te.currentTarget.selectionStart??c.length)},onFocus:()=>{F&&(z.current||c.length>0||_.length===0||(z.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const te=E.current;te&&te.setSelectionRange(1,1)})))},onPaste:te=>{const Te=Array.from(te.clipboardData.files);Te.length>0&&(te.preventDefault(),W(Te))},placeholder:F?"Type @ to pick a recipient, then your message":`Message @${$} · / for commands · @ to mention`,rows:2,onKeyDown:te=>{ue.handleKey(te)||te.key==="Enter"&&!te.shiftKey&&(te.preventDefault(),ne())},disabled:U.isPending||b,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2_25) var(--sp-3) var(--sp-7_5)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}})]}),u.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[u.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[u.jsx("button",{type:"button",onClick:()=>{var te;return(te=C.current)==null?void 0:te.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:u.jsx(HR,{className:"h-3.5 w-3.5"})}),u.jsx("input",{ref:C,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:te=>{te.target.files&&(W(Array.from(te.target.files)),te.target.value="")}}),u.jsx("span",{children:"/suspend"}),u.jsx("span",{children:"/resume"}),u.jsx("span",{children:"/branch"}),u.jsx("span",{children:"/promote"})]}),u.jsxs("span",{className:"flex items-center",style:{gap:8},children:[b&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),u.jsxs("span",{children:[u.jsx("span",{className:"kbd",children:"⏎"})," send ",u.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),u.jsxs("button",{type:"button",onClick:ne,disabled:U.isPending||b||!c.trim()&&y.length===0||F&&J.length===0,title:F&&J.length===0?"Pick at least one recipient with @ before sending in a group chat":void 0,className:_e("inline-flex items-center transition-colors text-label font-semibold",(U.isPending||b||!c.trim()&&y.length===0||F&&J.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"var(--hairline) solid var(--accent)",borderRadius:"var(--radius-input)"},children:[u.jsx(JR,{className:"h-3 w-3"})," Send"]})]})]})]}),(U.isError||k)&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(U.error instanceof Error?U.error.message:"Failed to send")})]})]})}function kH(){const{step:e,openModal:t}=vy();if(e!==null&&e!=="completed"){const a=e==="connect"?"Connect your computer to create your first agent.":e==="create_agent"?"Create your first agent to start collaborating.":"Finish setup to start collaborating.";return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(vl,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-subtitle mb-1",children:"No agents yet"}),u.jsx("div",{className:"text-body text-muted-foreground mb-4",children:a}),u.jsx(me,{onClick:t,children:"Resume setup"})]})})}return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(vl,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),u.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function jH({selectedAgentId:e,selectedChatId:t}){return t&&e?u.jsx(wH,{agentId:e,chatId:t}):u.jsx(kH,{})}function xN(){const{data:e}=qe({queryKey:["clients"],queryFn:Ni,staleTime:1e4,refetchInterval:1e4});return x.useMemo(()=>{const t=e??[],n=new Map;for(const a of t)n.set(a.id,a);return{resolve:a=>a?n.get(a)??null:null,clients:t,connectedClients:t.filter(a=>a.status==="connected")}},[e])}function $g({children:e}){return u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function SN({children:e}){return u.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Qr({label:e,children:t}){return u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{color:"var(--fg-3)"},children:e}),u.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function Nw(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function _w(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m`;const a=Math.floor(n/60);return a<24?`${a}h ${n%60}m`:`${Math.floor(a/24)}d ${a%24}h`}function Fp({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[u.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function CH({notifications:e,agentId:t}){const[,n]=yf(),a=kn(),l=bt({mutationFn:o=>Yj(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return u.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>u.jsx(Xj,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function wN({agentId:e}){var h;const t=El(),{resolve:n}=xN(),{data:a}=qe({queryKey:["activity"],queryFn:Gu,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(y=>y.agentId===e),o=n(l==null?void 0:l.clientId),{data:c}=qe({queryKey:["notifications","agent",e],queryFn:()=>wg({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:u.jsx(vl,{width:14,height:16,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),u.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),u.jsx(Ks,{state:m})]}),u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[u.jsx(Fp,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),u.jsx(Fp,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),u.jsx(Fp,{label:"uptime",value:_w((o==null?void 0:o.connectedAt)??null)})]})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx($g,{children:"Computer · runtime"}),u.jsxs(SN,{children:[u.jsx(Qr,{label:"host",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),u.jsx(Qr,{label:"os",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),u.jsx(Qr,{label:"runtime",children:u.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),u.jsx(Qr,{label:"sdk",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),u.jsx(Qr,{label:"connected",children:u.jsx("span",{className:"mono text-label",children:_w((o==null?void 0:o.connectedAt)??null)})})]})]}),u.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[u.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),u.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[u.jsx($g,{children:"Notifications"}),!(c!=null&&c.items)||c.items.length===0?u.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):u.jsx(CH,{notifications:c.items,agentId:e})]})]})}function EH({agentId:e,chatId:t}){const{data:n}=qe({queryKey:["session",e,t],queryFn:()=>to(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return u.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx($g,{children:"Session"}),u.jsxs(SN,{children:[u.jsx(Qr,{label:"state",children:u.jsx(Ks,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),u.jsx(Qr,{label:"chat",children:u.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),u.jsx(Qr,{label:"started",children:Nw((n==null?void 0:n.startedAt)??null)}),u.jsx(Qr,{label:"last",children:Nw((n==null?void 0:n.lastActivityAt)??null)}),u.jsx(Qr,{label:"messages",children:u.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),u.jsx(wN,{agentId:e})]})}function NH({selectedAgentId:e,selectedChatId:t}){return t&&e?u.jsx(EH,{agentId:e,chatId:t}):e?u.jsx(wN,{agentId:e}):null}const _H=32;function AH({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return u.jsx("div",{className:_e("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:_H}).map((l,o)=>{const c=e[o]??{workingCount:0,errorMask:!1},f=c.workingCount===0?.08:c.workingCount/a,m=.25+f*.7,h=c.errorMask?"var(--state-error)":"var(--accent)";return u.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const TH={error:0,blocked:1,working:2,idle:3};function RH(e,t){return t?e?TH[e]??4:4:5}function zH(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function OH({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=El(),{resolve:o}=xN(),c=fU(),[f,m]=x.useState(""),[h,y]=x.useState("all"),{data:g}=qe({queryKey:["activity"],queryFn:Gu,refetchInterval:1e4}),{data:b}=qe({queryKey:e?Xd(e):["agent-sessions",null],queryFn:()=>e?to(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),S=bt({mutationFn:M=>tC(M),onSuccess:(M,O)=>{a(O,M.id)}}),{humans:k,agents:j,totalAll:C}=x.useMemo(()=>{const M=(g==null?void 0:g.agents)??[],O=f.trim().toLowerCase(),D=M.filter(ne=>{var fe;if(!zH(ne,h))return!1;if(!O)return!0;const X=l(ne.agentId).toLowerCase(),be=ne.clientId?(((fe=o(ne.clientId))==null?void 0:fe.hostname)??"").toLowerCase():"";return X.includes(O)||be.includes(O)||ne.agentId.toLowerCase().includes(O)}),U=ne=>RH(ne.runtimeState,ne.clientId),W=[],H=[];for(const ne of D)(ne.type==="human"?W:H).push(ne);return W.sort((ne,X)=>U(ne)-U(X)),H.sort((ne,X)=>U(ne)-U(X)),{humans:W,agents:H,totalAll:M.length}},[g,f,h,l,o]),E=x.useMemo(()=>{const M=(g==null?void 0:g.agents)??[];return{working:M.filter(O=>O.runtimeState==="working").length,blocked:M.filter(O=>O.runtimeState==="blocked").length,error:M.filter(O=>O.runtimeState==="error").length}},[g]),A=[{value:"all",label:"all",count:C},{value:"active",label:"active",count:E.working},{value:"attn",label:"attn",count:E.blocked+E.error,warn:E.blocked+E.error>0}],z=M=>{var ne;const O=e===M.agentId,D=yN(M.runtimeState,M.clientId),U=M.clientId?((ne=o(M.clientId))==null?void 0:ne.hostname)??M.clientId.slice(0,8):null,W=M.activeSessions??0,H=M.totalSessions??0;return u.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("button",{type:"button",onClick:()=>n(O?null:M.agentId),className:_e("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"var(--sp-3_5) 1fr auto",columnGap:8,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-3)",background:O?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${O?"var(--accent)":"transparent"}`},children:[u.jsx(Kr,{state:D,size:8}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(M.agentId)}),M.type==="human"&&u.jsx("span",{className:"mono uppercase text-eyebrow",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),u.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:D==="offline"?"disconnected":U||"—"})]}),u.jsx("div",{className:"flex flex-col items-end gap-0.5",children:H>0&&u.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[W,u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",H]})]})})]}),O&&u.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!b||b.length===0)&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-4)"},children:"No sessions yet"}),b==null?void 0:b.filter(X=>X.state!=="evicted").map(X=>{const be=X.state==="active"?"working":"idle";return u.jsxs("button",{type:"button",onClick:()=>a(M.agentId,X.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"var(--sp-3_5) 1fr",columnGap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",background:t===X.chatId?"var(--bg-hover)":"transparent",color:X.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:fe=>{t!==X.chatId&&(fe.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:fe=>{t!==X.chatId&&(fe.currentTarget.style.background="transparent")},children:[u.jsx(Kr,{state:be,size:6}),u.jsx("span",{className:"truncate text-body",style:{color:X.topic||X.summary?"var(--fg-2)":"var(--fg-4)"},children:X.topic||X.summary||`Chat · ${X.chatId.slice(0,8)}`})]},X.chatId)}),u.jsxs("button",{type:"button",onClick:()=>S.mutate(M.agentId),disabled:S.isPending,className:"w-full flex items-center text-left transition-colors text-body",style:{gap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-3)"},onMouseEnter:X=>{X.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:X=>{X.currentTarget.style.background="transparent"},children:[u.jsx(Xr,{className:"h-3 w-3"}),"New chat"]})]})]},M.agentId)},I=k.length+j.length;return u.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("div",{style:{marginBottom:8},children:u.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[C," members"]})}),u.jsxs("div",{className:"relative",children:[u.jsx(vf,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),u.jsx("input",{value:f,onChange:M=>m(M.target.value),placeholder:"Filter…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2) var(--sp-1_25) var(--sp-6_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),u.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:A.map(M=>u.jsx(gu,{active:h===M.value,count:M.count,warn:M.warn,onClick:()=>y(M.value),children:M.label},M.value))})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[u.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[u.jsx(DH,{}),"5m"]}),u.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:c.stale?"stale":"live"})]}),u.jsx(AH,{aggregated:c.aggregated,stale:c.stale}),u.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[u.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[E.working," working"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[E.blocked," blocked"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[E.error," error"]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[I===0&&u.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:f||h!=="all"?"No matches":"No agents"}),j.length>0&&u.jsxs("div",{children:[u.jsx(Aw,{label:"Agents",count:j.length}),j.map(z)]}),k.length>0&&u.jsxs("div",{children:[u.jsx(Aw,{label:"Humans",count:k.length}),k.map(z)]})]})]})}function Aw({label:e,count:t}){return u.jsxs("div",{className:"mono uppercase sticky top-0 z-10 text-eyebrow",style:{padding:"var(--sp-1_25) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[e," · ",t]})}function DH(){return u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[u.jsx("title",{children:"pulse"}),u.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function MH(){const[e,t]=yf(),n=e.get("a"),a=e.get("c");tE();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:c}=qe({queryKey:["agent-sessions",n],queryFn:()=>n?to(n):Promise.resolve([]),enabled:!!n&&!a});return x.useEffect(()=>{if(!n||a||!c||c.length===0)return;const f=[...c].filter(m=>m.state!=="evicted").sort((m,h)=>(h.lastActivityAt??"").localeCompare(m.lastActivityAt??""))[0];f&&t({a:n,c:f.chatId},{replace:!0})},[n,a,c,t]),u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(OH,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),u.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:u.jsx(jH,{selectedAgentId:n,selectedChatId:a})}),n&&u.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:u.jsx(NH,{selectedAgentId:n,selectedChatId:a})})]})}const LH=new yA({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function IH(){return u.jsx(vA,{client:LH,children:u.jsx(iR,{children:u.jsx(QT,{children:u.jsxs(wT,{children:[u.jsx(rr,{path:"/login",element:u.jsx(L7,{})}),u.jsx(rr,{path:"/signup",element:u.jsx(pf,{to:"/login",replace:!0})}),u.jsx(rr,{path:"/auth/github/complete",element:u.jsx(I7,{})}),u.jsx(rr,{path:"/invite/:token",element:u.jsx(z7,{})}),u.jsx(rr,{element:u.jsx(dR,{}),children:u.jsxs(rr,{element:u.jsx(dU,{children:u.jsx(WD,{children:u.jsx(wM,{})})}),children:[u.jsx(rr,{index:!0,element:u.jsx(MH,{})}),u.jsx(rr,{path:"agents",element:u.jsx(b7,{})}),u.jsx(rr,{path:"agents/:uuid",element:u.jsx(r7,{})}),u.jsx(rr,{path:"clients",element:u.jsx(C7,{})}),u.jsx(rr,{path:"settings",element:u.jsx(W7,{})}),u.jsx(rr,{path:"admin",element:u.jsx(zU,{})})]})})]})})})})}const kN=document.getElementById("root");if(!kN)throw new Error("Root element not found");Z2.createRoot(kN).render(u.jsx(x.StrictMode,{children:u.jsx(IH,{})}));export{vl as F,Zu as L,lt as c,u as j,x as r};