@agent-team-foundation/first-tree-hub 0.9.11 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,371 +0,0 @@
1
- var d0=e=>{throw TypeError(e)};var Am=(e,t,n)=>t.has(e)||d0("Cannot "+n);var L=(e,t,n)=>(Am(e,t,"read from private field"),n?n.call(e):t.get(e)),Te=(e,t,n)=>t.has(e)?d0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),be=(e,t,n,a)=>(Am(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),He=(e,t,n)=>(Am(e,t,"access private method"),n);var nd=(e,t,n,a)=>({set _(l){be(e,t,l,n)},get _(){return L(e,t,a)}});function I_(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 u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).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 Qd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tm={exports:{}},Vo={};/**
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 f0;function U_(){if(f0)return Vo;f0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+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:u,ref:l!==void 0?l:null,props:o}}return Vo.Fragment=t,Vo.jsx=n,Vo.jsxs=n,Vo}var h0;function B_(){return h0||(h0=1,Tm.exports=U_()),Tm.exports}var d=B_(),Rm={exports:{}},Ue={};/**
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 m0;function P_(){if(m0)return Ue;m0=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"),u=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(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(I,U,_){this.props=I,this.context=U,this.refs=E,this.updater=_||k}C.prototype.isReactComponent={},C.prototype.setState=function(I,U){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,U,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=C.prototype;function O(I,U,_){this.props=I,this.context=U,this.refs=E,this.updater=_||k}var B=O.prototype=new T;B.constructor=O,j(B,C.prototype),B.isPureReactComponent=!0;var D=Array.isArray;function R(){}var P={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function re(I,U,_){var le=_.ref;return{$$typeof:e,type:I,key:U,ref:le!==void 0?le:null,props:_}}function F(I,U){return re(I.type,U,I.props)}function de(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function W(I){var U={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(_){return U[_]})}var ye=/\/+/g;function me(I,U){return typeof I=="object"&&I!==null&&I.key!=null?W(""+I.key):U.toString(36)}function te(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(R,R):(I.status="pending",I.then(function(U){I.status==="pending"&&(I.status="fulfilled",I.value=U)},function(U){I.status==="pending"&&(I.status="rejected",I.reason=U)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function q(I,U,_,le,V){var ue=typeof I;(ue==="undefined"||ue==="boolean")&&(I=null);var Se=!1;if(I===null)Se=!0;else switch(ue){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(I.$$typeof){case e:case t:Se=!0;break;case y:return Se=I._init,q(Se(I._payload),U,_,le,V)}}if(Se)return V=V(I),Se=le===""?"."+me(I,0):le,D(V)?(_="",Se!=null&&(_=Se.replace(ye,"$&/")+"/"),q(V,U,_,"",function(Ie){return Ie})):V!=null&&(de(V)&&(V=F(V,_+(V.key==null||I&&I.key===V.key?"":(""+V.key).replace(ye,"$&/")+"/")+Se)),U.push(V)),1;Se=0;var ee=le===""?".":le+":";if(D(I))for(var fe=0;fe<I.length;fe++)le=I[fe],ue=ee+me(le,fe),Se+=q(le,U,_,ue,V);else if(fe=S(I),typeof fe=="function")for(I=fe.call(I),fe=0;!(le=I.next()).done;)le=le.value,ue=ee+me(le,fe++),Se+=q(le,U,_,ue,V);else if(ue==="object"){if(typeof I.then=="function")return q(te(I),U,_,le,V);throw U=String(I),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Se}function oe(I,U,_){if(I==null)return I;var le=[],V=0;return q(I,le,"","",function(ue){return U.call(_,ue,V++)}),le}function K(I){if(I._status===-1){var U=I._result;U=U(),U.then(function(_){(I._status===0||I._status===-1)&&(I._status=1,I._result=_)},function(_){(I._status===0||I._status===-1)&&(I._status=2,I._result=_)}),I._status===-1&&(I._status=0,I._result=U)}if(I._status===1)return I._result.default;throw I._result}var he=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},A={map:oe,forEach:function(I,U,_){oe(I,function(){U.apply(this,arguments)},_)},count:function(I){var U=0;return oe(I,function(){U++}),U},toArray:function(I){return oe(I,function(U){return U})||[]},only:function(I){if(!de(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Ue.Activity=g,Ue.Children=A,Ue.Component=C,Ue.Fragment=n,Ue.Profiler=l,Ue.PureComponent=O,Ue.StrictMode=a,Ue.Suspense=m,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(I){return P.H.useMemoCache(I)}},Ue.cache=function(I){return function(){return I.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(I,U,_){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var le=j({},I.props),V=I.key;if(U!=null)for(ue in U.key!==void 0&&(V=""+U.key),U)!Z.call(U,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&U.ref===void 0||(le[ue]=U[ue]);var ue=arguments.length-2;if(ue===1)le.children=_;else if(1<ue){for(var Se=Array(ue),ee=0;ee<ue;ee++)Se[ee]=arguments[ee+2];le.children=Se}return re(I.type,V,le)},Ue.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:o,_context:I},I},Ue.createElement=function(I,U,_){var le,V={},ue=null;if(U!=null)for(le in U.key!==void 0&&(ue=""+U.key),U)Z.call(U,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(V[le]=U[le]);var Se=arguments.length-2;if(Se===1)V.children=_;else if(1<Se){for(var ee=Array(Se),fe=0;fe<Se;fe++)ee[fe]=arguments[fe+2];V.children=ee}if(I&&I.defaultProps)for(le in Se=I.defaultProps,Se)V[le]===void 0&&(V[le]=Se[le]);return re(I,ue,V)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(I){return{$$typeof:f,render:I}},Ue.isValidElement=de,Ue.lazy=function(I){return{$$typeof:y,_payload:{_status:-1,_result:I},_init:K}},Ue.memo=function(I,U){return{$$typeof:h,type:I,compare:U===void 0?null:U}},Ue.startTransition=function(I){var U=P.T,_={};P.T=_;try{var le=I(),V=P.S;V!==null&&V(_,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(R,he)}catch(ue){he(ue)}finally{U!==null&&_.types!==null&&(U.types=_.types),P.T=U}},Ue.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ue.use=function(I){return P.H.use(I)},Ue.useActionState=function(I,U,_){return P.H.useActionState(I,U,_)},Ue.useCallback=function(I,U){return P.H.useCallback(I,U)},Ue.useContext=function(I){return P.H.useContext(I)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(I,U){return P.H.useDeferredValue(I,U)},Ue.useEffect=function(I,U){return P.H.useEffect(I,U)},Ue.useEffectEvent=function(I){return P.H.useEffectEvent(I)},Ue.useId=function(){return P.H.useId()},Ue.useImperativeHandle=function(I,U,_){return P.H.useImperativeHandle(I,U,_)},Ue.useInsertionEffect=function(I,U){return P.H.useInsertionEffect(I,U)},Ue.useLayoutEffect=function(I,U){return P.H.useLayoutEffect(I,U)},Ue.useMemo=function(I,U){return P.H.useMemo(I,U)},Ue.useOptimistic=function(I,U){return P.H.useOptimistic(I,U)},Ue.useReducer=function(I,U,_){return P.H.useReducer(I,U,_)},Ue.useRef=function(I){return P.H.useRef(I)},Ue.useState=function(I){return P.H.useState(I)},Ue.useSyncExternalStore=function(I,U,_){return P.H.useSyncExternalStore(I,U,_)},Ue.useTransition=function(){return P.H.useTransition()},Ue.version="19.2.4",Ue}var p0;function yg(){return p0||(p0=1,Rm.exports=P_()),Rm.exports}var x=yg();const $_=Qd(x),vg=I_({__proto__:null,default:$_},[x]);var zm={exports:{}},Qo={},Om={exports:{}},Dm={};/**
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 g0;function F_(){return g0||(g0=1,(function(e){function t(q,oe){var K=q.length;q.push(oe);e:for(;0<K;){var he=K-1>>>1,A=q[he];if(0<l(A,oe))q[he]=oe,q[K]=A,K=he;else break e}}function n(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var oe=q[0],K=q.pop();if(K!==oe){q[0]=K;e:for(var he=0,A=q.length,I=A>>>1;he<I;){var U=2*(he+1)-1,_=q[U],le=U+1,V=q[le];if(0>l(_,K))le<A&&0>l(V,_)?(q[he]=V,q[le]=K,he=le):(q[he]=_,q[U]=K,he=U);else if(le<A&&0>l(V,K))q[he]=V,q[le]=K,he=le;else break e}}return oe}function l(q,oe){var K=q.sortIndex-oe.sortIndex;return K!==0?K:q.id-oe.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 u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],y=1,g=null,b=3,S=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function B(q){for(var oe=n(h);oe!==null;){if(oe.callback===null)a(h);else if(oe.startTime<=q)a(h),oe.sortIndex=oe.expirationTime,t(m,oe);else break;oe=n(h)}}function D(q){if(j=!1,B(q),!k)if(n(m)!==null)k=!0,R||(R=!0,W());else{var oe=n(h);oe!==null&&te(D,oe.startTime-q)}}var R=!1,P=-1,Z=5,re=-1;function F(){return E?!0:!(e.unstable_now()-re<Z)}function de(){if(E=!1,R){var q=e.unstable_now();re=q;var oe=!0;try{e:{k=!1,j&&(j=!1,T(P),P=-1),S=!0;var K=b;try{t:{for(B(q),g=n(m);g!==null&&!(g.expirationTime>q&&F());){var he=g.callback;if(typeof he=="function"){g.callback=null,b=g.priorityLevel;var A=he(g.expirationTime<=q);if(q=e.unstable_now(),typeof A=="function"){g.callback=A,B(q),oe=!0;break t}g===n(m)&&a(m),B(q)}else a(m);g=n(m)}if(g!==null)oe=!0;else{var I=n(h);I!==null&&te(D,I.startTime-q),oe=!1}}break e}finally{g=null,b=K,S=!1}oe=void 0}}finally{oe?W():R=!1}}}var W;if(typeof O=="function")W=function(){O(de)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,me=ye.port2;ye.port1.onmessage=de,W=function(){me.postMessage(null)}}else W=function(){C(de,0)};function te(q,oe){P=C(function(){q(e.unstable_now())},oe)}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(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(q){switch(b){case 1:case 2:case 3:var oe=3;break;default:oe=b}var K=b;b=oe;try{return q()}finally{b=K}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(q,oe){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var K=b;b=q;try{return oe()}finally{b=K}},e.unstable_scheduleCallback=function(q,oe,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,q){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=K+A,q={id:y++,callback:oe,priorityLevel:q,startTime:K,expirationTime:A,sortIndex:-1},K>he?(q.sortIndex=K,t(h,q),n(m)===null&&q===n(h)&&(j?(T(P),P=-1):j=!0,te(D,K-he))):(q.sortIndex=A,t(m,q),k||S||(k=!0,R||(R=!0,W()))),q},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(q){var oe=b;return function(){var K=b;b=oe;try{return q.apply(this,arguments)}finally{b=K}}}})(Dm)),Dm}var y0;function q_(){return y0||(y0=1,Om.exports=F_()),Om.exports}var Mm={exports:{}},hn={};/**
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 v0;function H_(){if(v0)return hn;v0=1;var e=yg();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 u=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 hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,hn.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)},hn.flushSync=function(m){var h=u.T,y=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=h,a.p=y,a.d.f()}},hn.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))},hn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},hn.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})}},hn.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)},hn.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})}},hn.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)},hn.requestFormReset=function(m){a.d.r(m)},hn.unstable_batchedUpdates=function(m,h){return m(h)},hn.useFormState=function(m,h,y){return u.H.useFormState(m,h,y)},hn.useFormStatus=function(){return u.H.useHostTransitionStatus()},hn.version="19.2.4",hn}var b0;function XS(){if(b0)return Mm.exports;b0=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(),Mm.exports=H_(),Mm.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 x0;function Z_(){if(x0)return Qo;x0=1;var e=q_(),t=yg(),n=XS();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 u(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,c=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===c)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==c.return)s=p,c=v;else{for(var w=!1,N=p.child;N;){if(N===s){w=!0,s=p,c=v;break}if(N===c){w=!0,c=p,s=v;break}N=N.sibling}if(!w){for(N=v.child;N;){if(N===s){w=!0,s=v,c=p;break}if(N===c){w=!0,c=v,s=p;break}N=N.sibling}if(!w)throw Error(a(189))}}if(s.alternate!==c)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"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),O=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function W(r){return r===null||typeof r!="object"?null:(r=de&&r[de]||r["@@iterator"],typeof r=="function"?r:null)}var ye=Symbol.for("react.client.reference");function me(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ye?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case R:return"SuspenseList";case re:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case T:return(r._context.displayName||"Context")+".Consumer";case B:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case P:return i=r.displayName||null,i!==null?i:me(r.type)||"Memo";case Z:i=r._payload,r=r._init;try{return me(r(i))}catch{}}return null}var te=Array.isArray,q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},he=[],A=-1;function I(r){return{current:r}}function U(r){0>A||(r.current=he[A],he[A]=null,A--)}function _(r,i){A++,he[A]=r.current,r.current=i}var le=I(null),V=I(null),ue=I(null),Se=I(null);function ee(r,i){switch(_(ue,i),_(V,r),_(le,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Dx(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Dx(i),r=Mx(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}U(le),_(le,r)}function fe(){U(le),U(V),U(ue)}function Ie(r){r.memoizedState!==null&&_(Se,r);var i=le.current,s=Mx(i,r.type);i!==s&&(_(V,r),_(le,s))}function Be(r){V.current===r&&(U(le),U(V)),Se.current===r&&(U(Se),Fo._currentValue=K)}var St,Vt;function Jt(r){if(St===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);St=i&&i[1]||"",Vt=-1<s.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+St+r+Vt}var Nr=!1;function _r(r,i){if(!r||Nr)return"";Nr=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={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(J){var Y=J}Reflect.construct(r,[],ce)}else{try{ce.call()}catch(J){Y=J}r.call(ce.prototype)}}else{try{throw Error()}catch(J){Y=J}(ce=r())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(J){if(J&&Y&&typeof J.stack=="string")return[J.stack,Y.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),w=v[0],N=v[1];if(w&&N){var M=w.split(`
44
- `),G=N.split(`
45
- `);for(p=c=0;c<M.length&&!M[c].includes("DetermineComponentFrameRoot");)c++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(c===M.length||p===G.length)for(c=M.length-1,p=G.length-1;1<=c&&0<=p&&M[c]!==G[p];)p--;for(;1<=c&&0<=p;c--,p--)if(M[c]!==G[p]){if(c!==1||p!==1)do if(c--,p--,0>p||M[c]!==G[p]){var ne=`
46
- `+M[c].replace(" at new "," at ");return r.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",r.displayName)),ne}while(1<=c&&0<=p);break}}}finally{Nr=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Jt(s):""}function Oa(r,i){switch(r.tag){case 26:case 27:case 5:return Jt(r.type);case 16:return Jt("Lazy");case 13:return r.child!==i&&i!==null?Jt("Suspense Fallback"):Jt("Suspense");case 19:return Jt("SuspenseList");case 0:case 15:return _r(r.type,!1);case 11:return _r(r.type.render,!1);case 1:return _r(r.type,!0);case 31:return Jt("Activity");default:return""}}function Da(r){try{var i="",s=null;do i+=Oa(r,s),s=r,r=r.return;while(r);return i}catch(c){return`
47
- Error generating stack: `+c.message+`
48
- `+c.stack}}var Ar=Object.prototype.hasOwnProperty,Gr=e.unstable_scheduleCallback,Ma=e.unstable_cancelCallback,Mi=e.unstable_shouldYield,La=e.unstable_requestPaint,tn=e.unstable_now,Nl=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,De=e.unstable_LowPriority,Pe=e.unstable_IdlePriority,nn=e.log,er=e.unstable_setDisableYieldValue,rn=null,At=null;function an(r){if(typeof nn=="function"&&er(r),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(rn,r)}catch{}}var ot=Math.clz32?Math.clz32:_l,Tr=Math.log,fn=Math.LN2;function _l(r){return r>>>=0,r===0?32:31-(Tr(r)/fn|0)|0}var Al=256,Tl=262144,Li=4194304;function Rr(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 Rl(r,i,s){var c=r.pendingLanes;if(c===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var N=c&134217727;return N!==0?(c=N&~v,c!==0?p=Rr(c):(w&=N,w!==0?p=Rr(w):s||(s=N&~r,s!==0&&(p=Rr(s))))):(N=c&~v,N!==0?p=Rr(N):w!==0?p=Rr(w):s||(s=c&~r,s!==0&&(p=Rr(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 Ii(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function xf(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 Bu(){var r=Li;return Li<<=1,(Li&62914560)===0&&(Li=4194304),r}function no(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function Ui(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Sf(r,i,s,c,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,M=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var ne=31-ot(s),ce=1<<ne;N[ne]=0,M[ne]=-1;var Y=G[ne];if(Y!==null)for(G[ne]=null,ne=0;ne<Y.length;ne++){var J=Y[ne];J!==null&&(J.lane&=-536870913)}s&=~ce}c!==0&&tr(r,c,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~i))}function tr(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-ot(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function Bi(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var c=31-ot(s),p=1<<c;p&i|r[c]&i&&(r[c]|=i),s&=~p}}function zl(r,i){var s=i&-i;return s=(s&42)!==0?1:Ol(s),(s&(r.suspendedLanes|i))!==0?0:s}function Ol(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 Pi(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Pu(){var r=oe.p;return r!==0?r:(r=window.event,r===void 0?32:a0(r.type))}function $u(r,i){var s=oe.p;try{return oe.p=r,i()}finally{oe.p=s}}var br=Math.random().toString(36).slice(2),Ut="__reactFiber$"+br,ln="__reactProps$"+br,Kr="__reactContainer$"+br,Dl="__reactEvents$"+br,Fu="__reactListeners$"+br,qu="__reactHandles$"+br,ro="__reactResources$"+br,Ia="__reactMarker$"+br;function Ml(r){delete r[Ut],delete r[ln],delete r[Dl],delete r[Fu],delete r[qu]}function Yr(r){var i=r[Ut];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Kr]||s[Ut]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=Fx(r);r!==null;){if(s=r[Ut])return s;r=Fx(r)}return i}r=s,s=r.parentNode}return null}function Xr(r){if(r=r[Ut]||r[Kr]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Ua(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Jr(r){var i=r[ro];return i||(i=r[ro]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function X(r){r[Ia]=!0}var $e=new Set,Pn={};function Nn(r,i){$i(r,i),$i(r+"Capture",i)}function $i(r,i){for(Pn[r]=i,r=0;r<i.length;r++)$e.add(i[r])}var _E=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]*$"),jy={},Cy={};function AE(r){return Ar.call(Cy,r)?!0:Ar.call(jy,r)?!1:_E.test(r)?Cy[r]=!0:(jy[r]=!0,!1)}function Hu(r,i,s){if(AE(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function Zu(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 Wr(r,i,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+c)}}function nr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Ey(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function TE(r,i,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,v=c.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:c.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function wf(r){if(!r._valueTracker){var i=Ey(r)?"checked":"value";r._valueTracker=TE(r,i,""+r[i])}}function Ny(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),c="";return r&&(c=Ey(r)?r.checked?"true":"false":r.value),r=c,r!==s?(i.setValue(r),!0):!1}function Vu(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 RE=/[\n"\\]/g;function rr(r){return r.replace(RE,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function kf(r,i,s,c,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=""+nr(i)):r.value!==""+nr(i)&&(r.value=""+nr(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?jf(r,w,nr(i)):s!=null?jf(r,w,nr(s)):c!=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=""+nr(N):r.removeAttribute("name")}function _y(r,i,s,c,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)){wf(r);return}s=s!=null?""+nr(s):"",i=i!=null?""+nr(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=N?r.checked:!!c,r.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),wf(r)}function jf(r,i,s){i==="number"&&Vu(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Ll(r,i,s,c){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&&c&&(r[s].defaultSelected=!0)}else{for(s=""+nr(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Ay(r,i,s){if(i!=null&&(i=""+nr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+nr(s):""}function Ty(r,i,s,c){if(i==null){if(c!=null){if(s!=null)throw Error(a(92));if(te(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),i=s}s=nr(i),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),wf(r)}function Il(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var zE=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 Ry(r,i,s){var c=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":c?r.setProperty(i,s):typeof s!="number"||s===0||zE.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function zy(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&s[p]!==c&&Ry(r,p,c)}else for(var v in i)i.hasOwnProperty(v)&&Ry(r,v,i[v])}function Cf(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 OE=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"]]),DE=/^[\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 Qu(r){return DE.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ea(){}var Ef=null;function Nf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ul=null,Bl=null;function Oy(r){var i=Xr(r);if(i&&(r=i.stateNode)){var s=r[ln]||null;e:switch(r=i.stateNode,i.type){case"input":if(kf(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="'+rr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var c=s[i];if(c!==r&&c.form===r.form){var p=c[ln]||null;if(!p)throw Error(a(90));kf(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)c=s[i],c.form===r.form&&Ny(c)}break e;case"textarea":Ay(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Ll(r,!!s.multiple,i,!1)}}}var _f=!1;function Dy(r,i,s){if(_f)return r(i,s);_f=!0;try{var c=r(i);return c}finally{if(_f=!1,(Ul!==null||Bl!==null)&&(Dc(),Ul&&(i=Ul,r=Bl,Bl=Ul=null,Oy(i),r)))for(i=0;i<r.length;i++)Oy(r[i])}}function ao(r,i){var s=r.stateNode;if(s===null)return null;var c=s[ln]||null;if(c===null)return null;s=c[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":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Af=!1;if(ta)try{var io={};Object.defineProperty(io,"passive",{get:function(){Af=!0}}),window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{Af=!1}var Ba=null,Tf=null,Gu=null;function My(){if(Gu)return Gu;var r,i=Tf,s=i.length,c,p="value"in Ba?Ba.value:Ba.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var w=s-r;for(c=1;c<=w&&i[s-c]===p[v-c];c++);return Gu=p.slice(r,1<c?1-c:void 0)}function Ku(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 Yu(){return!0}function Ly(){return!1}function _n(r){function i(s,c,p,v,w){this._reactName=s,this._targetInst=p,this.type=c,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)?Yu:Ly,this.isPropagationStopped=Ly,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=Yu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Yu)},persist:function(){},isPersistent:Yu}),i}var Fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xu=_n(Fi),lo=g({},Fi,{view:0,detail:0}),ME=_n(lo),Rf,zf,so,Ju=g({},lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Df,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!==so&&(so&&r.type==="mousemove"?(Rf=r.screenX-so.screenX,zf=r.screenY-so.screenY):zf=Rf=0,so=r),Rf)},movementY:function(r){return"movementY"in r?r.movementY:zf}}),Iy=_n(Ju),LE=g({},Ju,{dataTransfer:0}),IE=_n(LE),UE=g({},lo,{relatedTarget:0}),Of=_n(UE),BE=g({},Fi,{animationName:0,elapsedTime:0,pseudoElement:0}),PE=_n(BE),$E=g({},Fi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),FE=_n($E),qE=g({},Fi,{data:0}),Uy=_n(qE),HE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZE={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"},VE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QE(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=VE[r])?!!i[r]:!1}function Df(){return QE}var GE=g({},lo,{key:function(r){if(r.key){var i=HE[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Ku(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?ZE[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Df,charCode:function(r){return r.type==="keypress"?Ku(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ku(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),KE=_n(GE),YE=g({},Ju,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),By=_n(YE),XE=g({},lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Df}),JE=_n(XE),WE=g({},Fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),eN=_n(WE),tN=g({},Ju,{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}),nN=_n(tN),rN=g({},Fi,{newState:0,oldState:0}),aN=_n(rN),iN=[9,13,27,32],Mf=ta&&"CompositionEvent"in window,oo=null;ta&&"documentMode"in document&&(oo=document.documentMode);var lN=ta&&"TextEvent"in window&&!oo,Py=ta&&(!Mf||oo&&8<oo&&11>=oo),$y=" ",Fy=!1;function qy(r,i){switch(r){case"keyup":return iN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hy(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Pl=!1;function sN(r,i){switch(r){case"compositionend":return Hy(i);case"keypress":return i.which!==32?null:(Fy=!0,$y);case"textInput":return r=i.data,r===$y&&Fy?null:r;default:return null}}function oN(r,i){if(Pl)return r==="compositionend"||!Mf&&qy(r,i)?(r=My(),Gu=Tf=Ba=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 Py&&i.locale!=="ko"?null:i.data;default:return null}}var uN={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 Zy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!uN[r.type]:i==="textarea"}function Vy(r,i,s,c){Ul?Bl?Bl.push(c):Bl=[c]:Ul=c,i=$c(i,"onChange"),0<i.length&&(s=new Xu("onChange","change",null,s,c),r.push({event:s,listeners:i}))}var uo=null,co=null;function cN(r){_x(r,0)}function Wu(r){var i=Ua(r);if(Ny(i))return r}function Qy(r,i){if(r==="change")return i}var Gy=!1;if(ta){var Lf;if(ta){var If="oninput"in document;if(!If){var Ky=document.createElement("div");Ky.setAttribute("oninput","return;"),If=typeof Ky.oninput=="function"}Lf=If}else Lf=!1;Gy=Lf&&(!document.documentMode||9<document.documentMode)}function Yy(){uo&&(uo.detachEvent("onpropertychange",Xy),co=uo=null)}function Xy(r){if(r.propertyName==="value"&&Wu(co)){var i=[];Vy(i,co,r,Nf(r)),Dy(cN,i)}}function dN(r,i,s){r==="focusin"?(Yy(),uo=i,co=s,uo.attachEvent("onpropertychange",Xy)):r==="focusout"&&Yy()}function fN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Wu(co)}function hN(r,i){if(r==="click")return Wu(i)}function mN(r,i){if(r==="input"||r==="change")return Wu(i)}function pN(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var $n=typeof Object.is=="function"?Object.is:pN;function fo(r,i){if($n(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),c=Object.keys(i);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!Ar.call(i,p)||!$n(r[p],i[p]))return!1}return!0}function Jy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Wy(r,i){var s=Jy(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=i&&c>=i)return{node:s,offset:i-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Jy(s)}}function ev(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?ev(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function tv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Vu(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=Vu(r.document)}return i}function Uf(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 gN=ta&&"documentMode"in document&&11>=document.documentMode,$l=null,Bf=null,ho=null,Pf=!1;function nv(r,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Pf||$l==null||$l!==Vu(c)||(c=$l,"selectionStart"in c&&Uf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),ho&&fo(ho,c)||(ho=c,c=$c(Bf,"onSelect"),0<c.length&&(i=new Xu("onSelect","select",null,i,s),r.push({event:i,listeners:c}),i.target=$l)))}function qi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Fl={animationend:qi("Animation","AnimationEnd"),animationiteration:qi("Animation","AnimationIteration"),animationstart:qi("Animation","AnimationStart"),transitionrun:qi("Transition","TransitionRun"),transitionstart:qi("Transition","TransitionStart"),transitioncancel:qi("Transition","TransitionCancel"),transitionend:qi("Transition","TransitionEnd")},$f={},rv={};ta&&(rv=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function Hi(r){if($f[r])return $f[r];if(!Fl[r])return r;var i=Fl[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in rv)return $f[r]=i[s];return r}var av=Hi("animationend"),iv=Hi("animationiteration"),lv=Hi("animationstart"),yN=Hi("transitionrun"),vN=Hi("transitionstart"),bN=Hi("transitioncancel"),sv=Hi("transitionend"),ov=new Map,Ff="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(" ");Ff.push("scrollEnd");function xr(r,i){ov.set(r,i),Nn(i,[r])}var ec=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)},ar=[],ql=0,qf=0;function tc(){for(var r=ql,i=qf=ql=0;i<r;){var s=ar[i];ar[i++]=null;var c=ar[i];ar[i++]=null;var p=ar[i];ar[i++]=null;var v=ar[i];if(ar[i++]=null,c!==null&&p!==null){var w=c.pending;w===null?p.next=p:(p.next=w.next,w.next=p),c.pending=p}v!==0&&uv(s,p,v)}}function nc(r,i,s,c){ar[ql++]=r,ar[ql++]=i,ar[ql++]=s,ar[ql++]=c,qf|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Hf(r,i,s,c){return nc(r,i,s,c),rc(r)}function Zi(r,i){return nc(r,null,null,i),rc(r)}function uv(r,i,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,c=v.alternate,c!==null&&(c.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-ot(s),r=v.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=s|536870912),v):null}function rc(r){if(50<Mo)throw Mo=0,Wh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Hl={};function xN(r,i,s,c){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=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(r,i,s,c){return new xN(r,i,s,c)}function Zf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function na(r,i){var s=r.alternate;return s===null?(s=Fn(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 cv(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 ac(r,i,s,c,p,v){var w=0;if(c=r,typeof r=="function")Zf(r)&&(w=1);else if(typeof r=="string")w=C_(r,s,le.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case re:return r=Fn(31,s,i,p),r.elementType=re,r.lanes=v,r;case j:return Vi(s.children,p,v,i);case E:w=8,p|=24;break;case C:return r=Fn(12,s,i,p|2),r.elementType=C,r.lanes=v,r;case D:return r=Fn(13,s,i,p),r.elementType=D,r.lanes=v,r;case R:return r=Fn(19,s,i,p),r.elementType=R,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:w=10;break e;case T:w=9;break e;case B:w=11;break e;case P:w=14;break e;case Z:w=16,c=null;break e}w=29,s=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Fn(w,s,i,p),i.elementType=r,i.type=c,i.lanes=v,i}function Vi(r,i,s,c){return r=Fn(7,r,c,i),r.lanes=s,r}function Vf(r,i,s){return r=Fn(6,r,null,i),r.lanes=s,r}function dv(r){var i=Fn(18,null,null,0);return i.stateNode=r,i}function Qf(r,i,s){return i=Fn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var fv=new WeakMap;function ir(r,i){if(typeof r=="object"&&r!==null){var s=fv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:Da(i)},fv.set(r,i),i)}return{value:r,source:i,stack:Da(i)}}var Zl=[],Vl=0,ic=null,mo=0,lr=[],sr=0,Pa=null,zr=1,Or="";function ra(r,i){Zl[Vl++]=mo,Zl[Vl++]=ic,ic=r,mo=i}function hv(r,i,s){lr[sr++]=zr,lr[sr++]=Or,lr[sr++]=Pa,Pa=r;var c=zr;r=Or;var p=32-ot(c)-1;c&=~(1<<p),s+=1;var v=32-ot(i)+p;if(30<v){var w=p-p%5;v=(c&(1<<w)-1).toString(32),c>>=w,p-=w,zr=1<<32-ot(i)+p|s<<p|c,Or=v+r}else zr=1<<v|s<<p|c,Or=r}function Gf(r){r.return!==null&&(ra(r,1),hv(r,1,0))}function Kf(r){for(;r===ic;)ic=Zl[--Vl],Zl[Vl]=null,mo=Zl[--Vl],Zl[Vl]=null;for(;r===Pa;)Pa=lr[--sr],lr[sr]=null,Or=lr[--sr],lr[sr]=null,zr=lr[--sr],lr[sr]=null}function mv(r,i){lr[sr++]=zr,lr[sr++]=Or,lr[sr++]=Pa,zr=i.id,Or=i.overflow,Pa=r}var sn=null,jt=null,tt=!1,$a=null,or=!1,Yf=Error(a(519));function Fa(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw po(ir(i,r)),Yf}function pv(r){var i=r.stateNode,s=r.type,c=r.memoizedProps;switch(i[Ut]=r,i[ln]=c,s){case"dialog":Ye("cancel",i),Ye("close",i);break;case"iframe":case"object":case"embed":Ye("load",i);break;case"video":case"audio":for(s=0;s<Io.length;s++)Ye(Io[s],i);break;case"source":Ye("error",i);break;case"img":case"image":case"link":Ye("error",i),Ye("load",i);break;case"details":Ye("toggle",i);break;case"input":Ye("invalid",i),_y(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ye("invalid",i);break;case"textarea":Ye("invalid",i),Ty(i,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||c.suppressHydrationWarning===!0||zx(i.textContent,s)?(c.popover!=null&&(Ye("beforetoggle",i),Ye("toggle",i)),c.onScroll!=null&&Ye("scroll",i),c.onScrollEnd!=null&&Ye("scrollend",i),c.onClick!=null&&(i.onclick=ea),i=!0):i=!1,i||Fa(r,!0)}function gv(r){for(sn=r.return;sn;)switch(sn.tag){case 5:case 31:case 13:or=!1;return;case 27:case 3:or=!0;return;default:sn=sn.return}}function Ql(r){if(r!==sn)return!1;if(!tt)return gv(r),tt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||mm(r.type,r.memoizedProps)),s=!s),s&&jt&&Fa(r),gv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));jt=$x(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));jt=$x(r)}else i===27?(i=jt,ni(r.type)?(r=bm,bm=null,jt=r):jt=i):jt=sn?cr(r.stateNode.nextSibling):null;return!0}function Qi(){jt=sn=null,tt=!1}function Xf(){var r=$a;return r!==null&&(zn===null?zn=r:zn.push.apply(zn,r),$a=null),r}function po(r){$a===null?$a=[r]:$a.push(r)}var Jf=I(null),Gi=null,aa=null;function qa(r,i,s){_(Jf,i._currentValue),i._currentValue=s}function ia(r){r._currentValue=Jf.current,U(Jf)}function Wf(r,i,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),r===s)break;r=r.return}}function eh(r,i,s,c){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 M=0;M<i.length;M++)if(N.context===i[M]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),Wf(v.return,s,r),c||(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),Wf(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 Gl(r,i,s,c){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;$n(p.pendingProps.value,w.value)||(r!==null?r.push(N):r=[N])}}else if(p===Se.current){if(w=p.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Fo):r=[Fo])}p=p.return}r!==null&&eh(i,r,s,c),i.flags|=262144}function lc(r){for(r=r.firstContext;r!==null;){if(!$n(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ki(r){Gi=r,aa=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function on(r){return yv(Gi,r)}function sc(r,i){return Gi===null&&Ki(r),yv(r,i)}function yv(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},aa===null){if(r===null)throw Error(a(308));aa=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else aa=aa.next=i;return s}var SN=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},wN=e.unstable_scheduleCallback,kN=e.unstable_NormalPriority,Bt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function th(){return{controller:new SN,data:new Map,refCount:0}}function go(r){r.refCount--,r.refCount===0&&wN(kN,function(){r.controller.abort()})}var yo=null,nh=0,Kl=0,Yl=null;function jN(r,i){if(yo===null){var s=yo=[];nh=0,Kl=im(),Yl={status:"pending",value:void 0,then:function(c){s.push(c)}}}return nh++,i.then(vv,vv),i}function vv(){if(--nh===0&&yo!==null){Yl!==null&&(Yl.status="fulfilled");var r=yo;yo=null,Kl=0,Yl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function CN(r,i){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){c.status="fulfilled",c.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var bv=q.S;q.S=function(r,i){nx=tn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&jN(r,i),bv!==null&&bv(r,i)};var Yi=I(null);function rh(){var r=Yi.current;return r!==null?r:yt.pooledCache}function oc(r,i){i===null?_(Yi,Yi.current):_(Yi,i.pool)}function xv(){var r=rh();return r===null?null:{parent:Bt._currentValue,pool:r}}var Xl=Error(a(460)),ah=Error(a(474)),uc=Error(a(542)),cc={then:function(){}};function Sv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function wv(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(ea,ea),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,jv(r),r;default:if(typeof i.status=="string")i.then(ea,ea);else{if(r=yt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(c){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=c}},function(c){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,jv(r),r}throw Ji=i,Xl}}function Xi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ji=s,Xl):s}}var Ji=null;function kv(){if(Ji===null)throw Error(a(459));var r=Ji;return Ji=null,r}function jv(r){if(r===Xl||r===uc)throw Error(a(483))}var Jl=null,vo=0;function dc(r){var i=vo;return vo+=1,Jl===null&&(Jl=[]),wv(Jl,r,i)}function bo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function fc(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 Cv(r){function i(H,$){if(r){var Q=H.deletions;Q===null?(H.deletions=[$],H.flags|=16):Q.push($)}}function s(H,$){if(!r)return null;for(;$!==null;)i(H,$),$=$.sibling;return null}function c(H){for(var $=new Map;H!==null;)H.key!==null?$.set(H.key,H):$.set(H.index,H),H=H.sibling;return $}function p(H,$){return H=na(H,$),H.index=0,H.sibling=null,H}function v(H,$,Q){return H.index=Q,r?(Q=H.alternate,Q!==null?(Q=Q.index,Q<$?(H.flags|=67108866,$):Q):(H.flags|=67108866,$)):(H.flags|=1048576,$)}function w(H){return r&&H.alternate===null&&(H.flags|=67108866),H}function N(H,$,Q,se){return $===null||$.tag!==6?($=Vf(Q,H.mode,se),$.return=H,$):($=p($,Q),$.return=H,$)}function M(H,$,Q,se){var Re=Q.type;return Re===j?ne(H,$,Q.props.children,se,Q.key):$!==null&&($.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===Z&&Xi(Re)===$.type)?($=p($,Q.props),bo($,Q),$.return=H,$):($=ac(Q.type,Q.key,Q.props,null,H.mode,se),bo($,Q),$.return=H,$)}function G(H,$,Q,se){return $===null||$.tag!==4||$.stateNode.containerInfo!==Q.containerInfo||$.stateNode.implementation!==Q.implementation?($=Qf(Q,H.mode,se),$.return=H,$):($=p($,Q.children||[]),$.return=H,$)}function ne(H,$,Q,se,Re){return $===null||$.tag!==7?($=Vi(Q,H.mode,se,Re),$.return=H,$):($=p($,Q),$.return=H,$)}function ce(H,$,Q){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Vf(""+$,H.mode,Q),$.return=H,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case S:return Q=ac($.type,$.key,$.props,null,H.mode,Q),bo(Q,$),Q.return=H,Q;case k:return $=Qf($,H.mode,Q),$.return=H,$;case Z:return $=Xi($),ce(H,$,Q)}if(te($)||W($))return $=Vi($,H.mode,Q,null),$.return=H,$;if(typeof $.then=="function")return ce(H,dc($),Q);if($.$$typeof===O)return ce(H,sc(H,$),Q);fc(H,$)}return null}function Y(H,$,Q,se){var Re=$!==null?$.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Re!==null?null:N(H,$,""+Q,se);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return Q.key===Re?M(H,$,Q,se):null;case k:return Q.key===Re?G(H,$,Q,se):null;case Z:return Q=Xi(Q),Y(H,$,Q,se)}if(te(Q)||W(Q))return Re!==null?null:ne(H,$,Q,se,null);if(typeof Q.then=="function")return Y(H,$,dc(Q),se);if(Q.$$typeof===O)return Y(H,$,sc(H,Q),se);fc(H,Q)}return null}function J(H,$,Q,se,Re){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return H=H.get(Q)||null,N($,H,""+se,Re);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case S:return H=H.get(se.key===null?Q:se.key)||null,M($,H,se,Re);case k:return H=H.get(se.key===null?Q:se.key)||null,G($,H,se,Re);case Z:return se=Xi(se),J(H,$,Q,se,Re)}if(te(se)||W(se))return H=H.get(Q)||null,ne($,H,se,Re,null);if(typeof se.then=="function")return J(H,$,Q,dc(se),Re);if(se.$$typeof===O)return J(H,$,Q,sc($,se),Re);fc($,se)}return null}function ke(H,$,Q,se){for(var Re=null,it=null,Ee=$,qe=$=0,We=null;Ee!==null&&qe<Q.length;qe++){Ee.index>qe?(We=Ee,Ee=null):We=Ee.sibling;var lt=Y(H,Ee,Q[qe],se);if(lt===null){Ee===null&&(Ee=We);break}r&&Ee&&lt.alternate===null&&i(H,Ee),$=v(lt,$,qe),it===null?Re=lt:it.sibling=lt,it=lt,Ee=We}if(qe===Q.length)return s(H,Ee),tt&&ra(H,qe),Re;if(Ee===null){for(;qe<Q.length;qe++)Ee=ce(H,Q[qe],se),Ee!==null&&($=v(Ee,$,qe),it===null?Re=Ee:it.sibling=Ee,it=Ee);return tt&&ra(H,qe),Re}for(Ee=c(Ee);qe<Q.length;qe++)We=J(Ee,H,qe,Q[qe],se),We!==null&&(r&&We.alternate!==null&&Ee.delete(We.key===null?qe:We.key),$=v(We,$,qe),it===null?Re=We:it.sibling=We,it=We);return r&&Ee.forEach(function(si){return i(H,si)}),tt&&ra(H,qe),Re}function Me(H,$,Q,se){if(Q==null)throw Error(a(151));for(var Re=null,it=null,Ee=$,qe=$=0,We=null,lt=Q.next();Ee!==null&&!lt.done;qe++,lt=Q.next()){Ee.index>qe?(We=Ee,Ee=null):We=Ee.sibling;var si=Y(H,Ee,lt.value,se);if(si===null){Ee===null&&(Ee=We);break}r&&Ee&&si.alternate===null&&i(H,Ee),$=v(si,$,qe),it===null?Re=si:it.sibling=si,it=si,Ee=We}if(lt.done)return s(H,Ee),tt&&ra(H,qe),Re;if(Ee===null){for(;!lt.done;qe++,lt=Q.next())lt=ce(H,lt.value,se),lt!==null&&($=v(lt,$,qe),it===null?Re=lt:it.sibling=lt,it=lt);return tt&&ra(H,qe),Re}for(Ee=c(Ee);!lt.done;qe++,lt=Q.next())lt=J(Ee,H,qe,lt.value,se),lt!==null&&(r&&lt.alternate!==null&&Ee.delete(lt.key===null?qe:lt.key),$=v(lt,$,qe),it===null?Re=lt:it.sibling=lt,it=lt);return r&&Ee.forEach(function(L_){return i(H,L_)}),tt&&ra(H,qe),Re}function gt(H,$,Q,se){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;$!==null;){if($.key===Re){if(Re=Q.type,Re===j){if($.tag===7){s(H,$.sibling),se=p($,Q.props.children),se.return=H,H=se;break e}}else if($.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===Z&&Xi(Re)===$.type){s(H,$.sibling),se=p($,Q.props),bo(se,Q),se.return=H,H=se;break e}s(H,$);break}else i(H,$);$=$.sibling}Q.type===j?(se=Vi(Q.props.children,H.mode,se,Q.key),se.return=H,H=se):(se=ac(Q.type,Q.key,Q.props,null,H.mode,se),bo(se,Q),se.return=H,H=se)}return w(H);case k:e:{for(Re=Q.key;$!==null;){if($.key===Re)if($.tag===4&&$.stateNode.containerInfo===Q.containerInfo&&$.stateNode.implementation===Q.implementation){s(H,$.sibling),se=p($,Q.children||[]),se.return=H,H=se;break e}else{s(H,$);break}else i(H,$);$=$.sibling}se=Qf(Q,H.mode,se),se.return=H,H=se}return w(H);case Z:return Q=Xi(Q),gt(H,$,Q,se)}if(te(Q))return ke(H,$,Q,se);if(W(Q)){if(Re=W(Q),typeof Re!="function")throw Error(a(150));return Q=Re.call(Q),Me(H,$,Q,se)}if(typeof Q.then=="function")return gt(H,$,dc(Q),se);if(Q.$$typeof===O)return gt(H,$,sc(H,Q),se);fc(H,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,$!==null&&$.tag===6?(s(H,$.sibling),se=p($,Q),se.return=H,H=se):(s(H,$),se=Vf(Q,H.mode,se),se.return=H,H=se),w(H)):s(H,$)}return function(H,$,Q,se){try{vo=0;var Re=gt(H,$,Q,se);return Jl=null,Re}catch(Ee){if(Ee===Xl||Ee===uc)throw Ee;var it=Fn(29,Ee,null,H.mode);return it.lanes=se,it.return=H,it}finally{}}}var Wi=Cv(!0),Ev=Cv(!1),Ha=!1;function ih(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lh(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 Za(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Va(r,i,s){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(ut&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=rc(r),uv(r,null,s),i}return nc(r,c,i,s),rc(r)}function xo(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,Bi(r,s)}}function sh(r,i){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){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:c.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var oh=!1;function So(){if(oh){var r=Yl;if(r!==null)throw r}}function wo(r,i,s,c){oh=!1;var p=r.updateQueue;Ha=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var M=N,G=M.next;M.next=null,w===null?v=G:w.next=G,w=M;var ne=r.alternate;ne!==null&&(ne=ne.updateQueue,N=ne.lastBaseUpdate,N!==w&&(N===null?ne.firstBaseUpdate=G:N.next=G,ne.lastBaseUpdate=M))}if(v!==null){var ce=p.baseState;w=0,ne=G=M=null,N=v;do{var Y=N.lane&-536870913,J=Y!==N.lane;if(J?(Je&Y)===Y:(c&Y)===Y){Y!==0&&Y===Kl&&(oh=!0),ne!==null&&(ne=ne.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ke=r,Me=N;Y=i;var gt=s;switch(Me.tag){case 1:if(ke=Me.payload,typeof ke=="function"){ce=ke.call(gt,ce,Y);break e}ce=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Me.payload,Y=typeof ke=="function"?ke.call(gt,ce,Y):ke,Y==null)break e;ce=g({},ce,Y);break e;case 2:Ha=!0}}Y=N.callback,Y!==null&&(r.flags|=64,J&&(r.flags|=8192),J=p.callbacks,J===null?p.callbacks=[Y]:J.push(Y))}else J={lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ne===null?(G=ne=J,M=ce):ne=ne.next=J,w|=Y;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;J=N,N=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);ne===null&&(M=ce),p.baseState=M,p.firstBaseUpdate=G,p.lastBaseUpdate=ne,v===null&&(p.shared.lanes=0),Xa|=w,r.lanes=w,r.memoizedState=ce}}function Nv(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function _v(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)Nv(s[r],i)}var Wl=I(null),hc=I(0);function Av(r,i){r=ma,_(hc,r),_(Wl,i),ma=r|i.baseLanes}function uh(){_(hc,ma),_(Wl,Wl.current)}function ch(){ma=hc.current,U(Wl),U(hc)}var qn=I(null),ur=null;function Qa(r){var i=r.alternate;_(Lt,Lt.current&1),_(qn,r),ur===null&&(i===null||Wl.current!==null||i.memoizedState!==null)&&(ur=r)}function dh(r){_(Lt,Lt.current),_(qn,r),ur===null&&(ur=r)}function Tv(r){r.tag===22?(_(Lt,Lt.current),_(qn,r),ur===null&&(ur=r)):Ga()}function Ga(){_(Lt,Lt.current),_(qn,qn.current)}function Hn(r){U(qn),ur===r&&(ur=null),U(Lt)}var Lt=I(0);function mc(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ym(s)||vm(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 la=0,Fe=null,mt=null,Pt=null,pc=!1,es=!1,el=!1,gc=0,ko=0,ts=null,EN=0;function Ot(){throw Error(a(321))}function fh(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!$n(r[s],i[s]))return!1;return!0}function hh(r,i,s,c,p,v){return la=v,Fe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=r===null||r.memoizedState===null?hb:_h,el=!1,v=s(c,p),el=!1,es&&(v=zv(i,s,c,p)),Rv(r),v}function Rv(r){q.H=Eo;var i=mt!==null&&mt.next!==null;if(la=0,Pt=mt=Fe=null,pc=!1,ko=0,ts=null,i)throw Error(a(300));r===null||$t||(r=r.dependencies,r!==null&&lc(r)&&($t=!0))}function zv(r,i,s,c){Fe=r;var p=0;do{if(es&&(ts=null),ko=0,es=!1,25<=p)throw Error(a(301));if(p+=1,Pt=mt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}q.H=mb,v=i(s,c)}while(es);return v}function NN(){var r=q.H,i=r.useState()[0];return i=typeof i.then=="function"?jo(i):i,r=r.useState()[0],(mt!==null?mt.memoizedState:null)!==r&&(Fe.flags|=1024),i}function mh(){var r=gc!==0;return gc=0,r}function ph(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function gh(r){if(pc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}pc=!1}la=0,Pt=mt=Fe=null,es=!1,ko=gc=0,ts=null}function xn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?Fe.memoizedState=Pt=r:Pt=Pt.next=r,Pt}function It(){if(mt===null){var r=Fe.alternate;r=r!==null?r.memoizedState:null}else r=mt.next;var i=Pt===null?Fe.memoizedState:Pt.next;if(i!==null)Pt=i,mt=r;else{if(r===null)throw Fe.alternate===null?Error(a(467)):Error(a(310));mt=r,r={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Pt===null?Fe.memoizedState=Pt=r:Pt=Pt.next=r}return Pt}function yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(r){var i=ko;return ko+=1,ts===null&&(ts=[]),r=wv(ts,r,i),i=Fe,(Pt===null?i.memoizedState:Pt.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?hb:_h),r}function vc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return jo(r);if(r.$$typeof===O)return on(r)}throw Error(a(438,String(r)))}function yh(r){var i=null,s=Fe.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var c=Fe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=yc(),Fe.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),c=0;c<r;c++)s[c]=F;return i.index++,s}function sa(r,i){return typeof i=="function"?i(r):i}function bc(r){var i=It();return vh(i,mt,r)}function vh(r,i,s){var c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var p=r.baseQueue,v=c.pending;if(v!==null){if(p!==null){var w=p.next;p.next=v.next,v.next=w}i.baseQueue=p=v,c.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=w=null,M=null,G=i,ne=!1;do{var ce=G.lane&-536870913;if(ce!==G.lane?(Je&ce)===ce:(la&ce)===ce){var Y=G.revertLane;if(Y===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ce===Kl&&(ne=!0);else if((la&Y)===Y){G=G.next,Y===Kl&&(ne=!0);continue}else ce={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},M===null?(N=M=ce,w=v):M=M.next=ce,Fe.lanes|=Y,Xa|=Y;ce=G.action,el&&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},M===null?(N=M=Y,w=v):M=M.next=Y,Fe.lanes|=ce,Xa|=ce;G=G.next}while(G!==null&&G!==i);if(M===null?w=v:M.next=N,!$n(v,r.memoizedState)&&($t=!0,ne&&(s=Yl,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=M,c.lastRenderedState=v}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function bh(r){var i=It(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var c=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);$n(v,i.memoizedState)||($t=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,c]}function Ov(r,i,s){var c=Fe,p=It(),v=tt;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var w=!$n((mt||p).memoizedState,s);if(w&&(p.memoizedState=s,$t=!0),p=p.queue,wh(Lv.bind(null,c,p,r),[r]),p.getSnapshot!==i||w||Pt!==null&&Pt.memoizedState.tag&1){if(c.flags|=2048,ns(9,{destroy:void 0},Mv.bind(null,c,p,s,i),null),yt===null)throw Error(a(349));v||(la&127)!==0||Dv(c,i,s)}return s}function Dv(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=Fe.updateQueue,i===null?(i=yc(),Fe.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Mv(r,i,s,c){i.value=s,i.getSnapshot=c,Iv(i)&&Uv(r)}function Lv(r,i,s){return s(function(){Iv(i)&&Uv(r)})}function Iv(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!$n(r,s)}catch{return!0}}function Uv(r){var i=Zi(r,2);i!==null&&On(i,r,2)}function xh(r){var i=xn();if(typeof r=="function"){var s=r;if(r=s(),el){an(!0);try{s()}finally{an(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:r},i}function Bv(r,i,s,c){return r.baseState=s,vh(r,mt,typeof c=="function"?c:sa)}function _N(r,i,s,c,p){if(wc(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)}};q.T!==null?s(!0):v.isTransition=!1,c(v),s=i.pending,s===null?(v.next=i.pending=v,Pv(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Pv(r,i){var s=i.action,c=i.payload,p=r.state;if(i.isTransition){var v=q.T,w={};q.T=w;try{var N=s(p,c),M=q.S;M!==null&&M(w,N),$v(r,i,N)}catch(G){Sh(r,i,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),q.T=v}}else try{v=s(p,c),$v(r,i,v)}catch(G){Sh(r,i,G)}}function $v(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Fv(r,i,c)},function(c){return Sh(r,i,c)}):Fv(r,i,s)}function Fv(r,i,s){i.status="fulfilled",i.value=s,qv(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Pv(r,s)))}function Sh(r,i,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=s,qv(i),i=i.next;while(i!==c)}r.action=null}function qv(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Hv(r,i){return i}function Zv(r,i){if(tt){var s=yt.formState;if(s!==null){e:{var c=Fe;if(tt){if(jt){t:{for(var p=jt,v=or;p.nodeType!==8;){if(!v){p=null;break t}if(p=cr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){jt=cr(p.nextSibling),c=p.data==="F!";break e}}Fa(c)}c=!1}c&&(i=s[0])}}return s=xn(),s.memoizedState=s.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hv,lastRenderedState:i},s.queue=c,s=cb.bind(null,Fe,c),c.dispatch=s,c=xh(!1),v=Nh.bind(null,Fe,!1,c.queue),c=xn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,s=_N.bind(null,Fe,p,v,s),p.dispatch=s,c.memoizedState=r,[i,s,!1]}function Vv(r){var i=It();return Qv(i,mt,r)}function Qv(r,i,s){if(i=vh(r,i,Hv)[0],r=bc(sa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=jo(i)}catch(w){throw w===Xl?uc:w}else c=i;i=It();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(Fe.flags|=2048,ns(9,{destroy:void 0},AN.bind(null,p,s),null)),[c,v,r]}function AN(r,i){r.action=i}function Gv(r){var i=It(),s=mt;if(s!==null)return Qv(i,s,r);It(),i=i.memoizedState,s=It();var c=s.queue.dispatch;return s.memoizedState=r,[i,c,!1]}function ns(r,i,s,c){return r={tag:r,create:s,deps:c,inst:i,next:null},i=Fe.updateQueue,i===null&&(i=yc(),Fe.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,i.lastEffect=r),r}function Kv(){return It().memoizedState}function xc(r,i,s,c){var p=xn();Fe.flags|=r,p.memoizedState=ns(1|i,{destroy:void 0},s,c===void 0?null:c)}function Sc(r,i,s,c){var p=It();c=c===void 0?null:c;var v=p.memoizedState.inst;mt!==null&&c!==null&&fh(c,mt.memoizedState.deps)?p.memoizedState=ns(i,v,s,c):(Fe.flags|=r,p.memoizedState=ns(1|i,v,s,c))}function Yv(r,i){xc(8390656,8,r,i)}function wh(r,i){Sc(2048,8,r,i)}function TN(r){Fe.flags|=4;var i=Fe.updateQueue;if(i===null)i=yc(),Fe.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Xv(r){var i=It().memoizedState;return TN({ref:i,nextImpl:r}),function(){if((ut&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Jv(r,i){return Sc(4,2,r,i)}function Wv(r,i){return Sc(4,4,r,i)}function eb(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 tb(r,i,s){s=s!=null?s.concat([r]):null,Sc(4,4,eb.bind(null,i,r),s)}function kh(){}function nb(r,i){var s=It();i=i===void 0?null:i;var c=s.memoizedState;return i!==null&&fh(i,c[1])?c[0]:(s.memoizedState=[r,i],r)}function rb(r,i){var s=It();i=i===void 0?null:i;var c=s.memoizedState;if(i!==null&&fh(i,c[1]))return c[0];if(c=r(),el){an(!0);try{r()}finally{an(!1)}}return s.memoizedState=[c,i],c}function jh(r,i,s){return s===void 0||(la&1073741824)!==0&&(Je&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=ax(),Fe.lanes|=r,Xa|=r,s)}function ab(r,i,s,c){return $n(s,i)?s:Wl.current!==null?(r=jh(r,s,c),$n(r,i)||($t=!0),r):(la&42)===0||(la&1073741824)!==0&&(Je&261930)===0?($t=!0,r.memoizedState=s):(r=ax(),Fe.lanes|=r,Xa|=r,i)}function ib(r,i,s,c,p){var v=oe.p;oe.p=v!==0&&8>v?v:8;var w=q.T,N={};q.T=N,Nh(r,!1,i,s);try{var M=p(),G=q.S;if(G!==null&&G(N,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var ne=CN(M,c);Co(r,i,ne,Qn(r))}else Co(r,i,c,Qn(r))}catch(ce){Co(r,i,{then:function(){},status:"rejected",reason:ce},Qn())}finally{oe.p=v,w!==null&&N.types!==null&&(w.types=N.types),q.T=w}}function RN(){}function Ch(r,i,s,c){if(r.tag!==5)throw Error(a(476));var p=lb(r).queue;ib(r,p,i,K,s===null?RN:function(){return sb(r),s(c)})}function lb(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:sa,lastRenderedState:K},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function sb(r){var i=lb(r);i.next===null&&(i=r.alternate.memoizedState),Co(r,i.next.queue,{},Qn())}function Eh(){return on(Fo)}function ob(){return It().memoizedState}function ub(){return It().memoizedState}function zN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=Qn();r=Za(s);var c=Va(i,r,s);c!==null&&(On(c,i,s),xo(c,i,s)),i={cache:th()},r.payload=i;return}i=i.return}}function ON(r,i,s){var c=Qn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},wc(r)?db(i,s):(s=Hf(r,i,s,c),s!==null&&(On(s,r,c),fb(s,i,c)))}function cb(r,i,s){var c=Qn();Co(r,i,s,c)}function Co(r,i,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(wc(r))db(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,$n(N,w))return nc(r,i,p,0),yt===null&&tc(),!1}catch{}finally{}if(s=Hf(r,i,p,c),s!==null)return On(s,r,c),fb(s,i,c),!0}return!1}function Nh(r,i,s,c){if(c={lane:2,revertLane:im(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},wc(r)){if(i)throw Error(a(479))}else i=Hf(r,s,c,2),i!==null&&On(i,r,2)}function wc(r){var i=r.alternate;return r===Fe||i!==null&&i===Fe}function db(r,i){es=pc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function fb(r,i,s){if((s&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,Bi(r,s)}}var Eo={readContext:on,use:vc,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot,useHostTransitionStatus:Ot,useFormState:Ot,useActionState:Ot,useOptimistic:Ot,useMemoCache:Ot,useCacheRefresh:Ot};Eo.useEffectEvent=Ot;var hb={readContext:on,use:vc,useCallback:function(r,i){return xn().memoizedState=[r,i===void 0?null:i],r},useContext:on,useEffect:Yv,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,xc(4194308,4,eb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return xc(4194308,4,r,i)},useInsertionEffect:function(r,i){xc(4,2,r,i)},useMemo:function(r,i){var s=xn();i=i===void 0?null:i;var c=r();if(el){an(!0);try{r()}finally{an(!1)}}return s.memoizedState=[c,i],c},useReducer:function(r,i,s){var c=xn();if(s!==void 0){var p=s(i);if(el){an(!0);try{s(i)}finally{an(!1)}}}else p=i;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=ON.bind(null,Fe,r),[c.memoizedState,r]},useRef:function(r){var i=xn();return r={current:r},i.memoizedState=r},useState:function(r){r=xh(r);var i=r.queue,s=cb.bind(null,Fe,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:kh,useDeferredValue:function(r,i){var s=xn();return jh(s,r,i)},useTransition:function(){var r=xh(!1);return r=ib.bind(null,Fe,r.queue,!0,!1),xn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var c=Fe,p=xn();if(tt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),yt===null)throw Error(a(349));(Je&127)!==0||Dv(c,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Yv(Lv.bind(null,c,v,r),[r]),c.flags|=2048,ns(9,{destroy:void 0},Mv.bind(null,c,v,s,i),null),s},useId:function(){var r=xn(),i=yt.identifierPrefix;if(tt){var s=Or,c=zr;s=(c&~(1<<32-ot(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=gc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=EN++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Eh,useFormState:Zv,useActionState:Zv,useOptimistic:function(r){var i=xn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Nh.bind(null,Fe,!0,s),s.dispatch=i,[r,i]},useMemoCache:yh,useCacheRefresh:function(){return xn().memoizedState=zN.bind(null,Fe)},useEffectEvent:function(r){var i=xn(),s={impl:r};return i.memoizedState=s,function(){if((ut&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},_h={readContext:on,use:vc,useCallback:nb,useContext:on,useEffect:wh,useImperativeHandle:tb,useInsertionEffect:Jv,useLayoutEffect:Wv,useMemo:rb,useReducer:bc,useRef:Kv,useState:function(){return bc(sa)},useDebugValue:kh,useDeferredValue:function(r,i){var s=It();return ab(s,mt.memoizedState,r,i)},useTransition:function(){var r=bc(sa)[0],i=It().memoizedState;return[typeof r=="boolean"?r:jo(r),i]},useSyncExternalStore:Ov,useId:ob,useHostTransitionStatus:Eh,useFormState:Vv,useActionState:Vv,useOptimistic:function(r,i){var s=It();return Bv(s,mt,r,i)},useMemoCache:yh,useCacheRefresh:ub};_h.useEffectEvent=Xv;var mb={readContext:on,use:vc,useCallback:nb,useContext:on,useEffect:wh,useImperativeHandle:tb,useInsertionEffect:Jv,useLayoutEffect:Wv,useMemo:rb,useReducer:bh,useRef:Kv,useState:function(){return bh(sa)},useDebugValue:kh,useDeferredValue:function(r,i){var s=It();return mt===null?jh(s,r,i):ab(s,mt.memoizedState,r,i)},useTransition:function(){var r=bh(sa)[0],i=It().memoizedState;return[typeof r=="boolean"?r:jo(r),i]},useSyncExternalStore:Ov,useId:ob,useHostTransitionStatus:Eh,useFormState:Gv,useActionState:Gv,useOptimistic:function(r,i){var s=It();return mt!==null?Bv(s,mt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:yh,useCacheRefresh:ub};mb.useEffectEvent=Xv;function Ah(r,i,s,c){i=r.memoizedState,s=s(c,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Th={enqueueSetState:function(r,i,s){r=r._reactInternals;var c=Qn(),p=Za(c);p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,c),i!==null&&(On(i,r,c),xo(i,r,c))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var c=Qn(),p=Za(c);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,c),i!==null&&(On(i,r,c),xo(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=Qn(),c=Za(s);c.tag=2,i!=null&&(c.callback=i),i=Va(r,c,s),i!==null&&(On(i,r,s),xo(i,r,s))}};function pb(r,i,s,c,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,v,w):i.prototype&&i.prototype.isPureReactComponent?!fo(s,c)||!fo(p,v):!0}function gb(r,i,s,c){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,c),i.state!==r&&Th.enqueueReplaceState(i,i.state,null)}function tl(r,i){var s=i;if("ref"in i){s={};for(var c in i)c!=="ref"&&(s[c]=i[c])}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 yb(r){ec(r)}function vb(r){console.error(r)}function bb(r){ec(r)}function kc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function xb(r,i,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Rh(r,i,s){return s=Za(s),s.tag=3,s.payload={element:null},s.callback=function(){kc(r,i)},s}function Sb(r){return r=Za(r),r.tag=3,r}function wb(r,i,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=c.value;r.payload=function(){return p(v)},r.callback=function(){xb(i,s,c)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){xb(i,s,c),typeof p!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})})}function DN(r,i,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=s.alternate,i!==null&&Gl(i,s,p,!0),s=qn.current,s!==null){switch(s.tag){case 31:case 13:return ur===null?Mc():s.alternate===null&&Dt===0&&(Dt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===cc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([c]):i.add(c),nm(r,c,p)),!1;case 22:return s.flags|=65536,c===cc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([c]):s.add(c)),nm(r,c,p)),!1}throw Error(a(435,s.tag))}return nm(r,c,p),Mc(),!1}if(tt)return i=qn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==Yf&&(r=Error(a(422),{cause:c}),po(ir(r,s)))):(c!==Yf&&(i=Error(a(423),{cause:c}),po(ir(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=ir(c,s),p=Rh(r.stateNode,c,p),sh(r,p),Dt!==4&&(Dt=2)),!1;var v=Error(a(520),{cause:c});if(v=ir(v,s),Do===null?Do=[v]:Do.push(v),Dt!==4&&(Dt=2),i===null)return!0;c=ir(c,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Rh(s.stateNode,c,r),sh(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"&&(Ja===null||!Ja.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=Sb(p),wb(p,r,s,c),sh(s,p),!1}s=s.return}while(s!==null);return!1}var zh=Error(a(461)),$t=!1;function un(r,i,s,c){i.child=r===null?Ev(i,null,s,c):Wi(i,r.child,s,c)}function kb(r,i,s,c,p){s=s.render;var v=i.ref;if("ref"in c){var w={};for(var N in c)N!=="ref"&&(w[N]=c[N])}else w=c;return Ki(i),c=hh(r,i,s,w,v,p),N=mh(),r!==null&&!$t?(ph(r,i,p),oa(r,i,p)):(tt&&N&&Gf(i),i.flags|=1,un(r,i,c,p),i.child)}function jb(r,i,s,c,p){if(r===null){var v=s.type;return typeof v=="function"&&!Zf(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,Cb(r,i,v,c,p)):(r=ac(s.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Ph(r,p)){var w=v.memoizedProps;if(s=s.compare,s=s!==null?s:fo,s(w,c)&&r.ref===i.ref)return oa(r,i,p)}return i.flags|=1,r=na(v,c),r.ref=i.ref,r.return=i,i.child=r}function Cb(r,i,s,c,p){if(r!==null){var v=r.memoizedProps;if(fo(v,c)&&r.ref===i.ref)if($t=!1,i.pendingProps=c=v,Ph(r,p))(r.flags&131072)!==0&&($t=!0);else return i.lanes=r.lanes,oa(r,i,p)}return Oh(r,i,s,c,p)}function Eb(r,i,s,c){var p=c.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(c=i.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~v}else c=0,i.child=null;return Nb(r,i,v,s,c)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&oc(i,v!==null?v.cachePool:null),v!==null?Av(i,v):uh(),Tv(i);else return c=i.lanes=536870912,Nb(r,i,v!==null?v.baseLanes|s:s,s,c)}else v!==null?(oc(i,v.cachePool),Av(i,v),Ga(),i.memoizedState=null):(r!==null&&oc(i,null),uh(),Ga());return un(r,i,p,s),i.child}function No(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Nb(r,i,s,c,p){var v=rh();return v=v===null?null:{parent:Bt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&oc(i,null),uh(),Tv(i),r!==null&&Gl(r,i,c,!0),i.childLanes=p,null}function jc(r,i){return i=Ec({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function _b(r,i,s){return Wi(i,r.child,null,s),r=jc(i,i.pendingProps),r.flags|=2,Hn(i),i.memoizedState=null,r}function MN(r,i,s){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(tt){if(c.mode==="hidden")return r=jc(i,c),i.lanes=536870912,No(null,r);if(dh(i),(r=jt)?(r=Px(r,or),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:zr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},s=dv(r),s.return=i,i.child=s,sn=i,jt=null)):r=null,r===null)throw Fa(i);return i.lanes=536870912,null}return jc(i,c)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(dh(i),p)if(i.flags&256)i.flags&=-257,i=_b(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if($t||Gl(r,i,s,!1),p=(s&r.childLanes)!==0,$t||p){if(c=yt,c!==null&&(w=zl(c,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,Zi(r,w),On(c,r,w),zh;Mc(),i=_b(r,i,s)}else r=v.treeContext,jt=cr(w.nextSibling),sn=i,tt=!0,$a=null,or=!1,r!==null&&mv(i,r),i=jc(i,c),i.flags|=4096;return i}return r=na(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Cc(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 Oh(r,i,s,c,p){return Ki(i),s=hh(r,i,s,c,void 0,p),c=mh(),r!==null&&!$t?(ph(r,i,p),oa(r,i,p)):(tt&&c&&Gf(i),i.flags|=1,un(r,i,s,p),i.child)}function Ab(r,i,s,c,p,v){return Ki(i),i.updateQueue=null,s=zv(i,c,s,p),Rv(r),c=mh(),r!==null&&!$t?(ph(r,i,v),oa(r,i,v)):(tt&&c&&Gf(i),i.flags|=1,un(r,i,s,v),i.child)}function Tb(r,i,s,c,p){if(Ki(i),i.stateNode===null){var v=Hl,w=s.contextType;typeof w=="object"&&w!==null&&(v=on(w)),v=new s(c,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Th,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=c,v.state=i.memoizedState,v.refs={},ih(i),w=s.contextType,v.context=typeof w=="object"&&w!==null?on(w):Hl,v.state=i.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Ah(i,s,w,c),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&&Th.enqueueReplaceState(v,v.state,null),wo(i,c,v,p),So(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,M=tl(s,N);v.props=M;var G=v.context,ne=s.contextType;w=Hl,typeof ne=="object"&&ne!==null&&(w=on(ne));var ce=s.getDerivedStateFromProps;ne=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,ne||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||G!==w)&&gb(i,v,c,w),Ha=!1;var Y=i.memoizedState;v.state=Y,wo(i,c,v,p),So(),G=i.memoizedState,N||Y!==G||Ha?(typeof ce=="function"&&(Ah(i,s,ce,c),G=i.memoizedState),(M=Ha||pb(i,s,M,c,Y,G,w))?(ne||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=c,i.memoizedState=G),v.props=c,v.state=G,v.context=w,c=M):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{v=i.stateNode,lh(r,i),w=i.memoizedProps,ne=tl(s,w),v.props=ne,ce=i.pendingProps,Y=v.context,G=s.contextType,M=Hl,typeof G=="object"&&G!==null&&(M=on(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||Y!==M)&&gb(i,v,c,M),Ha=!1,Y=i.memoizedState,v.state=Y,wo(i,c,v,p),So();var J=i.memoizedState;w!==ce||Y!==J||Ha||r!==null&&r.dependencies!==null&&lc(r.dependencies)?(typeof N=="function"&&(Ah(i,s,N,c),J=i.memoizedState),(ne=Ha||pb(i,s,ne,c,Y,J,M)||r!==null&&r.dependencies!==null&&lc(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,J,M),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,J,M)),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=c,i.memoizedState=J),v.props=c,v.state=J,v.context=M,c=ne):(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),c=!1)}return v=c,Cc(r,i),c=(i.flags&128)!==0,v||c?(v=i.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&c?(i.child=Wi(i,r.child,null,p),i.child=Wi(i,null,s,p)):un(r,i,s,p),i.memoizedState=v.state,r=i.child):r=oa(r,i,p),r}function Rb(r,i,s,c){return Qi(),i.flags|=256,un(r,i,s,c),i.child}var Dh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mh(r){return{baseLanes:r,cachePool:xv()}}function Lh(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=Vn),r}function zb(r,i,s){var c=i.pendingProps,p=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Lt.current&2)!==0),w&&(p=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,r===null){if(tt){if(p?Qa(i):Ga(),(r=jt)?(r=Px(r,or),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:zr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},s=dv(r),s.return=i,i.child=s,sn=i,jt=null)):r=null,r===null)throw Fa(i);return vm(r)?i.lanes=32:i.lanes=536870912,null}var N=c.children;return c=c.fallback,p?(Ga(),p=i.mode,N=Ec({mode:"hidden",children:N},p),c=Vi(c,p,s,null),N.return=i,c.return=i,N.sibling=c,i.child=N,c=i.child,c.memoizedState=Mh(s),c.childLanes=Lh(r,w,s),i.memoizedState=Dh,No(null,c)):(Qa(i),Ih(i,N))}var M=r.memoizedState;if(M!==null&&(N=M.dehydrated,N!==null)){if(v)i.flags&256?(Qa(i),i.flags&=-257,i=Uh(r,i,s)):i.memoizedState!==null?(Ga(),i.child=r.child,i.flags|=128,i=null):(Ga(),N=c.fallback,p=i.mode,c=Ec({mode:"visible",children:c.children},p),N=Vi(N,p,s,null),N.flags|=2,c.return=i,N.return=i,c.sibling=N,i.child=c,Wi(i,r.child,null,s),c=i.child,c.memoizedState=Mh(s),c.childLanes=Lh(r,w,s),i.memoizedState=Dh,i=No(null,c));else if(Qa(i),vm(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var G=w.dgst;w=G,c=Error(a(419)),c.stack="",c.digest=w,po({value:c,source:null,stack:null}),i=Uh(r,i,s)}else if($t||Gl(r,i,s,!1),w=(s&r.childLanes)!==0,$t||w){if(w=yt,w!==null&&(c=zl(w,s),c!==0&&c!==M.retryLane))throw M.retryLane=c,Zi(r,c),On(w,r,c),zh;ym(N)||Mc(),i=Uh(r,i,s)}else ym(N)?(i.flags|=192,i.child=r.child,i=null):(r=M.treeContext,jt=cr(N.nextSibling),sn=i,tt=!0,$a=null,or=!1,r!==null&&mv(i,r),i=Ih(i,c.children),i.flags|=4096);return i}return p?(Ga(),N=c.fallback,p=i.mode,M=r.child,G=M.sibling,c=na(M,{mode:"hidden",children:c.children}),c.subtreeFlags=M.subtreeFlags&65011712,G!==null?N=na(G,N):(N=Vi(N,p,s,null),N.flags|=2),N.return=i,c.return=i,c.sibling=N,i.child=c,No(null,c),c=i.child,N=r.child.memoizedState,N===null?N=Mh(s):(p=N.cachePool,p!==null?(M=Bt._currentValue,p=p.parent!==M?{parent:M,pool:M}:p):p=xv(),N={baseLanes:N.baseLanes|s,cachePool:p}),c.memoizedState=N,c.childLanes=Lh(r,w,s),i.memoizedState=Dh,No(r.child,c)):(Qa(i),s=r.child,r=s.sibling,s=na(s,{mode:"visible",children:c.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 Ih(r,i){return i=Ec({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Ec(r,i){return r=Fn(22,r,null,i),r.lanes=0,r}function Uh(r,i,s){return Wi(i,r.child,null,s),r=Ih(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Ob(r,i,s){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),Wf(r.return,i,s)}function Bh(r,i,s,c,p,v){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function Db(r,i,s){var c=i.pendingProps,p=c.revealOrder,v=c.tail;c=c.children;var w=Lt.current,N=(w&2)!==0;if(N?(w=w&1|2,i.flags|=128):w&=1,_(Lt,w),un(r,i,c,s),c=tt?mo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Ob(r,s,i);else if(r.tag===19)Ob(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&&mc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),Bh(i,!1,p,s,v,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&mc(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Bh(i,!0,s,null,v,c);break;case"together":Bh(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function oa(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Xa|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Gl(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=na(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=na(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Ph(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&lc(r)))}function LN(r,i,s){switch(i.tag){case 3:ee(i,i.stateNode.containerInfo),qa(i,Bt,r.memoizedState.cache),Qi();break;case 27:case 5:Ie(i);break;case 4:ee(i,i.stateNode.containerInfo);break;case 10:qa(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,dh(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(Qa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?zb(r,i,s):(Qa(i),r=oa(r,i,s),r!==null?r.sibling:null);Qa(i);break;case 19:var p=(r.flags&128)!==0;if(c=(s&i.childLanes)!==0,c||(Gl(r,i,s,!1),c=(s&i.childLanes)!==0),p){if(c)return Db(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),_(Lt,Lt.current),c)break;return null;case 22:return i.lanes=0,Eb(r,i,s,i.pendingProps);case 24:qa(i,Bt,r.memoizedState.cache)}return oa(r,i,s)}function Mb(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)$t=!0;else{if(!Ph(r,s)&&(i.flags&128)===0)return $t=!1,LN(r,i,s);$t=(r.flags&131072)!==0}else $t=!1,tt&&(i.flags&1048576)!==0&&hv(i,mo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=Xi(i.elementType),i.type=r,typeof r=="function")Zf(r)?(c=tl(r,c),i.tag=1,i=Tb(null,i,r,c,s)):(i.tag=0,i=Oh(null,i,r,c,s));else{if(r!=null){var p=r.$$typeof;if(p===B){i.tag=11,i=kb(null,i,r,c,s);break e}else if(p===P){i.tag=14,i=jb(null,i,r,c,s);break e}}throw i=me(r)||r,Error(a(306,i,""))}}return i;case 0:return Oh(r,i,i.type,i.pendingProps,s);case 1:return c=i.type,p=tl(c,i.pendingProps),Tb(r,i,c,p,s);case 3:e:{if(ee(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var v=i.memoizedState;p=v.element,lh(r,i),wo(i,c,null,s);var w=i.memoizedState;if(c=w.cache,qa(i,Bt,c),c!==v.cache&&eh(i,[Bt],s,!0),So(),c=w.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=Rb(r,i,c,s);break e}else if(c!==p){p=ir(Error(a(424)),i),po(p),i=Rb(r,i,c,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(jt=cr(r.firstChild),sn=i,tt=!0,$a=null,or=!0,s=Ev(i,null,c,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Qi(),c===p){i=oa(r,i,s);break e}un(r,i,c,s)}i=i.child}return i;case 26:return Cc(r,i),r===null?(s=Vx(i.type,null,i.pendingProps,null))?i.memoizedState=s:tt||(s=i.type,r=i.pendingProps,c=Fc(ue.current).createElement(s),c[Ut]=i,c[ln]=r,cn(c,s,r),X(c),i.stateNode=c):i.memoizedState=Vx(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Ie(i),r===null&&tt&&(c=i.stateNode=qx(i.type,i.pendingProps,ue.current),sn=i,or=!0,p=jt,ni(i.type)?(bm=p,jt=cr(c.firstChild)):jt=p),un(r,i,i.pendingProps.children,s),Cc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&tt&&((p=c=jt)&&(c=f_(c,i.type,i.pendingProps,or),c!==null?(i.stateNode=c,sn=i,jt=cr(c.firstChild),or=!1,p=!0):p=!1),p||Fa(i)),Ie(i),p=i.type,v=i.pendingProps,w=r!==null?r.memoizedProps:null,c=v.children,mm(p,v)?c=null:w!==null&&mm(p,w)&&(i.flags|=32),i.memoizedState!==null&&(p=hh(r,i,NN,null,null,s),Fo._currentValue=p),Cc(r,i),un(r,i,c,s),i.child;case 6:return r===null&&tt&&((r=s=jt)&&(s=h_(s,i.pendingProps,or),s!==null?(i.stateNode=s,sn=i,jt=null,r=!0):r=!1),r||Fa(i)),null;case 13:return zb(r,i,s);case 4:return ee(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=Wi(i,null,c,s):un(r,i,c,s),i.child;case 11:return kb(r,i,i.type,i.pendingProps,s);case 7:return un(r,i,i.pendingProps,s),i.child;case 8:return un(r,i,i.pendingProps.children,s),i.child;case 12:return un(r,i,i.pendingProps.children,s),i.child;case 10:return c=i.pendingProps,qa(i,i.type,c.value),un(r,i,c.children,s),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,Ki(i),p=on(p),c=c(p),i.flags|=1,un(r,i,c,s),i.child;case 14:return jb(r,i,i.type,i.pendingProps,s);case 15:return Cb(r,i,i.type,i.pendingProps,s);case 19:return Db(r,i,s);case 31:return MN(r,i,s);case 22:return Eb(r,i,s,i.pendingProps);case 24:return Ki(i),c=on(Bt),r===null?(p=rh(),p===null&&(p=yt,v=th(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:c,cache:p},ih(i),qa(i,Bt,p)):((r.lanes&s)!==0&&(lh(r,i),wo(i,null,null,s),So()),p=r.memoizedState,v=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),qa(i,Bt,c)):(c=v.cache,qa(i,Bt,c),c!==p.cache&&eh(i,[Bt],s,!0))),un(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ua(r){r.flags|=4}function $h(r,i,s,c,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(ox())r.flags|=8192;else throw Ji=cc,ah}else r.flags&=-16777217}function Lb(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Xx(i))if(ox())r.flags|=8192;else throw Ji=cc,ah}function Nc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Bu():536870912,r.lanes|=i,ls|=i)}function _o(r,i){if(!tt)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 c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function Ct(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=s,i}function IN(r,i,s){var c=i.pendingProps;switch(Kf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(i),null;case 1:return Ct(i),null;case 3:return s=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),ia(Bt),fe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Ql(i)?ua(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Xf())),Ct(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ua(i),v!==null?(Ct(i),Lb(i,v)):(Ct(i),$h(i,p,null,c,s))):v?v!==r.memoizedState?(ua(i),Ct(i),Lb(i,v)):(Ct(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&ua(i),Ct(i),$h(i,p,r,c,s)),null;case 27:if(Be(i),s=ue.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&ua(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return Ct(i),null}r=le.current,Ql(i)?pv(i):(r=qx(p,c,s),i.stateNode=r,ua(i))}return Ct(i),null;case 5:if(Be(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&ua(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return Ct(i),null}if(v=le.current,Ql(i))pv(i);else{var w=Fc(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 c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?w.createElement(p,{is:c.is}):w.createElement(p)}}v[Ut]=i,v[ln]=c;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(cn(v,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&ua(i)}}return Ct(i),$h(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&ua(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=ue.current,Ql(i)){if(r=i.stateNode,s=i.memoizedProps,c=null,p=sn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[Ut]=i,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||zx(r.nodeValue,s)),r||Fa(i,!0)}else r=Fc(r).createTextNode(c),r[Ut]=i,i.stateNode=r}return Ct(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(c=Ql(i),s!==null){if(r===null){if(!c)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Ut]=i}else Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ct(i),r=!1}else s=Xf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Hn(i),i):(Hn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Ct(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Ql(i),c!==null&&c.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[Ut]=i}else Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ct(i),p=!1}else p=Xf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Hn(i),i):(Hn(i),null)}return Hn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,r=r!==null&&r.memoizedState!==null,s&&(c=i.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Nc(i,i.updateQueue),Ct(i),null);case 4:return fe(),r===null&&um(i.stateNode.containerInfo),Ct(i),null;case 10:return ia(i.type),Ct(i),null;case 19:if(U(Lt),c=i.memoizedState,c===null)return Ct(i),null;if(p=(i.flags&128)!==0,v=c.rendering,v===null)if(p)_o(c,!1);else{if(Dt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=mc(r),v!==null){for(i.flags|=128,_o(c,!1),r=v.updateQueue,i.updateQueue=r,Nc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)cv(s,r),s=s.sibling;return _(Lt,Lt.current&1|2),tt&&ra(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&&tn()>zc&&(i.flags|=128,p=!0,_o(c,!1),i.lanes=4194304)}else{if(!p)if(r=mc(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Nc(i,r),_o(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!tt)return Ct(i),null}else 2*tn()-c.renderingStartTime>zc&&s!==536870912&&(i.flags|=128,p=!0,_o(c,!1),i.lanes=4194304);c.isBackwards?(v.sibling=i.child,i.child=v):(r=c.last,r!==null?r.sibling=v:i.child=v,c.last=v)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=tn(),r.sibling=null,s=Lt.current,_(Lt,p?s&1|2:s&1),tt&&ra(i,c.treeForkCount),r):(Ct(i),null);case 22:case 23:return Hn(i),ch(),c=i.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(Ct(i),i.subtreeFlags&6&&(i.flags|=8192)):Ct(i),s=i.updateQueue,s!==null&&Nc(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),r!==null&&U(Yi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ia(Bt),Ct(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function UN(r,i){switch(Kf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ia(Bt),fe(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Be(i),null;case 31:if(i.memoizedState!==null){if(Hn(i),i.alternate===null)throw Error(a(340));Qi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Hn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Qi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return U(Lt),null;case 4:return fe(),null;case 10:return ia(i.type),null;case 22:case 23:return Hn(i),ch(),r!==null&&U(Yi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ia(Bt),null;case 25:return null;default:return null}}function Ib(r,i){switch(Kf(i),i.tag){case 3:ia(Bt),fe();break;case 26:case 27:case 5:Be(i);break;case 4:fe();break;case 31:i.memoizedState!==null&&Hn(i);break;case 13:Hn(i);break;case 19:U(Lt);break;case 10:ia(i.type);break;case 22:case 23:Hn(i),ch(),r!==null&&U(Yi);break;case 24:ia(Bt)}}function Ao(r,i){try{var s=i.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&r)===r){c=void 0;var v=s.create,w=s.inst;c=v(),w.destroy=c}s=s.next}while(s!==p)}}catch(N){ht(i,i.return,N)}}function Ka(r,i,s){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var v=p.next;c=v;do{if((c.tag&r)===r){var w=c.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,p=i;var M=s,G=N;try{G()}catch(ne){ht(p,M,ne)}}}c=c.next}while(c!==v)}}catch(ne){ht(i,i.return,ne)}}function Ub(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{_v(i,s)}catch(c){ht(r,r.return,c)}}}function Bb(r,i,s){s.props=tl(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){ht(r,i,c)}}function To(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(p){ht(r,i,p)}}function Dr(r,i){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){ht(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){ht(r,i,p)}else s.current=null}function Pb(r){var i=r.type,s=r.memoizedProps,c=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(p){ht(r,r.return,p)}}function Fh(r,i,s){try{var c=r.stateNode;l_(c,r.type,s,i),c[ln]=i}catch(p){ht(r,r.return,p)}}function $b(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ni(r.type)||r.tag===4}function qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||$b(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&&ni(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 Hh(r,i,s){var c=r.tag;if(c===5||c===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=ea));else if(c!==4&&(c===27&&ni(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Hh(r,i,s),r=r.sibling;r!==null;)Hh(r,i,s),r=r.sibling}function _c(r,i,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(c!==4&&(c===27&&ni(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(_c(r,i,s),r=r.sibling;r!==null;)_c(r,i,s),r=r.sibling}function Fb(r){var i=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);cn(i,c,s),i[Ut]=r,i[ln]=s}catch(v){ht(r,r.return,v)}}var ca=!1,Ft=!1,Zh=!1,qb=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function BN(r,i){if(r=r.containerInfo,fm=Kc,r=tv(r),Uf(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var w=0,N=-1,M=-1,G=0,ne=0,ce=r,Y=null;t:for(;;){for(var J;ce!==s||p!==0&&ce.nodeType!==3||(N=w+p),ce!==v||c!==0&&ce.nodeType!==3||(M=w+c),ce.nodeType===3&&(w+=ce.nodeValue.length),(J=ce.firstChild)!==null;)Y=ce,ce=J;for(;;){if(ce===r)break t;if(Y===s&&++G===p&&(N=w),Y===v&&++ne===c&&(M=w),(J=ce.nextSibling)!==null)break;ce=Y,Y=ce.parentNode}ce=J}s=N===-1||M===-1?null:{start:N,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(hm={focusedElem:r,selectionRange:s},Kc=!1,Wt=i;Wt!==null;)if(i=Wt,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Wt=r;else for(;Wt!==null;){switch(i=Wt,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,c=s.stateNode;try{var ke=tl(s.type,p);r=c.getSnapshotBeforeUpdate(ke,v),c.__reactInternalSnapshotBeforeUpdate=r}catch(Me){ht(s,s.return,Me)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)gm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":gm(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,Wt=r;break}Wt=i.return}}function Hb(r,i,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:fa(r,s),c&4&&Ao(5,s);break;case 1:if(fa(r,s),c&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(w){ht(s,s.return,w)}else{var p=tl(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(w){ht(s,s.return,w)}}c&64&&Ub(s),c&512&&To(s,s.return);break;case 3:if(fa(r,s),c&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{_v(r,i)}catch(w){ht(s,s.return,w)}}break;case 27:i===null&&c&4&&Fb(s);case 26:case 5:fa(r,s),i===null&&c&4&&Pb(s),c&512&&To(s,s.return);break;case 12:fa(r,s);break;case 31:fa(r,s),c&4&&Qb(r,s);break;case 13:fa(r,s),c&4&&Gb(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=GN.bind(null,s),m_(r,s))));break;case 22:if(c=s.memoizedState!==null||ca,!c){i=i!==null&&i.memoizedState!==null||Ft,p=ca;var v=Ft;ca=c,(Ft=i)&&!v?ha(r,s,(s.subtreeFlags&8772)!==0):fa(r,s),ca=p,Ft=v}break;case 30:break;default:fa(r,s)}}function Zb(r){var i=r.alternate;i!==null&&(r.alternate=null,Zb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Ml(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 Et=null,An=!1;function da(r,i,s){for(s=s.child;s!==null;)Vb(r,i,s),s=s.sibling}function Vb(r,i,s){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(rn,s)}catch{}switch(s.tag){case 26:Ft||Dr(s,i),da(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ft||Dr(s,i);var c=Et,p=An;ni(s.type)&&(Et=s.stateNode,An=!1),da(r,i,s),Bo(s.stateNode),Et=c,An=p;break;case 5:Ft||Dr(s,i);case 6:if(c=Et,p=An,Et=null,da(r,i,s),Et=c,An=p,Et!==null)if(An)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(s.stateNode)}catch(v){ht(s,i,v)}else try{Et.removeChild(s.stateNode)}catch(v){ht(s,i,v)}break;case 18:Et!==null&&(An?(r=Et,Ux(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),ms(r)):Ux(Et,s.stateNode));break;case 4:c=Et,p=An,Et=s.stateNode.containerInfo,An=!0,da(r,i,s),Et=c,An=p;break;case 0:case 11:case 14:case 15:Ka(2,s,i),Ft||Ka(4,s,i),da(r,i,s);break;case 1:Ft||(Dr(s,i),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Bb(s,i,c)),da(r,i,s);break;case 21:da(r,i,s);break;case 22:Ft=(c=Ft)||s.memoizedState!==null,da(r,i,s),Ft=c;break;default:da(r,i,s)}}function Qb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ms(r)}catch(s){ht(i,i.return,s)}}}function Gb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ms(r)}catch(s){ht(i,i.return,s)}}function PN(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new qb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new qb),i;default:throw Error(a(435,r.tag))}}function Ac(r,i){var s=PN(r);i.forEach(function(c){if(!s.has(c)){s.add(c);var p=KN.bind(null,r,c);c.then(p,p)}})}function Tn(r,i){var s=i.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],v=r,w=i,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(ni(N.type)){Et=N.stateNode,An=!1;break e}break;case 5:Et=N.stateNode,An=!1;break e;case 3:case 4:Et=N.stateNode.containerInfo,An=!0;break e}N=N.return}if(Et===null)throw Error(a(160));Vb(v,w,p),Et=null,An=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Kb(i,r),i=i.sibling}var Sr=null;function Kb(r,i){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Tn(i,r),Rn(r),c&4&&(Ka(3,r,r.return),Ao(3,r),Ka(5,r,r.return));break;case 1:Tn(i,r),Rn(r),c&512&&(Ft||s===null||Dr(s,s.return)),c&64&&ca&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=Sr;if(Tn(i,r),Rn(r),c&512&&(Ft||s===null||Dr(s,s.return)),c&4){var v=s!==null?s.memoizedState:null;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Ia]||v[Ut]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(c),p.head.insertBefore(v,p.querySelector("head > title"))),cn(v,c,s),v[Ut]=r,X(v),c=v;break e;case"link":var w=Kx("link","href",p).get(c+(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(c),cn(v,c,s),p.head.appendChild(v);break;case"meta":if(w=Kx("meta","content",p).get(c+(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(c),cn(v,c,s),p.head.appendChild(v);break;default:throw Error(a(468,c))}v[Ut]=r,X(v),c=v}r.stateNode=c}else Yx(p,r.type,r.stateNode);else r.stateNode=Gx(p,c,r.memoizedProps);else v!==c?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,c===null?Yx(p,r.type,r.stateNode):Gx(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&Fh(r,r.memoizedProps,s.memoizedProps)}break;case 27:Tn(i,r),Rn(r),c&512&&(Ft||s===null||Dr(s,s.return)),s!==null&&c&4&&Fh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Tn(i,r),Rn(r),c&512&&(Ft||s===null||Dr(s,s.return)),r.flags&32){p=r.stateNode;try{Il(p,"")}catch(ke){ht(r,r.return,ke)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Fh(r,p,s!==null?s.memoizedProps:p)),c&1024&&(Zh=!0);break;case 6:if(Tn(i,r),Rn(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(ke){ht(r,r.return,ke)}}break;case 3:if(Zc=null,p=Sr,Sr=qc(i.containerInfo),Tn(i,r),Sr=p,Rn(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{ms(i.containerInfo)}catch(ke){ht(r,r.return,ke)}Zh&&(Zh=!1,Yb(r));break;case 4:c=Sr,Sr=qc(r.stateNode.containerInfo),Tn(i,r),Rn(r),Sr=c;break;case 12:Tn(i,r),Rn(r);break;case 31:Tn(i,r),Rn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ac(r,c)));break;case 13:Tn(i,r),Rn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Rc=tn()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ac(r,c)));break;case 22:p=r.memoizedState!==null;var M=s!==null&&s.memoizedState!==null,G=ca,ne=Ft;if(ca=G||p,Ft=ne||M,Tn(i,r),Ft=ne,ca=G,Rn(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||M||ca||Ft||nl(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){M=s=i;try{if(v=M.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=M.stateNode;var ce=M.memoizedProps.style,Y=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;N.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(ke){ht(M,M.return,ke)}}}else if(i.tag===6){if(s===null){M=i;try{M.stateNode.nodeValue=p?"":M.memoizedProps}catch(ke){ht(M,M.return,ke)}}}else if(i.tag===18){if(s===null){M=i;try{var J=M.stateNode;p?Bx(J,!0):Bx(M.stateNode,!1)}catch(ke){ht(M,M.return,ke)}}}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}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Ac(r,s))));break;case 19:Tn(i,r),Rn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ac(r,c)));break;case 30:break;case 21:break;default:Tn(i,r),Rn(r)}}function Rn(r){var i=r.flags;if(i&2){try{for(var s,c=r.return;c!==null;){if($b(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=qh(r);_c(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(Il(w,""),s.flags&=-33);var N=qh(r);_c(r,N,w);break;case 3:case 4:var M=s.stateNode.containerInfo,G=qh(r);Hh(r,G,M);break;default:throw Error(a(161))}}catch(ne){ht(r,r.return,ne)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Yb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Yb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function fa(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Hb(r,i.alternate,i),i=i.sibling}function nl(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ka(4,i,i.return),nl(i);break;case 1:Dr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Bb(i,i.return,s),nl(i);break;case 27:Bo(i.stateNode);case 26:case 5:Dr(i,i.return),nl(i);break;case 22:i.memoizedState===null&&nl(i);break;case 30:nl(i);break;default:nl(i)}r=r.sibling}}function ha(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=r,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:ha(p,v,s),Ao(4,v);break;case 1:if(ha(p,v,s),c=v,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){ht(c,c.return,G)}if(c=v,p=c.updateQueue,p!==null){var N=c.stateNode;try{var M=p.shared.hiddenCallbacks;if(M!==null)for(p.shared.hiddenCallbacks=null,p=0;p<M.length;p++)Nv(M[p],N)}catch(G){ht(c,c.return,G)}}s&&w&64&&Ub(v),To(v,v.return);break;case 27:Fb(v);case 26:case 5:ha(p,v,s),s&&c===null&&w&4&&Pb(v),To(v,v.return);break;case 12:ha(p,v,s);break;case 31:ha(p,v,s),s&&w&4&&Qb(p,v);break;case 13:ha(p,v,s),s&&w&4&&Gb(p,v);break;case 22:v.memoizedState===null&&ha(p,v,s),To(v,v.return);break;case 30:break;default:ha(p,v,s)}i=i.sibling}}function Vh(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&&go(s))}function Qh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&go(r))}function wr(r,i,s,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Xb(r,i,s,c),i=i.sibling}function Xb(r,i,s,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:wr(r,i,s,c),p&2048&&Ao(9,i);break;case 1:wr(r,i,s,c);break;case 3:wr(r,i,s,c),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&go(r)));break;case 12:if(p&2048){wr(r,i,s,c),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(M){ht(i,i.return,M)}}else wr(r,i,s,c);break;case 31:wr(r,i,s,c);break;case 13:wr(r,i,s,c);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?wr(r,i,s,c):Ro(r,i):v._visibility&2?wr(r,i,s,c):(v._visibility|=2,rs(r,i,s,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Vh(w,i);break;case 24:wr(r,i,s,c),p&2048&&Qh(i.alternate,i);break;default:wr(r,i,s,c)}}function rs(r,i,s,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,w=i,N=s,M=c,G=w.flags;switch(w.tag){case 0:case 11:case 15:rs(v,w,N,M,p),Ao(8,w);break;case 23:break;case 22:var ne=w.stateNode;w.memoizedState!==null?ne._visibility&2?rs(v,w,N,M,p):Ro(v,w):(ne._visibility|=2,rs(v,w,N,M,p)),p&&G&2048&&Vh(w.alternate,w);break;case 24:rs(v,w,N,M,p),p&&G&2048&&Qh(w.alternate,w);break;default:rs(v,w,N,M,p)}i=i.sibling}}function Ro(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,c=i,p=c.flags;switch(c.tag){case 22:Ro(s,c),p&2048&&Vh(c.alternate,c);break;case 24:Ro(s,c),p&2048&&Qh(c.alternate,c);break;default:Ro(s,c)}i=i.sibling}}var zo=8192;function as(r,i,s){if(r.subtreeFlags&zo)for(r=r.child;r!==null;)Jb(r,i,s),r=r.sibling}function Jb(r,i,s){switch(r.tag){case 26:as(r,i,s),r.flags&zo&&r.memoizedState!==null&&E_(s,Sr,r.memoizedState,r.memoizedProps);break;case 5:as(r,i,s);break;case 3:case 4:var c=Sr;Sr=qc(r.stateNode.containerInfo),as(r,i,s),Sr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=zo,zo=16777216,as(r,i,s),zo=c):as(r,i,s));break;default:as(r,i,s)}}function Wb(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 Oo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Wt=c,tx(c,r)}Wb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)ex(r),r=r.sibling}function ex(r){switch(r.tag){case 0:case 11:case 15:Oo(r),r.flags&2048&&Ka(9,r,r.return);break;case 3:Oo(r);break;case 12:Oo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Tc(r)):Oo(r);break;default:Oo(r)}}function Tc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Wt=c,tx(c,r)}Wb(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ka(8,i,i.return),Tc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Tc(i));break;default:Tc(i)}r=r.sibling}}function tx(r,i){for(;Wt!==null;){var s=Wt;switch(s.tag){case 0:case 11:case 15:Ka(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:go(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Wt=c;else e:for(s=r;Wt!==null;){c=Wt;var p=c.sibling,v=c.return;if(Zb(c),c===s){Wt=null;break e}if(p!==null){p.return=v,Wt=p;break e}Wt=v}}}var $N={getCacheForType:function(r){var i=on(Bt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return on(Bt).controller.signal}},FN=typeof WeakMap=="function"?WeakMap:Map,ut=0,yt=null,Ke=null,Je=0,ft=0,Zn=null,Ya=!1,is=!1,Gh=!1,ma=0,Dt=0,Xa=0,rl=0,Kh=0,Vn=0,ls=0,Do=null,zn=null,Yh=!1,Rc=0,nx=0,zc=1/0,Oc=null,Ja=null,Qt=0,Wa=null,ss=null,pa=0,Xh=0,Jh=null,rx=null,Mo=0,Wh=null;function Qn(){return(ut&2)!==0&&Je!==0?Je&-Je:q.T!==null?im():Pu()}function ax(){if(Vn===0)if((Je&536870912)===0||tt){var r=Tl;Tl<<=1,(Tl&3932160)===0&&(Tl=262144),Vn=r}else Vn=536870912;return r=qn.current,r!==null&&(r.flags|=32),Vn}function On(r,i,s){(r===yt&&(ft===2||ft===9)||r.cancelPendingCommit!==null)&&(os(r,0),ei(r,Je,Vn,!1)),Ui(r,s),((ut&2)===0||r!==yt)&&(r===yt&&((ut&2)===0&&(rl|=s),Dt===4&&ei(r,Je,Vn,!1)),Mr(r))}function ix(r,i,s){if((ut&6)!==0)throw Error(a(327));var c=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ii(r,i),p=c?ZN(r,i):tm(r,i,!0),v=c;do{if(p===0){is&&!c&&ei(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!qN(s)){p=tm(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=Do;var M=N.current.memoizedState.isDehydrated;if(M&&(os(N,w).flags|=256),w=tm(N,w,!1),w!==2){if(Gh&&!M){N.errorRecoveryDisabledLanes|=v,rl|=v,p=4;break e}v=zn,zn=p,v!==null&&(zn===null?zn=v:zn.push.apply(zn,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){os(r,0),ei(r,i,0,!0);break}e:{switch(c=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ei(c,i,Vn,!Ya);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Rc+300-tn(),10<p)){if(ei(c,i,Vn,!Ya),Rl(c,0,!0)!==0)break e;pa=i,c.timeoutHandle=Lx(lx.bind(null,c,s,zn,Oc,Yh,i,Vn,rl,ls,Ya,v,"Throttled",-0,0),p);break e}lx(c,s,zn,Oc,Yh,i,Vn,rl,ls,Ya,v,null,-0,0)}}break}while(!0);Mr(r)}function lx(r,i,s,c,p,v,w,N,M,G,ne,ce,Y,J){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:ea},Jb(i,v,ce);var ke=(v&62914560)===v?Rc-tn():(v&4194048)===v?nx-tn():0;if(ke=N_(ce,ke),ke!==null){pa=v,r.cancelPendingCommit=ke(mx.bind(null,r,i,v,s,c,p,w,N,M,ne,ce,null,Y,J)),ei(r,v,w,!G);return}}mx(r,i,v,s,c,p,w,N,M)}function qN(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 c=0;c<s.length;c++){var p=s[c],v=p.getSnapshot;p=p.value;try{if(!$n(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 ei(r,i,s,c){i&=~Kh,i&=~rl,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var v=31-ot(p),w=1<<v;c[v]=-1,p&=~w}s!==0&&tr(r,s,i)}function Dc(){return(ut&6)===0?(Lo(0),!1):!0}function em(){if(Ke!==null){if(ft===0)var r=Ke.return;else r=Ke,aa=Gi=null,gh(r),Jl=null,vo=0,r=Ke;for(;r!==null;)Ib(r.alternate,r),r=r.return;Ke=null}}function os(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,u_(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),pa=0,em(),yt=r,Ke=s=na(r.current,null),Je=i,ft=0,Zn=null,Ya=!1,is=Ii(r,i),Gh=!1,ls=Vn=Kh=rl=Xa=Dt=0,zn=Do=null,Yh=!1,(i&8)!==0&&(i|=i&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=i;0<c;){var p=31-ot(c),v=1<<p;i|=r[p],c&=~v}return ma=i,tc(),s}function sx(r,i){Fe=null,q.H=Eo,i===Xl||i===uc?(i=kv(),ft=3):i===ah?(i=kv(),ft=4):ft=i===zh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Zn=i,Ke===null&&(Dt=1,kc(r,ir(i,r.current)))}function ox(){var r=qn.current;return r===null?!0:(Je&4194048)===Je?ur===null:(Je&62914560)===Je||(Je&536870912)!==0?r===ur:!1}function ux(){var r=q.H;return q.H=Eo,r===null?Eo:r}function cx(){var r=q.A;return q.A=$N,r}function Mc(){Dt=4,Ya||(Je&4194048)!==Je&&qn.current!==null||(is=!0),(Xa&134217727)===0&&(rl&134217727)===0||yt===null||ei(yt,Je,Vn,!1)}function tm(r,i,s){var c=ut;ut|=2;var p=ux(),v=cx();(yt!==r||Je!==i)&&(Oc=null,os(r,i)),i=!1;var w=Dt;e:do try{if(ft!==0&&Ke!==null){var N=Ke,M=Zn;switch(ft){case 8:em(),w=6;break e;case 3:case 2:case 9:case 6:qn.current===null&&(i=!0);var G=ft;if(ft=0,Zn=null,us(r,N,M,G),s&&is){w=0;break e}break;default:G=ft,ft=0,Zn=null,us(r,N,M,G)}}HN(),w=Dt;break}catch(ne){sx(r,ne)}while(!0);return i&&r.shellSuspendCounter++,aa=Gi=null,ut=c,q.H=p,q.A=v,Ke===null&&(yt=null,Je=0,tc()),w}function HN(){for(;Ke!==null;)dx(Ke)}function ZN(r,i){var s=ut;ut|=2;var c=ux(),p=cx();yt!==r||Je!==i?(Oc=null,zc=tn()+500,os(r,i)):is=Ii(r,i);e:do try{if(ft!==0&&Ke!==null){i=Ke;var v=Zn;t:switch(ft){case 1:ft=0,Zn=null,us(r,i,v,1);break;case 2:case 9:if(Sv(v)){ft=0,Zn=null,fx(i);break}i=function(){ft!==2&&ft!==9||yt!==r||(ft=7),Mr(r)},v.then(i,i);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:Sv(v)?(ft=0,Zn=null,fx(i)):(ft=0,Zn=null,us(r,i,v,7));break;case 5:var w=null;switch(Ke.tag){case 26:w=Ke.memoizedState;case 5:case 27:var N=Ke;if(w?Xx(w):N.stateNode.complete){ft=0,Zn=null;var M=N.sibling;if(M!==null)Ke=M;else{var G=N.return;G!==null?(Ke=G,Lc(G)):Ke=null}break t}}ft=0,Zn=null,us(r,i,v,5);break;case 6:ft=0,Zn=null,us(r,i,v,6);break;case 8:em(),Dt=6;break e;default:throw Error(a(462))}}VN();break}catch(ne){sx(r,ne)}while(!0);return aa=Gi=null,q.H=c,q.A=p,ut=s,Ke!==null?0:(yt=null,Je=0,tc(),Dt)}function VN(){for(;Ke!==null&&!Mi();)dx(Ke)}function dx(r){var i=Mb(r.alternate,r,ma);r.memoizedProps=r.pendingProps,i===null?Lc(r):Ke=i}function fx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=Ab(s,i,i.pendingProps,i.type,void 0,Je);break;case 11:i=Ab(s,i,i.pendingProps,i.type.render,i.ref,Je);break;case 5:gh(i);default:Ib(s,i),i=Ke=cv(i,ma),i=Mb(s,i,ma)}r.memoizedProps=r.pendingProps,i===null?Lc(r):Ke=i}function us(r,i,s,c){aa=Gi=null,gh(i),Jl=null,vo=0;var p=i.return;try{if(DN(r,p,i,s,Je)){Dt=1,kc(r,ir(s,r.current)),Ke=null;return}}catch(v){if(p!==null)throw Ke=p,v;Dt=1,kc(r,ir(s,r.current)),Ke=null;return}i.flags&32768?(tt||c===1?r=!0:is||(Je&536870912)!==0?r=!1:(Ya=r=!0,(c===2||c===9||c===3||c===6)&&(c=qn.current,c!==null&&c.tag===13&&(c.flags|=16384))),hx(i,r)):Lc(i)}function Lc(r){var i=r;do{if((i.flags&32768)!==0){hx(i,Ya);return}r=i.return;var s=IN(i.alternate,i,ma);if(s!==null){Ke=s;return}if(i=i.sibling,i!==null){Ke=i;return}Ke=i=r}while(i!==null);Dt===0&&(Dt=5)}function hx(r,i){do{var s=UN(r.alternate,r);if(s!==null){s.flags&=32767,Ke=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Ke=r;return}Ke=r=s}while(r!==null);Dt=6,Ke=null}function mx(r,i,s,c,p,v,w,N,M){r.cancelPendingCommit=null;do Ic();while(Qt!==0);if((ut&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=qf,Sf(r,s,v,w,N,M),r===yt&&(Ke=yt=null,Je=0),ss=i,Wa=r,pa=s,Xh=v,Jh=p,rx=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,YN(we,function(){return bx(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=q.T,q.T=null,p=oe.p,oe.p=2,w=ut,ut|=4;try{BN(r,i,s)}finally{ut=w,oe.p=p,q.T=c}}Qt=1,px(),gx(),yx()}}function px(){if(Qt===1){Qt=0;var r=Wa,i=ss,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var c=oe.p;oe.p=2;var p=ut;ut|=4;try{Kb(i,r);var v=hm,w=tv(r.containerInfo),N=v.focusedElem,M=v.selectionRange;if(w!==N&&N&&N.ownerDocument&&ev(N.ownerDocument.documentElement,N)){if(M!==null&&Uf(N)){var G=M.start,ne=M.end;if(ne===void 0&&(ne=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(ne,N.value.length);else{var ce=N.ownerDocument||document,Y=ce&&ce.defaultView||window;if(Y.getSelection){var J=Y.getSelection(),ke=N.textContent.length,Me=Math.min(M.start,ke),gt=M.end===void 0?Me:Math.min(M.end,ke);!J.extend&&Me>gt&&(w=gt,gt=Me,Me=w);var H=Wy(N,Me),$=Wy(N,gt);if(H&&$&&(J.rangeCount!==1||J.anchorNode!==H.node||J.anchorOffset!==H.offset||J.focusNode!==$.node||J.focusOffset!==$.offset)){var Q=ce.createRange();Q.setStart(H.node,H.offset),J.removeAllRanges(),Me>gt?(J.addRange(Q),J.extend($.node,$.offset)):(Q.setEnd($.node,$.offset),J.addRange(Q))}}}}for(ce=[],J=N;J=J.parentNode;)J.nodeType===1&&ce.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ce.length;N++){var se=ce[N];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Kc=!!fm,hm=fm=null}finally{ut=p,oe.p=c,q.T=s}}r.current=i,Qt=2}}function gx(){if(Qt===2){Qt=0;var r=Wa,i=ss,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var c=oe.p;oe.p=2;var p=ut;ut|=4;try{Hb(r,i.alternate,i)}finally{ut=p,oe.p=c,q.T=s}}Qt=3}}function yx(){if(Qt===4||Qt===3){Qt=0,La();var r=Wa,i=ss,s=pa,c=rx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Qt=5:(Qt=0,ss=Wa=null,vx(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ja=null),Pi(s),i=i.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(rn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=q.T,p=oe.p,oe.p=2,q.T=null;try{for(var v=r.onRecoverableError,w=0;w<c.length;w++){var N=c[w];v(N.value,{componentStack:N.stack})}}finally{q.T=i,oe.p=p}}(pa&3)!==0&&Ic(),Mr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===Wh?Mo++:(Mo=0,Wh=r):Mo=0,Lo(0)}}function vx(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,go(i)))}function Ic(){return px(),gx(),yx(),bx()}function bx(){if(Qt!==5)return!1;var r=Wa,i=Xh;Xh=0;var s=Pi(pa),c=q.T,p=oe.p;try{oe.p=32>s?32:s,q.T=null,s=Jh,Jh=null;var v=Wa,w=pa;if(Qt=0,ss=Wa=null,pa=0,(ut&6)!==0)throw Error(a(331));var N=ut;if(ut|=4,ex(v.current),Xb(v,v.current,w,s),ut=N,Lo(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(rn,v)}catch{}return!0}finally{oe.p=p,q.T=c,vx(r,i)}}function xx(r,i,s){i=ir(s,i),i=Rh(r.stateNode,i,2),r=Va(r,i,2),r!==null&&(Ui(r,2),Mr(r))}function ht(r,i,s){if(r.tag===3)xx(r,r,s);else for(;i!==null;){if(i.tag===3){xx(i,r,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ja===null||!Ja.has(c))){r=ir(s,r),s=Sb(2),c=Va(i,s,2),c!==null&&(wb(s,c,i,r),Ui(c,2),Mr(c));break}}i=i.return}}function nm(r,i,s){var c=r.pingCache;if(c===null){c=r.pingCache=new FN;var p=new Set;c.set(i,p)}else p=c.get(i),p===void 0&&(p=new Set,c.set(i,p));p.has(s)||(Gh=!0,p.add(s),r=QN.bind(null,r,i,s),i.then(r,r))}function QN(r,i,s){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,yt===r&&(Je&s)===s&&(Dt===4||Dt===3&&(Je&62914560)===Je&&300>tn()-Rc?(ut&2)===0&&os(r,0):Kh|=s,ls===Je&&(ls=0)),Mr(r)}function Sx(r,i){i===0&&(i=Bu()),r=Zi(r,i),r!==null&&(Ui(r,i),Mr(r))}function GN(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),Sx(r,s)}function KN(r,i){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),Sx(r,s)}function YN(r,i){return Gr(r,i)}var Uc=null,cs=null,rm=!1,Bc=!1,am=!1,ti=0;function Mr(r){r!==cs&&r.next===null&&(cs===null?Uc=cs=r:cs=cs.next=r),Bc=!0,rm||(rm=!0,JN())}function Lo(r,i){if(!am&&Bc){am=!0;do for(var s=!1,c=Uc;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var v=0;else{var w=c.suspendedLanes,N=c.pingedLanes;v=(1<<31-ot(42|r)+1)-1,v&=p&~(w&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,Cx(c,v))}else v=Je,v=Rl(c,c===yt?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Ii(c,v)||(s=!0,Cx(c,v));c=c.next}while(s);am=!1}}function XN(){wx()}function wx(){Bc=rm=!1;var r=0;ti!==0&&o_()&&(r=ti);for(var i=tn(),s=null,c=Uc;c!==null;){var p=c.next,v=kx(c,i);v===0?(c.next=null,s===null?Uc=p:s.next=p,p===null&&(cs=s)):(s=c,(r!==0||(v&3)!==0)&&(Bc=!0)),c=p}Qt!==0&&Qt!==5||Lo(r),ti!==0&&(ti=0)}function kx(r,i){for(var s=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-ot(v),N=1<<w,M=p[w];M===-1?((N&s)===0||(N&c)!==0)&&(p[w]=xf(N,i)):M<=i&&(r.expiredLanes|=N),v&=~N}if(i=yt,s=Je,s=Rl(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===i&&(ft===2||ft===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Ma(c),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ii(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(c!==null&&Ma(c),Pi(s)){case 2:case 8:s=ve;break;case 32:s=we;break;case 268435456:s=Pe;break;default:s=we}return c=jx.bind(null,r),s=Gr(s,c),r.callbackPriority=i,r.callbackNode=s,i}return c!==null&&c!==null&&Ma(c),r.callbackPriority=2,r.callbackNode=null,2}function jx(r,i){if(Qt!==0&&Qt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Ic()&&r.callbackNode!==s)return null;var c=Je;return c=Rl(r,r===yt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(ix(r,c,i),kx(r,tn()),r.callbackNode!=null&&r.callbackNode===s?jx.bind(null,r):null)}function Cx(r,i){if(Ic())return null;ix(r,i,!0)}function JN(){c_(function(){(ut&6)!==0?Gr(ae,XN):wx()})}function im(){if(ti===0){var r=Kl;r===0&&(r=Al,Al<<=1,(Al&261888)===0&&(Al=256)),ti=r}return ti}function Ex(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Qu(""+r)}function Nx(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 WN(r,i,s,c,p){if(i==="submit"&&s&&s.stateNode===p){var v=Ex((p[ln]||null).action),w=c.submitter;w&&(i=(i=w[ln]||null)?Ex(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var N=new Xu("action","action",null,c,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ti!==0){var M=w?Nx(p,w):new FormData(p);Ch(s,{pending:!0,data:M,method:p.method,action:v},null,M)}}else typeof v=="function"&&(N.preventDefault(),M=w?Nx(p,w):new FormData(p),Ch(s,{pending:!0,data:M,method:p.method,action:v},v,M))},currentTarget:p}]})}}for(var lm=0;lm<Ff.length;lm++){var sm=Ff[lm],e_=sm.toLowerCase(),t_=sm[0].toUpperCase()+sm.slice(1);xr(e_,"on"+t_)}xr(av,"onAnimationEnd"),xr(iv,"onAnimationIteration"),xr(lv,"onAnimationStart"),xr("dblclick","onDoubleClick"),xr("focusin","onFocus"),xr("focusout","onBlur"),xr(yN,"onTransitionRun"),xr(vN,"onTransitionStart"),xr(bN,"onTransitionCancel"),xr(sv,"onTransitionEnd"),$i("onMouseEnter",["mouseout","mouseover"]),$i("onMouseLeave",["mouseout","mouseover"]),$i("onPointerEnter",["pointerout","pointerover"]),$i("onPointerLeave",["pointerout","pointerover"]),Nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Nn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Io="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(" "),n_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Io));function _x(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var c=r[s],p=c.event;c=c.listeners;e:{var v=void 0;if(i)for(var w=c.length-1;0<=w;w--){var N=c[w],M=N.instance,G=N.currentTarget;if(N=N.listener,M!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ne){ec(ne)}p.currentTarget=null,v=M}else for(w=0;w<c.length;w++){if(N=c[w],M=N.instance,G=N.currentTarget,N=N.listener,M!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ne){ec(ne)}p.currentTarget=null,v=M}}}}function Ye(r,i){var s=i[Dl];s===void 0&&(s=i[Dl]=new Set);var c=r+"__bubble";s.has(c)||(Ax(i,r,2,!1),s.add(c))}function om(r,i,s){var c=0;i&&(c|=4),Ax(s,r,c,i)}var Pc="_reactListening"+Math.random().toString(36).slice(2);function um(r){if(!r[Pc]){r[Pc]=!0,$e.forEach(function(s){s!=="selectionchange"&&(n_.has(s)||om(s,!1,r),om(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Pc]||(i[Pc]=!0,om("selectionchange",!1,i))}}function Ax(r,i,s,c){switch(a0(i)){case 2:var p=T_;break;case 8:p=R_;break;default:p=jm}s=p.bind(null,i,s,r),p=void 0,!Af||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?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 cm(r,i,s,c,p){var v=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var N=c.stateNode.containerInfo;if(N===p)break;if(w===4)for(w=c.return;w!==null;){var M=w.tag;if((M===3||M===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;N!==null;){if(w=Yr(N),w===null)return;if(M=w.tag,M===5||M===6||M===26||M===27){c=v=w;continue e}N=N.parentNode}}c=c.return}Dy(function(){var G=v,ne=Nf(s),ce=[];e:{var Y=ov.get(r);if(Y!==void 0){var J=Xu,ke=r;switch(r){case"keypress":if(Ku(s)===0)break e;case"keydown":case"keyup":J=KE;break;case"focusin":ke="focus",J=Of;break;case"focusout":ke="blur",J=Of;break;case"beforeblur":case"afterblur":J=Of;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":J=Iy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=IE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=JE;break;case av:case iv:case lv:J=PE;break;case sv:J=eN;break;case"scroll":case"scrollend":J=ME;break;case"wheel":J=nN;break;case"copy":case"cut":case"paste":J=FE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=By;break;case"toggle":case"beforetoggle":J=aN}var Me=(i&4)!==0,gt=!Me&&(r==="scroll"||r==="scrollend"),H=Me?Y!==null?Y+"Capture":null:Y;Me=[];for(var $=G,Q;$!==null;){var se=$;if(Q=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||Q===null||H===null||(se=ao($,H),se!=null&&Me.push(Uo($,se,Q))),gt)break;$=$.return}0<Me.length&&(Y=new J(Y,ke,null,s,ne),ce.push({event:Y,listeners:Me}))}}if((i&7)===0){e:{if(Y=r==="mouseover"||r==="pointerover",J=r==="mouseout"||r==="pointerout",Y&&s!==Ef&&(ke=s.relatedTarget||s.fromElement)&&(Yr(ke)||ke[Kr]))break e;if((J||Y)&&(Y=ne.window===ne?ne:(Y=ne.ownerDocument)?Y.defaultView||Y.parentWindow:window,J?(ke=s.relatedTarget||s.toElement,J=G,ke=ke?Yr(ke):null,ke!==null&&(gt=o(ke),Me=ke.tag,ke!==gt||Me!==5&&Me!==27&&Me!==6)&&(ke=null)):(J=null,ke=G),J!==ke)){if(Me=Iy,se="onMouseLeave",H="onMouseEnter",$="mouse",(r==="pointerout"||r==="pointerover")&&(Me=By,se="onPointerLeave",H="onPointerEnter",$="pointer"),gt=J==null?Y:Ua(J),Q=ke==null?Y:Ua(ke),Y=new Me(se,$+"leave",J,s,ne),Y.target=gt,Y.relatedTarget=Q,se=null,Yr(ne)===G&&(Me=new Me(H,$+"enter",ke,s,ne),Me.target=Q,Me.relatedTarget=gt,se=Me),gt=se,J&&ke)t:{for(Me=r_,H=J,$=ke,Q=0,se=H;se;se=Me(se))Q++;se=0;for(var Re=$;Re;Re=Me(Re))se++;for(;0<Q-se;)H=Me(H),Q--;for(;0<se-Q;)$=Me($),se--;for(;Q--;){if(H===$||$!==null&&H===$.alternate){Me=H;break t}H=Me(H),$=Me($)}Me=null}else Me=null;J!==null&&Tx(ce,Y,J,Me,!1),ke!==null&&gt!==null&&Tx(ce,gt,ke,Me,!0)}}e:{if(Y=G?Ua(G):window,J=Y.nodeName&&Y.nodeName.toLowerCase(),J==="select"||J==="input"&&Y.type==="file")var it=Qy;else if(Zy(Y))if(Gy)it=mN;else{it=fN;var Ee=dN}else J=Y.nodeName,!J||J.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&Cf(G.elementType)&&(it=Qy):it=hN;if(it&&(it=it(r,G))){Vy(ce,it,s,ne);break e}Ee&&Ee(r,Y,G),r==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&jf(Y,"number",Y.value)}switch(Ee=G?Ua(G):window,r){case"focusin":(Zy(Ee)||Ee.contentEditable==="true")&&($l=Ee,Bf=G,ho=null);break;case"focusout":ho=Bf=$l=null;break;case"mousedown":Pf=!0;break;case"contextmenu":case"mouseup":case"dragend":Pf=!1,nv(ce,s,ne);break;case"selectionchange":if(gN)break;case"keydown":case"keyup":nv(ce,s,ne)}var qe;if(Mf)e:{switch(r){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Pl?qy(r,s)&&(We="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(We="onCompositionStart");We&&(Py&&s.locale!=="ko"&&(Pl||We!=="onCompositionStart"?We==="onCompositionEnd"&&Pl&&(qe=My()):(Ba=ne,Tf="value"in Ba?Ba.value:Ba.textContent,Pl=!0)),Ee=$c(G,We),0<Ee.length&&(We=new Uy(We,r,null,s,ne),ce.push({event:We,listeners:Ee}),qe?We.data=qe:(qe=Hy(s),qe!==null&&(We.data=qe)))),(qe=lN?sN(r,s):oN(r,s))&&(We=$c(G,"onBeforeInput"),0<We.length&&(Ee=new Uy("onBeforeInput","beforeinput",null,s,ne),ce.push({event:Ee,listeners:We}),Ee.data=qe)),WN(ce,r,G,s,ne)}_x(ce,i)})}function Uo(r,i,s){return{instance:r,listener:i,currentTarget:s}}function $c(r,i){for(var s=i+"Capture",c=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=ao(r,s),p!=null&&c.unshift(Uo(r,p,v)),p=ao(r,i),p!=null&&c.push(Uo(r,p,v))),r.tag===3)return c;r=r.return}return[]}function r_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Tx(r,i,s,c,p){for(var v=i._reactName,w=[];s!==null&&s!==c;){var N=s,M=N.alternate,G=N.stateNode;if(N=N.tag,M!==null&&M===c)break;N!==5&&N!==26&&N!==27||G===null||(M=G,p?(G=ao(s,v),G!=null&&w.unshift(Uo(s,G,M))):p||(G=ao(s,v),G!=null&&w.push(Uo(s,G,M)))),s=s.return}w.length!==0&&r.push({event:i,listeners:w})}var a_=/\r\n?/g,i_=/\u0000|\uFFFD/g;function Rx(r){return(typeof r=="string"?r:""+r).replace(a_,`
49
- `).replace(i_,"")}function zx(r,i){return i=Rx(i),Rx(r)===i}function pt(r,i,s,c,p,v){switch(s){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||Il(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&Il(r,""+c);break;case"className":Zu(r,"class",c);break;case"tabIndex":Zu(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Zu(r,s,c);break;case"style":zy(r,c,v);break;case"data":if(i!=="object"){Zu(r,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Qu(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="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"&&pt(r,i,"name",p.name,p,null),pt(r,i,"formEncType",p.formEncType,p,null),pt(r,i,"formMethod",p.formMethod,p,null),pt(r,i,"formTarget",p.formTarget,p,null)):(pt(r,i,"encType",p.encType,p,null),pt(r,i,"method",p.method,p,null),pt(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Qu(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=ea);break;case"onScroll":c!=null&&Ye("scroll",r);break;case"onScrollEnd":c!=null&&Ye("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=Qu(""+c),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":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):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":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":Ye("beforetoggle",r),Ye("toggle",r),Hu(r,"popover",c);break;case"xlinkActuate":Wr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Wr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Wr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Wr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Wr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Wr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Wr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Wr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Wr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Hu(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=OE.get(s)||s,Hu(r,s,c))}}function dm(r,i,s,c,p,v){switch(s){case"style":zy(r,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof c=="string"?Il(r,c):(typeof c=="number"||typeof c=="bigint")&&Il(r,""+c);break;case"onScroll":c!=null&&Ye("scroll",r);break;case"onScrollEnd":c!=null&&Ye("scrollend",r);break;case"onClick":c!=null&&(r.onclick=ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pn.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 c=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,c,p);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):Hu(r,s,c)}}}function cn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",r),Ye("load",r);var c=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var w=s[v];if(w!=null)switch(v){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:pt(r,i,v,w,s,null)}}p&&pt(r,i,"srcSet",s.srcSet,s,null),c&&pt(r,i,"src",s.src,s,null);return;case"input":Ye("invalid",r);var N=v=w=p=null,M=null,G=null;for(c in s)if(s.hasOwnProperty(c)){var ne=s[c];if(ne!=null)switch(c){case"name":p=ne;break;case"type":w=ne;break;case"checked":M=ne;break;case"defaultChecked":G=ne;break;case"value":v=ne;break;case"defaultValue":N=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:pt(r,i,c,ne,s,null)}}_y(r,v,N,M,G,w,p,!1);return;case"select":Ye("invalid",r),c=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":c=N;default:pt(r,i,p,N,s,null)}i=v,s=w,r.multiple=!!c,i!=null?Ll(r,!!c,i,!1):s!=null&&Ll(r,!!c,s,!0);return;case"textarea":Ye("invalid",r),v=p=c=null;for(w in s)if(s.hasOwnProperty(w)&&(N=s[w],N!=null))switch(w){case"value":c=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:pt(r,i,w,N,s,null)}Ty(r,c,p,v);return;case"option":for(M in s)if(s.hasOwnProperty(M)&&(c=s[M],c!=null))switch(M){case"selected":r.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:pt(r,i,M,c,s,null)}return;case"dialog":Ye("beforetoggle",r),Ye("toggle",r),Ye("cancel",r),Ye("close",r);break;case"iframe":case"object":Ye("load",r);break;case"video":case"audio":for(c=0;c<Io.length;c++)Ye(Io[c],r);break;case"image":Ye("error",r),Ye("load",r);break;case"details":Ye("toggle",r);break;case"embed":case"source":case"link":Ye("error",r),Ye("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)&&(c=s[G],c!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:pt(r,i,G,c,s,null)}return;default:if(Cf(i)){for(ne in s)s.hasOwnProperty(ne)&&(c=s[ne],c!==void 0&&dm(r,i,ne,c,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(c=s[N],c!=null&&pt(r,i,N,c,s,null))}function l_(r,i,s,c){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,M=null,G=null,ne=null;for(J in s){var ce=s[J];if(s.hasOwnProperty(J)&&ce!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":M=ce;default:c.hasOwnProperty(J)||pt(r,i,J,null,c,ce)}}for(var Y in c){var J=c[Y];if(ce=s[Y],c.hasOwnProperty(Y)&&(J!=null||ce!=null))switch(Y){case"type":v=J;break;case"name":p=J;break;case"checked":G=J;break;case"defaultChecked":ne=J;break;case"value":w=J;break;case"defaultValue":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:J!==ce&&pt(r,i,Y,J,c,ce)}}kf(r,w,N,M,G,ne,v,p);return;case"select":J=w=N=Y=null;for(v in s)if(M=s[v],s.hasOwnProperty(v)&&M!=null)switch(v){case"value":break;case"multiple":J=M;default:c.hasOwnProperty(v)||pt(r,i,v,null,c,M)}for(p in c)if(v=c[p],M=s[p],c.hasOwnProperty(p)&&(v!=null||M!=null))switch(p){case"value":Y=v;break;case"defaultValue":N=v;break;case"multiple":w=v;default:v!==M&&pt(r,i,p,v,c,M)}i=N,s=w,c=J,Y!=null?Ll(r,!!s,Y,!1):!!c!=!!s&&(i!=null?Ll(r,!!s,i,!0):Ll(r,!!s,s?[]:"",!1));return;case"textarea":J=Y=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!c.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:pt(r,i,N,null,c,p)}for(w in c)if(p=c[w],v=s[w],c.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":Y=p;break;case"defaultValue":J=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&pt(r,i,w,p,c,v)}Ay(r,Y,J);return;case"option":for(var ke in s)if(Y=s[ke],s.hasOwnProperty(ke)&&Y!=null&&!c.hasOwnProperty(ke))switch(ke){case"selected":r.selected=!1;break;default:pt(r,i,ke,null,c,Y)}for(M in c)if(Y=c[M],J=s[M],c.hasOwnProperty(M)&&Y!==J&&(Y!=null||J!=null))switch(M){case"selected":r.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:pt(r,i,M,Y,c,J)}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 Me in s)Y=s[Me],s.hasOwnProperty(Me)&&Y!=null&&!c.hasOwnProperty(Me)&&pt(r,i,Me,null,c,Y);for(G in c)if(Y=c[G],J=s[G],c.hasOwnProperty(G)&&Y!==J&&(Y!=null||J!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:pt(r,i,G,Y,c,J)}return;default:if(Cf(i)){for(var gt in s)Y=s[gt],s.hasOwnProperty(gt)&&Y!==void 0&&!c.hasOwnProperty(gt)&&dm(r,i,gt,void 0,c,Y);for(ne in c)Y=c[ne],J=s[ne],!c.hasOwnProperty(ne)||Y===J||Y===void 0&&J===void 0||dm(r,i,ne,Y,c,J);return}}for(var H in s)Y=s[H],s.hasOwnProperty(H)&&Y!=null&&!c.hasOwnProperty(H)&&pt(r,i,H,null,c,Y);for(ce in c)Y=c[ce],J=s[ce],!c.hasOwnProperty(ce)||Y===J||Y==null&&J==null||pt(r,i,ce,Y,c,J)}function Ox(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function s_(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],v=p.transferSize,w=p.initiatorType,N=p.duration;if(v&&N&&Ox(w)){for(w=0,N=p.responseEnd,c+=1;c<s.length;c++){var M=s[c],G=M.startTime;if(G>N)break;var ne=M.transferSize,ce=M.initiatorType;ne&&Ox(ce)&&(M=M.responseEnd,w+=ne*(M<N?1:(N-G)/(M-G)))}if(--c,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 fm=null,hm=null;function Fc(r){return r.nodeType===9?r:r.ownerDocument}function Dx(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 Mx(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 mm(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 pm=null;function o_(){var r=window.event;return r&&r.type==="popstate"?r===pm?!1:(pm=r,!0):(pm=null,!1)}var Lx=typeof setTimeout=="function"?setTimeout:void 0,u_=typeof clearTimeout=="function"?clearTimeout:void 0,Ix=typeof Promise=="function"?Promise:void 0,c_=typeof queueMicrotask=="function"?queueMicrotask:typeof Ix<"u"?function(r){return Ix.resolve(null).then(r).catch(d_)}:Lx;function d_(r){setTimeout(function(){throw r})}function ni(r){return r==="head"}function Ux(r,i){var s=i,c=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(p),ms(i);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Bo(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Bo(s);for(var v=s.firstChild;v;){var w=v.nextSibling,N=v.nodeName;v[Ia]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&Bo(r.ownerDocument.body);s=p}while(s);ms(i)}function Bx(r,i){var s=r;r=0;do{var c=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||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function gm(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":gm(s),Ml(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function f_(r,i,s,c){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[Ia])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=cr(r.nextSibling),r===null)break}return null}function h_(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=cr(r.nextSibling),r===null))return null;return r}function Px(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=cr(r.nextSibling),r===null))return null;return r}function ym(r){return r.data==="$?"||r.data==="$~"}function vm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function m_(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var c=function(){i(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function cr(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 bm=null;function $x(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return cr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function Fx(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 qx(r,i,s){switch(i=Fc(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 Bo(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Ml(r)}var dr=new Map,Hx=new Set;function qc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ga=oe.d;oe.d={f:p_,r:g_,D:y_,C:v_,L:b_,m:x_,X:w_,S:S_,M:k_};function p_(){var r=ga.f(),i=Dc();return r||i}function g_(r){var i=Xr(r);i!==null&&i.tag===5&&i.type==="form"?sb(i):ga.r(r)}var ds=typeof document>"u"?null:document;function Zx(r,i,s){var c=ds;if(c&&typeof i=="string"&&i){var p=rr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Hx.has(p)||(Hx.add(p),r={rel:r,crossOrigin:s,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),cn(i,"link",r),X(i),c.head.appendChild(i)))}}function y_(r){ga.D(r),Zx("dns-prefetch",r,null)}function v_(r,i){ga.C(r,i),Zx("preconnect",r,i)}function b_(r,i,s){ga.L(r,i,s);var c=ds;if(c&&r&&i){var p='link[rel="preload"][as="'+rr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+rr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+rr(s.imageSizes)+'"]')):p+='[href="'+rr(r)+'"]';var v=p;switch(i){case"style":v=fs(r);break;case"script":v=hs(r)}dr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),dr.set(v,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(Po(v))||i==="script"&&c.querySelector($o(v))||(i=c.createElement("link"),cn(i,"link",r),X(i),c.head.appendChild(i)))}}function x_(r,i){ga.m(r,i);var s=ds;if(s&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+rr(c)+'"][href="'+rr(r)+'"]',v=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=hs(r)}if(!dr.has(v)&&(r=g({rel:"modulepreload",href:r},i),dr.set(v,r),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector($o(v)))return}c=s.createElement("link"),cn(c,"link",r),X(c),s.head.appendChild(c)}}}function S_(r,i,s){ga.S(r,i,s);var c=ds;if(c&&r){var p=Jr(c).hoistableStyles,v=fs(r);i=i||"default";var w=p.get(v);if(!w){var N={loading:0,preload:null};if(w=c.querySelector(Po(v)))N.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=dr.get(v))&&xm(r,s);var M=w=c.createElement("link");X(M),cn(M,"link",r),M._p=new Promise(function(G,ne){M.onload=G,M.onerror=ne}),M.addEventListener("load",function(){N.loading|=1}),M.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Hc(w,i,c)}w={type:"stylesheet",instance:w,count:1,state:N},p.set(v,w)}}}function w_(r,i){ga.X(r,i);var s=ds;if(s&&r){var c=Jr(s).hoistableScripts,p=hs(r),v=c.get(p);v||(v=s.querySelector($o(p)),v||(r=g({src:r,async:!0},i),(i=dr.get(p))&&Sm(r,i),v=s.createElement("script"),X(v),cn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function k_(r,i){ga.M(r,i);var s=ds;if(s&&r){var c=Jr(s).hoistableScripts,p=hs(r),v=c.get(p);v||(v=s.querySelector($o(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=dr.get(p))&&Sm(r,i),v=s.createElement("script"),X(v),cn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function Vx(r,i,s,c){var p=(p=ue.current)?qc(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=fs(s.href),s=Jr(p).hoistableStyles,c=s.get(i),c||(c={type:"style",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=fs(s.href);var v=Jr(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(Po(r)))&&!v._p&&(w.instance=v,w.state.loading=5),dr.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},dr.set(r,s),v||j_(p,r,s,w.state))),i&&c===null)throw Error(a(528,""));return w}if(i&&c!==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=hs(s),s=Jr(p).hoistableScripts,c=s.get(i),c||(c={type:"script",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function fs(r){return'href="'+rr(r)+'"'}function Po(r){return'link[rel="stylesheet"]['+r+"]"}function Qx(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function j_(r,i,s,c){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=r.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),cn(i,"link",s),X(i),r.head.appendChild(i))}function hs(r){return'[src="'+rr(r)+'"]'}function $o(r){return"script[async]"+r}function Gx(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+rr(s.href)+'"]');if(c)return i.instance=c,X(c),c;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),X(c),cn(c,"style",p),Hc(c,s.precedence,r),i.instance=c;case"stylesheet":p=fs(s.href);var v=r.querySelector(Po(p));if(v)return i.state.loading|=4,i.instance=v,X(v),v;c=Qx(s),(p=dr.get(p))&&xm(c,p),v=(r.ownerDocument||r).createElement("link"),X(v);var w=v;return w._p=new Promise(function(N,M){w.onload=N,w.onerror=M}),cn(v,"link",c),i.state.loading|=4,Hc(v,s.precedence,r),i.instance=v;case"script":return v=hs(s.src),(p=r.querySelector($o(v)))?(i.instance=p,X(p),p):(c=s,(p=dr.get(v))&&(c=g({},s),Sm(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),X(p),cn(p,"link",c),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&&(c=i.instance,i.state.loading|=4,Hc(c,s.precedence,r));return i.instance}function Hc(r,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,v=p,w=0;w<c.length;w++){var N=c[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 xm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Sm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Zc=null;function Kx(r,i,s){if(Zc===null){var c=new Map,p=Zc=new Map;p.set(s,c)}else p=Zc,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[Ia]||v[Ut]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=r+w;var N=c.get(w);N?N.push(v):c.set(w,[v])}}return c}function Yx(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function C_(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 Xx(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function E_(r,i,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=fs(c.href),v=i.querySelector(Po(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Vc.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,X(v);return}v=i.ownerDocument||i,c=Qx(c),(p=dr.get(p))&&xm(c,p),v=v.createElement("link"),X(v);var w=v;w._p=new Promise(function(N,M){w.onload=N,w.onerror=M}),cn(v,"link",c),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=Vc.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var wm=0;function N_(r,i){return r.stylesheets&&r.count===0&&Gc(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&Gc(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&wm===0&&(wm=62500*s_());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Gc(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>wm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Vc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Qc=null;function Gc(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Qc=new Map,i.forEach(__,r),Qc=null,Vc.call(r))}function __(r,i){if(!(i.state.loading&4)){var s=Qc.get(r);if(s)var c=s.get(null);else{s=new Map,Qc.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),c=w)}c&&s.set(null,c)}p=i.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||c,v===c&&s.set(null,p),s.set(w,p),this.count++,c=Vc.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Fo={$$typeof:O,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function A_(r,i,s,c,p,v,w,N,M){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=no(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=no(0),this.hiddenUpdates=no(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Jx(r,i,s,c,p,v,w,N,M,G,ne,ce){return r=new A_(r,i,s,w,M,G,ne,ce,N),i=1,v===!0&&(i|=24),v=Fn(3,null,null,i),r.current=v,v.stateNode=r,i=th(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:c,isDehydrated:s,cache:i},ih(v),r}function Wx(r){return r?(r=Hl,r):Hl}function e0(r,i,s,c,p,v){p=Wx(p),c.context===null?c.context=p:c.pendingContext=p,c=Za(i),c.payload={element:s},v=v===void 0?null:v,v!==null&&(c.callback=v),s=Va(r,c,i),s!==null&&(On(s,r,i),xo(s,r,i))}function t0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function km(r,i){t0(r,i),(r=r.alternate)&&t0(r,i)}function n0(r){if(r.tag===13||r.tag===31){var i=Zi(r,67108864);i!==null&&On(i,r,67108864),km(r,67108864)}}function r0(r){if(r.tag===13||r.tag===31){var i=Qn();i=Ol(i);var s=Zi(r,i);s!==null&&On(s,r,i),km(r,i)}}var Kc=!0;function T_(r,i,s,c){var p=q.T;q.T=null;var v=oe.p;try{oe.p=2,jm(r,i,s,c)}finally{oe.p=v,q.T=p}}function R_(r,i,s,c){var p=q.T;q.T=null;var v=oe.p;try{oe.p=8,jm(r,i,s,c)}finally{oe.p=v,q.T=p}}function jm(r,i,s,c){if(Kc){var p=Cm(c);if(p===null)cm(r,i,c,Yc,s),i0(r,c);else if(O_(p,r,i,s,c))c.stopPropagation();else if(i0(r,c),i&4&&-1<z_.indexOf(r)){for(;p!==null;){var v=Xr(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Rr(v.pendingLanes);if(w!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var M=1<<31-ot(w);N.entanglements[1]|=M,w&=~M}Mr(v),(ut&6)===0&&(zc=tn()+500,Lo(0))}}break;case 31:case 13:N=Zi(v,2),N!==null&&On(N,v,2),Dc(),km(v,2)}if(v=Cm(c),v===null&&cm(r,i,c,Yc,s),v===p)break;p=v}p!==null&&c.stopPropagation()}else cm(r,i,c,null,s)}}function Cm(r){return r=Nf(r),Em(r)}var Yc=null;function Em(r){if(Yc=null,r=Yr(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=u(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 Yc=r,null}function a0(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(Nl()){case ae:return 2;case ve:return 8;case we:case De:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var Nm=!1,ri=null,ai=null,ii=null,qo=new Map,Ho=new Map,li=[],z_="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 i0(r,i){switch(r){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":qo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ho.delete(i.pointerId)}}function Zo(r,i,s,c,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:c,nativeEvent:v,targetContainers:[p]},i!==null&&(i=Xr(i),i!==null&&n0(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function O_(r,i,s,c,p){switch(i){case"focusin":return ri=Zo(ri,r,i,s,c,p),!0;case"dragenter":return ai=Zo(ai,r,i,s,c,p),!0;case"mouseover":return ii=Zo(ii,r,i,s,c,p),!0;case"pointerover":var v=p.pointerId;return qo.set(v,Zo(qo.get(v)||null,r,i,s,c,p)),!0;case"gotpointercapture":return v=p.pointerId,Ho.set(v,Zo(Ho.get(v)||null,r,i,s,c,p)),!0}return!1}function l0(r){var i=Yr(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){r.blockedOn=i,$u(r.priority,function(){r0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,$u(r.priority,function(){r0(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 Xc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Cm(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);Ef=c,s.target.dispatchEvent(c),Ef=null}else return i=Xr(s),i!==null&&n0(i),r.blockedOn=s,!1;i.shift()}return!0}function s0(r,i,s){Xc(r)&&s.delete(i)}function D_(){Nm=!1,ri!==null&&Xc(ri)&&(ri=null),ai!==null&&Xc(ai)&&(ai=null),ii!==null&&Xc(ii)&&(ii=null),qo.forEach(s0),Ho.forEach(s0)}function Jc(r,i){r.blockedOn===i&&(r.blockedOn=null,Nm||(Nm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,D_)))}var Wc=null;function o0(r){Wc!==r&&(Wc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wc===r&&(Wc=null);for(var i=0;i<r.length;i+=3){var s=r[i],c=r[i+1],p=r[i+2];if(typeof c!="function"){if(Em(c||s)===null)continue;break}var v=Xr(s);v!==null&&(r.splice(i,3),i-=3,Ch(v,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function ms(r){function i(M){return Jc(M,r)}ri!==null&&Jc(ri,r),ai!==null&&Jc(ai,r),ii!==null&&Jc(ii,r),qo.forEach(i),Ho.forEach(i);for(var s=0;s<li.length;s++){var c=li[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<li.length&&(s=li[0],s.blockedOn===null);)l0(s),s.blockedOn===null&&li.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],v=s[c+1],w=p[ln]||null;if(typeof v=="function")w||o0(s);else if(w){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[ln]||null)N=w.formAction;else if(Em(p)!==null)continue}else N=w.action;typeof N=="function"?s[c+1]=N:(s.splice(c,3),c-=3),o0(s)}}}function u0(){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),c||setTimeout(s,20)}function s(){if(!c&&!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 c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function _m(r){this._internalRoot=r}ed.prototype.render=_m.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,c=Qn();e0(s,c,r,i,null,null)},ed.prototype.unmount=_m.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;e0(r.current,2,null,r,null,null),Dc(),i[Kr]=null}};function ed(r){this._internalRoot=r}ed.prototype.unstable_scheduleHydration=function(r){if(r){var i=Pu();r={blockedOn:null,target:r,priority:i};for(var s=0;s<li.length&&i!==0&&i<li[s].priority;s++);li.splice(s,0,r),s===0&&l0(r)}};var c0=t.version;if(c0!=="19.2.4")throw Error(a(527,c0,"19.2.4"));oe.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 M_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var td=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!td.isDisabled&&td.supportsFiber)try{rn=td.inject(M_),At=td}catch{}}return Qo.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,c="",p=yb,v=vb,w=bb;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=Jx(r,1,!1,null,null,s,c,null,p,v,w,u0),r[Kr]=i.current,um(r),new _m(i)},Qo.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var c=!1,p="",v=yb,w=vb,N=bb,M=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!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&&(M=s.formState)),i=Jx(r,1,!0,i,s??null,c,p,M,v,w,N,u0),i.context=Wx(null),s=i.current,c=Qn(),c=Ol(c),p=Za(c),p.callback=null,Va(s,p,c),s=c,i.current.lanes=s,Ui(i,s),Mr(i),r[Kr]=i.current,um(r),new ed(i)},Qo.version="19.2.4",Qo}var S0;function V_(){if(S0)return zm.exports;S0=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(),zm.exports=Z_(),zm.exports}var Q_=V_(),Gs=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(){}},sl,mi,Rs,PS,G_=(PS=class extends Gs{constructor(){super();Te(this,sl);Te(this,mi);Te(this,Rs);be(this,Rs,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){L(this,mi)||this.setEventListener(L(this,Rs))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,mi))==null||t.call(this),be(this,mi,void 0))}setEventListener(t){var n;be(this,Rs,t),(n=L(this,mi))==null||n.call(this),be(this,mi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){L(this,sl)!==t&&(be(this,sl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof L(this,sl)=="boolean"?L(this,sl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sl=new WeakMap,mi=new WeakMap,Rs=new WeakMap,PS),bg=new G_,K_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pi,gg,$S,Y_=($S=class{constructor(){Te(this,pi,K_);Te(this,gg,!1)}setTimeoutProvider(e){be(this,pi,e)}setTimeout(e,t){return L(this,pi).setTimeout(e,t)}clearTimeout(e){L(this,pi).clearTimeout(e)}setInterval(e,t){return L(this,pi).setInterval(e,t)}clearInterval(e){L(this,pi).clearInterval(e)}},pi=new WeakMap,gg=new WeakMap,$S),ll=new Y_;function X_(e){setTimeout(e,0)}var J_=typeof window>"u"||"Deno"in globalThis;function kn(){}function W_(e,t){return typeof e=="function"?e(t):e}function Cp(e){return typeof e=="number"&&e>=0&&e!==1/0}function JS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ji(e,t){return typeof e=="function"?e(t):e}function hr(e,t){return typeof e=="function"?e(t):e}function w0(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==xg(u,t.options))return!1}else if(!fu(t.queryKey,u))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 k0(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(gl(t.options.mutationKey)!==gl(o))return!1}else if(!fu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function xg(e,t){return((t==null?void 0:t.queryKeyHashFn)||gl)(e)}function gl(e){return JSON.stringify(e,(t,n)=>Ep(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function fu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fu(e[n],t[n])):!1}var e2=Object.prototype.hasOwnProperty;function WS(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=j0(e)&&j0(t);if(!a&&!(Ep(e)&&Ep(t)))return t;const o=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,m=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:u[y],b=e[g],S=t[g];if(b===S){m[g]=b,(a?y<o:e2.call(e,g))&&h++;continue}if(b===null||S===null||typeof b!="object"||typeof S!="object"){m[g]=S;continue}const k=WS(b,S,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function Rd(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 j0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ep(e){if(!C0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!C0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function C0(e){return Object.prototype.toString.call(e)==="[object Object]"}function t2(e){return new Promise(t=>{ll.setTimeout(t,e)})}function Np(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?WS(e,t):t}function n2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function r2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Sg=Symbol();function ew(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Sg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wg(e,t){return typeof e=="function"?e(...t):!!e}function a2(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 hu=(()=>{let e=()=>J_;return{isServer(){return e()},setIsServer(t){e=t}}})();function _p(){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 i2=X_;function l2(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=i2;const o=f=>{t?e.push(f):l(()=>{n(f)})},u=()=>{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||u()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Kt=l2(),zs,gi,Os,FS,s2=(FS=class extends Gs{constructor(){super();Te(this,zs,!0);Te(this,gi);Te(this,Os);be(this,Os,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,gi)||this.setEventListener(L(this,Os))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,gi))==null||t.call(this),be(this,gi,void 0))}setEventListener(t){var n;be(this,Os,t),(n=L(this,gi))==null||n.call(this),be(this,gi,t(this.setOnline.bind(this)))}setOnline(t){L(this,zs)!==t&&(be(this,zs,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return L(this,zs)}},zs=new WeakMap,gi=new WeakMap,Os=new WeakMap,FS),zd=new s2;function o2(e){return Math.min(1e3*2**e,3e4)}function tw(e){return(e??"online")==="online"?zd.isOnline():!0}var Ap=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function nw(e){let t=!1,n=0,a;const l=_p(),o=()=>l.status!=="pending",u=j=>{var E;if(!o()){const C=new Ap(j);b(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>bg.isFocused()&&(e.networkMode==="always"||zd.isOnline())&&e.canRun(),y=()=>tw(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 E;a=C=>{(o()||h())&&j(C)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(C){j=Promise.reject(C)}Promise.resolve(j).then(g).catch(C=>{var R;if(o())return;const T=e.retry??(hu.isServer()?0:3),O=e.retryDelay??o2,B=typeof O=="function"?O(n,C):O,D=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,C);if(t||!D){b(C);return}n++,(R=e.onFail)==null||R.call(e,n,C),t2(B).then(()=>h()?void 0:S()).then(()=>{t?b(C):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():S().then(k),l)}}var ol,qS,rw=(qS=class{constructor(){Te(this,ol)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cp(this.gcTime)&&be(this,ol,ll.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hu.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,ol)&&(ll.clearTimeout(L(this,ol)),be(this,ol,void 0))}},ol=new WeakMap,qS),ul,Ds,fr,cl,en,ju,dl,Kn,aw,va,HS,u2=(HS=class extends rw{constructor(t){super();Te(this,Kn);Te(this,ul);Te(this,Ds);Te(this,fr);Te(this,cl);Te(this,en);Te(this,ju);Te(this,dl);be(this,dl,!1),be(this,ju,t.defaultOptions),this.setOptions(t.options),this.observers=[],be(this,cl,t.client),be(this,fr,L(this,cl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,be(this,ul,N0(this.options)),this.state=t.state??L(this,ul),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=L(this,en))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,ju),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=N0(this.options);n.data!==void 0&&(this.setState(E0(n.data,n.dataUpdatedAt)),be(this,ul,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,fr).remove(this)}setData(t,n){const a=Np(this.state.data,t,this.options);return He(this,Kn,va).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){He(this,Kn,va).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=L(this,en))==null?void 0:a.promise;return(l=L(this,en))==null||l.cancel(t),n?n.then(kn).catch(kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,ul)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>hr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sg||!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:!JS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,en))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,en))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,fr).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,en)&&(L(this,dl)||He(this,Kn,aw).call(this)?L(this,en).cancel({revert:!0}):L(this,en).cancelRetry()),this.scheduleGc()),L(this,fr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,Kn,va).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,S,k,j,E,C,T,O;if(this.state.fetchStatus!=="idle"&&((m=L(this,en))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(L(this,en))return L(this,en).continueRetry(),L(this,en).promise}if(t&&this.setOptions(t),!this.options.queryFn){const B=this.observers.find(D=>D.options.queryFn);B&&this.setOptions(B.options)}const a=new AbortController,l=B=>{Object.defineProperty(B,"signal",{enumerable:!0,get:()=>(be(this,dl,!0),a.signal)})},o=()=>{const B=ew(this.options,n),R=(()=>{const P={client:L(this,cl),queryKey:this.queryKey,meta:this.meta};return l(P),P})();return be(this,dl,!1),this.options.persister?this.options.persister(B,R,this):B(R)},f=(()=>{const B={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:L(this,cl),state:this.state,fetchFn:o};return l(B),B})();(h=this.options.behavior)==null||h.onFetch(f,this),be(this,Ds,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&He(this,Kn,va).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),be(this,en,nw({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:B=>{B instanceof Ap&&B.revert&&this.setState({...L(this,Ds),fetchStatus:"idle"}),a.abort()},onFail:(B,D)=>{He(this,Kn,va).call(this,{type:"failed",failureCount:B,error:D})},onPause:()=>{He(this,Kn,va).call(this,{type:"pause"})},onContinue:()=>{He(this,Kn,va).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const B=await L(this,en).start();if(B===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(B),(S=(b=L(this,fr).config).onSuccess)==null||S.call(b,B,this),(j=(k=L(this,fr).config).onSettled)==null||j.call(k,B,this.state.error,this),B}catch(B){if(B instanceof Ap){if(B.silent)return L(this,en).promise;if(B.revert){if(this.state.data===void 0)throw B;return this.state.data}}throw He(this,Kn,va).call(this,{type:"error",error:B}),(C=(E=L(this,fr).config).onError)==null||C.call(E,B,this),(O=(T=L(this,fr).config).onSettled)==null||O.call(T,this.state.data,B,this),B}finally{this.scheduleGc()}}},ul=new WeakMap,Ds=new WeakMap,fr=new WeakMap,cl=new WeakMap,en=new WeakMap,ju=new WeakMap,dl=new WeakMap,Kn=new WeakSet,aw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},va=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,...iw(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...E0(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return be(this,Ds,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),Kt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),L(this,fr).notify({query:this,type:"updated",action:t})})},HS);function iw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function E0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function N0(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 Mn,nt,Cu,wn,fl,Ms,ba,yi,Eu,Ls,Is,hl,ml,vi,Us,dt,ru,Tp,Rp,zp,Op,Dp,Mp,Lp,lw,ZS,c2=(ZS=class extends Gs{constructor(t,n){super();Te(this,dt);Te(this,Mn);Te(this,nt);Te(this,Cu);Te(this,wn);Te(this,fl);Te(this,Ms);Te(this,ba);Te(this,yi);Te(this,Eu);Te(this,Ls);Te(this,Is);Te(this,hl);Te(this,ml);Te(this,vi);Te(this,Us,new Set);this.options=n,be(this,Mn,t),be(this,yi,null),be(this,ba,_p()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,nt).addObserver(this),_0(L(this,nt),this.options)?He(this,dt,ru).call(this):this.updateResult(),He(this,dt,Op).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ip(L(this,nt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ip(L(this,nt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,dt,Dp).call(this),He(this,dt,Mp).call(this),L(this,nt).removeObserver(this)}setOptions(t){const n=this.options,a=L(this,nt);if(this.options=L(this,Mn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hr(this.options.enabled,L(this,nt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,dt,Lp).call(this),L(this,nt).setOptions(this.options),n._defaulted&&!Rd(this.options,n)&&L(this,Mn).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,nt),observer:this});const l=this.hasListeners();l&&A0(L(this,nt),a,this.options,n)&&He(this,dt,ru).call(this),this.updateResult(),l&&(L(this,nt)!==a||hr(this.options.enabled,L(this,nt))!==hr(n.enabled,L(this,nt))||ji(this.options.staleTime,L(this,nt))!==ji(n.staleTime,L(this,nt)))&&He(this,dt,Tp).call(this);const o=He(this,dt,Rp).call(this);l&&(L(this,nt)!==a||hr(this.options.enabled,L(this,nt))!==hr(n.enabled,L(this,nt))||o!==L(this,vi))&&He(this,dt,zp).call(this,o)}getOptimisticResult(t){const n=L(this,Mn).getQueryCache().build(L(this,Mn),t),a=this.createResult(n,t);return f2(this,a)&&(be(this,wn,a),be(this,Ms,this.options),be(this,fl,L(this,nt).state)),a}getCurrentResult(){return L(this,wn)}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,ba).status==="pending"&&L(this,ba).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){L(this,Us).add(t)}getCurrentQuery(){return L(this,nt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=L(this,Mn).defaultQueryOptions(t),a=L(this,Mn).getQueryCache().build(L(this,Mn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return He(this,dt,ru).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,wn)))}createResult(t,n){var re;const a=L(this,nt),l=this.options,o=L(this,wn),u=L(this,fl),f=L(this,Ms),h=t!==a?t.state:L(this,Cu),{state:y}=t;let g={...y},b=!1,S;if(n._optimisticResults){const F=this.hasListeners(),de=!F&&_0(t,n),W=F&&A0(t,a,n,l);(de||W)&&(g={...g,...iw(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;S=g.data;let C=!1;if(n.placeholderData!==void 0&&S===void 0&&E==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(F=o.data,C=!0):F=typeof n.placeholderData=="function"?n.placeholderData((re=L(this,Is))==null?void 0:re.state.data,L(this,Is)):n.placeholderData,F!==void 0&&(E="success",S=Np(o==null?void 0:o.data,F,n),b=!0)}if(n.select&&S!==void 0&&!C)if(o&&S===(u==null?void 0:u.data)&&n.select===L(this,Eu))S=L(this,Ls);else try{be(this,Eu,n.select),S=n.select(S),S=Np(o==null?void 0:o.data,S,n),be(this,Ls,S),be(this,yi,null)}catch(F){be(this,yi,F)}L(this,yi)&&(k=L(this,yi),S=L(this,Ls),j=Date.now(),E="error");const T=g.fetchStatus==="fetching",O=E==="pending",B=E==="error",D=O&&T,R=S!==void 0,Z={status:E,fetchStatus:g.fetchStatus,isPending:O,isSuccess:E==="success",isError:B,isInitialLoading:D,isLoading:D,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:T,isRefetching:T&&!O,isLoadingError:B&&!R,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:B&&R,isStale:kg(t,n),refetch:this.refetch,promise:L(this,ba),isEnabled:hr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=Z.data!==void 0,de=Z.status==="error"&&!F,W=te=>{de?te.reject(Z.error):F&&te.resolve(Z.data)},ye=()=>{const te=be(this,ba,Z.promise=_p());W(te)},me=L(this,ba);switch(me.status){case"pending":t.queryHash===a.queryHash&&W(me);break;case"fulfilled":(de||Z.data!==me.value)&&ye();break;case"rejected":(!de||Z.error!==me.reason)&&ye();break}}return Z}updateResult(){const t=L(this,wn),n=this.createResult(L(this,nt),this.options);if(be(this,fl,L(this,nt).state),be(this,Ms,this.options),L(this,fl).data!==void 0&&be(this,Is,L(this,nt)),Rd(n,t))return;be(this,wn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!L(this,Us).size)return!0;const u=new Set(o??L(this,Us));return this.options.throwOnError&&u.add("error"),Object.keys(L(this,wn)).some(f=>{const m=f;return L(this,wn)[m]!==t[m]&&u.has(m)})};He(this,dt,lw).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,dt,Op).call(this)}},Mn=new WeakMap,nt=new WeakMap,Cu=new WeakMap,wn=new WeakMap,fl=new WeakMap,Ms=new WeakMap,ba=new WeakMap,yi=new WeakMap,Eu=new WeakMap,Ls=new WeakMap,Is=new WeakMap,hl=new WeakMap,ml=new WeakMap,vi=new WeakMap,Us=new WeakMap,dt=new WeakSet,ru=function(t){He(this,dt,Lp).call(this);let n=L(this,nt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kn)),n},Tp=function(){He(this,dt,Dp).call(this);const t=ji(this.options.staleTime,L(this,nt));if(hu.isServer()||L(this,wn).isStale||!Cp(t))return;const a=JS(L(this,wn).dataUpdatedAt,t)+1;be(this,hl,ll.setTimeout(()=>{L(this,wn).isStale||this.updateResult()},a))},Rp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,nt)):this.options.refetchInterval)??!1},zp=function(t){He(this,dt,Mp).call(this),be(this,vi,t),!(hu.isServer()||hr(this.options.enabled,L(this,nt))===!1||!Cp(L(this,vi))||L(this,vi)===0)&&be(this,ml,ll.setInterval(()=>{(this.options.refetchIntervalInBackground||bg.isFocused())&&He(this,dt,ru).call(this)},L(this,vi)))},Op=function(){He(this,dt,Tp).call(this),He(this,dt,zp).call(this,He(this,dt,Rp).call(this))},Dp=function(){L(this,hl)&&(ll.clearTimeout(L(this,hl)),be(this,hl,void 0))},Mp=function(){L(this,ml)&&(ll.clearInterval(L(this,ml)),be(this,ml,void 0))},Lp=function(){const t=L(this,Mn).getQueryCache().build(L(this,Mn),this.options);if(t===L(this,nt))return;const n=L(this,nt);be(this,nt,t),be(this,Cu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},lw=function(t){Kt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(L(this,wn))}),L(this,Mn).getQueryCache().notify({query:L(this,nt),type:"observerResultsUpdated"})})},ZS);function d2(e,t){return hr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function _0(e,t){return d2(e,t)||e.state.data!==void 0&&Ip(e,t,t.refetchOnMount)}function Ip(e,t,n){if(hr(t.enabled,e)!==!1&&ji(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&kg(e,t)}return!1}function A0(e,t,n,a){return(e!==t||hr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kg(e,n)}function kg(e,t){return hr(t.enabled,e)!==!1&&e.isStaleByTime(ji(t.staleTime,e))}function f2(e,t){return!Rd(e.getCurrentResult(),t)}function T0(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)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{a2(O,()=>t.signal,()=>j=!0)},C=ew(t.options,t.fetchOptions),T=async(O,B,D)=>{if(j)return Promise.reject();if(B==null&&O.pages.length)return Promise.resolve(O);const P=(()=>{const de={client:t.client,queryKey:t.queryKey,pageParam:B,direction:D?"backward":"forward",meta:t.options.meta};return E(de),de})(),Z=await C(P),{maxPages:re}=t.options,F=D?r2:n2;return{pages:F(O.pages,Z,re),pageParams:F(O.pageParams,B,re)}};if(l&&o.length){const O=l==="backward",B=O?h2:R0,D={pages:o,pageParams:u},R=B(a,D);f=await T(D,R,O)}else{const O=e??o.length;do{const B=m===0?u[0]??a.initialPageParam:R0(a,f);if(m>0&&B==null)break;f=await T(f,B),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function R0(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 h2(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 Nu,Ur,mn,pl,Br,di,VS,m2=(VS=class extends rw{constructor(t){super();Te(this,Br);Te(this,Nu);Te(this,Ur);Te(this,mn);Te(this,pl);be(this,Nu,t.client),this.mutationId=t.mutationId,be(this,mn,t.mutationCache),be(this,Ur,[]),this.state=t.state||sw(),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,Ur).includes(t)||(L(this,Ur).push(t),this.clearGcTimeout(),L(this,mn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){be(this,Ur,L(this,Ur).filter(n=>n!==t)),this.scheduleGc(),L(this,mn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Ur).length||(this.state.status==="pending"?this.scheduleGc():L(this,mn).remove(this))}continue(){var t;return((t=L(this,pl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,y,g,b,S,k,j,E,C,T,O,B,D,R,P;const n=()=>{He(this,Br,di).call(this,{type:"continue"})},a={client:L(this,Nu),meta:this.options.meta,mutationKey:this.options.mutationKey};be(this,pl,nw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(Z,re)=>{He(this,Br,di).call(this,{type:"failed",failureCount:Z,error:re})},onPause:()=>{He(this,Br,di).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,mn).canRun(this)}));const l=this.state.status==="pending",o=!L(this,pl).canStart();try{if(l)n();else{He(this,Br,di).call(this,{type:"pending",variables:t,isPaused:o}),L(this,mn).config.onMutate&&await L(this,mn).config.onMutate(t,this,a);const re=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,a));re!==this.state.context&&He(this,Br,di).call(this,{type:"pending",context:re,variables:t,isPaused:o})}const Z=await L(this,pl).start();return await((h=(m=L(this,mn).config).onSuccess)==null?void 0:h.call(m,Z,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,Z,t,this.state.context,a)),await((S=(b=L(this,mn).config).onSettled)==null?void 0:S.call(b,Z,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,Z,null,t,this.state.context,a)),He(this,Br,di).call(this,{type:"success",data:Z}),Z}catch(Z){try{await((C=(E=L(this,mn).config).onError)==null?void 0:C.call(E,Z,t,this.state.context,this,a))}catch(re){Promise.reject(re)}try{await((O=(T=this.options).onError)==null?void 0:O.call(T,Z,t,this.state.context,a))}catch(re){Promise.reject(re)}try{await((D=(B=L(this,mn).config).onSettled)==null?void 0:D.call(B,void 0,Z,this.state.variables,this.state.context,this,a))}catch(re){Promise.reject(re)}try{await((P=(R=this.options).onSettled)==null?void 0:P.call(R,void 0,Z,t,this.state.context,a))}catch(re){Promise.reject(re)}throw He(this,Br,di).call(this,{type:"error",error:Z}),Z}finally{L(this,mn).runNext(this)}}},Nu=new WeakMap,Ur=new WeakMap,mn=new WeakMap,pl=new WeakMap,Br=new WeakSet,di=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),Kt.batch(()=>{L(this,Ur).forEach(a=>{a.onMutationUpdate(t)}),L(this,mn).notify({mutation:this,type:"updated",action:t})})},VS);function sw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xa,kr,_u,QS,p2=(QS=class extends Gs{constructor(t={}){super();Te(this,xa);Te(this,kr);Te(this,_u);this.config=t,be(this,xa,new Set),be(this,kr,new Map),be(this,_u,0)}build(t,n,a){const l=new m2({client:t,mutationCache:this,mutationId:++nd(this,_u)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){L(this,xa).add(t);const n=rd(t);if(typeof n=="string"){const a=L(this,kr).get(n);a?a.push(t):L(this,kr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,xa).delete(t)){const n=rd(t);if(typeof n=="string"){const a=L(this,kr).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,kr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=rd(t);if(typeof n=="string"){const a=L(this,kr).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=rd(t);if(typeof n=="string"){const l=(a=L(this,kr).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(){Kt.batch(()=>{L(this,xa).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,xa).clear(),L(this,kr).clear()})}getAll(){return Array.from(L(this,xa))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>k0(n,a))}findAll(t={}){return this.getAll().filter(n=>k0(t,n))}notify(t){Kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Kt.batch(()=>Promise.all(t.map(n=>n.continue().catch(kn))))}},xa=new WeakMap,kr=new WeakMap,_u=new WeakMap,QS);function rd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Sa,bi,Ln,wa,ja,wd,Up,GS,g2=(GS=class extends Gs{constructor(n,a){super();Te(this,ja);Te(this,Sa);Te(this,bi);Te(this,Ln);Te(this,wa);be(this,Sa,n),this.setOptions(a),this.bindMethods(),He(this,ja,wd).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,Sa).defaultMutationOptions(n),Rd(this.options,a)||L(this,Sa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,Ln),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&gl(a.mutationKey)!==gl(this.options.mutationKey)?this.reset():((l=L(this,Ln))==null?void 0:l.state.status)==="pending"&&L(this,Ln).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=L(this,Ln))==null||n.removeObserver(this)}onMutationUpdate(n){He(this,ja,wd).call(this),He(this,ja,Up).call(this,n)}getCurrentResult(){return L(this,bi)}reset(){var n;(n=L(this,Ln))==null||n.removeObserver(this),be(this,Ln,void 0),He(this,ja,wd).call(this),He(this,ja,Up).call(this)}mutate(n,a){var l;return be(this,wa,a),(l=L(this,Ln))==null||l.removeObserver(this),be(this,Ln,L(this,Sa).getMutationCache().build(L(this,Sa),this.options)),L(this,Ln).addObserver(this),L(this,Ln).execute(n)}},Sa=new WeakMap,bi=new WeakMap,Ln=new WeakMap,wa=new WeakMap,ja=new WeakSet,wd=function(){var a;const n=((a=L(this,Ln))==null?void 0:a.state)??sw();be(this,bi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Up=function(n){Kt.batch(()=>{var a,l,o,u,f,m,h,y;if(L(this,wa)&&this.hasListeners()){const g=L(this,bi).variables,b=L(this,bi).context,S={client:L(this,Sa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=L(this,wa)).onSuccess)==null||l.call(a,n.data,g,b,S)}catch(k){Promise.reject(k)}try{(u=(o=L(this,wa)).onSettled)==null||u.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,wa)).onError)==null||m.call(f,n.error,g,b,S)}catch(k){Promise.reject(k)}try{(y=(h=L(this,wa)).onSettled)==null||y.call(h,void 0,n.error,g,b,S)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(L(this,bi))})})},GS),Pr,KS,y2=(KS=class extends Gs{constructor(t={}){super();Te(this,Pr);this.config=t,be(this,Pr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??xg(l,n);let u=this.get(o);return u||(u=new u2({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){L(this,Pr).has(t.queryHash)||(L(this,Pr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=L(this,Pr).get(t.queryHash);n&&(t.destroy(),n===t&&L(this,Pr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Pr).get(t)}getAll(){return[...L(this,Pr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>w0(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>w0(t,a)):n}notify(t){Kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Pr=new WeakMap,KS),Mt,xi,Si,Bs,Ps,wi,$s,Fs,YS,v2=(YS=class{constructor(e={}){Te(this,Mt);Te(this,xi);Te(this,Si);Te(this,Bs);Te(this,Ps);Te(this,wi);Te(this,$s);Te(this,Fs);be(this,Mt,e.queryCache||new y2),be(this,xi,e.mutationCache||new p2),be(this,Si,e.defaultOptions||{}),be(this,Bs,new Map),be(this,Ps,new Map),be(this,wi,0)}mount(){nd(this,wi)._++,L(this,wi)===1&&(be(this,$s,bg.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Mt).onFocus())})),be(this,Fs,zd.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Mt).onOnline())})))}unmount(){var e,t;nd(this,wi)._--,L(this,wi)===0&&((e=L(this,$s))==null||e.call(this),be(this,$s,void 0),(t=L(this,Fs))==null||t.call(this),be(this,Fs,void 0))}isFetching(e){return L(this,Mt).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,Mt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=L(this,Mt).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,Mt).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,Mt).get(a.queryHash),o=l==null?void 0:l.state.data,u=W_(t,o);if(u!==void 0)return L(this,Mt).build(this,a).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Kt.batch(()=>L(this,Mt).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,Mt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=L(this,Mt);Kt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=L(this,Mt);return Kt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Kt.batch(()=>L(this,Mt).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(kn).catch(kn)}invalidateQueries(e,t={}){return Kt.batch(()=>(L(this,Mt).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=Kt.batch(()=>L(this,Mt).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(kn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=L(this,Mt).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(kn).catch(kn)}fetchInfiniteQuery(e){return e.behavior=T0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kn).catch(kn)}ensureInfiniteQueryData(e){return e.behavior=T0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return zd.isOnline()?L(this,xi).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Mt)}getMutationCache(){return L(this,xi)}getDefaultOptions(){return L(this,Si)}setDefaultOptions(e){be(this,Si,e)}setQueryDefaults(e,t){L(this,Bs).set(gl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,Bs).values()],n={};return t.forEach(a=>{fu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){L(this,Ps).set(gl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,Ps).values()],n={};return t.forEach(a=>{fu(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=xg(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===Sg&&(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,Mt).clear(),L(this,xi).clear()}},Mt=new WeakMap,xi=new WeakMap,Si=new WeakMap,Bs=new WeakMap,Ps=new WeakMap,wi=new WeakMap,$s=new WeakMap,Fs=new WeakMap,YS),ow=x.createContext(void 0),Jn=e=>{const t=x.useContext(ow);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},b2=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(ow.Provider,{value:e,children:t})),uw=x.createContext(!1),x2=()=>x.useContext(uw);uw.Provider;function S2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var w2=x.createContext(S2()),k2=()=>x.useContext(w2),j2=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?wg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},C2=e=>{x.useEffect(()=>{e.clearReset()},[e])},E2=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||wg(n,[e.error,a])),N2=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))}},_2=(e,t)=>e.isLoading&&e.isFetching&&!t,A2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,z0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function T2(e,t,n){var b,S,k,j;const a=x2(),l=k2(),o=Jn(),u=o.defaultQueryOptions(e);(S=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||S.call(b,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",N2(u),j2(u,l,f),C2(l);const m=!o.getQueryCache().get(u.queryHash),[h]=x.useState(()=>new t(o,u)),y=h.getOptimisticResult(u),g=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(E=>{const C=g?h.subscribe(Kt.batchCalls(E)):kn;return h.updateResult(),C},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(u)},[u,h]),A2(u,y))throw z0(u,h,l);if(E2({result:y,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,u,y),u.experimental_prefetchInRender&&!hu.isServer()&&_2(y,a)){const E=m?z0(u,h,l):f==null?void 0:f.promise;E==null||E.catch(kn).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?y:h.trackResult(y)}function Ve(e,t){return T2(e,c2)}function vt(e,t){const n=Jn(),[a]=x.useState(()=>new g2(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(u=>a.subscribe(Kt.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((u,f)=>{a.mutate(u,f).catch(kn)},[a]);if(l.error&&wg(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 O0="popstate";function D0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function R2(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:u,search:f,hash:m}=o||a.location;return Bp("",{pathname:u,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:mu(l)}return O2(t,n,null,e)}function Nt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function z2(){return Math.random().toString(36).substring(2,10)}function M0(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 Bp(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ks(t):t,state:n,key:t&&t.key||a||z2(),unstable_mask:l}}function mu({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 Ks(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 O2(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,u=l.history,f="POP",m=null,h=y();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function y(){return(u.state||{idx:null}).idx}function g(){f="POP";let E=y(),C=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:C})}function b(E,C){f="PUSH";let T=D0(E)?E:Bp(j.location,E,C);h=y()+1;let O=M0(T,h),B=j.createHref(T.unstable_mask||T);try{u.pushState(O,"",B)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;l.location.assign(B)}o&&m&&m({action:f,location:j.location,delta:1})}function S(E,C){f="REPLACE";let T=D0(E)?E:Bp(j.location,E,C);h=y();let O=M0(T,h),B=j.createHref(T.unstable_mask||T);u.replaceState(O,"",B),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return D2(E)}let j={get action(){return f},get location(){return e(l,u)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(O0,g),m=E,()=>{l.removeEventListener(O0,g),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let C=k(E);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:S,go(E){return u.go(E)}};return j}function D2(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Nt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:mu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function cw(e,t,n="/"){return M2(e,t,n,!1)}function M2(e,t,n,a){let l=typeof t=="string"?Ks(t):t,o=Ca(l.pathname||"/",n);if(o==null)return null;let u=dw(e);L2(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=Q2(o);f=Z2(u[m],h,a)}return f}function dw(e,t=[],n=[],a="",l=!1){let o=(u,f,m=l,h)=>{let y={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;Nt(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=qr([a,y.relativePath]),b=n.concat(y);u.children&&u.children.length>0&&(Nt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),dw(u.children,t,b,g,m)),!(u.path==null&&!u.index)&&t.push({path:g,score:q2(g,u.index),routesMeta:b})};return e.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))o(u,f);else for(let h of fw(u.path))o(u,f,!0,h)}),t}function fw(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 u=fw(a.join("/")),f=[];return f.push(...u.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function L2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:H2(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var I2=/^:[\w-]+$/,U2=3,B2=2,P2=1,$2=10,F2=-2,L0=e=>e==="*";function q2(e,t){let n=e.split("/"),a=n.length;return n.some(L0)&&(a+=F2),t&&(a+=B2),n.filter(l=>!L0(l)).reduce((l,o)=>l+(I2.test(o)?U2:o===""?P2:$2),a)}function H2(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 Z2(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",u=[];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=Od({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Od({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),u.push({params:l,pathname:qr([o,g.pathname]),pathnameBase:X2(qr([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=qr([o,g.pathnameBase]))}return u}function Od(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=V2(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";u=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:u,pattern:e}}function V2(e,t=!1,n=!0){pr(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,(u,f,m,h,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+u.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 Q2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pr(!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 Ca(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 G2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function K2(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Ks(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=I0(n.substring(1),"/"):o=I0(n,t)):o=t,{pathname:o,search:J2(a),hash:W2(l)}}function I0(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 Lm(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 Y2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function jg(e){let t=Y2(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Gd(e,t,n,a=!1){let l;typeof e=="string"?l=Ks(e):(l={...e},Nt(!l.pathname||!l.pathname.includes("?"),Lm("?","pathname","search",l)),Nt(!l.pathname||!l.pathname.includes("#"),Lm("#","pathname","hash",l)),Nt(!l.search||!l.search.includes("#"),Lm("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,f;if(u==null)f=n;else{let g=t.length-1;if(!a&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=K2(l,f),h=u&&u!=="/"&&u.endsWith("/"),y=(o||u===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var qr=e=>e.join("/").replace(/\/\/+/g,"/"),X2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),J2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,W2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,eA=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 tA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function nA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var hw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mw(e,t){let n=e;if(typeof n!="string"||!G2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(hw)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Ca(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{pr(!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 pw=["POST","PUT","PATCH","DELETE"];new Set(pw);var rA=["GET",...pw];new Set(rA);var Ys=x.createContext(null);Ys.displayName="DataRouter";var Kd=x.createContext(null);Kd.displayName="DataRouterState";var aA=x.createContext(!1),gw=x.createContext({isTransitioning:!1});gw.displayName="ViewTransition";var iA=x.createContext(new Map);iA.displayName="Fetchers";var lA=x.createContext(null);lA.displayName="Await";var Wn=x.createContext(null);Wn.displayName="Navigation";var Au=x.createContext(null);Au.displayName="Location";var gr=x.createContext({outlet:null,matches:[],isDataRoute:!1});gr.displayName="Route";var Cg=x.createContext(null);Cg.displayName="RouteError";var yw="REACT_ROUTER_ERROR",sA="REDIRECT",oA="ROUTE_ERROR_RESPONSE";function uA(e){if(e.startsWith(`${yw}:${sA}:{`))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 cA(e){if(e.startsWith(`${yw}:${oA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new eA(t.status,t.statusText,t.data)}catch{}}function dA(e,{relative:t}={}){Nt(Xs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(Wn),{hash:l,pathname:o,search:u}=Tu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:qr([n,o])),a.createHref({pathname:f,search:u,hash:l})}function Xs(){return x.useContext(Au)!=null}function yr(){return Nt(Xs(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Au).location}var vw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bw(e){x.useContext(Wn).static||x.useLayoutEffect(e)}function Vr(){let{isDataRoute:e}=x.useContext(gr);return e?NA():fA()}function fA(){Nt(Xs(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Ys),{basename:t,navigator:n}=x.useContext(Wn),{matches:a}=x.useContext(gr),{pathname:l}=yr(),o=JSON.stringify(jg(a)),u=x.useRef(!1);return bw(()=>{u.current=!0}),x.useCallback((m,h={})=>{if(pr(u.current,vw),!u.current)return;if(typeof m=="number"){n.go(m);return}let y=Gd(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:qr([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var hA=x.createContext(null);function mA(e){let t=x.useContext(gr).outlet;return x.useMemo(()=>t&&x.createElement(hA.Provider,{value:e},t),[t,e])}function pA(){let{matches:e}=x.useContext(gr),t=e[e.length-1];return t?t.params:{}}function Tu(e,{relative:t}={}){let{matches:n}=x.useContext(gr),{pathname:a}=yr(),l=JSON.stringify(jg(n));return x.useMemo(()=>Gd(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function gA(e,t){return xw(e,t)}function xw(e,t,n){var E;Nt(Xs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(Wn),{matches:l}=x.useContext(gr),o=l[l.length-1],u=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";ww(f,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) 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="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let y=yr(),g;if(t){let C=typeof t=="string"?Ks(t):t;Nt(m==="/"||((E=C.pathname)==null?void 0:E.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 "${C.pathname}" was given in the \`location\` prop.`),g=C}else g=y;let b=g.pathname||"/",S=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=cw(e,{pathname:S});pr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),pr(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=SA(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:qr([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:qr([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n);return t&&j?x.createElement(Au.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function yA(){let e=EA(),t=tA(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},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=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,u)}var vA=x.createElement(yA,null),Sw=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=cA(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(gr.Provider,{value:this.props.routeContext},x.createElement(Cg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(bA,{error:e},t):t}};Sw.contextType=aA;var Im=new WeakMap;function bA({children:e,error:t}){let{basename:n}=x.useContext(Wn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=uA(t.digest);if(a){let l=Im.get(t);if(l)throw l;let o=mw(a.location,n);if(hw&&!Im.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw Im.set(t,u),u}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function xA({routeContext:e,match:t,children:n}){let a=x.useContext(Ys);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(gr.Provider,{value:e},n)}function SA(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);Nt(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 u=!1,f=-1;if(n&&a){u=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&&(u=!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:nA(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let S,k=!1,j=null,E=null;a&&(S=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||vA,u&&(f<0&&b===0?(ww("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===b&&(k=!0,E=g.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,b+1)),T=()=>{let O;return S?O=j:k?O=E:g.route.Component?O=x.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=y,x.createElement(xA,{match:g,routeContext:{outlet:y,matches:C,isDataRoute:a!=null},children:O})};return a&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(Sw,{location:a.location,revalidation:a.revalidation,component:j,error:S,children:T(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):T()},null)}function Eg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wA(e){let t=x.useContext(Ys);return Nt(t,Eg(e)),t}function kA(e){let t=x.useContext(Kd);return Nt(t,Eg(e)),t}function jA(e){let t=x.useContext(gr);return Nt(t,Eg(e)),t}function Ng(e){let t=jA(e),n=t.matches[t.matches.length-1];return Nt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function CA(){return Ng("useRouteId")}function EA(){var a;let e=x.useContext(Cg),t=kA("useRouteError"),n=Ng("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function NA(){let{router:e}=wA("useNavigate"),t=Ng("useNavigate"),n=x.useRef(!1);return bw(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{pr(n.current,vw),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var U0={};function ww(e,t,n){!t&&!U0[e]&&(U0[e]=!0,pr(!1,n))}x.memo(_A);function _A({routes:e,future:t,state:n,isStatic:a,onError:l}){return xw(e,void 0,{state:n,isStatic:a,onError:l})}function _g({to:e,replace:t,state:n,relative:a}){Nt(Xs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(Wn);pr(!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(gr),{pathname:u}=yr(),f=Vr(),m=Gd(e,jg(o),u,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 Pp(e){return mA(e.context)}function Lr(e){Nt(!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 AA({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){Nt(!Xs(),"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:u,future:{}}),[f,l,o,u]);typeof n=="string"&&(n=Ks(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:S="default",unstable_mask:k}=n,j=x.useMemo(()=>{let E=Ca(h,f);return E==null?null:{location:{pathname:E,search:y,hash:g,state:b,key:S,unstable_mask:k},navigationType:a}},[f,h,y,g,b,S,a,k]);return pr(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(Wn.Provider,{value:m},x.createElement(Au.Provider,{children:t,value:j}))}function TA({children:e,location:t}){return gA($p(e),t)}function $p(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,$p(a.props.children,o));return}Nt(a.type===Lr,`[${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>`),Nt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let u={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&&(u.children=$p(a.props.children,o)),n.push(u)}),n}var kd="get",jd="application/x-www-form-urlencoded";function Yd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function RA(e){return Yd(e)&&e.tagName.toLowerCase()==="button"}function zA(e){return Yd(e)&&e.tagName.toLowerCase()==="form"}function OA(e){return Yd(e)&&e.tagName.toLowerCase()==="input"}function DA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function MA(e,t){return e.button===0&&(!t||t==="_self")&&!DA(e)}function Fp(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 LA(e,t){let n=Fp(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var ad=null;function IA(){if(ad===null)try{new FormData(document.createElement("form"),0),ad=!1}catch{ad=!0}return ad}var UA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Um(e){return e!=null&&!UA.has(e)?(pr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jd}"`),null):e}function BA(e,t){let n,a,l,o,u;if(zA(e)){let f=e.getAttribute("action");a=f?Ca(f,t):null,n=e.getAttribute("method")||kd,l=Um(e.getAttribute("enctype"))||jd,o=new FormData(e)}else if(RA(e)||OA(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?Ca(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||kd,l=Um(e.getAttribute("formenctype"))||Um(f.getAttribute("enctype"))||jd,o=new FormData(f,e),!IA()){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(Yd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=kd,a=null,l=jd,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ag(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function PA(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&&Ca(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function $A(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 FA(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 qA(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await $A(o,n);return u.links?u.links():[]}return[]}));return QA(a.flat(1).filter(FA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function B0(e,t,n,a,l,o){let u=(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)=>u(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(u(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 HA(e,t,{includeHydrateFallback:n}={}){return ZA(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 ZA(e){return[...new Set(e)]}function VA(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function QA(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(VA(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function kw(){let e=x.useContext(Ys);return Ag(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function GA(){let e=x.useContext(Kd);return Ag(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Tg=x.createContext(void 0);Tg.displayName="FrameworkContext";function jw(){let e=x.useContext(Tg);return Ag(e,"You must render this element inside a <HydratedRouter> element"),e}function KA(e,t){let n=x.useContext(Tg),[a,l]=x.useState(!1),[o,u]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=C=>{C.forEach(T=>{u(T.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[a]);let S=()=>{l(!0)},k=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:Go(f,S),onBlur:Go(m,k),onMouseEnter:Go(h,S),onMouseLeave:Go(y,k),onTouchStart:Go(g,S)}]:[!1,b,{}]}function Go(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YA({page:e,...t}){let{router:n}=kw(),a=x.useMemo(()=>cw(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(JA,{page:e,matches:a,...t}):null}function XA(e){let{manifest:t,routeModules:n}=jw(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return qA(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),a}function JA({page:e,matches:t,...n}){let a=yr(),{future:l,manifest:o,routeModules:u}=jw(),{basename:f}=kw(),{loaderData:m,matches:h}=GA(),y=x.useMemo(()=>B0(e,t,h,o,a,"data"),[e,t,h,o,a]),g=x.useMemo(()=>B0(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,E=!1;if(t.forEach(T=>{var B;let O=o.routes[T.route.id];!O||!O.hasLoader||(!y.some(D=>D.route.id===T.route.id)&&T.route.id in m&&((B=u[T.route.id])!=null&&B.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(T.route.id))}),j.size===0)return[];let C=PA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(T=>j.has(T.route.id)).map(T=>T.route.id).join(",")),[C.pathname+C.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,u]),S=x.useMemo(()=>HA(g,o),[g,o]),k=XA(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:E})=>x.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function WA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var eT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{eT&&(window.__reactRouterVersion="7.13.1")}catch{}function tT({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=R2({window:a,v5Compat:!0}));let o=l.current,[u,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(AA,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var Cw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ew=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:u,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:S,...k},j){let{basename:E,navigator:C,unstable_useTransitions:T}=x.useContext(Wn),O=typeof y=="string"&&Cw.test(y),B=mw(y,E);y=B.to;let D=dA(y,{relative:l}),R=yr(),P=null;if(f){let te=Gd(f,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);E!=="/"&&(te.pathname=te.pathname==="/"?E:qr([E,te.pathname])),P=C.createHref(te)}let[Z,re,F]=KA(a,k),de=aT(y,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:T});function W(te){t&&t(te),te.defaultPrevented||de(te)}let ye=!(B.isExternal||o),me=x.createElement("a",{...k,...F,href:(ye?P:void 0)||B.absoluteURL||D,onClick:ye?W:t,ref:WA(j,re),target:h,"data-discover":!O&&n==="render"?"true":void 0});return Z&&!O?x.createElement(x.Fragment,null,me,x.createElement(YA,{page:D})):me});Ew.displayName="Link";var Nw=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:u,viewTransition:f,children:m,...h},y){let g=Tu(u,{relative:h.relative}),b=yr(),S=x.useContext(Kd),{navigator:k,basename:j}=x.useContext(Wn),E=S!=null&&uT(g)&&f===!0,C=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,T=b.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;n||(T=T.toLowerCase(),O=O?O.toLowerCase():null,C=C.toLowerCase()),O&&j&&(O=Ca(O,j)||O);const B=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let D=T===C||!l&&T.startsWith(C)&&T.charAt(B)==="/",R=O!=null&&(O===C||!l&&O.startsWith(C)&&O.charAt(C.length)==="/"),P={isActive:D,isPending:R,isTransitioning:E},Z=D?t:void 0,re;typeof a=="function"?re=a(P):re=[a,D?"active":null,R?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(P):o;return x.createElement(Ew,{...h,"aria-current":Z,className:re,ref:y,style:F,to:u,viewTransition:f},typeof m=="function"?m(P):m)});Nw.displayName="NavLink";var nT=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:u=kd,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:j}=x.useContext(Wn),E=sT(),C=oT(f,{relative:h}),T=u.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&Cw.test(f),B=D=>{if(m&&m(D),D.defaultPrevented)return;D.preventDefault();let R=D.nativeEvent.submitter,P=(R==null?void 0:R.getAttribute("formmethod"))||u,Z=()=>E(R||D.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>Z()):Z()};return x.createElement("form",{ref:k,method:T,action:C,onSubmit:a?m:B,...S,"data-discover":!O&&e==="render"?"true":void 0})});nT.displayName="Form";function rT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _w(e){let t=x.useContext(Ys);return Nt(t,rT(e)),t}function aT(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=Vr(),g=yr(),b=Tu(e,{relative:u});return x.useCallback(S=>{if(MA(S,t)){S.preventDefault();let k=n!==void 0?n:mu(g)===mu(b),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[g,y,b,n,a,l,t,e,o,u,f,m,h])}function Rg(e){pr(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(Fp(e)),n=x.useRef(!1),a=yr(),l=x.useMemo(()=>LA(a.search,n.current?null:t.current),[a.search]),o=Vr(),u=x.useCallback((f,m)=>{const h=Fp(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var iT=0,lT=()=>`__${String(++iT)}__`;function sT(){let{router:e}=_w("useSubmit"),{basename:t}=x.useContext(Wn),n=CA(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=BA(o,t);if(u.navigate===!1){let b=u.fetcherKey||lT();await a(b,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await l(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,l,t,n])}function oT(e,{relative:t}={}){let{basename:n}=x.useContext(Wn),a=x.useContext(gr);Nt(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...Tu(e||".",{relative:t})},u=yr();if(e==null){o.search=u.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:qr([n,o.pathname])),mu(o)}function uT(e,{relative:t}={}){let n=x.useContext(gw);Nt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=_w("useViewTransitionState"),l=Tu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ca(n.currentLocation.pathname,a)||n.currentLocation.pathname,u=Ca(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Od(l.pathname,u)!=null||Od(l.pathname,o)!=null}const cT="/api/v1";async function dT(e,t){const n=await fetch(`${cT}/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 Aw="/api/v1",zg="first-tree-hub:tokens";function Og(){const e=localStorage.getItem(zg);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Tw(e){localStorage.setItem(zg,JSON.stringify(e))}function Rw(){localStorage.removeItem(zg)}class Xd extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let Ko=null;async function fT(e){return Ko||(Ko=(async()=>{try{const t=await fetch(`${Aw}/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 Tw(a),a}catch{return null}finally{Ko=null}})(),Ko)}async function id(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(`${Aw}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=Og();let u=await l(o==null?void 0:o.accessToken);if(u.status===401&&(o!=null&&o.refreshToken)){const f=await fT(o.refreshToken);f&&(u=await l(f.accessToken))}if(!u.ok){u.status===401&&(Rw(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await u.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 Xd(u.status,m,h)}if(u.status!==204)return await u.json()}const Le={get:e=>id(e),post:(e,t)=>id(e,{method:"POST",body:t}),patch:(e,t)=>id(e,{method:"PATCH",body:t}),delete:e=>id(e,{method:"DELETE"})},zw=x.createContext(null);function hT({children:e}){const[t,n]=x.useState(()=>!!Og()),[a,l]=x.useState(null),[o,u]=x.useState(null),[f,m]=x.useState(null),h=x.useCallback(()=>{Rw(),n(!1),l(null),u(null),m(null)},[]),y=x.useCallback(async()=>{try{const b=await Le.get("/me");l(b.member.role),u(b.member.id),m(b.member.agentId)}catch{}},[]),g=x.useCallback(async(b,S)=>{const k=await dT(b,S);Tw({accessToken:k.accessToken,refreshToken:k.refreshToken}),n(!0),await Le.get("/me").then(j=>{l(j.member.role),u(j.member.id),m(j.member.agentId)}).catch(()=>{})},[]);return x.useEffect(()=>{t&&!a&&y()},[t,a,y]),x.useEffect(()=>{const b=()=>h();return window.addEventListener("auth:logout",b),()=>window.removeEventListener("auth:logout",b)},[h]),d.jsx(zw.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,login:g,logout:h},children:e})}function Aa(){const e=x.useContext(zw);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function mT(){const{isAuthenticated:e}=Aa();return e?d.jsx(Pp,{}):d.jsx(_g,{to:"/login",replace:!0})}/**
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 Ow=(...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 pT=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 gT=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 P0=e=>{const t=gT(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 yT={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 vT=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 bT=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:u,...f},m)=>x.createElement("svg",{ref:m,...yT,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Ow("lucide",l),...!o&&!vT(f)&&{"aria-hidden":"true"},...f},[...u.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 st=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(bT,{ref:o,iconNode:t,className:Ow(`lucide-${pT(P0(e))}`,`lucide-${e}`,a),...l}));return n.displayName=P0(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 xT=[["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"}]],ST=st("bell",xT);/**
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 wT=[["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"}]],kT=st("bot",wT);/**
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 jT=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],CT=st("cable",jT);/**
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 ET=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ru=st("check",ET);/**
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 NT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_T=st("chevron-down",NT);/**
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 AT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],TT=st("chevron-right",AT);/**
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 RT=[["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"}]],Dg=st("copy",RT);/**
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 zT=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],OT=st("ellipsis",zT);/**
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 DT=[["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"}]],MT=st("eye-off",DT);/**
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 LT=[["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"}]],IT=st("eye",LT);/**
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 UT=[["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"}]],BT=st("layout-dashboard",UT);/**
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 PT=[["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"}]],Mg=st("link-2",PT);/**
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 $T=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],FT=st("loader-circle",$T);/**
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 qT=[["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"}]],Dw=st("lock",qT);/**
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 HT=[["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"}]],ZT=st("log-out",HT);/**
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 VT=[["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"}]],Lg=st("message-square",VT);/**
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 QT=[["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"}]],GT=st("moon",QT);/**
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 KT=[["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"}]],YT=st("paperclip",KT);/**
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 XT=[["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"}]],JT=st("pause",XT);/**
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 WT=[["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"}]],Jd=st("pencil",WT);/**
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 eR=[["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"}]],Mw=st("play",eR);/**
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 tR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Sl=st("plus",tR);/**
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 nR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wd=st("search",nR);/**
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 rR=[["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"}]],aR=st("send",rR);/**
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 iR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],lR=st("square",iR);/**
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 sR=[["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"}]],oR=st("sun",sR);/**
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 uR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],cR=st("terminal",uR);/**
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 dR=[["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"}]],pu=st("trash-2",dR);/**
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 fR=[["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"}]],hR=st("triangle-alert",fR);/**
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 mR=[["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"}]],pR=st("undo-2",mR);/**
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 gR=[["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"}]],yR=st("unplug",gR);/**
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 vR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qp=st("x",vR);function Lw(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=Lw(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Iw(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Lw(e))&&(a&&(a+=" "),a+=t);return a}const bR=(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},xR=(e,t)=>({classGroupId:e,validator:t}),Uw=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Dd="-",$0=[],SR="arbitrary..",wR=e=>{const t=jR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return kR(u);const f=u.split(Dd),m=f[0]===""&&f.length>1?1:0;return Bw(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],h=n[u];return m?h?bR(h,m):m:h||$0}return n[u]||$0}}},Bw=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Bw(e,t+1,o);if(h)return h}const u=n.validators;if(u===null)return;const f=t===0?e.join(Dd):e.slice(t).join(Dd),m=u.length;for(let h=0;h<m;h++){const y=u[h];if(y.validator(f))return y.classGroupId}},kR=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?SR+a:void 0})(),jR=e=>{const{theme:t,classGroups:n}=e;return CR(n,t)},CR=(e,t)=>{const n=Uw();for(const a in e){const l=e[a];Ig(l,n,a,t)}return n},Ig=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];ER(u,t,n,a)}},ER=(e,t,n,a)=>{if(typeof e=="string"){NR(e,t,n);return}if(typeof e=="function"){_R(e,t,n,a);return}AR(e,t,n,a)},NR=(e,t,n)=>{const a=e===""?t:Pw(t,e);a.classGroupId=n},_R=(e,t,n,a)=>{if(TR(e)){Ig(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(xR(n,e))},AR=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];Ig(m,Pw(t,f),n,a)}},Pw=(e,t)=>{let n=e;const a=t.split(Dd),l=a.length;for(let o=0;o<l;o++){const u=a[o];let f=n.nextPart.get(u);f||(f=Uw(),n.nextPart.set(u,f)),n=f}return n},TR=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,RR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,u)=>{n[o]=u,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=a[o])!==void 0)return l(o,u),u},set(o,u){o in n?n[o]=u:l(o,u)}}},Hp="!",F0=":",zR=[],q0=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),OR=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let u=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const E=l[j];if(u===0&&f===0){if(E===F0){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?u++:E==="]"?u--:E==="("?f++:E===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,S=!1;g.endsWith(Hp)?(b=g.slice(0,-1),S=!0):g.startsWith(Hp)&&(b=g.slice(1),S=!0);const k=h&&h>m?h-m:void 0;return q0(o,S,b,k)};if(t){const l=t+F0,o=a;a=u=>u.startsWith(l)?o(u.slice(l.length)):q0(zR,!1,u,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},DR=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 u=n[o],f=u[0]==="[",m=t.has(u);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(u)):l.push(u)}return l.length>0&&(l.sort(),a.push(...l)),a}},MR=e=>({cache:RR(e.cacheSize),parseClassName:OR(e),sortModifiers:DR(e),...wR(e)}),LR=/\s+/,IR=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(LR);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 E=!!j,C=a(E?k.substring(0,j):k);if(!C){if(!E){m=y+(m.length>0?" "+m:m);continue}if(C=a(k),!C){m=y+(m.length>0?" "+m:m);continue}E=!1}const T=b.length===0?"":b.length===1?b[0]:o(b).join(":"),O=S?T+Hp:T,B=O+C;if(u.indexOf(B)>-1)continue;u.push(B);const D=l(C,E);for(let R=0;R<D.length;++R){const P=D[R];u.push(O+P)}m=y+(m.length>0?" "+m:m)}return m},UR=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=$w(n))&&(l&&(l+=" "),l+=a);return l},$w=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=$w(e[a]))&&(n&&(n+=" "),n+=t);return n},BR=(e,...t)=>{let n,a,l,o;const u=m=>{const h=t.reduce((y,g)=>g(y),e());return n=MR(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=IR(m,n);return l(m,y),y};return o=u,(...m)=>o(UR(...m))},PR=[],Gt=e=>{const t=n=>n[e]||PR;return t.isThemeGetter=!0,t},Fw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$R=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,FR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qR=/\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$/,HR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ZR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oi=e=>$R.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),ui=e=>!!e&&Number.isInteger(Number(e)),Bm=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),ya=e=>FR.test(e),Hw=()=>!0,QR=e=>qR.test(e)&&!HR.test(e),Ug=()=>!1,GR=e=>ZR.test(e),KR=e=>VR.test(e),YR=e=>!je(e)&&!Ce(e),XR=e=>Ri(e,Qw,Ug),je=e=>Fw.test(e),al=e=>Ri(e,Gw,QR),H0=e=>Ri(e,iz,Qe),JR=e=>Ri(e,Yw,Hw),WR=e=>Ri(e,Kw,Ug),Z0=e=>Ri(e,Zw,Ug),ez=e=>Ri(e,Vw,KR),ld=e=>Ri(e,Xw,GR),Ce=e=>qw.test(e),Yo=e=>wl(e,Gw),tz=e=>wl(e,Kw),V0=e=>wl(e,Zw),nz=e=>wl(e,Qw),rz=e=>wl(e,Vw),sd=e=>wl(e,Xw,!0),az=e=>wl(e,Yw,!0),Ri=(e,t,n)=>{const a=Fw.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},wl=(e,t,n=!1)=>{const a=qw.exec(e);return a?a[1]?t(a[1]):n:!1},Zw=e=>e==="position"||e==="percentage",Vw=e=>e==="image"||e==="url",Qw=e=>e==="length"||e==="size"||e==="bg-size",Gw=e=>e==="length",iz=e=>e==="number",Kw=e=>e==="family-name",Yw=e=>e==="number"||e==="weight",Xw=e=>e==="shadow",lz=()=>{const e=Gt("color"),t=Gt("font"),n=Gt("text"),a=Gt("font-weight"),l=Gt("tracking"),o=Gt("leading"),u=Gt("breakpoint"),f=Gt("container"),m=Gt("spacing"),h=Gt("radius"),y=Gt("shadow"),g=Gt("inset-shadow"),b=Gt("text-shadow"),S=Gt("drop-shadow"),k=Gt("blur"),j=Gt("perspective"),E=Gt("aspect"),C=Gt("ease"),T=Gt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...B(),Ce,je],R=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],Z=()=>[Ce,je,m],re=()=>[oi,"full","auto",...Z()],F=()=>[ui,"none","subgrid",Ce,je],de=()=>["auto",{span:["full",ui,Ce,je]},ui,Ce,je],W=()=>[ui,"auto",Ce,je],ye=()=>["auto","min","max","fr",Ce,je],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...Z()],oe=()=>[oi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],K=()=>[oi,"screen","full","dvw","lvw","svw","min","max","fit",...Z()],he=()=>[oi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Z()],A=()=>[e,Ce,je],I=()=>[...B(),V0,Z0,{position:[Ce,je]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",nz,XR,{size:[Ce,je]}],le=()=>[Bm,Yo,al],V=()=>["","none","full",h,Ce,je],ue=()=>["",Qe,Yo,al],Se=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Qe,Bm,V0,Z0],Ie=()=>["","none",k,Ce,je],Be=()=>["none",Qe,Ce,je],St=()=>["none",Qe,Ce,je],Vt=()=>[Qe,Ce,je],Jt=()=>[oi,"full",...Z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ya],breakpoint:[ya],color:[Hw],container:[ya],"drop-shadow":[ya],ease:["in","out","in-out"],font:[YR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ya],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ya],shadow:[ya],spacing:["px",Qe],text:[ya],"text-shadow":[ya],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oi,je,Ce,E]}],container:["container"],columns:[{columns:[Qe,je,Ce,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:D()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{"inset-s":re(),start:re()}],end:[{"inset-e":re(),end:re()}],"inset-bs":[{"inset-bs":re()}],"inset-be":[{"inset-be":re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:["visible","invisible","collapse"],z:[{z:[ui,"auto",Ce,je]}],basis:[{basis:[oi,"full","auto",f,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,oi,"auto","initial","none",je]}],grow:[{grow:["",Qe,Ce,je]}],shrink:[{shrink:["",Qe,Ce,je]}],order:[{order:[ui,"first","last","none",Ce,je]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:de()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:de()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ye()}],"auto-rows":[{"auto-rows":ye()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pbs:[{pbs:Z()}],pbe:[{pbe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],"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",...oe()]}],"min-w":[{"min-w":[f,"screen","none",...oe()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh",...oe()]}],"font-size":[{text:["base",n,Yo,al]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,az,JR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Bm,je]}],"font-family":[{font:[tz,WR,t]}],"font-features":[{"font-features":[je]}],"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,Ce,je]}],"line-clamp":[{"line-clamp":[Qe,"none",Ce,H0]}],leading:[{leading:[o,...Z()]}],"list-image":[{"list-image":["none",Ce,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Ce,al]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Qe,"auto",Ce,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,je]}],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",Ce,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ui,Ce,je],radial:["",Ce,je],conic:[ui,Ce,je]},rz,ez]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"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:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Ce,je]}],"outline-w":[{outline:["",Qe,Yo,al]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",y,sd,ld]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,sd,ld]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Qe,al]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",b,sd,ld]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Qe,Ce,je]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ce,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":B()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,je]}],filter:[{filter:["","none",Ce,je]}],blur:[{blur:Ie()}],brightness:[{brightness:[Qe,Ce,je]}],contrast:[{contrast:[Qe,Ce,je]}],"drop-shadow":[{"drop-shadow":["","none",S,sd,ld]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Qe,Ce,je]}],"hue-rotate":[{"hue-rotate":[Qe,Ce,je]}],invert:[{invert:["",Qe,Ce,je]}],saturate:[{saturate:[Qe,Ce,je]}],sepia:[{sepia:["",Qe,Ce,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,je]}],"backdrop-blur":[{"backdrop-blur":Ie()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Ce,je]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Ce,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Ce,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Ce,je]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Ce,je]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Ce,je]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Ce,je]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Ce,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Ce,je]}],ease:[{ease:["linear","initial",C,Ce,je]}],delay:[{delay:[Qe,Ce,je]}],animate:[{animate:["none",T,Ce,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ce,je]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Be()}],"rotate-x":[{"rotate-x":Be()}],"rotate-y":[{"rotate-y":Be()}],"rotate-z":[{"rotate-z":Be()}],scale:[{scale:St()}],"scale-x":[{"scale-x":St()}],"scale-y":[{"scale-y":St()}],"scale-z":[{"scale-z":St()}],"scale-3d":["scale-3d"],skew:[{skew:Vt()}],"skew-x":[{"skew-x":Vt()}],"skew-y":[{"skew-y":Vt()}],transform:[{transform:[Ce,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Jt()}],"translate-x":[{"translate-x":Jt()}],"translate-y":[{"translate-y":Jt()}],"translate-z":[{"translate-z":Jt()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",Ce,je]}],"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":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mbs":[{"scroll-mbs":Z()}],"scroll-mbe":[{"scroll-mbe":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pbs":[{"scroll-pbs":Z()}],"scroll-pbe":[{"scroll-pbe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"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",Ce,je]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Qe,Yo,al,H0]}],stroke:[{stroke:["none",...A()]}],"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"]}},sz=BR(lz);function _e(...e){return sz(Iw(e))}function Hr(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 oz(e){return Le.delete(`/clients/${encodeURIComponent(e)}`)}function zu(){return Le.get("/admin/agents/activity")}function gu(){return Le.get("/clients")}function uz(e){return Le.post(`/clients/${e}/disconnect`)}function Jw(){return Le.post("/connect-tokens")}const Ww=(e,t)=>["session",e,t],Zp=e=>["agent-sessions",e];function cz(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 dz(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 fz(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function Js(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 Le.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function hz(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 Le.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function mz(e,t){return Le.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function pz(e,t){return Le.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var Q0=1,gz=.9,yz=.8,vz=.17,Pm=.1,$m=.999,bz=.9999,xz=.99,Sz=/[\\\/_+.#"@\[\(\{&]/,wz=/[\\\/_+.#"@\[\(\{&]/g,kz=/[\s-]/,ek=/[\s-]/g;function Vp(e,t,n,a,l,o,u){if(o===t.length)return l===e.length?Q0:xz;var f=`${l},${o}`;if(u[f]!==void 0)return u[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,b,S,k;h>=0;)g=Vp(e,t,n,a,h+1,o+1,u),g>y&&(h===l?g*=Q0:Sz.test(e.charAt(h-1))?(g*=yz,S=e.slice(l,h-1).match(wz),S&&l>0&&(g*=Math.pow($m,S.length))):kz.test(e.charAt(h-1))?(g*=gz,k=e.slice(l,h-1).match(ek),k&&l>0&&(g*=Math.pow($m,k.length))):(g*=vz,l>0&&(g*=Math.pow($m,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=bz)),(g<Pm&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=Vp(e,t,n,a,h+1,o+2,u),b*Pm>g&&(g=b*Pm)),g>y&&(y=g),h=n.indexOf(m,h+1);return u[f]=y,y}function G0(e){return e.toLowerCase().replace(ek," ")}function jz(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Vp(e,t,G0(e),G0(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 K0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ei(...e){return t=>{let n=!1;const a=e.map(l=>{const o=K0(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():K0(e[l],null)}}}}function kl(...e){return x.useCallback(Ei(...e),e)}function Cz(e,t){const n=x.createContext(t),a=o=>{const{children:u,...f}=o,m=x.useMemo(()=>f,Object.values(f));return d.jsx(n.Provider,{value:m,children:u})};a.displayName=e+"Provider";function l(o){const u=x.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function Ez(e,t=[]){let n=[];function a(o,u){const f=x.createContext(u),m=n.length;n=[...n,u];const h=g=>{var C;const{scope:b,children:S,...k}=g,j=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,E=x.useMemo(()=>k,Object.values(k));return d.jsx(j.Provider,{value:E,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(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(u=>x.createContext(u));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,Nz(l,...t)]}function Nz(...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 u=a.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var yu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},_z=vg[" useId ".trim().toString()]||(()=>{}),Az=0;function ka(e){const[t,n]=x.useState(_z());return yu(()=>{n(a=>a??String(Az++))},[e]),t?`radix-${t}`:""}var Tz=vg[" useInsertionEffect ".trim().toString()]||yu;function Rz({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,u]=zz({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=Oz(y)?y(e):y;b!==e&&((g=u.current)==null||g.call(u,b))}else o(y)},[f,e,o,u]);return[m,h]}function zz({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return Tz(()=>{o.current=t},[t]),x.useEffect(()=>{var u;l.current!==n&&((u=o.current)==null||u.call(o,n),l.current=n)},[n,l]),[n,a,o]}function Oz(e){return typeof e=="function"}var tk=XS();const Dz=Qd(tk);function nk(e){const t=Mz(e),n=x.forwardRef((a,l)=>{const{children:o,...u}=a,f=x.Children.toArray(o),m=f.find(Iz);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 d.jsx(t,{...u,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function Mz(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const u=Bz(l),f=Uz(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Ei(a,u):u),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lz=Symbol("radix.slottable");function Iz(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lz}function Uz(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 Bz(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 Pz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=Pz.reduce((e,t)=>{const n=nk(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function $z(e,t){e&&tk.flushSync(()=>e.dispatchEvent(t))}function vu(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 Fz(e,t=globalThis==null?void 0:globalThis.document){const n=vu(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 qz="DismissableLayer",Qp="dismissableLayer.update",Hz="dismissableLayer.pointerDownOutside",Zz="dismissableLayer.focusOutside",Y0,rk=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ak=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=x.useContext(rk),[y,g]=x.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=x.useState({}),k=kl(t,P=>g(P)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),T=y?j.indexOf(y):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,B=T>=C,D=Gz(P=>{const Z=P.target,re=[...h.branches].some(F=>F.contains(Z));!B||re||(l==null||l(P),u==null||u(P),P.defaultPrevented||f==null||f())},b),R=Kz(P=>{const Z=P.target;[...h.branches].some(F=>F.contains(Z))||(o==null||o(P),u==null||u(P),P.defaultPrevented||f==null||f())},b);return Fz(P=>{T===h.layers.size-1&&(a==null||a(P),!P.defaultPrevented&&f&&(P.preventDefault(),f()))},b),x.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Y0=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),X0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Y0)}},[y,b,n,h]),x.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),X0())},[y,h]),x.useEffect(()=>{const P=()=>S({});return document.addEventListener(Qp,P),()=>document.removeEventListener(Qp,P)},[]),d.jsx(Ta.div,{...m,ref:k,style:{pointerEvents:O?B?"auto":"none":void 0,...e.style},onFocusCapture:Ci(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Ci(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Ci(e.onPointerDownCapture,D.onPointerDownCapture)})});ak.displayName=qz;var Vz="DismissableLayerBranch",Qz=x.forwardRef((e,t)=>{const n=x.useContext(rk),a=x.useRef(null),l=kl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(Ta.div,{...e,ref:l})});Qz.displayName=Vz;function Gz(e,t=globalThis==null?void 0:globalThis.document){const n=vu(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){ik(Hz,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},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function Kz(e,t=globalThis==null?void 0:globalThis.document){const n=vu(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&ik(Zz,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 X0(){const e=new CustomEvent(Qp);document.dispatchEvent(e)}function ik(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?$z(l,o):l.dispatchEvent(o)}var Fm="focusScope.autoFocusOnMount",qm="focusScope.autoFocusOnUnmount",J0={bubbles:!1,cancelable:!0},Yz="FocusScope",lk=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=x.useState(null),h=vu(l),y=vu(o),g=x.useRef(null),b=kl(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(O){if(S.paused||!f)return;const B=O.target;f.contains(B)?g.current=B:fi(g.current,{select:!0})},E=function(O){if(S.paused||!f)return;const B=O.relatedTarget;B!==null&&(f.contains(B)||fi(g.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const D of O)D.removedNodes.length>0&&fi(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const T=new MutationObserver(C);return f&&T.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),T.disconnect()}}},[a,f,S.paused]),x.useEffect(()=>{if(f){e1.add(S);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(Fm,J0);f.addEventListener(Fm,h),f.dispatchEvent(C),C.defaultPrevented||(Xz(nO(sk(f)),{select:!0}),document.activeElement===j&&fi(f))}return()=>{f.removeEventListener(Fm,h),setTimeout(()=>{const C=new CustomEvent(qm,J0);f.addEventListener(qm,y),f.dispatchEvent(C),C.defaultPrevented||fi(j??document.body,{select:!0}),f.removeEventListener(qm,y),e1.remove(S)},0)}}},[f,h,y,S]);const k=x.useCallback(j=>{if(!n&&!a||S.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const T=j.currentTarget,[O,B]=Jz(T);O&&B?!j.shiftKey&&C===B?(j.preventDefault(),n&&fi(O,{select:!0})):j.shiftKey&&C===O&&(j.preventDefault(),n&&fi(B,{select:!0})):C===T&&j.preventDefault()}},[n,a,S.paused]);return d.jsx(Ta.div,{tabIndex:-1,...u,ref:b,onKeyDown:k})});lk.displayName=Yz;function Xz(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(fi(a,{select:t}),document.activeElement!==n)return}function Jz(e){const t=sk(e),n=W0(t,e),a=W0(t.reverse(),e);return[n,a]}function sk(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 W0(e,t){for(const n of e)if(!Wz(n,{upTo:t}))return n}function Wz(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 eO(e){return e instanceof HTMLInputElement&&"select"in e}function fi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&eO(e)&&t&&e.select()}}var e1=tO();function tO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=t1(e,t),e.unshift(t)},remove(t){var n;e=t1(e,t),(n=e[0])==null||n.resume()}}}function t1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function nO(e){return e.filter(t=>t.tagName!=="A")}var rO="Portal",ok=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);yu(()=>o(!0),[]);const u=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?Dz.createPortal(d.jsx(Ta.div,{...a,ref:t}),u):null});ok.displayName=rO;function aO(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var ef=e=>{const{present:t,children:n}=e,a=iO(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=kl(a.ref,lO(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};ef.displayName="Presence";function iO(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),u=e?"mounted":"unmounted",[f,m]=aO(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=od(a.current);o.current=f==="mounted"?h:"none"},[f]),yu(()=>{const h=a.current,y=l.current;if(y!==e){const b=o.current,S=od(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]),yu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=S=>{const j=od(a.current).includes(CSS.escape(S.animationName));if(S.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=S=>{S.target===t&&(o.current=od(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 od(e){return(e==null?void 0:e.animationName)||"none"}function lO(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 Hm=0;function sO(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??n1()),document.body.insertAdjacentElement("beforeend",e[1]??n1()),Hm++,()=>{Hm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hm--}},[])}function n1(){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 $r=function(){return $r=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},$r.apply(this,arguments)};function uk(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 oO(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 Cd="right-scroll-bar-position",Ed="width-before-scroll-bar",uO="with-scroll-bars-hidden",cO="--removed-body-scroll-bar-size";function Zm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function dO(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 fO=typeof window<"u"?x.useLayoutEffect:x.useEffect,r1=new WeakMap;function hO(e,t){var n=dO(null,function(a){return e.forEach(function(l){return Zm(l,a)})});return fO(function(){var a=r1.get(n);if(a){var l=new Set(a),o=new Set(e),u=n.current;l.forEach(function(f){o.has(f)||Zm(f,null)}),o.forEach(function(f){l.has(f)||Zm(f,u)})}r1.set(n,e)},[e]),n}function mO(e){return e}function pO(e,t){t===void 0&&(t=mO);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 u=t(o,a);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(a=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(o),u=n}var m=function(){var y=u;u=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){u.push(y),h()},filter:function(y){return u=u.filter(y),n}}}};return l}function gO(e){e===void 0&&(e={});var t=pO(null);return t.options=$r({async:!0,ssr:!1},e),t}var ck=function(e){var t=e.sideCar,n=uk(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,$r({},n))};ck.isSideCarExport=!0;function yO(e,t){return e.useMedium(t),ck}var dk=gO(),Vm=function(){},tf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:Vm,onWheelCapture:Vm,onTouchMoveCapture:Vm}),l=a[0],o=a[1],u=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,E=e.allowPinchZoom,C=e.as,T=C===void 0?"div":C,O=e.gapMode,B=uk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=b,R=hO([n,t]),P=$r($r({},B),l);return x.createElement(x.Fragment,null,y&&x.createElement(D,{sideCar:dk,removeScrollBar:h,shards:g,noRelative:S,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),u?x.cloneElement(x.Children.only(f),$r($r({},P),{ref:R})):x.createElement(T,$r({},P,{className:m,ref:R}),f))});tf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tf.classNames={fullWidth:Ed,zeroRight:Cd};var vO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=vO();return t&&e.setAttribute("nonce",t),e}function xO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bO())&&(xO(t,n),SO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kO=function(){var e=wO();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fk=function(){var e=kO(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},jO={left:0,top:0,right:0,gap:0},Qm=function(e){return parseInt(e||"",10)||0},CO=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[Qm(n),Qm(a),Qm(l)]},EO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jO;var t=CO(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])}},NO=fk(),_s="data-scroll-locked",_O=function(e,t,n,a){var l=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
261
- .`.concat(uO,` {
262
- overflow: hidden `).concat(a,`;
263
- padding-right: `).concat(f,"px ").concat(a,`;
264
- }
265
- body[`).concat(_s,`] {
266
- overflow: hidden `).concat(a,`;
267
- overscroll-behavior: contain;
268
- `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
269
- padding-left: `.concat(l,`px;
270
- padding-top: `).concat(o,`px;
271
- padding-right: `).concat(u,`px;
272
- margin-left:0;
273
- margin-top:0;
274
- margin-right: `).concat(f,"px ").concat(a,`;
275
- `),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
276
- }
277
-
278
- .`).concat(Cd,` {
279
- right: `).concat(f,"px ").concat(a,`;
280
- }
281
-
282
- .`).concat(Ed,` {
283
- margin-right: `).concat(f,"px ").concat(a,`;
284
- }
285
-
286
- .`).concat(Cd," .").concat(Cd,` {
287
- right: 0 `).concat(a,`;
288
- }
289
-
290
- .`).concat(Ed," .").concat(Ed,` {
291
- margin-right: 0 `).concat(a,`;
292
- }
293
-
294
- body[`).concat(_s,`] {
295
- `).concat(cO,": ").concat(f,`px;
296
- }
297
- `)},a1=function(){var e=parseInt(document.body.getAttribute(_s)||"0",10);return isFinite(e)?e:0},AO=function(){x.useEffect(function(){return document.body.setAttribute(_s,(a1()+1).toString()),function(){var e=a1()-1;e<=0?document.body.removeAttribute(_s):document.body.setAttribute(_s,e.toString())}},[])},TO=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;AO();var o=x.useMemo(function(){return EO(l)},[l]);return x.createElement(NO,{styles:_O(o,!t,l,n?"":"!important")})},Gp=!1;if(typeof window<"u")try{var ud=Object.defineProperty({},"passive",{get:function(){return Gp=!0,!0}});window.addEventListener("test",ud,ud),window.removeEventListener("test",ud,ud)}catch{Gp=!1}var ps=Gp?{passive:!1}:!1,RO=function(e){return e.tagName==="TEXTAREA"},hk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!RO(e)&&n[t]==="visible")},zO=function(e){return hk(e,"overflowY")},OO=function(e){return hk(e,"overflowX")},i1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=mk(e,a);if(l){var o=pk(e,a),u=o[1],f=o[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},DO=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},MO=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},mk=function(e,t){return e==="v"?zO(t):OO(t)},pk=function(e,t){return e==="v"?DO(t):MO(t)},LO=function(e,t){return e==="h"&&t==="rtl"?-1:1},IO=function(e,t,n,a,l){var o=LO(e,window.getComputedStyle(t).direction),u=o*a,f=n.target,m=t.contains(f),h=!1,y=u>0,g=0,b=0;do{if(!f)break;var S=pk(e,f),k=S[0],j=S[1],E=S[2],C=j-E-o*k;(k||C)&&mk(e,f)&&(g+=C,b+=k);var T=f.parentNode;f=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}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},cd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},l1=function(e){return[e.deltaX,e.deltaY]},s1=function(e){return e&&"current"in e?e.current:e},UO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},BO=function(e){return`
298
- .block-interactivity-`.concat(e,` {pointer-events: none;}
299
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
300
- `)},PO=0,gs=[];function $O(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(PO++)[0],o=x.useState(fk)[0],u=x.useRef(e);x.useEffect(function(){u.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=oO([e.lockRef.current],(e.shards||[]).map(s1),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var C=cd(j),T=n.current,O="deltaX"in j?j.deltaX:T[0]-C[0],B="deltaY"in j?j.deltaY:T[1]-C[1],D,R=j.target,P=Math.abs(O)>Math.abs(B)?"h":"v";if("touches"in j&&P==="h"&&R.type==="range")return!1;var Z=window.getSelection(),re=Z&&Z.anchorNode,F=re?re===R||re.contains(R):!1;if(F)return!1;var de=i1(P,R);if(!de)return!0;if(de?D=P:(D=P==="v"?"h":"v",de=i1(P,R)),!de)return!1;if(!a.current&&"changedTouches"in j&&(O||B)&&(a.current=D),!D)return!0;var W=a.current||D;return IO(W,E,j,W==="h"?O:B)},[]),m=x.useCallback(function(j){var E=j;if(!(!gs.length||gs[gs.length-1]!==o)){var C="deltaY"in E?l1(E):cd(E),T=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&UO(D.delta,C)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var O=(u.current.shards||[]).map(s1).filter(Boolean).filter(function(D){return D.contains(E.target)}),B=O.length>0?f(E,O[0]):!u.current.noIsolation;B&&E.cancelable&&E.preventDefault()}}},[]),h=x.useCallback(function(j,E,C,T){var O={name:j,delta:E,target:C,should:T,shadowParent:FO(C)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(B){return B!==O})},1)},[]),y=x.useCallback(function(j){n.current=cd(j),a.current=void 0},[]),g=x.useCallback(function(j){h(j.type,l1(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,cd(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return gs.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,ps),document.addEventListener("touchmove",m,ps),document.addEventListener("touchstart",y,ps),function(){gs=gs.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,ps),document.removeEventListener("touchmove",m,ps),document.removeEventListener("touchstart",y,ps)}},[]);var S=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:BO(l)}):null,S?x.createElement(TO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function FO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qO=yO(dk,$O);var gk=x.forwardRef(function(e,t){return x.createElement(tf,$r({},e,{ref:t,sideCar:qO}))});gk.classNames=tf.classNames;var HO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ys=new WeakMap,dd=new WeakMap,fd={},Gm=0,yk=function(e){return e&&(e.host||yk(e.parentNode))},ZO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=yk(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})},VO=function(e,t,n,a){var l=ZO(t,Array.isArray(e)?e:[e]);fd[n]||(fd[n]=new WeakMap);var o=fd[n],u=[],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=(ys.get(b)||0)+1,E=(o.get(b)||0)+1;ys.set(b,j),o.set(b,E),u.push(b),j===1&&k&&dd.set(b,!0),E===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return y(t),f.clear(),Gm++,function(){u.forEach(function(g){var b=ys.get(g)-1,S=o.get(g)-1;ys.set(g,b),o.set(g,S),b||(dd.has(g)||g.removeAttribute(a),dd.delete(g)),S||g.removeAttribute(n)}),Gm--,Gm||(ys=new WeakMap,ys=new WeakMap,dd=new WeakMap,fd={})}},QO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=HO(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),VO(a,l,n,"aria-hidden")):function(){return null}},nf="Dialog",[vk]=Ez(nf),[GO,Er]=vk(nf),bk=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,y]=Rz({prop:a,defaultProp:l??!1,onChange:o,caller:nf});return d.jsx(GO,{scope:t,triggerRef:f,contentRef:m,contentId:ka(),titleId:ka(),descriptionId:ka(),open:h,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:u,children:n})};bk.displayName=nf;var xk="DialogTrigger",Sk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Er(xk,n),o=kl(t,l.triggerRef);return d.jsx(Ta.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":$g(l.open),...a,ref:o,onClick:Ci(e.onClick,l.onOpenToggle)})});Sk.displayName=xk;var Bg="DialogPortal",[KO,wk]=vk(Bg,{forceMount:void 0}),kk=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Er(Bg,t);return d.jsx(KO,{scope:t,forceMount:n,children:x.Children.map(a,u=>d.jsx(ef,{present:n||o.open,children:d.jsx(ok,{asChild:!0,container:l,children:u})}))})};kk.displayName=Bg;var Md="DialogOverlay",jk=x.forwardRef((e,t)=>{const n=wk(Md,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Er(Md,e.__scopeDialog);return o.modal?d.jsx(ef,{present:a||o.open,children:d.jsx(XO,{...l,ref:t})}):null});jk.displayName=Md;var YO=nk("DialogOverlay.RemoveScroll"),XO=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Er(Md,n);return d.jsx(gk,{as:YO,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(Ta.div,{"data-state":$g(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),yl="DialogContent",Ck=x.forwardRef((e,t)=>{const n=wk(yl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Er(yl,e.__scopeDialog);return d.jsx(ef,{present:a||o.open,children:o.modal?d.jsx(JO,{...l,ref:t}):d.jsx(WO,{...l,ref:t})})});Ck.displayName=yl;var JO=x.forwardRef((e,t)=>{const n=Er(yl,e.__scopeDialog),a=x.useRef(null),l=kl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return QO(o)},[]),d.jsx(Ek,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ci(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ci(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:Ci(e.onFocusOutside,o=>o.preventDefault())})}),WO=x.forwardRef((e,t)=>{const n=Er(yl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return d.jsx(Ek,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.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 u=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),Ek=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=Er(yl,n),m=x.useRef(null),h=kl(t,m);return sO(),d.jsxs(d.Fragment,{children:[d.jsx(lk,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:d.jsx(ak,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":$g(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(e3,{titleId:f.titleId}),d.jsx(n3,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Pg="DialogTitle",Nk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Er(Pg,n);return d.jsx(Ta.h2,{id:l.titleId,...a,ref:t})});Nk.displayName=Pg;var _k="DialogDescription",Ak=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Er(_k,n);return d.jsx(Ta.p,{id:l.descriptionId,...a,ref:t})});Ak.displayName=_k;var Tk="DialogClose",Rk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Er(Tk,n);return d.jsx(Ta.button,{type:"button",...a,ref:t,onClick:Ci(e.onClick,()=>l.onOpenChange(!1))})});Rk.displayName=Tk;function $g(e){return e?"open":"closed"}var zk="DialogTitleWarning",[_q,Ok]=Cz(zk,{contentName:yl,titleName:Pg,docsSlug:"dialog"}),e3=({titleId:e})=>{const t=Ok(zk),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
301
-
302
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
303
-
304
- 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},t3="DialogDescriptionWarning",n3=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ok(t3).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},Dk=bk,r3=Sk,Mk=kk,Lk=jk,Ik=Ck,a3=Nk,i3=Ak,l3=Rk,s3=Symbol.for("react.lazy"),Ld=vg[" use ".trim().toString()];function o3(e){return typeof e=="object"&&e!==null&&"then"in e}function Uk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===s3&&"_payload"in e&&o3(e._payload)}function Bk(e){const t=c3(e),n=x.forwardRef((a,l)=>{let{children:o,...u}=a;Uk(o)&&typeof Ld=="function"&&(o=Ld(o._payload));const f=x.Children.toArray(o),m=f.find(f3);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 d.jsx(t,{...u,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var u3=Bk("Slot");function c3(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(Uk(l)&&typeof Ld=="function"&&(l=Ld(l._payload)),x.isValidElement(l)){const u=m3(l),f=h3(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Ei(a,u):u),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var d3=Symbol("radix.slottable");function f3(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d3}function h3(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 m3(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"],Ra=p3.reduce((e,t)=>{const n=Bk(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Xo='[cmdk-group=""]',Km='[cmdk-group-items=""]',g3='[cmdk-group-heading=""]',Pk='[cmdk-item=""]',o1=`${Pk}:not([aria-disabled="true"])`,Kp="cmdk-item-select",Ss="data-value",y3=(e,t,n)=>jz(e,t,n),$k=x.createContext(void 0),Ou=()=>x.useContext($k),Fk=x.createContext(void 0),Fg=()=>x.useContext(Fk),qk=x.createContext(void 0),Hk=x.forwardRef((e,t)=>{let n=ws(()=>{var U,_;return{search:"",value:(_=(U=e.value)!=null?U:e.defaultValue)!=null?_:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=ws(()=>new Set),l=ws(()=>new Map),o=ws(()=>new Map),u=ws(()=>new Set),f=Zk(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:S,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,T=ka(),O=ka(),B=ka(),D=x.useRef(null),R=_3();vl(()=>{if(y!==void 0){let U=y.trim();n.current.value=U,P.emit()}},[y]),vl(()=>{R(6,ye)},[]);let P=x.useMemo(()=>({subscribe:U=>(u.current.add(U),()=>u.current.delete(U)),snapshot:()=>n.current,setState:(U,_,le)=>{var V,ue,Se,ee;if(!Object.is(n.current[U],_)){if(n.current[U]=_,U==="search")W(),F(),R(1,de);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let fe=document.getElementById(B);fe?fe.focus():(V=document.getElementById(T))==null||V.focus()}if(R(7,()=>{var fe;n.current.selectedItemId=(fe=me())==null?void 0:fe.id,P.emit()}),le||R(5,ye),((ue=f.current)==null?void 0:ue.value)!==void 0){let fe=_??"";(ee=(Se=f.current).onValueChange)==null||ee.call(Se,fe);return}}P.emit()}},emit:()=>{u.current.forEach(U=>U())}}),[]),Z=x.useMemo(()=>({value:(U,_,le)=>{var V;_!==((V=o.current.get(U))==null?void 0:V.value)&&(o.current.set(U,{value:_,keywords:le}),n.current.filtered.items.set(U,re(_,le)),R(2,()=>{F(),P.emit()}))},item:(U,_)=>(a.current.add(U),_&&(l.current.has(_)?l.current.get(_).add(U):l.current.set(_,new Set([U]))),R(3,()=>{W(),F(),n.current.value||de(),P.emit()}),()=>{o.current.delete(U),a.current.delete(U),n.current.filtered.items.delete(U);let le=me();R(4,()=>{W(),(le==null?void 0:le.getAttribute("id"))===U&&de(),P.emit()})}),group:U=>(l.current.has(U)||l.current.set(U,new Set),()=>{o.current.delete(U),l.current.delete(U)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:T,inputId:B,labelId:O,listInnerRef:D}),[]);function re(U,_){var le,V;let ue=(V=(le=f.current)==null?void 0:le.filter)!=null?V:y3;return U?ue(U,n.current.search,_):0}function F(){if(!n.current.search||f.current.shouldFilter===!1)return;let U=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(V=>{let ue=l.current.get(V),Se=0;ue.forEach(ee=>{let fe=U.get(ee);Se=Math.max(fe,Se)}),_.push([V,Se])});let le=D.current;te().sort((V,ue)=>{var Se,ee;let fe=V.getAttribute("id"),Ie=ue.getAttribute("id");return((Se=U.get(Ie))!=null?Se:0)-((ee=U.get(fe))!=null?ee:0)}).forEach(V=>{let ue=V.closest(Km);ue?ue.appendChild(V.parentElement===ue?V:V.closest(`${Km} > *`)):le.appendChild(V.parentElement===le?V:V.closest(`${Km} > *`))}),_.sort((V,ue)=>ue[1]-V[1]).forEach(V=>{var ue;let Se=(ue=D.current)==null?void 0:ue.querySelector(`${Xo}[${Ss}="${encodeURIComponent(V[0])}"]`);Se==null||Se.parentElement.appendChild(Se)})}function de(){let U=te().find(le=>le.getAttribute("aria-disabled")!=="true"),_=U==null?void 0:U.getAttribute(Ss);P.setState("value",_||void 0)}function W(){var U,_,le,V;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 Se of a.current){let ee=(_=(U=o.current.get(Se))==null?void 0:U.value)!=null?_:"",fe=(V=(le=o.current.get(Se))==null?void 0:le.keywords)!=null?V:[],Ie=re(ee,fe);n.current.filtered.items.set(Se,Ie),Ie>0&&ue++}for(let[Se,ee]of l.current)for(let fe of ee)if(n.current.filtered.items.get(fe)>0){n.current.filtered.groups.add(Se);break}n.current.filtered.count=ue}function ye(){var U,_,le;let V=me();V&&(((U=V.parentElement)==null?void 0:U.firstChild)===V&&((le=(_=V.closest(Xo))==null?void 0:_.querySelector(g3))==null||le.scrollIntoView({block:"nearest"})),V.scrollIntoView({block:"nearest"}))}function me(){var U;return(U=D.current)==null?void 0:U.querySelector(`${Pk}[aria-selected="true"]`)}function te(){var U;return Array.from(((U=D.current)==null?void 0:U.querySelectorAll(o1))||[])}function q(U){let _=te()[U];_&&P.setState("value",_.getAttribute(Ss))}function oe(U){var _;let le=me(),V=te(),ue=V.findIndex(ee=>ee===le),Se=V[ue+U];(_=f.current)!=null&&_.loop&&(Se=ue+U<0?V[V.length-1]:ue+U===V.length?V[0]:V[ue+U]),Se&&P.setState("value",Se.getAttribute(Ss))}function K(U){let _=me(),le=_==null?void 0:_.closest(Xo),V;for(;le&&!V;)le=U>0?E3(le,Xo):N3(le,Xo),V=le==null?void 0:le.querySelector(o1);V?P.setState("value",V.getAttribute(Ss)):oe(U)}let he=()=>q(te().length-1),A=U=>{U.preventDefault(),U.metaKey?he():U.altKey?K(1):oe(1)},I=U=>{U.preventDefault(),U.metaKey?q(0):U.altKey?K(-1):oe(-1)};return x.createElement(Ra.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:U=>{var _;(_=C.onKeyDown)==null||_.call(C,U);let le=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||le))switch(U.key){case"n":case"j":{E&&U.ctrlKey&&A(U);break}case"ArrowDown":{A(U);break}case"p":case"k":{E&&U.ctrlKey&&I(U);break}case"ArrowUp":{I(U);break}case"Home":{U.preventDefault(),q(0);break}case"End":{U.preventDefault(),he();break}case"Enter":{U.preventDefault();let V=me();if(V){let ue=new Event(Kp);V.dispatchEvent(ue)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:Z.inputId,id:Z.labelId,style:T3},m),rf(e,U=>x.createElement(Fk.Provider,{value:P},x.createElement($k.Provider,{value:Z},U))))}),v3=x.forwardRef((e,t)=>{var n,a;let l=ka(),o=x.useRef(null),u=x.useContext(qk),f=Ou(),m=Zk(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:u==null?void 0:u.forceMount;vl(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let y=Vk(l,o,[e.value,e.children,o],e.keywords),g=Fg(),b=Ni(R=>R.value&&R.value===y.current),S=Ni(R=>h||f.filter()===!1?!0:R.search?R.filtered.items.get(l)>0:!0);x.useEffect(()=>{let R=o.current;if(!(!R||e.disabled))return R.addEventListener(Kp,k),()=>R.removeEventListener(Kp,k)},[S,e.onSelect,e.disabled]);function k(){var R,P;j(),(P=(R=m.current).onSelect)==null||P.call(R,y.current)}function j(){g.setState("value",y.current,!0)}if(!S)return null;let{disabled:E,value:C,onSelect:T,forceMount:O,keywords:B,...D}=e;return x.createElement(Ra.div,{ref:Ei(o,t),...D,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||f.getDisablePointerSelection()?void 0:j,onClick:E?void 0:k},e.children)}),b3=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,u=ka(),f=x.useRef(null),m=x.useRef(null),h=ka(),y=Ou(),g=Ni(S=>l||y.filter()===!1?!0:S.search?S.filtered.groups.has(u):!0);vl(()=>y.group(u),[]),Vk(u,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:u,forceMount:l}),[l]);return x.createElement(Ra.div,{ref:Ei(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),rf(e,S=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(qk.Provider,{value:b},S))))}),x3=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Ni(u=>!u.search);return!n&&!o?null:x.createElement(Ra.div,{ref:Ei(l,t),...a,"cmdk-separator":"",role:"separator"})}),S3=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=Fg(),u=Ni(h=>h.search),f=Ni(h=>h.selectedItemId),m=Ou();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:u,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),w3=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),u=x.useRef(null),f=Ni(h=>h.selectedItemId),m=Ou();return x.useEffect(()=>{if(u.current&&o.current){let h=u.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:Ei(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},rf(e,h=>x.createElement("div",{ref:Ei(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),k3=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:u,...f}=e;return x.createElement(Dk,{open:n,onOpenChange:a},x.createElement(Mk,{container:u},x.createElement(Lk,{"cmdk-overlay":"",className:l}),x.createElement(Ik,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(Hk,{ref:t,...f}))))}),j3=x.forwardRef((e,t)=>Ni(n=>n.filtered.count===0)?x.createElement(Ra.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),C3=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},rf(e,u=>x.createElement("div",{"aria-hidden":!0},u)))}),In=Object.assign(Hk,{List:w3,Item:v3,Input:S3,Group:b3,Separator:x3,Dialog:k3,Empty:j3,Loading:C3});function E3(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function N3(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Zk(e){let t=x.useRef(e);return vl(()=>{t.current=e}),t}var vl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function ws(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ni(e){let t=Fg(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Vk(e,t,n,a=[]){let l=x.useRef(),o=Ou();return vl(()=>{var u;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),(u=t.current)==null||u.setAttribute(Ss,f),l.current=f}),l}var _3=()=>{let[e,t]=x.useState(),n=ws(()=>new Map);return vl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function A3(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function rf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(A3(t),{ref:t.ref},n(t.props.children)):n(t)}var T3={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const gn=Dk,R3=r3,z3=Mk,Qk=x.forwardRef(({className:e,...t},n)=>d.jsx(Lk,{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}));Qk.displayName="DialogOverlay";const dn=x.forwardRef(({className:e,children:t,...n},a)=>d.jsxs(z3,{children:[d.jsx(Qk,{}),d.jsxs(Ik,{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,d.jsxs(l3,{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:[d.jsx(qp,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dn.displayName="DialogContent";function En({className:e,...t}){return d.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function yn({className:e,...t}){return d.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const vn=x.forwardRef(({className:e,...t},n)=>d.jsx(a3,{ref:n,className:_e("text-subtitle leading-none tracking-tight",e),...t}));vn.displayName="DialogTitle";const O3=x.forwardRef(({className:e,...t},n)=>d.jsx(i3,{ref:n,className:_e("text-body text-muted-foreground",e),...t}));O3.displayName="DialogDescription";const Gk=x.forwardRef(({className:e,...t},n)=>d.jsx(In,{ref:n,className:_e("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Gk.displayName=In.displayName;function D3({open:e,onOpenChange:t,children:n}){return d.jsx(gn,{open:e,onOpenChange:t,children:d.jsx(dn,{className:"overflow-hidden p-0 shadow-lg",children:d.jsx(Gk,{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 Kk=x.forwardRef(({className:e,...t},n)=>d.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[d.jsx(Wd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),d.jsx(In.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})]}));Kk.displayName=In.Input.displayName;const Yk=x.forwardRef(({className:e,...t},n)=>d.jsx(In.List,{ref:n,className:_e("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Yk.displayName=In.List.displayName;const Xk=x.forwardRef((e,t)=>d.jsx(In.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Xk.displayName=In.Empty.displayName;const Nd=x.forwardRef(({className:e,...t},n)=>d.jsx(In.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}));Nd.displayName=In.Group.displayName;const Yp=x.forwardRef(({className:e,...t},n)=>d.jsx(In.Separator,{ref:n,className:_e("-mx-1 h-px bg-border",e),...t}));Yp.displayName=In.Separator.displayName;const _d=x.forwardRef(({className:e,...t},n)=>d.jsx(In.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}));_d.displayName=In.Item.displayName;function af(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 Le.get(`/admin/agents${n?`?${n}`:""}`)}function M3(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 Le.get(`/admin/agents/all${n?`?${n}`:""}`)}function Jk(e){return Le.get(`/admin/agents/${encodeURIComponent(e)}`)}function L3(e){return Le.post("/admin/agents",e)}function I3(e){return Le.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function u1(e,t){return Le.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function U3(e){return Le.delete(`/admin/agents/${encodeURIComponent(e)}`)}function B3(e){return Le.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function P3(e){return Le.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function $3(e){return Le.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function jl(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>af({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??n.name??n.uuid);return n=>n?t.get(n)??n:"—"},[e])}function qg(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>af({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 F3=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function q3({open:e,onOpenChange:t}){const n=Vr(),a=jl(),{data:l}=Ve({queryKey:["activity"],queryFn:zu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=Ve({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await Js(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 d.jsxs(D3,{open:e,onOpenChange:t,children:[d.jsx(Kk,{placeholder:"Jump to agent, chat, or page…"}),d.jsxs(Yk,{children:[d.jsx(Xk,{children:"No results"}),o.length>0&&d.jsx(Nd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return d.jsxs(_d,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[d.jsx(kT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:y}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(Yp,{}),d.jsx(Nd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return d.jsxs(_d,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[d.jsx(Lg,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:g}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),d.jsx(Yp,{}),d.jsx(Nd,{heading:"Pages",children:F3.map(h=>d.jsxs(_d,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[d.jsx(BT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{children:h.label})]},h.path))})]})]})}function Du(e){return d.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[d.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),d.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),d.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),d.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),d.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),d.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function Xp(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 Le.get(`/admin/notifications${n?`?${n}`:""}`)}function Wk(e){return Le.post(`/admin/notifications/${e}/read`)}function H3(){return Le.post("/admin/notifications/read-all")}const Z3={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 V3(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function ej({notification:e,onClick:t,clickable:n}){const a=(Z3[e.type]??e.type).toString(),l=V3(e.severity),o=n??!0;return d.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:u=>{o&&(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{u.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[d.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[d.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:Hr(e.createdAt)})]}),d.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function Q3(){var S;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=Vr(),u=Jn(),{data:f}=Ve({queryKey:["notifications","bell"],queryFn:()=>Xp({limit:8}),refetchInterval:1e4}),{data:m}=Ve({queryKey:["notifications","unread-count"],queryFn:()=>Xp({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||(Wk(k.id).catch(()=>{}),u.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,u]),b=x.useCallback(async()=>{a(null);try{await H3(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[u]);return d.jsxs("div",{className:"relative",children:[d.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:[d.jsx(ST,{className:"h-4 w-4"}),y&&d.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&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),d.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:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&d.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&d.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}),d.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?d.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=>d.jsx(ej,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function G3(){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 K3(){const[e,t]=x.useState(G3);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),d.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",children:e==="dark"?d.jsx(oR,{className:"h-4 w-4"}):d.jsx(GT,{className:"h-4 w-4"})})}const c1=[{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"}],Y3={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function X3(){const{role:e,logout:t}=Aa(),n=e==="admin",[a,l]=x.useState(!1),o=n?[...c1,Y3]:c1,u=yr(),f=u.pathname==="/"||u.search.includes("a=");return x.useEffect(()=>{const m=h=>{(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k"&&(h.preventDefault(),l(y=>!y))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),d.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[d.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"auto 1fr auto",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx(Du,{width:16,height:18,style:{color:"var(--fg)"}}),d.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",d.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),d.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:o.map(m=>d.jsx(Nw,{to:m.to,end:m.end,style:{pointerEvents:"auto"},className:({isActive:h})=>_e("inline-flex items-center transition-colors",h?"":"hover:text-[var(--fg)]"),children:({isActive:h})=>d.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:h?"var(--fg)":"var(--fg-3)",background:h?"var(--bg-hover)":"transparent"},children:[m.label,h&&d.jsx("span",{className:"kbd",children:m.kbd})]})},m.to))}),d.jsxs("div",{className:"flex items-center",style:{gap:6},children:[d.jsxs("button",{type:"button",onClick:()=>l(!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:m=>{m.currentTarget.style.color="var(--fg)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--fg-3)"},children:[d.jsx(Wd,{className:"h-4 w-4"}),d.jsx("span",{children:"Jump to…"}),d.jsx("span",{className:"kbd",children:"⌘K"})]}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx(Q3,{}),d.jsx(K3,{}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center transition-colors hover:text-[var(--fg)] text-body",style:{padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",borderRadius:"var(--radius-input)",gap:6},"aria-label":"Log out",children:d.jsx(ZT,{className:"h-4 w-4"})})]})]}),d.jsx(q3,{open:a,onOpenChange:l}),f?d.jsx(Pp,{}):d.jsx("main",{className:"flex-1 overflow-auto",children:d.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:d.jsx(Pp,{})})})]})}function ie(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=u.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 u(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(u,"init",{value:a}),Object.defineProperty(u,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(u,"name",{value:e}),u}class As extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const nj={};function _i(e){return nj}function rj(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 Jp(e,t){return typeof t=="bigint"?t.toString():t}function lf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Hg(e){return e==null}function Zg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function J3(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,u=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return u%f/10**o}const d1=Symbol("evaluating");function ct(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==d1)return a===void 0&&(a=d1,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function Cl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function zi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function f1(e){return JSON.stringify(e)}function W3(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const aj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const eD=lf(()=>{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 qs(e){if(bu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(bu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ij(e){return qs(e)?{...e}:Array.isArray(e)?[...e]:e}const tD=new Set(["string","number","symbol"]);function Hs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oi(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 nD(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const rD={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 aD(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=zi(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return Cl(this,"shape",u),u},checks:[]});return Oi(e,o)}function iD(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=zi(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return Cl(this,"shape",u),u},checks:[]});return Oi(e,o)}function lD(e,t){if(!qs(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 u in t)if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=zi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Cl(this,"shape",o),o}});return Oi(e,l)}function sD(e,t){if(!qs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Cl(this,"shape",a),a}});return Oi(e,n)}function oD(e,t){const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Cl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Oi(e,n)}function uD(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 u=zi(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 Cl(this,"shape",m),m},checks:[]});return Oi(t,u)}function cD(e,t,n){const a=zi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const u in n){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(o[u]=new e({type:"nonoptional",innerType:l[u]}))}else for(const u in l)o[u]=new e({type:"nonoptional",innerType:l[u]});return Cl(this,"shape",o),o}});return Oi(t,a)}function js(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 Cs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function hd(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ai(e,t,n){var l,o,u,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=hd((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??hd((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??hd((m=n.customError)==null?void 0:m.call(n,e))??hd((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 Vg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const lj=(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,Jp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},sj=ie("$ZodError",lj),oj=ie("$ZodError",lj,{Parent:Error});function dD(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 fD(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(u=>a({issues:u}));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 u=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(o))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return a(e),n}const Qg=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new As;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>Ai(m,o,_i())));throw aj(f,l==null?void 0:l.callee),f}return u.value},Gg=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>Ai(m,o,_i())));throw aj(f,l==null?void 0:l.callee),f}return u.value},sf=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 As;return o.issues.length?{success:!1,error:new(e??sj)(o.issues.map(u=>Ai(u,l,_i())))}:{success:!0,data:o.value}},hD=sf(oj),of=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(u=>Ai(u,l,_i())))}:{success:!0,data:o.value}},mD=of(oj),pD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Qg(e)(t,n,l)},gD=e=>(t,n,a)=>Qg(e)(t,n,a),yD=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gg(e)(t,n,l)},vD=e=>async(t,n,a)=>Gg(e)(t,n,a),bD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return sf(e)(t,n,l)},xD=e=>(t,n,a)=>sf(e)(t,n,a),SD=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return of(e)(t,n,l)},wD=e=>async(t,n,a)=>of(e)(t,n,a),kD=/^[cC][^\s-]{8,}$/,jD=/^[0-9a-z]+$/,CD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ED=/^[0-9a-vA-V]{20}$/,ND=/^[A-Za-z0-9]{27}$/,_D=/^[a-zA-Z0-9_-]{21}$/,AD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,TD=/^([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})$/,h1=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)$/,RD=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function OD(){return new RegExp(zD,"u")}const DD=/^(?:(?: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])$/,MD=/^(([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}|:))$/,LD=/^((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])$/,ID=/^(([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])$/,UD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uj=/^[A-Za-z0-9_-]*$/,BD=/^\+[1-9]\d{6,14}$/,cj="(?:(?:\\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])))",PD=new RegExp(`^${cj}$`);function dj(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 $D(e){return new RegExp(`^${dj(e)}$`)}function FD(e){const t=dj({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(`^${cj}T(?:${a})$`)}const qD=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}$`)},HD=/^-?\d+$/,fj=/^-?\d+(?:\.\d+)?$/,ZD=/^(?:true|false)$/i,VD=/^[^A-Z]*$/,QD=/^[^a-z]*$/,Un=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),hj={number:"number",bigint:"bigint",object:"date"},mj=ie("$ZodCheckLessThan",(e,t)=>{Un.init(e,t);const n=hj[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})}}),pj=ie("$ZodCheckGreaterThan",(e,t)=>{Un.init(e,t);const n=hj[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})}}),GD=ie("$ZodCheckMultipleOf",(e,t)=>{Un.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):J3(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})}}),KD=ie("$ZodCheckNumberFormat",(e,t)=>{var u;Un.init(e,t),t.format=t.format||"float64";const n=(u=t.format)==null?void 0:u.includes("int"),a=n?"int":"number",[l,o]=rD[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=HD)}),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})}}),YD=ie("$ZodCheckMaxLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Hg(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 u=Vg(l);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),XD=ie("$ZodCheckMinLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Hg(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 u=Vg(l);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),JD=ie("$ZodCheckLengthEquals",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Hg(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 u=Vg(l),f=o>t.length;a.issues.push({origin:u,...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})}}),uf=ie("$ZodCheckStringFormat",(e,t)=>{var n,a;Un.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=()=>{})}),WD=ie("$ZodCheckRegex",(e,t)=>{uf.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})}}),eM=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=VD),uf.init(e,t)}),tM=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=QD),uf.init(e,t)}),nM=ie("$ZodCheckIncludes",(e,t)=>{Un.init(e,t);const n=Hs(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})}}),rM=ie("$ZodCheckStartsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`^${Hs(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})}}),aM=ie("$ZodCheckEndsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`.*${Hs(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})}}),iM=ie("$ZodCheckOverwrite",(e,t)=>{Un.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class lM{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(`
305
- `).filter(u=>u),l=Math.min(...a.map(u=>u.length-u.trimStart().length)),o=a.map(u=>u.slice(l)).map(u=>" ".repeat(this.indent*2)+u);for(const u of o)this.content.push(u)}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(`
306
- `))}}const sM={major:4,minor:3,patch:6},Tt=ie("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sM;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const u of o._zod.onattach)u(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=js(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 As;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==S&&(y||(y=js(f,S)))});else{if(f.issues.length===S)continue;y||(y=js(f,S))}}return g?g.then(()=>f):f},u=(f,m,h)=>{if(js(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new As;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=>u(g,f,m)):u(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new As;return h.then(y=>o(y,a,m))}return o(h,a,m)}}ct(e,"~standard",()=>({validate:o=>{var u;try{const f=hD(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return mD(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}))}),Kg=ie("$ZodString",(e,t)=>{var n;Tt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??qD(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}}),_t=ie("$ZodStringFormat",(e,t)=>{uf.init(e,t),Kg.init(e,t)}),oM=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=TD),_t.init(e,t)}),uM=ie("$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=h1(a))}else t.pattern??(t.pattern=h1());_t.init(e,t)}),cM=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=RD),_t.init(e,t)}),dM=ie("$ZodURL",(e,t)=>{_t.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})}}}),fM=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=OD()),_t.init(e,t)}),hM=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=_D),_t.init(e,t)}),mM=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=kD),_t.init(e,t)}),pM=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=jD),_t.init(e,t)}),gM=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=CD),_t.init(e,t)}),yM=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ED),_t.init(e,t)}),vM=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ND),_t.init(e,t)}),bM=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=FD(t)),_t.init(e,t)}),xM=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=PD),_t.init(e,t)}),SM=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$D(t)),_t.init(e,t)}),wM=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=AD),_t.init(e,t)}),kM=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=DD),_t.init(e,t),e._zod.bag.format="ipv4"}),jM=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=MD),_t.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})}}}),CM=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=LD),_t.init(e,t)}),EM=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ID),_t.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 u=Number(o);if(`${u}`!==o)throw new Error;if(u<0||u>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 gj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const NM=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=UD),_t.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{gj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function _M(e){if(!uj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return gj(n)}const AM=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=uj),_t.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{_M(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),TM=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=BD),_t.init(e,t)});function RM(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 zM=ie("$ZodJWT",(e,t)=>{_t.init(e,t),e._zod.check=n=>{RM(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),yj=ie("$ZodNumber",(e,t)=>{Tt.init(e,t),e._zod.pattern=e._zod.bag.pattern??fj,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}}),OM=ie("$ZodNumberFormat",(e,t)=>{KD.init(e,t),yj.init(e,t)}),DM=ie("$ZodBoolean",(e,t)=>{Tt.init(e,t),e._zod.pattern=ZD,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}}),MM=ie("$ZodUnknown",(e,t)=>{Tt.init(e,t),e._zod.parse=n=>n}),LM=ie("$ZodNever",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function m1(e,t,n){e.issues.length&&t.issues.push(...Cs(n,e.issues)),t.value[n]=e.value}const IM=ie("$ZodArray",(e,t)=>{Tt.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 u=0;u<l.length;u++){const f=l[u],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>m1(h,n,u))):m1(m,n,u)}return o.length?Promise.all(o).then(()=>n):n}});function Id(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...Cs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function vj(e){var a,l,o,u;const t=Object.keys(e.shape);for(const f of t)if(!((u=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=nD(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function bj(e,t,n,a,l,o){const u=[],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"){u.push(g);continue}const b=m.run({value:t[g],issues:[]},a);b instanceof Promise?e.push(b.then(S=>Id(S,n,g,t,y))):Id(b,n,g,t,y)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const UM=ie("$ZodObject",(e,t)=>{Tt.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=lf(()=>vj(t));ct(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const l=bu,o=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=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=u.shape;for(const b of u.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(E=>Id(E,f,b,h,k))):Id(j,f,b,h,k)}return o?bj(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),BM=ie("$ZodObjectJIT",(e,t)=>{UM.init(e,t);const n=e._zod.parse,a=lf(()=>vj(t)),l=b=>{var O;const S=new lM(["shape","payload","ctx"]),k=a.value,j=B=>{const D=f1(B);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};S.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const B of k.keys)E[B]=`key_${C++}`;S.write("const newResult = {};");for(const B of k.keys){const D=E[B],R=f1(B),P=b[B],Z=((O=P==null?void 0:P._zod)==null?void 0:O.optout)==="optional";S.write(`const ${D} = ${j(B)};`),Z?S.write(`
307
- if (${D}.issues.length) {
308
- if (${R} in input) {
309
- payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
310
- ...iss,
311
- path: iss.path ? [${R}, ...iss.path] : [${R}]
312
- })));
313
- }
314
- }
315
-
316
- if (${D}.value === undefined) {
317
- if (${R} in input) {
318
- newResult[${R}] = undefined;
319
- }
320
- } else {
321
- newResult[${R}] = ${D}.value;
322
- }
323
-
324
- `):S.write(`
325
- if (${D}.issues.length) {
326
- payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
327
- ...iss,
328
- path: iss.path ? [${R}, ...iss.path] : [${R}]
329
- })));
330
- }
331
-
332
- if (${D}.value === undefined) {
333
- if (${R} in input) {
334
- newResult[${R}] = undefined;
335
- }
336
- } else {
337
- newResult[${R}] = ${D}.value;
338
- }
339
-
340
- `)}S.write("payload.value = newResult;"),S.write("return payload;");const T=S.compile();return(B,D)=>T(b,B,D)};let o;const u=bu,f=!nj.jitless,h=f&&eD.value,y=t.catchall;let g;e._zod.parse=(b,S)=>{g??(g=a.value);const k=b.value;return u(k)?f&&h&&(S==null?void 0:S.async)===!1&&S.jitless!==!0?(o||(o=l(t.shape)),b=o(b,S),y?bj([],k,b,S,g,e):b):n(b,S):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function p1(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=>!js(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(u=>Ai(u,a,_i())))}),t)}const xj=ie("$ZodUnion",(e,t)=>{Tt.init(e,t),ct(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),ct(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),ct(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),ct(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=>Zg(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 u=!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),u=!0;else{if(h.issues.length===0)return h;f.push(h)}}return u?Promise.all(f).then(m=>p1(m,l,e,o)):p1(f,l,e,o)}}),PM=ie("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xj.init(e,t);const n=e._zod.parse;ct(e._zod,"propValues",()=>{const l={};for(const o of t.options){const u=o._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(u)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=lf(()=>{var u;const l=t.options,o=new Map;for(const f of l){const m=(u=f._zod.propValues)==null?void 0:u[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 u=l.value;if(!bu(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=a.value.get(u==null?void 0:u[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:u,path:[t.discriminator],inst:e}),l)}}),$M=ie("$ZodIntersection",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),u=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||u instanceof Promise?Promise.all([o,u]).then(([m,h])=>g1(n,m,h)):g1(n,o,u)}});function Wp(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(qs(e)&&qs(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 u=Wp(e[o],t[o]);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};l[o]=u.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],u=Wp(l,o);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function g1(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}),js(e))return e;const u=Wp(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const FM=ie("$ZodRecord",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!qs(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const h of u)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(...Cs(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...Cs(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"&&fj.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=>Ai(g,a,_i())),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(...Cs(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...Cs(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),qM=ie("$ZodEnum",(e,t)=>{Tt.init(e,t);const n=rj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>tD.has(typeof l)).map(l=>typeof l=="string"?Hs(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return a.has(u)||l.issues.push({code:"invalid_value",values:n,input:u,inst:e}),l}}),HM=ie("$ZodLiteral",(e,t)=>{if(Tt.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"?Hs(a):a?Hs(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}}),ZM=ie("$ZodTransform",(e,t)=>{Tt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new tj(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(n.value=u,n));if(l instanceof Promise)throw new As;return n.value=l,n}});function y1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Sj=ie("$ZodOptional",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ct(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zg(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=>y1(o,n.value)):y1(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),VM=ie("$ZodExactOptional",(e,t)=>{Sj.init(e,t),ct(e._zod,"values",()=>t.innerType._zod.values),ct(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),QM=ie("$ZodNullable",(e,t)=>{Tt.init(e,t),ct(e._zod,"optin",()=>t.innerType._zod.optin),ct(e._zod,"optout",()=>t.innerType._zod.optout),ct(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zg(n.source)}|null)$`):void 0}),ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),GM=ie("$ZodDefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",ct(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=>v1(o,t)):v1(l,t)}});function v1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const KM=ie("$ZodPrefault",(e,t)=>{Tt.init(e,t),e._zod.optin="optional",ct(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))}),YM=ie("$ZodNonOptional",(e,t)=>{Tt.init(e,t),ct(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=>b1(o,e)):b1(l,e)}});function b1(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 XM=ie("$ZodCatch",(e,t)=>{Tt.init(e,t),ct(e._zod,"optin",()=>t.innerType._zod.optin),ct(e._zod,"optout",()=>t.innerType._zod.optout),ct(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(u=>Ai(u,a,_i()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ai(o,a,_i()))},input:n.value}),n.issues=[]),n)}}),JM=ie("$ZodPipe",(e,t)=>{Tt.init(e,t),ct(e._zod,"values",()=>t.in._zod.values),ct(e._zod,"optin",()=>t.in._zod.optin),ct(e._zod,"optout",()=>t.out._zod.optout),ct(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(u=>md(u,t.in,a)):md(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>md(o,t.out,a)):md(l,t.out,a)}});function md(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const WM=ie("$ZodReadonly",(e,t)=>{Tt.init(e,t),ct(e._zod,"propValues",()=>t.innerType._zod.propValues),ct(e._zod,"values",()=>t.innerType._zod.values),ct(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),ct(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(x1):x1(l)}});function x1(e){return e.value=Object.freeze(e.value),e}const e4=ie("$ZodCustom",(e,t)=>{Un.init(e,t),Tt.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=>S1(o,n,a,e));S1(l,n,a,e)}});function S1(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(xu(l))}}var w1;class t4{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 n4(){return new t4}(w1=globalThis).__zod_globalRegistry??(w1.__zod_globalRegistry=n4());const au=globalThis.__zod_globalRegistry;function r4(e,t){return new e({type:"string",...Ae(t)})}function a4(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ae(t)})}function k1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(t)})}function i4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(t)})}function l4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(t)})}function s4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(t)})}function o4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(t)})}function u4(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ae(t)})}function c4(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(t)})}function d4(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(t)})}function f4(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(t)})}function h4(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(t)})}function m4(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(t)})}function p4(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(t)})}function g4(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(t)})}function y4(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(t)})}function v4(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(t)})}function b4(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(t)})}function x4(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(t)})}function S4(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(t)})}function w4(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(t)})}function k4(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(t)})}function j4(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(t)})}function C4(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(t)})}function E4(e,t){return new e({type:"string",format:"date",check:"string_format",...Ae(t)})}function N4(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ae(t)})}function _4(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ae(t)})}function A4(e,t){return new e({type:"number",checks:[],...Ae(t)})}function T4(e,t){return new e({type:"number",coerce:!0,checks:[],...Ae(t)})}function R4(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(t)})}function z4(e,t){return new e({type:"boolean",...Ae(t)})}function O4(e){return new e({type:"unknown"})}function D4(e,t){return new e({type:"never",...Ae(t)})}function j1(e,t){return new mj({check:"less_than",...Ae(t),value:e,inclusive:!1})}function Ym(e,t){return new mj({check:"less_than",...Ae(t),value:e,inclusive:!0})}function C1(e,t){return new pj({check:"greater_than",...Ae(t),value:e,inclusive:!1})}function Xm(e,t){return new pj({check:"greater_than",...Ae(t),value:e,inclusive:!0})}function E1(e,t){return new GD({check:"multiple_of",...Ae(t),value:e})}function wj(e,t){return new YD({check:"max_length",...Ae(t),maximum:e})}function Ud(e,t){return new XD({check:"min_length",...Ae(t),minimum:e})}function kj(e,t){return new JD({check:"length_equals",...Ae(t),length:e})}function M4(e,t){return new WD({check:"string_format",format:"regex",...Ae(t),pattern:e})}function L4(e){return new eM({check:"string_format",format:"lowercase",...Ae(e)})}function I4(e){return new tM({check:"string_format",format:"uppercase",...Ae(e)})}function U4(e,t){return new nM({check:"string_format",format:"includes",...Ae(t),includes:e})}function B4(e,t){return new rM({check:"string_format",format:"starts_with",...Ae(t),prefix:e})}function P4(e,t){return new aM({check:"string_format",format:"ends_with",...Ae(t),suffix:e})}function Ws(e){return new iM({check:"overwrite",tx:e})}function $4(e){return Ws(t=>t.normalize(e))}function F4(){return Ws(e=>e.trim())}function q4(){return Ws(e=>e.toLowerCase())}function H4(){return Ws(e=>e.toUpperCase())}function Z4(){return Ws(e=>W3(e))}function V4(e,t,n){return new e({type:"array",element:t,...Ae(n)})}function Q4(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ae(n)})}function G4(e){const t=K4(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(xu(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(xu(l))}},e(n.value,n)));return t}function K4(e,t){const n=new Un({check:"custom",...Ae(t)});return n._zod.check=e,n}function jj(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)??au,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 Ht(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 u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)u.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,b);else{const k=u.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&&(u.ref||(u.ref=S),Ht(S,t,b),t.seen.get(S).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&Sn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function Cj(e,t){var u,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=(u=e.metadataRegistry.get(y[0]))==null?void 0:u.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 E=(j=e.external.registry.get(y[0]))==null?void 0:j.id,C=e.external.uri??(O=>O);if(E)return{ref:C(E)};const T=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=T,{defId:T,ref:`${C("__shared")}#/${g}/${T}`}}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>
341
-
342
- 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 Ej(e,t){var u,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),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(E)):Object.assign(g,E),Object.assign(g,b),h._zod.parent===S)for(const T in g)T==="$ref"||T==="allOf"||T in b||delete g[T];if(E.$ref&&j.def)for(const T in g)T==="$ref"||T==="allOf"||T in j.def&&JSON.stringify(g[T])===JSON.stringify(j.def[T])&&delete g[T]}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 E in g)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(g[E])===JSON.stringify(j.def[E])&&delete g[E]}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,(u=e.external)!=null&&u.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:Bd(t,"input",e.processors),output:Bd(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Sn(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 Sn(a.element,n);if(a.type==="set")return Sn(a.valueType,n);if(a.type==="lazy")return Sn(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 Sn(a.innerType,n);if(a.type==="intersection")return Sn(a.left,n)||Sn(a.right,n);if(a.type==="record"||a.type==="map")return Sn(a.keyType,n)||Sn(a.valueType,n);if(a.type==="pipe")return Sn(a.in,n)||Sn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(Sn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(Sn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(Sn(l,n))return!0;return!!(a.rest&&Sn(a.rest,n))}return!1}const Y4=(e,t={})=>n=>{const a=jj({...n,processors:t});return Ht(e,a),Cj(a,e),Ej(a,e)},Bd=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},u=jj({...l??{},target:o,io:t,processors:n});return Ht(e,u),Cj(u,e),Ej(u,e)},X4={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},J4=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:u,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof u=="number"&&(l.maxLength=u),f&&(l.format=X4[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}))])}},W4=(e,t,n,a)=>{const l=n,{minimum:o,maximum:u,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 u=="number"&&(l.maximum=u,typeof h=="number"&&t.target!=="draft-04"&&(h<=u?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},e5=(e,t,n,a)=>{n.type="boolean"},t5=(e,t,n,a)=>{n.not={}},n5=(e,t,n,a)=>{},r5=(e,t,n,a)=>{const l=e._zod.def,o=rj(l.entries);o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),n.enum=o},a5=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const u of l.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(u))}else o.push(u);if(o.length!==0)if(o.length===1){const u=o[0];n.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[u]:n.const=u}else o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),o.every(u=>typeof u=="boolean")&&(n.type="boolean"),o.every(u=>u===null)&&(n.type="null"),n.enum=o},i5=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},l5=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},s5=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(l.minItems=u),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Ht(o.element,t,{...a,path:[...a.path,"items"]})},o5=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const u=o.shape;for(const y in u)l.properties[y]=Ht(u[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(u)),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=Ht(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},u5=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>Ht(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=u:n.anyOf=u},c5=(e,t,n,a)=>{const l=e._zod.def,o=Ht(l.left,t,{...a,path:[...a.path,"allOf",0]}),u=Ht(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(u)?u.allOf:[u]];n.allOf=m},d5=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const u=o.keyType,f=u._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=Ht(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=Ht(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Ht(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=u._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},f5=(e,t,n,a)=>{const l=e._zod.def,o=Ht(l.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},h5=(e,t,n,a)=>{const l=e._zod.def;Ht(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},m5=(e,t,n,a)=>{const l=e._zod.def;Ht(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},p5=(e,t,n,a)=>{const l=e._zod.def;Ht(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)))},g5=(e,t,n,a)=>{const l=e._zod.def;Ht(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let u;try{u=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},y5=(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;Ht(o,t,a);const u=t.seen.get(e);u.ref=o},v5=(e,t,n,a)=>{const l=e._zod.def;Ht(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},Nj=(e,t,n,a)=>{const l=e._zod.def;Ht(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},b5=ie("ZodISODateTime",(e,t)=>{bM.init(e,t),zt.init(e,t)});function x5(e){return C4(b5,e)}const S5=ie("ZodISODate",(e,t)=>{xM.init(e,t),zt.init(e,t)});function w5(e){return E4(S5,e)}const k5=ie("ZodISOTime",(e,t)=>{SM.init(e,t),zt.init(e,t)});function j5(e){return N4(k5,e)}const C5=ie("ZodISODuration",(e,t)=>{wM.init(e,t),zt.init(e,t)});function E5(e){return _4(C5,e)}const N5=(e,t)=>{sj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>fD(e,n)},flatten:{value:n=>dD(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Jp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Jp,2)}},isEmpty:{get(){return e.issues.length===0}}})},vr=ie("ZodError",N5,{Parent:Error}),_5=Qg(vr),A5=Gg(vr),T5=sf(vr),R5=of(vr),z5=pD(vr),O5=gD(vr),D5=yD(vr),M5=vD(vr),L5=bD(vr),I5=xD(vr),U5=SD(vr),B5=wD(vr),Rt=ie("ZodType",(e,t)=>(Tt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bd(e,"input"),output:Bd(e,"output")}}),e.toJSONSchema=Y4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(zi(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)=>Oi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>_5(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>T5(e,n,a),e.parseAsync=async(n,a)=>A5(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>R5(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>z5(e,n,a),e.decode=(n,a)=>O5(e,n,a),e.encodeAsync=async(n,a)=>D5(e,n,a),e.decodeAsync=async(n,a)=>M5(e,n,a),e.safeEncode=(n,a)=>L5(e,n,a),e.safeDecode=(n,a)=>I5(e,n,a),e.safeEncodeAsync=async(n,a)=>U5(e,n,a),e.safeDecodeAsync=async(n,a)=>B5(e,n,a),e.refine=(n,a)=>e.check(z6(n,a)),e.superRefine=n=>e.check(O6(n)),e.overwrite=n=>e.check(Ws(n)),e.optional=()=>A1(e),e.exactOptional=()=>b6(e),e.nullable=()=>T1(e),e.nullish=()=>A1(T1(e)),e.nonoptional=n=>C6(e,n),e.array=()=>Yn(e),e.or=n=>Tj([e,n]),e.and=n=>h6(e,n),e.transform=n=>R1(e,y6(n)),e.default=n=>w6(e,n),e.prefault=n=>j6(e,n),e.catch=n=>N6(e,n),e.pipe=n=>R1(e,n),e.readonly=()=>T6(e),e.describe=n=>{const a=e.clone();return au.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=au.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return au.get(e);const a=e.clone();return au.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),_j=ie("_ZodString",(e,t)=>{Kg.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>J4(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(M4(...a)),e.includes=(...a)=>e.check(U4(...a)),e.startsWith=(...a)=>e.check(B4(...a)),e.endsWith=(...a)=>e.check(P4(...a)),e.min=(...a)=>e.check(Ud(...a)),e.max=(...a)=>e.check(wj(...a)),e.length=(...a)=>e.check(kj(...a)),e.nonempty=(...a)=>e.check(Ud(1,...a)),e.lowercase=a=>e.check(L4(a)),e.uppercase=a=>e.check(I4(a)),e.trim=()=>e.check(F4()),e.normalize=(...a)=>e.check($4(...a)),e.toLowerCase=()=>e.check(q4()),e.toUpperCase=()=>e.check(H4()),e.slugify=()=>e.check(Z4())}),P5=ie("ZodString",(e,t)=>{Kg.init(e,t),_j.init(e,t),e.email=n=>e.check(a4($5,n)),e.url=n=>e.check(u4(F5,n)),e.jwt=n=>e.check(j4(r6,n)),e.emoji=n=>e.check(c4(q5,n)),e.guid=n=>e.check(k1(N1,n)),e.uuid=n=>e.check(i4(pd,n)),e.uuidv4=n=>e.check(l4(pd,n)),e.uuidv6=n=>e.check(s4(pd,n)),e.uuidv7=n=>e.check(o4(pd,n)),e.nanoid=n=>e.check(d4(H5,n)),e.guid=n=>e.check(k1(N1,n)),e.cuid=n=>e.check(f4(Z5,n)),e.cuid2=n=>e.check(h4(V5,n)),e.ulid=n=>e.check(m4(Q5,n)),e.base64=n=>e.check(S4(e6,n)),e.base64url=n=>e.check(w4(t6,n)),e.xid=n=>e.check(p4(G5,n)),e.ksuid=n=>e.check(g4(K5,n)),e.ipv4=n=>e.check(y4(Y5,n)),e.ipv6=n=>e.check(v4(X5,n)),e.cidrv4=n=>e.check(b4(J5,n)),e.cidrv6=n=>e.check(x4(W5,n)),e.e164=n=>e.check(k4(n6,n)),e.datetime=n=>e.check(x5(n)),e.date=n=>e.check(w5(n)),e.time=n=>e.check(j5(n)),e.duration=n=>e.check(E5(n))});function z(e){return r4(P5,e)}const zt=ie("ZodStringFormat",(e,t)=>{_t.init(e,t),_j.init(e,t)}),$5=ie("ZodEmail",(e,t)=>{cM.init(e,t),zt.init(e,t)}),N1=ie("ZodGUID",(e,t)=>{oM.init(e,t),zt.init(e,t)}),pd=ie("ZodUUID",(e,t)=>{uM.init(e,t),zt.init(e,t)}),F5=ie("ZodURL",(e,t)=>{dM.init(e,t),zt.init(e,t)}),q5=ie("ZodEmoji",(e,t)=>{fM.init(e,t),zt.init(e,t)}),H5=ie("ZodNanoID",(e,t)=>{hM.init(e,t),zt.init(e,t)}),Z5=ie("ZodCUID",(e,t)=>{mM.init(e,t),zt.init(e,t)}),V5=ie("ZodCUID2",(e,t)=>{pM.init(e,t),zt.init(e,t)}),Q5=ie("ZodULID",(e,t)=>{gM.init(e,t),zt.init(e,t)}),G5=ie("ZodXID",(e,t)=>{yM.init(e,t),zt.init(e,t)}),K5=ie("ZodKSUID",(e,t)=>{vM.init(e,t),zt.init(e,t)}),Y5=ie("ZodIPv4",(e,t)=>{kM.init(e,t),zt.init(e,t)}),X5=ie("ZodIPv6",(e,t)=>{jM.init(e,t),zt.init(e,t)}),J5=ie("ZodCIDRv4",(e,t)=>{CM.init(e,t),zt.init(e,t)}),W5=ie("ZodCIDRv6",(e,t)=>{EM.init(e,t),zt.init(e,t)}),e6=ie("ZodBase64",(e,t)=>{NM.init(e,t),zt.init(e,t)}),t6=ie("ZodBase64URL",(e,t)=>{AM.init(e,t),zt.init(e,t)}),n6=ie("ZodE164",(e,t)=>{TM.init(e,t),zt.init(e,t)}),r6=ie("ZodJWT",(e,t)=>{zM.init(e,t),zt.init(e,t)}),Yg=ie("ZodNumber",(e,t)=>{yj.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>W4(e,a,l),e.gt=(a,l)=>e.check(C1(a,l)),e.gte=(a,l)=>e.check(Xm(a,l)),e.min=(a,l)=>e.check(Xm(a,l)),e.lt=(a,l)=>e.check(j1(a,l)),e.lte=(a,l)=>e.check(Ym(a,l)),e.max=(a,l)=>e.check(Ym(a,l)),e.int=a=>e.check(_1(a)),e.safe=a=>e.check(_1(a)),e.positive=a=>e.check(C1(0,a)),e.nonnegative=a=>e.check(Xm(0,a)),e.negative=a=>e.check(j1(0,a)),e.nonpositive=a=>e.check(Ym(0,a)),e.multipleOf=(a,l)=>e.check(E1(a,l)),e.step=(a,l)=>e.check(E1(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 A4(Yg,e)}const a6=ie("ZodNumberFormat",(e,t)=>{OM.init(e,t),Yg.init(e,t)});function _1(e){return R4(a6,e)}const i6=ie("ZodBoolean",(e,t)=>{DM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>e5(e,n,a)});function Mu(e){return z4(i6,e)}const l6=ie("ZodUnknown",(e,t)=>{MM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>n5()});function kt(){return O4(l6)}const s6=ie("ZodNever",(e,t)=>{LM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>t5(e,n,a)});function o6(e){return D4(s6,e)}const u6=ie("ZodArray",(e,t)=>{IM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>s5(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(Ud(n,a)),e.nonempty=n=>e.check(Ud(1,n)),e.max=(n,a)=>e.check(wj(n,a)),e.length=(n,a)=>e.check(kj(n,a)),e.unwrap=()=>e.element});function Yn(e,t){return V4(u6,e,t)}const c6=ie("ZodObject",(e,t)=>{BM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>o5(e,n,a,l),ct(e,"shape",()=>t.shape),e.keyof=()=>et(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:kt()}),e.loose=()=>e.clone({...e._zod.def,catchall:kt()}),e.strict=()=>e.clone({...e._zod.def,catchall:o6()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>lD(e,n),e.safeExtend=n=>sD(e,n),e.merge=n=>oD(e,n),e.pick=n=>aD(e,n),e.omit=n=>iD(e,n),e.partial=(...n)=>uD(zj,e,n[0]),e.required=(...n)=>cD(Oj,e,n[0])});function pe(e,t){const n={type:"object",shape:e??{},...Ae(t)};return new c6(n)}const Aj=ie("ZodUnion",(e,t)=>{xj.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>u5(e,n,a,l),e.options=t.options});function Tj(e,t){return new Aj({type:"union",options:e,...Ae(t)})}const d6=ie("ZodDiscriminatedUnion",(e,t)=>{Aj.init(e,t),PM.init(e,t)});function Rj(e,t,n){return new d6({type:"union",options:t,discriminator:e,...Ae(n)})}const f6=ie("ZodIntersection",(e,t)=>{$M.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>c5(e,n,a,l)});function h6(e,t){return new f6({type:"intersection",left:e,right:t})}const m6=ie("ZodRecord",(e,t)=>{FM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>d5(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Zt(e,t,n){return new m6({type:"record",keyType:e,valueType:t,...Ae(n)})}const eg=ie("ZodEnum",(e,t)=>{qM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>r5(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 u of a)if(n.has(u))o[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new eg({...t,checks:[],...Ae(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const u of a)if(n.has(u))delete o[u];else throw new Error(`Key ${u} not found in enum`);return new eg({...t,checks:[],...Ae(l),entries:o})}});function et(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new eg({type:"enum",entries:n,...Ae(t)})}const p6=ie("ZodLiteral",(e,t)=>{HM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>a5(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 jn(e,t){return new p6({type:"literal",values:Array.isArray(e)?e:[e],...Ae(t)})}const g6=ie("ZodTransform",(e,t)=>{ZM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>l5(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new tj(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(xu(o,n.value,t));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(xu(u))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function y6(e){return new g6({type:"transform",transform:e})}const zj=ie("ZodOptional",(e,t)=>{Sj.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Nj(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function A1(e){return new zj({type:"optional",innerType:e})}const v6=ie("ZodExactOptional",(e,t)=>{VM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Nj(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function b6(e){return new v6({type:"optional",innerType:e})}const x6=ie("ZodNullable",(e,t)=>{QM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>f5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function T1(e){return new x6({type:"nullable",innerType:e})}const S6=ie("ZodDefault",(e,t)=>{GM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>m5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function w6(e,t){return new S6({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ij(t)}})}const k6=ie("ZodPrefault",(e,t)=>{KM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>p5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function j6(e,t){return new k6({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ij(t)}})}const Oj=ie("ZodNonOptional",(e,t)=>{YM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>h5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function C6(e,t){return new Oj({type:"nonoptional",innerType:e,...Ae(t)})}const E6=ie("ZodCatch",(e,t)=>{XM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>g5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function N6(e,t){return new E6({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const _6=ie("ZodPipe",(e,t)=>{JM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>y5(e,n,a,l),e.in=t.in,e.out=t.out});function R1(e,t){return new _6({type:"pipe",in:e,out:t})}const A6=ie("ZodReadonly",(e,t)=>{WM.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>v5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function T6(e){return new A6({type:"readonly",innerType:e})}const R6=ie("ZodCustom",(e,t)=>{e4.init(e,t),Rt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>i5(e,n)});function z6(e,t={}){return Q4(R6,e,t)}function O6(e){return G4(e)}const Jm={custom:"custom"};function cf(e){return T4(Yg,e)}const D6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},Dj=et(["feishu","slack","kael"]),Mj=et(["active","inactive"]);pe({platform:Dj,agentId:z().min(1),credentials:Zt(z(),kt()),status:Mj.default("active")});pe({agentId:z().min(1).optional(),credentials:Zt(z(),kt()).optional(),status:Mj.optional()});pe({id:Ge(),platform:z(),agentId:z(),hasCredentials:Mu(),status:z(),createdAt:z(),updatedAt:z()});const M6=et(["code","reverse_token","oauth","manual"]);pe({appId:z().min(1),appSecret:z().min(1)});pe({platform:Dj,externalUserId:z().min(1),agentId:z().min(1),boundVia:M6.default("manual"),displayName:z().max(200).optional()});pe({id:Ge(),platform:z(),externalUserId:z(),agentId:z(),boundVia:z().nullable(),displayName:z().nullable(),createdAt:z()});pe({feishuUserId:z().min(1),displayName:z().max(200).optional()});pe({configId:Ge(),platform:z(),agentId:z(),appId:z(),connected:Mu(),lastActiveAt:z().nullable()});const Lj=et(["online","offline"]),Ij=et(["idle","working","blocked","error"]);et(["active","suspended","evicted"]);const L6=et(["active","suspended"]);pe({chatId:z().min(1),state:L6});pe({runtimeState:Ij});pe({agentId:z().min(1),runtimeType:z().max(50),runtimeVersion:z().max(50).optional()});et(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);pe({agentId:z(),status:Lj,connectedAt:z().nullable(),lastSeenAt:z(),clientId:z().nullable().optional(),runtimeType:z().nullable().optional(),runtimeVersion:z().nullable().optional(),runtimeState:Ij.nullable().optional(),activeSessions:Ge().int().nullable().optional(),totalSessions:Ge().int().nullable().optional(),runtimeUpdatedAt:z().nullable().optional()});pe({total:Ge().int(),running:Ge().int(),byState:pe({idle:Ge().int(),working:Ge().int(),blocked:Ge().int(),error:Ge().int()}),clients:Ge().int()});const I6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},df=et(["human","personal_assistant","autonomous_agent"]),z1={PRIVATE:"private",ORGANIZATION:"organization"},Xg=et(["private","organization"]),U6=et(["admin-api","portal"]);et(["active","suspended"]);const tg=/^[a-z0-9][a-z0-9_-]{0,63}$/,Es=64,B6=["admin","agent","first-tree","hub","me","null","system","undefined"],P6=new Set(B6);function ng(e){return P6.has(e)}pe({name:z().min(1).max(64).regex(tg,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!ng(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:df,displayName:z().max(200).optional(),delegateMention:z().max(100).optional(),organizationId:z().max(100).optional(),source:U6.optional(),visibility:Xg.optional(),metadata:Zt(z(),kt()).optional(),managerId:z().optional(),clientId:z().min(1).max(100).optional()});pe({type:df.optional(),displayName:z().max(200).nullable().optional(),delegateMention:z().max(100).nullable().optional(),visibility:Xg.optional(),metadata:Zt(z(),kt()).optional(),managerId:z().nullable().optional(),clientId:z().min(1).max(100).nullable().optional()});pe({uuid:z(),name:z().nullable(),organizationId:z(),type:df,displayName:z().nullable(),delegateMention:z().nullable(),inboxId:z(),status:z(),source:z().nullable().optional(),visibility:Xg,metadata:Zt(z(),kt()),managerId:z().nullable(),clientId:z().nullable(),presenceStatus:Lj.optional(),createdAt:z(),updatedAt:z()});pe({repo:z().nullable(),branch:z().nullable()});pe({type:jn("agent:pinned"),agentId:z(),name:z().nullable(),displayName:z().nullable(),agentType:df});const $6=32e3,Jg=/^[a-z0-9][a-z0-9_-]{0,63}$/i,F6=/^[A-Z][A-Z0-9_]*$/,q6=pe({append:z().max($6).default("")}),H6=pe({name:z().regex(Jg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:jn("stdio"),command:z().min(1),args:Yn(z()).optional()}),Z6=pe({name:z().regex(Jg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:jn("http"),url:z().url(),headers:Zt(z(),z()).optional()}),V6=pe({name:z().regex(Jg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:jn("sse"),url:z().url(),headers:Zt(z(),z()).optional()}),Q6=Rj("transport",[H6,Z6,V6]),G6=pe({key:z().regex(F6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:z(),sensitive:Mu().default(!1)}),K6=pe({url:z().min(1),ref:z().min(1).optional(),localPath:z().min(1).optional()}),Wg=pe({prompt:q6.default({append:""}),model:z().default("opus"),mcpServers:Yn(Q6).default([]),env:Yn(G6).default([]),gitRepos:Yn(K6).default([])}),Y6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:Jm.custom,path:["mcpServers",u,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,u)=>{a.has(o.key)&&t.addIssue({code:Jm.custom,path:["env",u,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,u)=>{const f=o.localPath??$d(o.url);f&&(l.has(f)&&t.addIssue({code:Jm.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},Uj=Wg.superRefine(Y6),X6=pe({agentId:z(),version:Ge().int().positive(),payload:Uj,updatedAt:z(),updatedBy:z()});pe({expectedVersion:Ge().int().positive(),payload:Wg.partial()});pe({payload:Wg.partial()});pe({current:X6,next:Uj,diff:Yn(pe({path:z(),op:et(["add","remove","replace"]),before:kt().optional(),after:kt().optional()}))});const Pd="***";function $d(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}pe({username:z().min(1),password:z().min(1)});pe({accessToken:z(),refreshToken:z()});pe({refreshToken:z().min(1)});pe({token:z().min(1)});pe({token:z(),expiresIn:Ge(),command:z()});const J6=et(["direct","group","thread"]);pe({type:J6,topic:z().max(500).optional(),participantIds:Yn(z()).min(1),metadata:Zt(z(),kt()).optional()});const Bj=pe({agentId:z(),role:z(),mode:z(),joinedAt:z()});Bj.extend({name:z().nullable(),displayName:z().nullable(),type:z()});const W6=pe({id:z(),organizationId:z(),type:z(),topic:z().nullable(),lifecyclePolicy:z().nullable().optional(),metadata:Zt(z(),kt()),createdAt:z(),updatedAt:z()});W6.extend({participants:Yn(Bj)});pe({topic:z().trim().max(500).nullable()});pe({agentId:z().min(1),mode:et(["full","mention_only"]).default("full")});pe({agentId:z().min(1)});const eL=et(["connected","disconnected"]);pe({id:z(),userId:z().nullable(),status:eL,sdkVersion:z().max(50).nullable(),hostname:z().max(100).nullable(),os:z().max(50).nullable(),agentCount:Ge().int().min(0),connectedAt:z().nullable(),lastSeenAt:z(),metadata:Zt(z(),kt()).nullable()});pe({clientId:z().min(1).max(100),hostname:z().max(100).optional(),os:z().max(50).optional(),sdkVersion:z().max(50).optional()});pe({limit:cf().int().min(1).max(100).default(20),cursor:z().optional()});const tL=["image/png","image/jpeg","image/gif","image/webp"],ey=et(tL);pe({data:z().min(1),mimeType:ey,filename:z().min(1),size:Ge().int().nonnegative().optional(),imageId:z().uuid().optional()});pe({imageId:z().uuid(),mimeType:ey,filename:z().min(1),size:Ge().int().nonnegative().optional()});pe({type:jn("image_payload"),imageId:z().uuid(),chatId:z(),base64:z().min(1),mimeType:ey,filename:z().min(1),size:Ge().int().nonnegative().optional()});const ty=et(["hub_ui","cli","feishu","github","api"]),Pj=et(["text","markdown","card","reference","file","task"]);pe({format:Pj.default("text"),content:kt(),metadata:Zt(z(),kt()).optional(),inReplyTo:z().optional(),replyToInbox:z().optional(),replyToChat:z().optional(),source:ty.optional()});pe({format:Pj.default("text"),content:kt(),metadata:Zt(z(),kt()).optional(),replyToInbox:z().optional(),replyToChat:z().optional(),source:ty.optional()});const nL=pe({id:z(),chatId:z(),senderId:z(),format:z(),content:kt(),metadata:Zt(z(),kt()),replyToInbox:z().nullable(),replyToChat:z().nullable(),inReplyTo:z().nullable(),source:ty.nullable(),createdAt:z()}),rL=pe({senderId:z(),chatId:z(),replyToChat:z().nullable()}).nullable(),aL=et(["full","mention_only"]),iL=nL.extend({configVersion:Ge().int().positive(),recipientMode:aL.default("full"),inReplyToSnapshot:rL.default(null)});et(["pending","delivered","acked","failed"]);const lL=pe({id:Ge(),inboxId:z(),messageId:z(),chatId:z().nullable(),status:z(),retryCount:Ge(),createdAt:z(),deliveredAt:z().nullable(),ackedAt:z().nullable()});lL.extend({message:iL});pe({limit:cf().int().min(1).max(50).default(10)});const sL={ADMIN:"admin",MEMBER:"member"},ny=et(["admin","member"]),oL=pe({id:z(),userId:z(),organizationId:z(),agentId:z(),role:ny,createdAt:z()});pe({username:z().min(1).max(100),displayName:z().min(1).max(200),role:ny.default("member")});pe({role:ny.optional(),displayName:z().min(1).max(200).optional()});oL.extend({username:z(),displayName:z(),password:z()});const uL=et(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),$j=et(["high","medium","low"]);pe({id:z(),organizationId:z(),type:uL,severity:$j,agentId:z().nullable(),chatId:z().nullable(),message:z(),read:Mu(),createdAt:z()});pe({limit:cf().int().min(1).max(100).default(20),cursor:z().optional(),severity:$j.optional(),read:et(["true","false"]).transform(e=>e==="true").optional(),agentId:z().optional()});const Fj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;pe({name:z().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=>!Fj.test(e),"Name must not be a UUID format"),displayName:z().min(1).max(200),maxAgents:Ge().int().min(0).default(0),maxMessagesPerMinute:Ge().int().min(0).default(0),features:Zt(z(),kt()).default({})});pe({name:z().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=>!Fj.test(e),"Name must not be a UUID format").optional(),displayName:z().min(1).max(200).optional(),maxAgents:Ge().int().min(0).optional(),maxMessagesPerMinute:Ge().int().min(0).optional(),features:Zt(z(),kt()).optional()});pe({id:z(),name:z(),displayName:z(),maxAgents:Ge(),maxMessagesPerMinute:Ge(),features:Zt(z(),kt()),createdAt:z(),updatedAt:z()});const cL=pe({workingCount:Ge().int().nonnegative(),errorMask:Mu()}),dL=pe({type:jn("pulse:tick"),organizationId:z(),agents:Zt(z(),Yn(cL).length(32))}),fL=et(["tool_call","error","assistant_text","thinking","turn_end"]),qj=pe({toolUseId:z(),name:z(),args:kt(),status:et(["pending","ok","error"]),durationMs:Ge().int().nonnegative().optional(),resultPreview:z().max(400).optional()}),Hj=pe({source:et(["sdk","runtime","tool"]),message:z().max(2e3)}),Zj=pe({text:z().max(8e3)}),Vj=pe({}),Qj=pe({status:et(["success","error"])}),hL=Rj("kind",[pe({kind:jn("tool_call"),payload:qj}),pe({kind:jn("error"),payload:Hj}),pe({kind:jn("assistant_text"),payload:Zj}),pe({kind:jn("thinking"),payload:Vj}),pe({kind:jn("turn_end"),payload:Qj})]);pe({id:z(),agentId:z(),chatId:z(),seq:Ge().int().positive(),kind:fL,payload:Tj([qj,Hj,Zj,Vj,Qj]),createdAt:z()});pe({agentId:z(),chatId:z(),event:hL});pe({agentId:z(),chatId:z()});pe({type:jn("session:reconcile"),agentId:z().min(1),chatIds:Yn(z().min(1)).max(500)});pe({type:jn("session:reconcile:result"),agentId:z().min(1),staleChatIds:Yn(z().min(1))});const mL=pe({organizationId:z(),agentCount:Ge(),chatCount:Ge(),messageCount:Ge()});pe({totalAgents:Ge(),totalChats:Ge(),totalMessages:Ge(),byOrganization:Yn(mL)});pe({key:z(),value:kt(),updatedAt:z()});Zt(z(),kt());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"},Ad={[ki.INBOX_TIMEOUT_SECONDS]:300,[ki.MAX_RETRY_COUNT]:3,[ki.POLLING_INTERVAL_SECONDS]:5,[ki.PRESENCE_CLEANUP_SECONDS]:60},Su=et(["pending","assigned","working","completed","failed","cancelled"]),O1=et(["agent","admin"]),pL=et(["assigned","status_changed","cancelled"]);pe({taskId:z(),event:pL,title:z(),body:z().default(""),status:Su,fromStatus:Su.optional(),originRef:z().nullable().optional()});const gL=pe({title:z().min(1).max(500),body:z().optional(),assigneeAgentId:z().optional(),originRef:z().max(500).optional(),metadata:Zt(z(),kt()).optional()});gL.extend({organizationId:z().optional()});pe({status:et(["working","completed","failed"]),result:z().optional()});pe({assigneeAgentId:z().nullable().optional(),status:Su.optional(),result:z().optional()});pe({chatId:z().min(1)});const yL=pe({id:z(),organizationId:z(),title:z(),body:z(),status:Su,assigneeAgentId:z().nullable(),createdByType:O1,createdById:z(),originRef:z().nullable(),result:z().nullable(),metadata:Zt(z(),kt()),createdAt:z(),updatedAt:z(),cancelledAt:z().nullable(),cancelledByType:O1.nullable(),cancelledById:z().nullable()}),vL=pe({taskId:z(),chatId:z(),linkedByAgentId:z().nullable(),linkedAt:z()});yL.extend({chats:Yn(vL)});pe({status:Su.optional(),assigneeAgentId:z().optional(),originRef:z().optional(),limit:cf().int().min(1).max(100).default(20),cursor:z().optional()});const bL=et(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);pe({taskId:z(),signal:bL,reason:z()});const xL=et(["active","suspended"]);pe({id:z(),username:z(),displayName:z(),avatarUrl:z().nullable(),status:xL,createdAt:z(),updatedAt:z()});pe({username:z().min(1).max(100),displayName:z().min(1).max(200),password:z().min(8).max(200)});pe({displayName:z().min(1).max(200).optional(),password:z().min(8).max(200).optional()});pe({type:jn("auth"),token:z().min(1)});pe({type:jn("server:welcome"),serverCommandVersion:z().min(1),serverTimeMs:Ge().int().nonnegative()}).passthrough();const Gj=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function SL(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 wL=2e3,kL=3e4;let hi=null,Fd=!1,Wm=0,su=null;const rg=new Set;let iu=null,Ns=0;function jL(e){for(const t of rg)try{t(e)}catch{}iu&&(e.type==="notification"?iu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(iu.invalidateQueries({queryKey:["activity"]}),iu.invalidateQueries({queryKey:["sessions"]})))}function Kj(){const e=Og();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);hi=a,a.onmessage=l=>{if(a===hi)try{const o=JSON.parse(l.data);jL(o)}catch{}},a.onopen=()=>{a===hi&&(Wm=0)},a.onclose=()=>{if(a!==hi||(hi=null,Fd||Ns===0))return;Wm++;const l=Math.min(wL*2**(Wm-1),kL);su=setTimeout(()=>{su=null,!Fd&&Ns>0&&Kj()},l)}}function CL(){Fd=!0,su&&(clearTimeout(su),su=null),hi&&(hi.close(1e3,"unmount"),hi=null)}function Yj(e){const{onMessage:t,enabled:n=!0}=e??{},a=Jn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{iu=a},[a]),x.useEffect(()=>{if(!n)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return rg.add(o),Ns++,Ns===1&&(Fd=!1,Kj()),()=>{rg.delete(o),Ns--,Ns===0&&CL()}},[n])}const Xj=x.createContext({aggregated:Gj,agents:{},receivedAtMs:null,stale:!0});function EL({children:e}){const[t,n]=x.useState({aggregated:Gj,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());Yj({onMessage:u=>{const f=dL.safeParse(u);f.success&&n({aggregated:SL(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const u=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(u)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return d.jsx(Xj.Provider,{value:o,children:e})}function NL(){return x.useContext(Xj)}function ff({title:e,subtitle:t,right:n,className:a,style:l,...o}){return d.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:[d.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),d.jsx("div",{style:{flex:1}}),n]})}function Jj({className:e,style:t,...n}){return d.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 Wj({active:e,onClick:t,children:n}){return d.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 _L={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 Xt({tone:e="neutral",className:t,style:n,...a}){const l=_L[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return d.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 Ea=x.forwardRef(({className:e,...t},n)=>d.jsx("table",{ref:n,className:_e("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));Ea.displayName="DenseTable";const Na=x.forwardRef(({className:e,...t},n)=>d.jsx("thead",{ref:n,className:e,...t}));Na.displayName="DenseTableHeader";const _a=x.forwardRef(({className:e,...t},n)=>d.jsx("tbody",{ref:n,className:e,...t}));_a.displayName="DenseTableBody";const Yt=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>d.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}));Yt.displayName="DenseTableRow";const ze=x.forwardRef(({className:e,style:t,...n},a)=>d.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}));ze.displayName="DenseTableHead";const Ne=x.forwardRef(({className:e,style:t,...n},a)=>d.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}));Ne.displayName="DenseTableCell";const Zr=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},...t}));Zr.displayName="Panel";const eC=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,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}));eC.displayName="PanelHeader";const tC=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)"},...t}));tC.displayName="PanelTitle";const AL=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e(e),style:{padding:"var(--sp-3) var(--sp-3_5)"},...t}));AL.displayName="PanelBody";function Zs({children:e,right:t,className:n,style:a,...l}){return d.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:[d.jsx("span",{children:e}),t]})}function hf({className:e,style:t,...n}){return d.jsx("span",{className:_e("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function ry(){return Le.get("/members")}function TL(e){return Le.post("/members",e)}function RL(e,t){return Le.patch(`/members/${encodeURIComponent(e)}`,t)}function zL(e){return Le.delete(`/members/${encodeURIComponent(e)}`)}function ay(){const{data:e}=Ve({queryKey:["members","name-map"],queryFn:ry,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 OL(){const e=Vr(),t=ay(),{data:n,isLoading:a,error:l}=Ve({queryKey:["admin-all-agents"],queryFn:()=>M3({limit:100})});return d.jsxs("div",{children:[d.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."}),d.jsxs(Zr,{children:[d.jsxs(Zs,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?d.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?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Yt,{children:[d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Agent name"}),d.jsx(ze,{children:"Type"}),d.jsx(ze,{children:"Visibility"}),d.jsx(ze,{children:"Owner"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Created"})]})}),d.jsx(_a,{children:n.items.map(o=>d.jsxs(Yt,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[d.jsx(Ne,{children:d.jsx("span",{className:"font-medium",children:o.displayName??d.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})})}),d.jsx(Ne,{children:o.name?d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",o.name]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:o.uuid.slice(0,8)})}),d.jsx(Ne,{children:d.jsx(Xt,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),d.jsx(Ne,{children:d.jsx(Xt,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),d.jsx(Ne,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),d.jsx(Ne,{children:d.jsx(Xt,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(o.createdAt)})]},o.uuid))})]})]})]})}const D1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,M1=Iw,DL=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return M1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,u=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=D1(y)||D1(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,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,b]:h},[]);return M1(e,u,m,n==null?void 0:n.class,n==null?void 0:n.className)},ML=DL("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"}}),xe=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const u=a?u3:"button";return d.jsx(u,{className:_e(ML({variant:t,size:n,className:e})),ref:o,...l})});xe.displayName="Button";const bt=x.forwardRef(({className:e,type:t,...n},a)=>d.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}));bt.displayName="Input";var LL="Label",nC=x.forwardRef((e,t)=>d.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())}}));nC.displayName=LL;var IL=nC;const rt=x.forwardRef(({className:e,...t},n)=>d.jsx(IL,{ref:n,className:_e("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));rt.displayName="Label";const rC=Object.values(sL);function UL(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 BL(){const e=Jn(),{memberId:t}=Aa(),[n,a]=x.useState(!1),[l,o]=x.useState({username:"",displayName:"",role:"member"}),[u,f]=x.useState(null),[m,h]=x.useState(null),{data:y,isLoading:g,error:b}=Ve({queryKey:["members"],queryFn:ry}),S=vt({mutationFn:()=>TL({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:T=>{e.invalidateQueries({queryKey:["members"]}),f(T.password)}}),k=vt({mutationFn:zL,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(T){T.preventDefault(),S.mutate()}function C(T){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(T)}return d.jsxs(d.Fragment,{children:[d.jsxs(Zr,{children:[d.jsxs(Zs,{right:d.jsxs(gn,{open:n,onOpenChange:T=>T?a(!0):j(),children:[d.jsx(R3,{asChild:!0,children:d.jsxs(xe,{size:"xs",className:"normal-case tracking-normal",children:[d.jsx(Sl,{className:"h-3 w-3"}),"Add member"]})}),d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:u?"Member Created":"Create Member"})}),u?d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),d.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:[d.jsx("code",{className:"flex-1 text-body mono",children:u}),d.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(u),title:"Copy password",children:d.jsx(Dg,{className:"h-4 w-4"})})]}),d.jsx(yn,{children:d.jsx(xe,{onClick:j,children:"Done"})})]}):d.jsxs("form",{onSubmit:E,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"member-username",children:"Username"}),d.jsx(bt,{id:"member-username",type:"text",value:l.username,onChange:T=>o({...l,username:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"member-name",children:"Display Name"}),d.jsx(bt,{id:"member-name",value:l.displayName,onChange:T=>o({...l,displayName:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"member-role",children:"Role"}),d.jsx("select",{id:"member-role",value:l.role,onChange:T=>o({...l,role:T.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:rC.map(T=>d.jsx("option",{value:T,children:T},T))})]}),S.error instanceof Error&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:S.error.message}),d.jsx(yn,{children:d.jsx(xe,{type:"submit",disabled:S.isPending,children:S.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(y==null?void 0:y.length)??0]}),g?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?d.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?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Yt,{children:[d.jsx(ze,{style:{width:30}}),d.jsx(ze,{children:"Username"}),d.jsx(ze,{children:"Name"}),d.jsx(ze,{children:"Role"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{style:{width:1}})]})}),d.jsx(_a,{children:y==null?void 0:y.map(T=>{const O=t===T.id;return d.jsxs(Yt,{children:[d.jsx(Ne,{children:d.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:O?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:O?"var(--accent-dim)":"var(--fg-2)"},children:UL(T.displayName,T.username)})}),d.jsxs(Ne,{children:[d.jsx("span",{className:"mono font-medium",children:T.username}),O&&d.jsx(hf,{style:{marginLeft:6},children:"you"})]}),d.jsx(Ne,{style:{color:"var(--fg-2)"},children:T.displayName}),d.jsx(Ne,{children:d.jsx(Xt,{tone:T.role==="admin"?"accent":"neutral",children:T.role})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(T.createdAt)}),d.jsx(Ne,{style:{whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-0.5 justify-end",children:[d.jsx(xe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:T.id,username:T.username,displayName:T.displayName,role:T.role}),title:"Edit",children:d.jsx(Jd,{className:"h-3.5 w-3.5"})}),d.jsx(xe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>C(T.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:d.jsx(pu,{className:"h-3.5 w-3.5"})})]})})]},T.id)})})]})]}),d.jsx(PL,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function PL({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,u]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),u(e.role),m(null))},[e]);const h=vt({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:RL(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 d.jsx(gn,{open:g,onOpenChange:b=>b?void 0:t(),children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:"Edit Member"})}),e&&d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{children:"Username"}),d.jsx(bt,{value:e.username,disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"edit-member-display",children:"Display Name"}),d.jsx(bt,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"edit-member-role",children:"Role"}),d.jsx("select",{id:"edit-member-role",value:o,onChange:b=>u(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:rC.map(b=>d.jsx("option",{value:b,children:b},b))}),d.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&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),d.jsxs(yn,{children:[d.jsx(xe,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),d.jsx(xe,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function $L(){return Le.get("/admin/system/config")}function FL(e){return Le.patch("/admin/system/config",e)}const aC=[{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"}],L1=aC.map(e=>e.key);function qL(){const e=Jn(),{data:t,isLoading:n}=Ve({queryKey:["system-config"],queryFn:$L}),[a,l]=x.useState({}),[o,u]=x.useState(!1);x.useEffect(()=>{if(!t)return;const y={};for(const g of L1){const b=t[g]??Ad[g]??"";y[g]=String(b)}l(y)},[t]);const f=vt({mutationFn:()=>{const y={};for(const[g,b]of Object.entries(a)){const S=b.trim();if(S==="")y[g]=Ad[g]??0;else{const k=Number(S);y[g]=Number.isNaN(k)?S:k}}return FL(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),u(!0),setTimeout(()=>u(!1),2e3)}});function m(){const y={};for(const g of L1)y[g]=String(Ad[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return d.jsx("form",{onSubmit:h,children:d.jsxs(Zr,{children:[d.jsxs(eC,{children:[d.jsx(tC,{children:"System configuration"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),d.jsx(xe,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),d.jsxs(xe,{type:"submit",size:"xs",disabled:f.isPending,children:[d.jsx(Ru,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),d.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?d.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):aC.map(y=>d.jsx(HL,{field:y,value:a[y.key]??"",onChange:g=>l({...a,[y.key]:g})},y.key)),f.error instanceof Error&&d.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})}function HL({field:e,value:t,onChange:n}){const a=String(Ad[e.key]??"—");return d.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:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),d.jsxs(hf,{style:{marginTop:4,display:"block"},children:["default"," ",d.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),d.jsxs("div",{style:{position:"relative"},children:[d.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&&d.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 I1=[{key:"members",label:"Members"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function ZL(){const{role:e}=Aa(),t=yr(),n=Vr();if(e===null)return d.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return d.jsx(_g,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=I1.some(u=>u.key===a)?a:"members",o=u=>{n({hash:u},{replace:!0})};return d.jsxs("div",{className:"-m-6",children:[d.jsx(ff,{title:"Admin",subtitle:"Organization-wide controls"}),d.jsx(Jj,{children:I1.map(u=>d.jsx(Wj,{active:l===u.key,onClick:()=>o(u.key),children:u.label},u.key))}),d.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&d.jsx(BL,{}),l==="all-agents"&&d.jsx(OL,{}),l==="settings"&&d.jsx(qL,{})]})]})}function iC(){return Le.get("/admin/adapter-mappings")}function VL(e){return Le.post("/admin/adapter-mappings",e)}function QL(e){return Le.delete(`/admin/adapter-mappings/${e}`)}function lC(){return Le.get("/admin/adapters/status")}function sC(){return Le.get("/admin/adapters")}function GL(e){return Le.post("/admin/adapters",e)}function KL(e,t){return Le.patch(`/admin/adapters/${e}`,t)}function YL(e){return Le.delete(`/admin/adapters/${e}`)}function XL(e){return Le.get(`/admin/agents/${e}/config`)}function JL(e,t){return Le.patch(`/admin/agents/${e}/config`,t)}function WL(e,t){return Le.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function eI(e){return Le.get(`/admin/agents/${e}/client-status`)}function tI({className:e,style:t,...n}){return d.jsx("div",{className:_e("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function nI({onClick:e,children:t}){return d.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 rI(){return d.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function aI({children:e,mono:t}){return d.jsx("span",{className:_e("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function bl({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?d.jsxs("span",{className:_e("shrink-0",n),style:a,role:"img","aria-label":"working",children:[d.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),d.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"?d.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:d.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?d.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"?d.jsx("span",{className:_e("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):d.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 iI(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Ti({state:e,className:t}){const n=e!==null&&iI(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return d.jsxs("span",{className:_e("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[d.jsx(bl,{state:n,size:7}),n]})}function gd({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:4},children:[d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:1},children:t})]})}function lI({runtimeLabel:e,computerLabel:t,modelLabel:n,visible:a=!0}){return a?d.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:d.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[d.jsxs("span",{children:["Runs on ",d.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),d.jsx("span",{style:{color:"var(--fg-2)"},children:t})]}),d.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{children:["model ",d.jsx("span",{style:{color:"var(--fg-2)"},children:n})]})]})}):null}function sI(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),u=t.displayName||t.name||t.uuid;return d.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:6},children:[d.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[d.jsx(hR,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),d.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),d.jsxs("div",{children:[t.status==="active"?d.jsx(ep,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:d.jsx(xe,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):d.jsx(ep,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:d.jsx(xe,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),d.jsx(ep,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:d.jsxs(xe,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[d.jsx(pu,{className:"h-3 w-3"}),"Delete"]})})]}),d.jsx(oI,{open:l,onOpenChange:o,label:u,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),d.jsx(uI,{open:n,onOpenChange:a,expected:u,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function ep(e){return d.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:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),d.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),d.jsx("div",{children:e.action})]})}function oI({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return d.jsx(gn,{open:e,onOpenChange:t,children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsxs(vn,{children:['Suspend "',n,'"?']})}),d.jsx("div",{className:"space-y-3",children:d.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."})}),d.jsxs(yn,{children:[d.jsx(xe,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(xe,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function uI({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,u]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return d.jsx(gn,{open:e,onOpenChange:m=>{t(m),m||u("")},children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsxs(vn,{children:['Delete "',n,'"?']})}),d.jsxs("form",{onSubmit:f,className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",d.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),d.jsx(bt,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),d.jsxs(yn,{children:[d.jsx(xe,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(xe,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const cI={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 iy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const u=cI[e],f=e==="deleted";return d.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:[d.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&d.jsx("span",{className:_e("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?d.jsxs(xe,{size:"sm",variant:"ghost",onClick:a,children:[d.jsx(pR,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):d.jsx(dI,{onEdit:t,onDelete:n}))]})}function dI({onEdit:e,onDelete:t}){return d.jsxs("div",{className:"flex gap-1",children:[d.jsx(xe,{size:"sm",variant:"ghost",onClick:e,title:"Edit",children:"Edit"}),d.jsxs(xe,{size:"sm",variant:"ghost",onClick:t,title:"Delete",children:[d.jsx(OT,{className:"sr-only h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})}function fI(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}),u=e.items.filter(f=>f.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["Environment Variables (",u,")"]}),!e.disabled&&d.jsxs(xe,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(Sl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.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===Pd,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||d.jsx("em",{children:"(empty)"}),d.jsxs(iy,{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:[d.jsx("span",{className:"font-mono font-medium",children:f.value.key}),d.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&d.jsx(Dw,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&d.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?d.jsx(MT,{className:"h-3.5 w-3.5"}):d.jsx(IT,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&d.jsx(hI,{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 hI({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,u]=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&&(u((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=Pd),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return d.jsx(gn,{open:e,onOpenChange:t,children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:n?"Edit environment variable":"Add environment variable"})}),d.jsxs("form",{onSubmit:S,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"env-key",children:"Key"}),d.jsx(bt,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&d.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"env-value",children:"Value"}),d.jsx(bt,{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"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-body",children:[d.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)"]}),d.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&&d.jsx("p",{className:"text-body text-destructive",children:g}),d.jsxs(yn,{children:[d.jsx(xe,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(xe,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function mI(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["Git Repositories (",a,")"]}),!e.disabled&&d.jsxs(xe,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(Sl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??$d(l.value.url);return d.jsxs(iy,{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:[d.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&d.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),d.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&d.jsx(pI,{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 pI({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,u]=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&&(u((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 E=h.trim()||$d(j);if(E&&a.has(E)){b(`Another repo already occupies local path "${E}".`);return}const C={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(C)}return d.jsx(gn,{open:e,onOpenChange:t,children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:n?"Edit Git repository":"Add Git repository"})}),d.jsxs("form",{onSubmit:S,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"git-url",children:"URL"}),d.jsx(bt,{id:"git-url",value:o,onChange:k=>u(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),d.jsx(bt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"git-path",children:"Local path (optional)"}),d.jsx(bt,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:$d(o)||"repo-name",className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&d.jsx("p",{className:"text-body text-destructive",children:g}),d.jsxs(yn,{children:[d.jsx(xe,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(xe,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function oC({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:u,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return d.jsx("span",{className:_e("mono text-label",o),style:{color:"var(--fg-4)",...u},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"?d.jsxs("span",{className:_e("inline-flex flex-col leading-tight",o),style:{gap:1,...u},title:y??void 0,children:[h&&d.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&d.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):d.jsxs("span",{className:_e("inline-flex items-baseline gap-1.5",o),style:u,title:y??void 0,children:[h&&d.jsx("span",{style:{color:g},children:t}),m&&d.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function gI({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=qg(),o=ay(),u=e.metadata,f=u==null?void 0:u.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 d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("h2",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:"Profile"}),e.status==="active"&&d.jsxs(xe,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[d.jsx(Jd,{className:"h-3 w-3"})," Edit"]})]}),d.jsxs("div",{className:"px-4 py-3 text-body space-y-1",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-semibold",children:e.displayName??d.jsx("span",{className:"text-muted-foreground italic",children:"no display name"})}),e.name&&d.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),d.jsxs("span",{className:"text-muted-foreground",children:["delegate ",d.jsx(oC,{name:g.name,displayName:g.displayName})]})]})]}),d.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[d.jsxs("span",{children:["owner ",d.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&d.jsxs("span",{children:["role ",d.jsx("span",{className:"text-foreground",children:m})]}),d.jsxs("span",{children:["type ",d.jsx(Xt,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),d.jsxs("span",{children:["visibility"," ",d.jsx(Xt,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&d.jsxs("span",{children:["domains"," ",d.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>d.jsx(Xt,{tone:"outline",children:b},b))})]})]})]}),d.jsx(yI,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function yI({agent:e,open:t,onOpenChange:n,onSave:a}){var B;const{memberId:l,role:o}=Aa(),[u,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 E=e.type==="human",C=o==="admin"||e.managerId===l,T=Ve({queryKey:["agents-for-delegate"],queryFn:async()=>(await af({limit:100})).items.filter(R=>R.type==="personal_assistant"&&R.status==="active"),enabled:t&&E});async function O(D){D.preventDefault(),j(null),S(!0);try{const R={displayName:u||null,delegateMention:m||null};y!==e.visibility&&(R.visibility=y),await a(R),n(!1)}catch(R){j(R instanceof Error?R.message:String(R))}finally{S(!1)}}return d.jsx(gn,{open:t,onOpenChange:n,children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:"Edit Identity"})}),d.jsxs("form",{onSubmit:O,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{children:"Agent name"}),d.jsx(bt,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"id-display",children:"Display Name"}),d.jsx(bt,{id:"id-display",value:u,onChange:D=>f(D.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"id-visibility",children:"Visibility"}),d.jsxs("select",{id:"id-visibility",value:y,onChange:D=>g(D.target.value),disabled:!C,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:[d.jsx("option",{value:z1.PRIVATE,children:"Private — only the manager"}),d.jsx("option",{value:z1.ORGANIZATION,children:"Organization — all members"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:C?"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."})]}),E&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"id-delegate",children:"Delegate Mention"}),d.jsxs("select",{id:"id-delegate",value:m,onChange:D=>h(D.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:[d.jsx("option",{value:"",children:"None"}),(B=T.data)==null?void 0:B.map(D=>d.jsx("option",{value:D.uuid,children:D.displayName?`${D.displayName} (@${D.name??D.uuid})`:D.name?`@${D.name}`:D.uuid},D.uuid))]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&d.jsx("p",{className:"text-body text-destructive",children:k}),d.jsxs(yn,{children:[d.jsx(xe,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),d.jsx(xe,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function vI(e){return e==="working"?"accent":e==="error"?"error":"outline"}function bI(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["MCP Servers (",a,")"]}),!e.disabled&&d.jsxs(xe,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(Sl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.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 d.jsxs(iy,{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:[d.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),d.jsx("span",{className:"font-medium font-mono",children:l.value.name}),d.jsx(Xt,{tone:vI(o),children:o}),d.jsx("span",{className:"text-caption text-muted-foreground truncate",children:xI(l.value)})]},l.key)})}),t&&d.jsx(SI,{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 xI(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 SI({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,u]=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,E]=x.useState(null);x.useEffect(()=>{e&&(u((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:""),E(null))},[e,n]);function C(T){if(T.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const B=g.trim().split(/\s+/).filter(D=>D.length>0);O={name:f,transport:"stdio",command:h.trim(),...B.length?{args:B}:{}}}else{const B=S.trim();try{new URL(B)}catch{E("URL is not valid.");return}O={name:f,transport:o,url:B}}l(O)}return d.jsx(gn,{open:e,onOpenChange:t,children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:n?"Edit MCP server":"Add MCP server"})}),d.jsxs("form",{onSubmit:C,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-transport",children:"Transport"}),d.jsxs("select",{id:"mcp-transport",value:o,onChange:T=>u(T.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:[d.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),d.jsx("option",{value:"http",children:"http"}),d.jsx("option",{value:"sse",children:"sse"})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-name",children:"Name"}),d.jsx(bt,{id:"mcp-name",value:f,onChange:T=>m(T.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-command",children:"Command"}),d.jsx(bt,{id:"mcp-command",value:h,onChange:T=>y(T.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),d.jsx(bt,{id:"mcp-args",value:g,onChange:T=>b(T.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"mcp-url",children:"URL"}),d.jsx(bt,{id:"mcp-url",value:S,onChange:T=>k(T.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&d.jsx("p",{className:"text-body text-destructive",children:j}),d.jsxs(yn,{children:[d.jsx(xe,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(xe,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const U1=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}];function wI({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const o=e!==t,u=!U1.some(f=>f.value===e)&&e!=="";return d.jsxs("section",{style:{background:"var(--bg-raised)",border:`var(--hairline) solid ${o?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["Model",o&&d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),o&&d.jsx(xe,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),d.jsxs("div",{className:"px-4 py-3 space-y-2",children:[d.jsxs("select",{value:e,onChange:f=>n(f.target.value),disabled:l,className:"flex h-9 w-full max-w-md 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:[e===""&&d.jsx("option",{value:"",children:"(unset — inherits local)"}),U1.map(f=>d.jsxs("option",{value:f.value,children:[f.label,f.hint?` — ${f.hint}`:""]},f.value)),u&&d.jsxs("option",{value:e,children:[e," — custom"]})]}),d.jsxs("p",{className:"text-caption text-muted-foreground",children:["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 ",d.jsx("code",{children:"~/.claude/settings.json"})," model preference, then the CLI default."]})]})]})}function kI(e){const{agent:t,isHuman:n}=e;return d.jsxs("div",{className:"space-y-3",children:[e.profileSlot,e.bindingsSlot,d.jsx(jI,{state:e.health.runtimeState,model:e.health.model,activeSessions:e.health.activeSessions,totalSessions:e.health.totalSessions,offlineSince:e.health.offlineSince,agentActive:t.status==="active",isHuman:n,onOpenChat:e.onOpenChat,onTest:e.onTest,testPending:e.testPending??!1})]})}function jI(e){return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["Status & health",d.jsx(Ti,{state:e.state})]}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsxs(xe,{variant:"ghost",size:"xs",onClick:e.onOpenChat,children:[d.jsx(Lg,{className:"h-3 w-3"})," Open chat"]}),!e.isHuman&&e.agentActive&&e.onTest&&d.jsxs(xe,{variant:"outline",size:"xs",onClick:e.onTest,disabled:e.testPending,children:[d.jsx(Mw,{className:"h-3 w-3"}),e.testPending?"Testing…":"Test"]})]})]}),d.jsxs("div",{className:"px-4 py-3 text-body grid gap-2",style:{gridTemplateColumns:"repeat(2, minmax(0, 1fr))"},children:[d.jsx(tp,{label:"Model",value:d.jsx("span",{className:"mono",children:e.model})}),d.jsx(tp,{label:"Sessions",value:d.jsxs("span",{className:"mono tnum",children:[d.jsx("span",{style:{color:"var(--fg-2)"},children:e.activeSessions}),d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",e.totalSessions]})," ",d.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:"active / total"})]})}),d.jsx(tp,{label:"Offline since",value:e.offlineSince?d.jsx("span",{className:"mono text-label",children:Hr(e.offlineSince)}):d.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:"— (online)"})})]})]})}function tp({label:e,value:t}){return d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-caption shrink-0",style:{color:"var(--fg-4)",minWidth:86},children:e}),d.jsx("span",{className:"min-w-0 truncate",children:t})]})}function CI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const EI=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NI=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_I={};function B1(e,t){return(_I.jsx?NI:EI).test(e)}const AI=/[ \t\n\f\r]/g;function TI(e){return typeof e=="object"?e.type==="text"?P1(e.value):!1:P1(e)}function P1(e){return e.replace(AI,"")===""}class Lu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Lu.prototype.normal={};Lu.prototype.property={};Lu.prototype.space=void 0;function uC(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Lu(n,a,t)}function ag(e){return e.toLowerCase()}class Bn{constructor(t,n){this.attribute=n,this.property=t}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let RI=0;const Ze=El(),qt=El(),ig=El(),ge=El(),wt=El(),Ts=El(),Gn=El();function El(){return 2**++RI}const lg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:qt,commaOrSpaceSeparated:Gn,commaSeparated:Ts,number:ge,overloadedBoolean:ig,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),np=Object.keys(lg);class ly extends Bn{constructor(t,n,a,l){let o=-1;if(super(t,n),$1(this,"space",l),typeof a=="number")for(;++o<np.length;){const u=np[o];$1(this,np[o],(a&lg[u])===lg[u])}}}ly.prototype.defined=!0;function $1(e,t,n){n&&(e[t]=n)}function eo(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new ly(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[ag(a)]=a,n[ag(o.attribute)]=a}return new Lu(t,n,e.space)}const cC=eo({properties:{ariaActiveDescendant:null,ariaAtomic:qt,ariaAutoComplete:null,ariaBusy:qt,ariaChecked:qt,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:qt,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:qt,ariaFlowTo:wt,ariaGrabbed:qt,ariaHasPopup:null,ariaHidden:qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:ge,ariaLive:null,ariaModal:qt,ariaMultiLine:qt,ariaMultiSelectable:qt,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:qt,ariaReadOnly:qt,ariaRelevant:null,ariaRequired:qt,ariaRoleDescription:wt,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:qt,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function dC(e,t){return t in e?e[t]:t}function fC(e,t){return dC(e,t.toLowerCase())}const zI=eo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ts,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Ze,allowPaymentRequest:Ze,allowUserMedia:Ze,alt:null,as:null,async:Ze,autoCapitalize:null,autoComplete:wt,autoFocus:Ze,autoPlay:Ze,blocking:wt,capture:null,charSet:null,checked:Ze,cite:null,className:wt,cols:ge,colSpan:null,content:null,contentEditable:qt,controls:Ze,controlsList:wt,coords:ge|Ts,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ze,defer:Ze,dir:null,dirName:null,disabled:Ze,download:ig,draggable:qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ze,formTarget:null,headers:wt,height:ge,hidden:ig,high:ge,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Ze,inputMode:null,integrity:null,is:null,isMap:Ze,itemId:null,itemProp:wt,itemRef:wt,itemScope:Ze,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ze,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:Ze,muted:Ze,name:null,nonce:null,noModule:Ze,noValidate:Ze,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:Ze,optimum:ge,pattern:null,ping:wt,placeholder:null,playsInline:Ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ze,referrerPolicy:null,rel:wt,required:Ze,reversed:Ze,rows:ge,rowSpan:ge,sandbox:wt,scope:null,scoped:Ze,seamless:Ze,selected:Ze,shadowRootClonable:Ze,shadowRootDelegatesFocus:Ze,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:Ze,useMap:null,value:qt,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ze,declare:Ze,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:Ze,noHref:Ze,noShade:Ze,noWrap:Ze,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:qt,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ze,disableRemotePlayback:Ze,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:fC}),OI=eo({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:Gn,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:wt,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:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:Ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,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:Ts,g2:Ts,glyphName:Ts,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:Gn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,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:ge,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:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gn,rev:Gn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gn,requiredFeatures:Gn,requiredFonts:Gn,requiredFormats:Gn,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:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:Gn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gn,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dC}),hC=eo({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()}}),mC=eo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fC}),pC=eo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),DI={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"},MI=/[A-Z]/g,F1=/-[a-z]/g,LI=/^data[-\w.:]+$/i;function II(e,t){const n=ag(t);let a=t,l=Bn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&LI.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(F1,BI);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!F1.test(o)){let u=o.replace(MI,UI);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=ly}return new l(a,t)}function UI(e){return"-"+e.toLowerCase()}function BI(e){return e.charAt(1).toUpperCase()}const PI=uC([cC,zI,hC,mC,pC],"html"),sy=uC([cC,OI,hC,mC,pC],"svg");function $I(e){return e.join(" ").trim()}var vs={},rp,q1;function FI(){if(q1)return rp;q1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
343
- `,h="/",y="*",g="",b="comment",S="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var T=1,O=1;function B(me){var te=me.match(t);te&&(T+=te.length);var q=me.lastIndexOf(m);O=~q?me.length-q:O+me.length}function D(){var me={line:T,column:O};return function(te){return te.position=new R(me),re(),te}}function R(me){this.start=me,this.end={line:T,column:O},this.source=C.source}R.prototype.content=E;function P(me){var te=new Error(C.source+":"+T+":"+O+": "+me);if(te.reason=me,te.filename=C.source,te.line=T,te.column=O,te.source=E,!C.silent)throw te}function Z(me){var te=me.exec(E);if(te){var q=te[0];return B(q),E=E.slice(q.length),te}}function re(){Z(n)}function F(me){var te;for(me=me||[];te=de();)te!==!1&&me.push(te);return me}function de(){var me=D();if(!(h!=E.charAt(0)||y!=E.charAt(1))){for(var te=2;g!=E.charAt(te)&&(y!=E.charAt(te)||h!=E.charAt(te+1));)++te;if(te+=2,g===E.charAt(te-1))return P("End of comment missing");var q=E.slice(2,te-2);return O+=2,B(q),E=E.slice(te),O+=2,me({type:b,comment:q})}}function W(){var me=D(),te=Z(a);if(te){if(de(),!Z(l))return P("property missing ':'");var q=Z(o),oe=me({type:S,property:j(te[0].replace(e,g)),value:q?j(q[0].replace(e,g)):g});return Z(u),oe}}function ye(){var me=[];F(me);for(var te;te=W();)te!==!1&&(me.push(te),F(me));return me}return re(),ye()}function j(E){return E?E.replace(f,g):g}return rp=k,rp}var H1;function qI(){if(H1)return vs;H1=1;var e=vs&&vs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(vs,"__esModule",{value:!0}),vs.default=n;const t=e(FI());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const u=(0,t.default)(a),f=typeof l=="function";return u.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 vs}var Jo={},Z1;function HI(){if(Z1)return Jo;Z1=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.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)},u=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,u))};return Jo.camelCase=m,Jo}var Wo,V1;function ZI(){if(V1)return Wo;V1=1;var e=Wo&&Wo.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(qI()),n=HI();function a(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(u[(0,n.camelCase)(f,o)]=m)}),u}return a.default=a,Wo=a,Wo}var VI=ZI();const QI=Qd(VI),gC=yC("end"),oy=yC("start");function yC(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 GI(e){const t=oy(e),n=gC(e);if(t&&n)return{start:t,end:n}}function ou(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Q1(e.position):"start"in e||"end"in e?Q1(e):"line"in e||"column"in e?sg(e):""}function sg(e){return G1(e&&e.line)+":"+G1(e&&e.column)}function Q1(e){return sg(e&&e.start)+"-"+sg(e&&e.end)}function G1(e){return e&&typeof e=="number"?e:1}class bn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},u=!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&&(u=!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=ou(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=u&&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}}bn.prototype.file="";bn.prototype.name="";bn.prototype.reason="";bn.prototype.message="";bn.prototype.stack="";bn.prototype.column=void 0;bn.prototype.line=void 0;bn.prototype.ancestors=void 0;bn.prototype.cause=void 0;bn.prototype.fatal=void 0;bn.prototype.place=void 0;bn.prototype.ruleId=void 0;bn.prototype.source=void 0;const uy={}.hasOwnProperty,KI=new Map,YI=/[A-Z]/g,XI=new Set(["table","tbody","thead","tfoot","tr"]),JI=new Set(["td","th"]),vC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function WI(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=sU(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=lU(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"?sy:PI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=bC(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function bC(e,t,n){if(t.type==="element")return eU(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rU(e,t,n);if(t.type==="mdxjsEsm")return nU(e,t);if(t.type==="root")return aU(e,t,n);if(t.type==="text")return iU(e,t)}function eU(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=sy,e.schema=l),e.ancestors.push(t);const o=SC(e,t.tagName,!1),u=oU(e,t);let f=dy(e,t);return XI.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!TI(m):!0})),xC(e,u,o,t),cy(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function tU(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)}wu(e,t.position)}function nU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wu(e,t.position)}function rU(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=sy,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:SC(e,t.name,!0),u=uU(e,t),f=dy(e,t);return xC(e,u,o,t),cy(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function aU(e,t,n){const a={};return cy(a,dy(e,t)),e.create(t,e.Fragment,a,n)}function iU(e,t){return t.value}function xC(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function cy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lU(e,t,n){return a;function a(l,o,u,f){const h=Array.isArray(u.children)?n:t;return f?h(o,u,f):h(o,u)}}function sU(e,t){return n;function n(a,l,o,u){const f=Array.isArray(o.children),m=oy(a);return t(l,o,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function oU(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&uy.call(t.properties,l)){const o=cU(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&JI.has(t.tagName)?a=f:n[u]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function uU(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 u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else wu(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 wu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function dy(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:KI;for(;++a<t.children.length;){const o=t.children[a];let u;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;u=m+"-"+h,l.set(m,h+1)}}const f=bC(e,o,u);f!==void 0&&n.push(f)}return n}function cU(e,t,n){const a=II(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?CI(n):$I(n)),a.property==="style"){let l=typeof n=="object"?n:dU(e,String(n));return e.stylePropertyNameCase==="css"&&(l=fU(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?DI[a.property]||a.property:a.attribute,n]}}function dU(e,t){try{return QI(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new bn("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=vC+"#cannot-parse-style-attribute",l}}function SC(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const f=B1(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=u}else a=B1(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);wu(e)}function wu(e,t){const n=new bn("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=vC+"#cannot-handle-mdx-estrees-without-createevaluater",n}function fU(e){const t={};let n;for(n in e)uy.call(e,n)&&(t[hU(n)]=e[n]);return t}function hU(e){let t=e.replace(YI,mU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function mU(e){return"-"+e.toLowerCase()}const ap={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"]},pU={};function fy(e,t){const n=pU,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return wC(e,a,l)}function wC(e,t,n){if(gU(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 K1(e.children,t,n)}return Array.isArray(e)?K1(e,t,n):""}function K1(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=wC(e[l],t,n);return a.join("")}function gU(e){return!!(e&&typeof e=="object")}const Y1=document.createElement("i");function hy(e){const t="&"+e+";";Y1.innerHTML=t;const n=Y1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xn(e,t,n,a){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)u=Array.from(a),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<a.length;)u=a.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function mr(e,t){return e.length>0?(Xn(e,e.length,0,t),e):t}const X1={}.hasOwnProperty;function kC(e){const t={};let n=-1;for(;++n<e.length;)yU(t,e[n]);return t}function yU(e,t){let n;for(n in t){const l=(X1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){X1.call(l,u)||(l[u]=[]);const f=o[u];vU(l[u],Array.isArray(f)?f:f?[f]:[])}}}function vU(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Xn(e,0,0,a)}function jC(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 Cr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Cn=Di(/[A-Za-z]/),pn=Di(/[\dA-Za-z]/),bU=Di(/[#-'*+\--9=?A-Z^-~]/);function qd(e){return e!==null&&(e<32||e===127)}const og=Di(/\d/),xU=Di(/[\dA-Fa-f]/),SU=Di(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const mf=Di(new RegExp("\\p{P}|\\p{S}","u")),xl=Di(/\s/);function Di(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function to(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&pn(e.charCodeAt(n+1))&&pn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(a,n),encodeURIComponent(u)),a=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function at(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Xe(m)?(e.enter(n),f(m)):t(m)}function f(m){return Xe(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const wU={tokenize:kU};function kU(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"),at(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,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Oe(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const jU={tokenize:CU},J1={tokenize:EU};function CU(e){const t=this,n=[];let a=0,l,o,u;return f;function f(O){if(a<n.length){const B=n[a];return t.containerState=B[1],e.attempt(B[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&T();const B=t.events.length;let D=B,R;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){R=t.events[D][1].end;break}C(a);let P=B;for(;P<t.events.length;)t.events[P][1].end={...R},P++;return Xn(t.events,D+1,0,t.events.slice(B)),t.events.length=P,h(O)}return f(O)}function h(O){if(a===n.length){if(!l)return b(O);if(l.currentConstruct&&l.currentConstruct.concrete)return k(O);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(J1,y,g)(O)}function y(O){return l&&T(),C(a),b(O)}function g(O){return t.parser.lazy[t.now().line]=a!==n.length,u=t.now().offset,k(O)}function b(O){return t.containerState={},e.attempt(J1,S,k)(O)}function S(O){return a++,n.push([t.currentConstruct,t.containerState]),b(O)}function k(O){if(O===null){l&&T(),C(0),e.consume(O);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(O);return}return Oe(O)?(e.consume(O),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,B){const D=t.sliceStream(O);if(B&&D.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(D),t.parser.lazy[O.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<u&&(!l.events[R][1].end||l.events[R][1].end.offset>u))return;const P=t.events.length;let Z=P,re,F;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(re){F=t.events[Z][1].end;break}re=!0}for(C(a),R=P;R<t.events.length;)t.events[R][1].end={...F},R++;Xn(t.events,Z+1,0,t.events.slice(P)),t.events.length=R}}function C(O){let B=n.length;for(;B-- >O;){const D=n[B];t.containerState=D[1],D[0].exit.call(t,e)}n.length=O}function T(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function EU(e,t,n){return at(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vs(e){if(e===null||xt(e)||xl(e))return 1;if(mf(e))return 2}function pf(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 ug={name:"attention",resolveAll:NU,tokenize:_U};function NU(e,t){let n=-1,a,l,o,u,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};W1(g,-m),W1(b,m),u={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:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=mr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=mr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=mr(h,pf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=mr(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=mr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,Xn(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 _U(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Vs(a);let o;return u;function u(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=Vs(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 W1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const AU={name:"autolink",tokenize:TU};function TU(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 Cn(S)?(e.consume(S),u):S===64?n(S):h(S)}function u(S){return S===43||S===45||S===46||pn(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||pn(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||qd(S)?n(S):(e.consume(S),m)}function h(S){return S===64?(e.consume(S),y):bU(S)?(e.consume(S),h):n(S)}function y(S){return pn(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||pn(S))&&a++<63){const k=S===45?b:g;return e.consume(S),k}return n(S)}}const Iu={partial:!0,tokenize:RU};function RU(e,t,n){return a;function a(o){return Xe(o)?at(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Oe(o)?t(o):n(o)}}const CC={continuation:{tokenize:OU},exit:DU,name:"blockQuote",tokenize:zU};function zU(e,t,n){const a=this;return l;function l(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Xe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function OU(e,t,n){const a=this;return l;function l(u){return Xe(u)?at(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(CC,t,n)(u)}}function DU(e){e.exit("blockQuote")}const EC={name:"characterEscape",tokenize:MU};function MU(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 SU(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const NC={name:"characterReference",tokenize:LU};function LU(e,t,n){const a=this;let l=0,o,u;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,u=pn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=xU,y):(e.enter("characterReferenceValue"),o=7,u=og,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return u===pn&&!hy(a.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&l++<o?(e.consume(g),y):n(g)}}const eS={partial:!0,tokenize:UU},tS={concrete:!0,name:"codeFenced",tokenize:IU};function IU(e,t,n){const a=this,l={partial:!0,tokenize:D};let o=0,u=0,f;return m;function m(R){return h(R)}function h(R){const P=a.events[a.events.length-1];return o=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(R)}function y(R){return R===f?(u++,e.consume(R),y):u<3?n(R):(e.exit("codeFencedFenceSequence"),Xe(R)?at(e,g,"whitespace")(R):g(R))}function g(R){return R===null||Oe(R)?(e.exit("codeFencedFence"),a.interrupt?t(R):e.check(eS,j,B)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Oe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(R)):Xe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,S,"whitespace")(R)):R===96&&R===f?n(R):(e.consume(R),b)}function S(R){return R===null||Oe(R)?g(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||Oe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(R)):R===96&&R===f?n(R):(e.consume(R),k)}function j(R){return e.attempt(l,B,E)(R)}function E(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),C}function C(R){return o>0&&Xe(R)?at(e,T,"linePrefix",o+1)(R):T(R)}function T(R){return R===null||Oe(R)?e.check(eS,j,B)(R):(e.enter("codeFlowValue"),O(R))}function O(R){return R===null||Oe(R)?(e.exit("codeFlowValue"),T(R)):(e.consume(R),O)}function B(R){return e.exit("codeFenced"),t(R)}function D(R,P,Z){let re=0;return F;function F(te){return R.enter("lineEnding"),R.consume(te),R.exit("lineEnding"),de}function de(te){return R.enter("codeFencedFence"),Xe(te)?at(R,W,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):W(te)}function W(te){return te===f?(R.enter("codeFencedFenceSequence"),ye(te)):Z(te)}function ye(te){return te===f?(re++,R.consume(te),ye):re>=u?(R.exit("codeFencedFenceSequence"),Xe(te)?at(R,me,"whitespace")(te):me(te)):Z(te)}function me(te){return te===null||Oe(te)?(R.exit("codeFencedFence"),P(te)):Z(te)}}}function UU(e,t,n){const a=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}const ip={name:"codeIndented",tokenize:PU},BU={partial:!0,tokenize:$U};function PU(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),at(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?u(h):n(h)}function u(h){return h===null?m(h):Oe(h)?e.attempt(BU,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Oe(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function $U(e,t,n){const a=this;return l;function l(u){return a.parser.lazy[a.now().line]?n(u):Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):at(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Oe(u)?l(u):n(u)}}const FU={name:"codeText",previous:HU,resolve:qU,tokenize:ZU};function qU(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 HU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZU(e,t,n){let a=0,l,o;return u;function u(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)):Oe(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||Oe(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 VU{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&&eu(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),eu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),eu(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);eu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);eu(this.left,n.reverse())}}}function eu(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 _C(e){const t={};let n=-1,a,l,o,u,f,m,h;const y=new VU(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,QU(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(u=y.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[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 Xn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function QU(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let u=n._tokenizer;u||(u=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,m=[],h={};let y,g,b=-1,S=n,k=0,j=0;const E=[j];for(;S;){for(;e.get(++l)[1]!==S;);o.push(l),S._tokenizer||(y=a.sliceStream(S),S.next||y.push(null),g&&u.defineSkip(S.start),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),S._isInFirstContentOfListItem&&(u._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,E.push(j),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(u.events=[],S?(S._tokenizer=void 0,S.previous=void 0):E.pop(),b=E.length;b--;){const C=f.slice(E[b],E[b+1]),T=o.pop();m.push([T,T+C.length-1]),e.splice(T,2,C)}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 GU={resolve:YU,tokenize:XU},KU={partial:!0,tokenize:JU};function YU(e){return _C(e),e}function XU(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):Oe(f)?e.check(KU,u,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function JU(e,t,n){const a=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),at(e,o,"linePrefix")}function o(u){if(u===null||Oe(u))return n(u);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(u):e.interrupt(a.parser.constructs.flow,n,t)(u)}}function AC(e,t,n,a,l,o,u,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(C){return C===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(C),e.exit(o),b):C===null||C===32||C===41||qd(C)?n(C):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function b(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),S(C))}function S(C){return C===62?(e.exit("chunkString"),e.exit(f),b(C)):C===null||C===60||Oe(C)?n(C):(e.consume(C),C===92?k:S)}function k(C){return C===60||C===62||C===92?(e.consume(C),S):S(C)}function j(C){return!y&&(C===null||C===41||xt(C))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(C)):y<h&&C===40?(e.consume(C),y++,j):C===41?(e.consume(C),y--,j):C===null||C===32||C===40||qd(C)?n(C):(e.consume(C),C===92?E:j)}function E(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function TC(e,t,n,a,l,o){const u=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 u.parser.constructs?n(S):S===93?(e.exit(o),e.enter(l),e.consume(S),e.exit(l),e.exit(a),t):Oe(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||Oe(S)||f++>999?(e.exit("chunkString"),y(S)):(e.consume(S),m||(m=!Xe(S)),S===92?b:g)}function b(S){return S===91||S===92||S===93?(e.consume(S),f++,g):g(S)}}function RC(e,t,n,a,l,o){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),u=b===40?41:b,m):n(b)}function m(b){return b===u?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===u?(e.exit(o),m(u)):b===null?n(b):Oe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),at(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===u||b===null||Oe(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===u||b===92?(e.consume(b),y):y(b)}}function uu(e,t){let n;return a;function a(l){return Oe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Xe(l)?at(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const WU={name:"definition",tokenize:t9},e9={partial:!0,tokenize:n9};function t9(e,t,n){const a=this;let l;return o;function o(S){return e.enter("definition"),u(S)}function u(S){return TC.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function f(S){return l=Cr(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 xt(S)?uu(e,h)(S):h(S)}function h(S){return AC(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function y(S){return e.attempt(e9,g,g)(S)}function g(S){return Xe(S)?at(e,b,"whitespace")(S):b(S)}function b(S){return S===null||Oe(S)?(e.exit("definition"),a.parser.defined.push(l),t(S)):n(S)}}function n9(e,t,n){return a;function a(f){return xt(f)?uu(e,l)(f):n(f)}function l(f){return RC(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Xe(f)?at(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Oe(f)?t(f):n(f)}}const r9={name:"hardBreakEscape",tokenize:a9};function a9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Oe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const i9={name:"headingAtx",resolve:l9,tokenize:s9};function l9(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"},Xn(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function s9(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&a++<6?(e.consume(y),u):y===null||xt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||Oe(y)?(e.exit("atxHeading"),t(y)):Xe(y)?at(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||xt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const o9=["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"],nS=["pre","script","style","textarea"],u9={concrete:!0,name:"htmlFlow",resolveTo:f9,tokenize:h9},c9={partial:!0,tokenize:p9},d9={partial:!0,tokenize:m9};function f9(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 h9(e,t,n){const a=this;let l,o,u,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:A):Cn(_)?(e.consume(_),u=String.fromCharCode(_),E):n(_)}function b(_){return _===45?(e.consume(_),l=2,S):_===91?(e.consume(_),l=5,f=0,k):Cn(_)?(e.consume(_),l=4,a.interrupt?t:A):n(_)}function S(_){return _===45?(e.consume(_),a.interrupt?t:A):n(_)}function k(_){const le="CDATA[";return _===le.charCodeAt(f++)?(e.consume(_),f===le.length?a.interrupt?t:W:k):n(_)}function j(_){return Cn(_)?(e.consume(_),u=String.fromCharCode(_),E):n(_)}function E(_){if(_===null||_===47||_===62||xt(_)){const le=_===47,V=u.toLowerCase();return!le&&!o&&nS.includes(V)?(l=1,a.interrupt?t(_):W(_)):o9.includes(u.toLowerCase())?(l=6,le?(e.consume(_),C):a.interrupt?t(_):W(_)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(_):o?T(_):O(_))}return _===45||pn(_)?(e.consume(_),u+=String.fromCharCode(_),E):n(_)}function C(_){return _===62?(e.consume(_),a.interrupt?t:W):n(_)}function T(_){return Xe(_)?(e.consume(_),T):F(_)}function O(_){return _===47?(e.consume(_),F):_===58||_===95||Cn(_)?(e.consume(_),B):Xe(_)?(e.consume(_),O):F(_)}function B(_){return _===45||_===46||_===58||_===95||pn(_)?(e.consume(_),B):D(_)}function D(_){return _===61?(e.consume(_),R):Xe(_)?(e.consume(_),D):O(_)}function R(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),m=_,P):Xe(_)?(e.consume(_),R):Z(_)}function P(_){return _===m?(e.consume(_),m=null,re):_===null||Oe(_)?n(_):(e.consume(_),P)}function Z(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||xt(_)?D(_):(e.consume(_),Z)}function re(_){return _===47||_===62||Xe(_)?O(_):n(_)}function F(_){return _===62?(e.consume(_),de):n(_)}function de(_){return _===null||Oe(_)?W(_):Xe(_)?(e.consume(_),de):n(_)}function W(_){return _===45&&l===2?(e.consume(_),q):_===60&&l===1?(e.consume(_),oe):_===62&&l===4?(e.consume(_),I):_===63&&l===3?(e.consume(_),A):_===93&&l===5?(e.consume(_),he):Oe(_)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(c9,U,ye)(_)):_===null||Oe(_)?(e.exit("htmlFlowData"),ye(_)):(e.consume(_),W)}function ye(_){return e.check(d9,me,U)(_)}function me(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),te}function te(_){return _===null||Oe(_)?ye(_):(e.enter("htmlFlowData"),W(_))}function q(_){return _===45?(e.consume(_),A):W(_)}function oe(_){return _===47?(e.consume(_),u="",K):W(_)}function K(_){if(_===62){const le=u.toLowerCase();return nS.includes(le)?(e.consume(_),I):W(_)}return Cn(_)&&u.length<8?(e.consume(_),u+=String.fromCharCode(_),K):W(_)}function he(_){return _===93?(e.consume(_),A):W(_)}function A(_){return _===62?(e.consume(_),I):_===45&&l===2?(e.consume(_),A):W(_)}function I(_){return _===null||Oe(_)?(e.exit("htmlFlowData"),U(_)):(e.consume(_),I)}function U(_){return e.exit("htmlFlow"),t(_)}}function m9(e,t,n){const a=this;return l;function l(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}function p9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Iu,t,n)}}const g9={name:"htmlText",tokenize:y9};function y9(e,t,n){const a=this;let l,o,u;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),D):A===63?(e.consume(A),O):Cn(A)?(e.consume(A),Z):n(A)}function h(A){return A===45?(e.consume(A),y):A===91?(e.consume(A),o=0,k):Cn(A)?(e.consume(A),T):n(A)}function y(A){return A===45?(e.consume(A),S):n(A)}function g(A){return A===null?n(A):A===45?(e.consume(A),b):Oe(A)?(u=g,oe(A)):(e.consume(A),g)}function b(A){return A===45?(e.consume(A),S):g(A)}function S(A){return A===62?q(A):A===45?b(A):g(A)}function k(A){const I="CDATA[";return A===I.charCodeAt(o++)?(e.consume(A),o===I.length?j:k):n(A)}function j(A){return A===null?n(A):A===93?(e.consume(A),E):Oe(A)?(u=j,oe(A)):(e.consume(A),j)}function E(A){return A===93?(e.consume(A),C):j(A)}function C(A){return A===62?q(A):A===93?(e.consume(A),C):j(A)}function T(A){return A===null||A===62?q(A):Oe(A)?(u=T,oe(A)):(e.consume(A),T)}function O(A){return A===null?n(A):A===63?(e.consume(A),B):Oe(A)?(u=O,oe(A)):(e.consume(A),O)}function B(A){return A===62?q(A):O(A)}function D(A){return Cn(A)?(e.consume(A),R):n(A)}function R(A){return A===45||pn(A)?(e.consume(A),R):P(A)}function P(A){return Oe(A)?(u=P,oe(A)):Xe(A)?(e.consume(A),P):q(A)}function Z(A){return A===45||pn(A)?(e.consume(A),Z):A===47||A===62||xt(A)?re(A):n(A)}function re(A){return A===47?(e.consume(A),q):A===58||A===95||Cn(A)?(e.consume(A),F):Oe(A)?(u=re,oe(A)):Xe(A)?(e.consume(A),re):q(A)}function F(A){return A===45||A===46||A===58||A===95||pn(A)?(e.consume(A),F):de(A)}function de(A){return A===61?(e.consume(A),W):Oe(A)?(u=de,oe(A)):Xe(A)?(e.consume(A),de):re(A)}function W(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,ye):Oe(A)?(u=W,oe(A)):Xe(A)?(e.consume(A),W):(e.consume(A),me)}function ye(A){return A===l?(e.consume(A),l=void 0,te):A===null?n(A):Oe(A)?(u=ye,oe(A)):(e.consume(A),ye)}function me(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||xt(A)?re(A):(e.consume(A),me)}function te(A){return A===47||A===62||xt(A)?re(A):n(A)}function q(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function oe(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),K}function K(A){return Xe(A)?at(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):he(A)}function he(A){return e.enter("htmlTextData"),u(A)}}const my={name:"labelEnd",resolveAll:S9,resolveTo:w9,tokenize:k9},v9={tokenize:j9},b9={tokenize:C9},x9={tokenize:E9};function S9(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&&Xn(e,0,e.length,n),e}function w9(e,t){let n=e.length,a=0,l,o,u,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(u){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"&&(u=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[u][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=mr(f,e.slice(o+1,o+a+3)),f=mr(f,[["enter",y,t]]),f=mr(f,pf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),t)),f=mr(f,[["exit",y,t],e[u-2],e[u-1],["exit",h,t]]),f=mr(f,e.slice(u+1)),f=mr(f,[["exit",m,t]]),Xn(e,o,e.length,f),e}function k9(e,t,n){const a=this;let l=a.events.length,o,u;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):(u=a.parser.defined.includes(Cr(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(v9,y,u?y:g)(b):b===91?e.attempt(b9,y,u?h:g)(b):u?y(b):g(b)}function h(b){return e.attempt(x9,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function j9(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 xt(g)?uu(e,o)(g):o(g)}function o(g){return g===41?y(g):AC(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return xt(g)?uu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?RC(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return xt(g)?uu(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 C9(e,t,n){const a=this;return l;function l(f){return TC.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Cr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function E9(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 N9={name:"labelStartImage",resolveAll:my.resolveAll,tokenize:_9};function _9(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"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const A9={name:"labelStartLink",resolveAll:my.resolveAll,tokenize:T9};function T9(e,t,n){const a=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(u):t(u)}}const lp={name:"lineEnding",tokenize:R9};function R9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),at(e,t,"linePrefix")}}const Td={name:"thematicBreak",tokenize:z9};function z9(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),u(h)}function u(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||Oe(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),Xe(h)?at(e,f,"whitespace")(h):f(h))}}const Dn={continuation:{tokenize:L9},exit:U9,name:"list",tokenize:M9},O9={partial:!0,tokenize:B9},D9={partial:!0,tokenize:I9};function M9(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,u=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:og(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(Td,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 og(S)&&++u<10?(e.consume(S),m):(!a.interrupt||u<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(Iu,a.interrupt?n:y,e.attempt(O9,b,g))}function y(S){return a.containerState.initialBlankLine=!0,o++,b(S)}function g(S){return Xe(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 L9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Iu,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,at(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Xe(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(D9,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,at(e,e.attempt(Dn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function I9(e,t,n){const a=this;return at(e,l,"listItemIndent",a.containerState.size+1);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(o):n(o)}}function U9(e){e.exit(this.containerState.type)}function B9(e,t,n){const a=this;return at(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=a.events[a.events.length-1];return!Xe(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const rS={name:"setextUnderline",resolveTo:P9,tokenize:$9};function P9(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 u={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",u,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function $9(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,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Xe(h)?at(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Oe(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const F9={tokenize:q9};function q9(e){const t=this,n=e.attempt(Iu,a,e.attempt(this.parser.constructs.flowInitial,l,at(e,e.attempt(this.parser.constructs.flow,l,e.attempt(GU,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 H9={resolveAll:OC()},Z9=zC("string"),V9=zC("text");function zC(e){return{resolveAll:OC(e==="text"?Q9:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,u,f);return u;function u(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 OC(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 Q9(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,u=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-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?u:a.start._bufferIndex+u,_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 G9={42:Dn,43:Dn,45:Dn,48:Dn,49:Dn,50:Dn,51:Dn,52:Dn,53:Dn,54:Dn,55:Dn,56:Dn,57:Dn,62:CC},K9={91:WU},Y9={[-2]:ip,[-1]:ip,32:ip},X9={35:i9,42:Td,45:[rS,Td],60:u9,61:rS,95:Td,96:tS,126:tS},J9={38:NC,92:EC},W9={[-5]:lp,[-4]:lp,[-3]:lp,33:N9,38:NC,42:ug,60:[AU,g9],91:A9,92:[r9,EC],93:my,95:ug,96:FU},eB={null:[ug,H9]},tB={null:[42,95]},nB={null:[]},rB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:tB,contentInitial:K9,disable:nB,document:G9,flow:X9,flowInitial:Y9,insideSpan:eB,string:J9,text:W9},Symbol.toStringTag,{value:"Module"}));function aB(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 u=[],f=[];const m={attempt:P(D),check:P(R),consume:T,enter:O,exit:B,interrupt:P(R,{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(de){return u=mr(u,de),E(),u[u.length-1]!==null?[]:(Z(t,0),h.events=pf(o,h.events,h),h.events)}function b(de,W){return lB(S(de),W)}function S(de){return iB(u,de)}function k(){const{_bufferIndex:de,_index:W,line:ye,column:me,offset:te}=a;return{_bufferIndex:de,_index:W,line:ye,column:me,offset:te}}function j(de){l[de.line]=de.column,F()}function E(){let de;for(;a._index<u.length;){const W=u[a._index];if(typeof W=="string")for(de=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===de&&a._bufferIndex<W.length;)C(W.charCodeAt(a._bufferIndex));else C(W)}}function C(de){y=y(de)}function T(de){Oe(de)?(a.line++,a.column=1,a.offset+=de===-3?2:1,F()):de!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=de}function O(de,W){const ye=W||{};return ye.type=de,ye.start=k(),h.events.push(["enter",ye,h]),f.push(ye),ye}function B(de){const W=f.pop();return W.end=k(),h.events.push(["exit",W,h]),W}function D(de,W){Z(de,W.from)}function R(de,W){W.restore()}function P(de,W){return ye;function ye(me,te,q){let oe,K,he,A;return Array.isArray(me)?U(me):"tokenize"in me?U([me]):I(me);function I(ue){return Se;function Se(ee){const fe=ee!==null&&ue[ee],Ie=ee!==null&&ue.null,Be=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return U(Be)(ee)}}function U(ue){return oe=ue,K=0,ue.length===0?q:_(ue[K])}function _(ue){return Se;function Se(ee){return A=re(),he=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?V():ue.tokenize.call(W?Object.assign(Object.create(h),W):h,m,le,V)(ee)}}function le(ue){return de(he,A),te}function V(ue){return A.restore(),++K<oe.length?_(oe[K]):q}}}function Z(de,W){de.resolveAll&&!o.includes(de)&&o.push(de),de.resolve&&Xn(h.events,W,h.events.length-W,de.resolve(h.events.slice(W),h)),de.resolveTo&&(h.events=de.resolveTo(h.events,h))}function re(){const de=k(),W=h.previous,ye=h.currentConstruct,me=h.events.length,te=Array.from(f);return{from:me,restore:q};function q(){a=de,h.previous=W,h.currentConstruct=ye,h.events.length=me,f=te,F()}}function F(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function iB(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(a,o)];else{if(u=e.slice(n,l),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function lB(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
344
- `;break}case-3:{u=`\r
345
- `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,a.push(u)}return a.join("")}function sB(e){const a={constructs:kC([rB,...(e||{}).extensions||[]]),content:l(wU),defined:[],document:l(jU),flow:l(F9),lazy:{},string:l(Z9),text:l(V9)};return a;function l(o){return u;function u(f){return aB(a,o,f)}}}function oB(e){for(;!_C(e););return e}const aS=/[\0\t\n\r]/g;function uB(){let e=1,t="",n=!0,a;return l;function l(o,u,f){const m=[];let h,y,g,b,S;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(aS.lastIndex=g,h=aS.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 cB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function dB(e){return e.replace(cB,fB)}function fB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return jC(n.slice(o?2:1),o?16:10)}return hy(n)||e}const DC={}.hasOwnProperty;function hB(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),mB(n)(oB(sB(n).document().write(uB()(e,t,!0))))}function mB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ar),autolinkProtocol:re,autolinkEmail:re,atxHeading:o(Nr),blockQuote:o(Ie),characterEscape:re,characterReference:re,codeFenced:o(Be),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(Be,u),codeText:o(St,u),codeTextData:re,data:re,codeFlowValue:re,definition:o(Vt),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Jt),hardBreakEscape:o(_r),hardBreakTrailing:o(_r),htmlFlow:o(Oa,u),htmlFlowData:re,htmlText:o(Oa,u),htmlTextData:re,image:o(Da),label:u,link:o(Ar),listItem:o(Ma),listItemValue:b,listOrdered:o(Gr,g),listUnordered:o(Gr),paragraph:o(Mi),reference:_,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Nr),strong:o(La),thematicBreak:o(Nl)},exit:{atxHeading:m(),atxHeadingSequence:D,autolink:m(),autolinkEmail:fe,autolinkProtocol:ee,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:ue,characterReference:Se,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:m(C),codeText:m(te),codeTextData:F,data:F,definition:m(),definitionDestinationString:B,definitionLabelString:T,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(W),hardBreakTrailing:m(W),htmlFlow:m(ye),htmlFlowData:F,htmlText:m(me),htmlTextData:F,image:m(oe),label:he,labelText:K,lineEnding:de,link:m(q),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:le,resourceDestinationString:A,resourceTitleString:I,resource:U,setextHeading:m(Z),setextHeadingLineSequence:P,setextHeadingText:R,strong:m(),thematicBreak:m()}};MC(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ae){let ve={type:"root",children:[]};const we={stack:[ve],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:y,data:n},De=[];let Pe=-1;for(;++Pe<ae.length;)if(ae[Pe][1].type==="listOrdered"||ae[Pe][1].type==="listUnordered")if(ae[Pe][0]==="enter")De.push(Pe);else{const nn=De.pop();Pe=l(ae,nn,Pe)}for(Pe=-1;++Pe<ae.length;){const nn=t[ae[Pe][0]];DC.call(nn,ae[Pe][1].type)&&nn[ae[Pe][1].type].call(Object.assign({sliceSerialize:ae[Pe][2].sliceSerialize},we),ae[Pe][1])}if(we.tokenStack.length>0){const nn=we.tokenStack[we.tokenStack.length-1];(nn[1]||iS).call(we,void 0,nn[0])}for(ve.position={start:ci(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:ci(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},Pe=-1;++Pe<t.transforms.length;)ve=t.transforms[Pe](ve)||ve;return ve}function l(ae,ve,we){let De=ve-1,Pe=-1,nn=!1,er,rn,At,an;for(;++De<=we;){const ot=ae[De];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?Pe++:Pe--,an=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(er&&!an&&!Pe&&!At&&(At=De),an=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:an=void 0}if(!Pe&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||Pe===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(er){let Tr=De;for(rn=void 0;Tr--;){const fn=ae[Tr];if(fn[1].type==="lineEnding"||fn[1].type==="lineEndingBlank"){if(fn[0]==="exit")continue;rn&&(ae[rn][1].type="lineEndingBlank",nn=!0),fn[1].type="lineEnding",rn=Tr}else if(!(fn[1].type==="linePrefix"||fn[1].type==="blockQuotePrefix"||fn[1].type==="blockQuotePrefixWhitespace"||fn[1].type==="blockQuoteMarker"||fn[1].type==="listItemIndent"))break}At&&(!rn||At<rn)&&(er._spread=!0),er.end=Object.assign({},rn?ae[rn][1].start:ot[1].end),ae.splice(rn||De,0,["exit",er,ot[2]]),De++,we++}if(ot[1].type==="listItemPrefix"){const Tr={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};er=Tr,ae.splice(De,0,["enter",Tr,ot[2]]),De++,we++,At=void 0,an=!0}}}return ae[ve][1]._spread=nn,we}function o(ae,ve){return we;function we(De){f.call(this,ae(De),De),ve&&ve.call(this,De)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ae,ve,we){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([ve,we||void 0]),ae.position={start:ci(ve.start),end:void 0}}function m(ae){return ve;function ve(we){ae&&ae.call(this,we),h.call(this,we)}}function h(ae,ve){const we=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==ae.type&&(ve?ve.call(this,ae,De[0]):(De[1]||iS).call(this,ae,De[0]));else throw new Error("Cannot close `"+ae.type+"` ("+ou({start:ae.start,end:ae.end})+"): it’s not open");we.position.end=ci(ae.end)}function y(){return fy(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(ae){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function S(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ae}function k(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ae}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae.replace(/(\r?\n|\r)$/g,"")}function T(ae){const ve=this.resume(),we=this.stack[this.stack.length-1];we.label=ve,we.identifier=Cr(this.sliceSerialize(ae)).toLowerCase()}function O(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ae}function B(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ae}function D(ae){const ve=this.stack[this.stack.length-1];if(!ve.depth){const we=this.sliceSerialize(ae).length;ve.depth=we}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function P(ae){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function re(ae){const we=this.stack[this.stack.length-1].children;let De=we[we.length-1];(!De||De.type!=="text")&&(De=tn(),De.position={start:ci(ae.start),end:void 0},we.push(De)),this.stack.push(De)}function F(ae){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ae),ve.position.end=ci(ae.end)}function de(ae){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=ve.children[ve.children.length-1];we.position.end=ci(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(re.call(this,ae),F.call(this,ae))}function W(){this.data.atHardBreak=!0}function ye(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae}function me(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae}function te(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ae}function q(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ve,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function oe(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ve,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function K(ae){const ve=this.sliceSerialize(ae),we=this.stack[this.stack.length-2];we.label=dB(ve),we.identifier=Cr(ve).toLowerCase()}function he(){const ae=this.stack[this.stack.length-1],ve=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const De=ae.children;we.children=De}else we.alt=ve}function A(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ae}function I(){const ae=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ae}function U(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function le(ae){const ve=this.resume(),we=this.stack[this.stack.length-1];we.label=ve,we.identifier=Cr(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function V(ae){this.data.characterReferenceType=ae.type}function ue(ae){const ve=this.sliceSerialize(ae),we=this.data.characterReferenceType;let De;we?(De=jC(ve,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=hy(ve);const Pe=this.stack[this.stack.length-1];Pe.value+=De}function Se(ae){const ve=this.stack.pop();ve.position.end=ci(ae.end)}function ee(ae){F.call(this,ae);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ae)}function fe(ae){F.call(this,ae);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ae)}function Ie(){return{type:"blockquote",children:[]}}function Be(){return{type:"code",lang:null,meta:null,value:""}}function St(){return{type:"inlineCode",value:""}}function Vt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Jt(){return{type:"emphasis",children:[]}}function Nr(){return{type:"heading",depth:0,children:[]}}function _r(){return{type:"break"}}function Oa(){return{type:"html",value:""}}function Da(){return{type:"image",title:null,url:"",alt:null}}function Ar(){return{type:"link",title:null,url:"",children:[]}}function Gr(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Ma(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function Mi(){return{type:"paragraph",children:[]}}function La(){return{type:"strong",children:[]}}function tn(){return{type:"text",value:""}}function Nl(){return{type:"thematicBreak"}}}function ci(e){return{line:e.line,column:e.column,offset:e.offset}}function MC(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?MC(e,a):pB(e,a)}}function pB(e,t){let n;for(n in t)if(DC.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 iS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ou({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ou({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ou({start:t.start,end:t.end})+") is still open")}function gB(e){const t=this;t.parser=n;function n(a){return hB(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function yB(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 vB(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
346
- `}]}function bB(e,t){const n=t.value?t.value+`
347
- `:"",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 xB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=to(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=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(u)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function kB(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 jB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function LC(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 u=l[l.length-1];return u&&u.type==="text"?u.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 LC(e,t);const l={src:to(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 EB(e,t){const n={src:to(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 NB(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 _B(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return LC(e,t);const l={href:to(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 AB(e,t){const n={href:to(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 TB(e,t,n){const a=e.all(t),l=n?RB(n):IC(t),o={},u=[];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")&&u.push({type:"text",value:`
348
- `}),y.type==="element"&&y.tagName==="p"&&!l?u.push(...y.children):u.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
349
- `});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function RB(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=IC(n[a])}return t}function IC(e){const t=e.spread;return t??e.children.length>1}function zB(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 u=a[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.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 OB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function MB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LB(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=oy(t.children[1]),m=gC(t.children[t.children.length-1]);f&&m&&(u.position={start:f,end:m}),l.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function IB(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],b={},S=u?u[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 UB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const lS=9,sS=32;function BB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(oS(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(oS(t.slice(l),l>0,!1)),o.join("")}function oS(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===lS||o===sS;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===lS||o===sS;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function PB(e,t){const n={type:"text",value:BB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $B(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const FB={blockquote:yB,break:vB,code:bB,delete:xB,emphasis:SB,footnoteReference:wB,heading:kB,html:jB,imageReference:CB,image:EB,inlineCode:NB,linkReference:_B,link:AB,listItem:TB,list:zB,paragraph:OB,root:DB,strong:MB,table:LB,tableCell:UB,tableRow:IB,text:PB,thematicBreak:$B,toml:yd,yaml:yd,definition:yd,footnoteDefinition:yd};function yd(){}const UC=-1,gf=0,cu=1,Hd=2,py=3,gy=4,yy=5,vy=6,BC=7,PC=8,uS=typeof self=="object"?self:globalThis,qB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case gf:case UC:return n(u,l);case cu:{const f=n([],l);for(const m of u)f.push(a(m));return f}case Hd:{const f=n({},l);for(const[m,h]of u)f[a(m)]=a(h);return f}case py:return n(new Date(u),l);case gy:{const{source:f,flags:m}=u;return n(new RegExp(f,m),l)}case yy:{const f=n(new Map,l);for(const[m,h]of u)f.set(a(m),a(h));return f}case vy:{const f=n(new Set,l);for(const m of u)f.add(a(m));return f}case BC:{const{name:f,message:m}=u;return n(new uS[f](m),l)}case PC:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new uS[o](u),l)};return a},cS=e=>qB(new Map,e)(0),bs="",{toString:HB}={},{keys:ZB}=Object,tu=e=>{const t=typeof e;if(t!=="object"||!e)return[gf,t];const n=HB.call(e).slice(8,-1);switch(n){case"Array":return[cu,bs];case"Object":return[Hd,bs];case"Date":return[py,bs];case"RegExp":return[gy,bs];case"Map":return[yy,bs];case"Set":return[vy,bs];case"DataView":return[cu,n]}return n.includes("Array")?[cu,n]:n.includes("Error")?[BC,n]:[Hd,n]},vd=([e,t])=>e===gf&&(t==="function"||t==="symbol"),VB=(e,t,n,a)=>{const l=(u,f)=>{const m=a.push(u)-1;return n.set(f,m),m},o=u=>{if(n.has(u))return n.get(u);let[f,m]=tu(u);switch(f){case gf:{let y=u;switch(m){case"bigint":f=PC,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([UC],u)}return l([f,y],u)}case cu:{if(m){let b=u;return m==="DataView"?b=new Uint8Array(u.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(u)),l([m,[...b]],u)}const y=[],g=l([f,y],u);for(const b of u)y.push(o(b));return g}case Hd:{if(m)switch(m){case"BigInt":return l([m,u.toString()],u);case"Boolean":case"Number":case"String":return l([m,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const y=[],g=l([f,y],u);for(const b of ZB(u))(e||!vd(tu(u[b])))&&y.push([o(b),o(u[b])]);return g}case py:return l([f,u.toISOString()],u);case gy:{const{source:y,flags:g}=u;return l([f,{source:y,flags:g}],u)}case yy:{const y=[],g=l([f,y],u);for(const[b,S]of u)(e||!(vd(tu(b))||vd(tu(S))))&&y.push([o(b),o(S)]);return g}case vy:{const y=[],g=l([f,y],u);for(const b of u)(e||!vd(tu(b)))&&y.push(o(b));return g}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},dS=(e,{json:t,lossy:n}={})=>{const a=[];return VB(!(t||n),!!t,new Map,a)(e),a},Zd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?cS(dS(e,t)):structuredClone(e):(e,t)=>cS(dS(e,t));function QB(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 GB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function KB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||QB,a=e.options.footnoteBackLabel||GB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=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=to(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 T=typeof n=="string"?n:n(m,S);typeof T=="string"&&(T={type:"text",value:T}),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(T)?T:[T]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const T=E.children[E.children.length-1];T&&T.type==="text"?T.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else y.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(h,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Zd(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
350
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
351
- `}]}}const yf=(function(e){if(e==null)return WB;if(typeof e=="function")return vf(e);if(typeof e=="object")return Array.isArray(e)?YB(e):XB(e);if(typeof e=="string")return JB(e);throw new Error("Expected function, string, or object as test")});function YB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=yf(e[n]);return vf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function XB(e){const t=e;return vf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function JB(e){return vf(t);function t(n){return n&&n.type===e}}function vf(e){return t;function t(n,a,l){return!!(e8(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function WB(){return!0}function e8(e){return e!==null&&typeof e=="object"&&"type"in e}const $C=[],t8=!0,cg=!1,n8="skip";function FC(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=yf(l),u=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=$C,k,j,E;if((!t||o(m,h,y[y.length-1]||void 0))&&(S=r8(n(m,y)),S[0]===cg))return S;if("children"in m&&m.children){const C=m;if(C.children&&S[0]!==n8)for(j=(a?C.children.length:-1)+u,E=y.concat(C);j>-1&&j<C.children.length;){const T=C.children[j];if(k=f(T,j,E)(),k[0]===cg)return k;j=typeof k[1]=="number"?k[1]:j+u}}return S}}}function r8(e){return Array.isArray(e)?e:typeof e=="number"?[t8,e]:e==null?$C:[e]}function by(e,t,n,a){let l,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,l=n):(o=t,u=n,l=a),FC(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return u(m,g,y)}}const dg={}.hasOwnProperty,a8={};function i8(e,t){const n=t||a8,a=new Map,l=new Map,o=new Map,u={...FB,...n.handlers},f={all:h,applyData:s8,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:n,patch:l8,wrap:u8};return by(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(dg.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,...E}=y,C=Zd(E);return C.children=f.all(y),C}return Zd(y)}return(f.options.unknownHandler||o8)(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=fS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=fS(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function l8(e,t){e.position&&(t.position=GI(e))}function s8(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 u="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,Zd(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function o8(e,t){const n=t.data||{},a="value"in t&&!(dg.call(n,"hProperties")||dg.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 u8(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
352
- `});++a<e.length;)a&&n.push({type:"text",value:`
353
- `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
354
- `}),n}function fS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function hS(e,t){const n=i8(e,t),a=n.one(e,void 0),l=KB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
355
- `},l),o}function c8(e,t){return e&&"run"in e?async function(n,a){const l=hS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return hS(n,{file:a,...e||t})}}function mS(e){if(e)throw e}var sp,pS;function d8(){if(pS)return sp;pS=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)},u=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 sp=function m(){var h,y,g,b,S,k,j=arguments[0],E=1,C=arguments.length,T=!1;for(typeof j=="boolean"&&(T=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<C;++E)if(h=arguments[E],h!=null)for(y in h)g=f(j,y),b=f(h,y),j!==b&&(T&&b&&(o(b)||(S=l(b)))?(S?(S=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},u(j,{name:y,newValue:m(T,k,b)})):typeof b<"u"&&u(j,{name:y,newValue:b}));return j},sp}var f8=d8();const op=Qd(f8);function fg(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 h8(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){u(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?m8(y,f)(...h):u(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 m8(e,t){let n;return a;function a(...u){const f=e.length>u.length;let m;f&&u.push(l);try{m=e.apply(this,u)}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(u,...f){n||(n=!0,t(u,...f))}function o(u){l(null,u)}}const Ir={basename:p8,dirname:g8,extname:y8,join:v8,sep:"/"};function p8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Uu(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 u=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else u<0&&(o=!0,u=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=u));return n===a?a=u:a<0&&(a=e.length),e.slice(n,a)}function g8(e){if(Uu(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 y8(e){Uu(e);let t=e.length,n=-1,a=0,l=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}n<0&&(u=!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 v8(...e){let t=-1,n;for(;++t<e.length;)Uu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":b8(n)}function b8(e){Uu(e);const t=e.codePointAt(0)===47;let n=x8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function x8(e,t){let n="",a=0,l=-1,o=0,u=-1,f,m;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(l===u-1||o===1))if(l!==u-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=u,o=0;continue}}else if(n.length>0){n="",a=0,l=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),a=u-l-1;l=u,o=0}else f===46&&o>-1?o++:o=-1}return n}function Uu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const S8={cwd:w8};function w8(){return"/"}function hg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function k8(e){if(typeof e=="string")e=new URL(e);else if(!hg(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 j8(e)}function j8(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 up=["history","path","basename","stem","extname","dirname"];class qC{constructor(t){let n;t?hg(t)?n={path:t}:typeof t=="string"||C8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":S8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<up.length;){const o=up[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)up.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Ir.basename(this.path):void 0}set basename(t){dp(t,"basename"),cp(t,"basename"),this.path=Ir.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ir.dirname(this.path):void 0}set dirname(t){gS(this.basename,"dirname"),this.path=Ir.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ir.extname(this.path):void 0}set extname(t){if(cp(t,"extname"),gS(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=Ir.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){hg(t)&&(t=k8(t)),dp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ir.basename(this.path,this.extname):void 0}set stem(t){dp(t,"stem"),cp(t,"stem"),this.path=Ir.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 bn(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 cp(e,t){if(e&&e.includes(Ir.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ir.sep+"`")}function dp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function gS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function C8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const E8=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),N8={}.hasOwnProperty;class xy extends E8{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=h8()}copy(){const t=new xy;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(op(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(mp("data",this.frozen),this.namespace[t]=n,this):N8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(mp("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=bd(t),a=this.parser||this.Parser;return fp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),fp("process",this.parser||this.Parser),hp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const f=bd(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);T8(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?u(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),fp("processSync",this.parser||this.Parser),hp("processSync",this.compiler||this.Compiler),this.process(t,l),vS("processSync","process",n),a;function l(o,u){n=!0,mS(o),a=u}}run(t,n,a){yS(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(u,f){const m=bd(n);l.run(t,m,h);function h(y,g,b){const S=g||t;y?f(y):u?u(S):a(void 0,S,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),vS("runSync","run",a),l;function o(u,f){mS(u),l=f,a=!0}}stringify(t,n){this.freeze();const a=bd(n),l=this.compiler||this.Compiler;return hp("stringify",l),yS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(mp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(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 u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(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=op(!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];fg(j)&&fg(S)&&(S=op(!0,j,S)),a[b]=[h,S,...k]}}}}const _8=new xy().freeze();function fp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mp(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 yS(e){if(!fg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bd(e){return A8(e)?e:new qC(e)}function A8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function T8(e){return typeof e=="string"||R8(e)}function R8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const z8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bS=[],xS={allowDangerousHtml:!0},O8=/^(https?|ircs?|mailto|xmpp)$/i,D8=[{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 M8(e){const t=L8(e),n=I8(e);return U8(t.runSync(t.parse(n),n),e)}function L8(e){const t=e.rehypePlugins||bS,n=e.remarkPlugins||bS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xS}:xS;return _8().use(gB).use(n).use(c8,a).use(t)}function I8(e){const t=e.children||"",n=new qC;return typeof t=="string"&&(n.value=t),n}function U8(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||B8;for(const y of D8)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+z8+y.id,void 0);return by(e,h),WI(e,{Fragment:d.Fragment,components:l,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return u?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let S;for(S in ap)if(Object.hasOwn(ap,S)&&Object.hasOwn(y.properties,S)){const k=y.properties[S],j=ap[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 B8(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||O8.test(e.slice(0,t))?e:""}function P8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function HC(e,t,n){const l=yf((n||{}).ignore||[]),o=$8(t);let u=-1;for(;++u<o.length;)FC(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[u][0],S=o[u][1];let k=0;const E=g.children.indexOf(h);let C=!1,T=[];b.lastIndex=0;let O=b.exec(h.value);for(;O;){const B=O.index,D={index:O.index,input:O.input,stack:[...y,h]};let R=S(...O,D);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=B+1:(k!==B&&T.push({type:"text",value:h.value.slice(k,B)}),Array.isArray(R)?T.push(...R):R&&T.push(R),k=B+O[0].length,C=!0),!b.global)break;O=b.exec(h.value)}return C?(k<h.value.length&&T.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...T)):T=[h],E+T.length}}function $8(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([F8(l[0]),q8(l[1])])}return t}function F8(e){return typeof e=="string"?new RegExp(P8(e),"g"):e}function q8(e){return typeof e=="function"?e:function(){return e}}function H8(e){HC(e,[/\r?\n|\r/g,Z8])}function Z8(){return{type:"break"}}function V8(){return function(e){H8(e)}}function SS(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 pp="phrasing",gp=["autolink","link","image","label"];function Q8(){return{transforms:[eP],enter:{literalAutolink:K8,literalAutolinkEmail:yp,literalAutolinkHttp:yp,literalAutolinkWww:yp},exit:{literalAutolink:W8,literalAutolinkEmail:J8,literalAutolinkHttp:Y8,literalAutolinkWww:X8}}}function G8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pp,notInConstruct:gp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pp,notInConstruct:gp},{character:":",before:"[ps]",after:"\\/",inConstruct:pp,notInConstruct:gp}]}}function K8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function yp(e){this.config.enter.autolinkProtocol.call(this,e)}function Y8(e){this.config.exit.autolinkProtocol.call(this,e)}function X8(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 J8(e){this.config.exit.autolinkEmail.call(this,e)}function W8(e){this.exit(e)}function eP(e){HC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),nP]],{ignore:["link","linkReference"]})}function tP(e,t,n,a,l){let o="";if(!ZC(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!rP(n)))return!1;const u=aP(n+a);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function nP(e,t,n,a){return!ZC(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rP(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 aP(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=SS(e,"(");let o=SS(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 ZC(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||xl(n)||mf(n))&&(!t||n!==47)}VC.peek=hP;function iP(){this.buffer()}function lP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function sP(){this.buffer()}function oP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function uP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cP(e){this.exit(e)}function dP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fP(e){this.exit(e)}function hP(){return"["}function VC(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),u(),o+=l.move("]"),o}function mP(){return{enter:{gfmFootnoteCallString:iP,gfmFootnoteCall:lP,gfmFootnoteDefinitionLabelString:sP,gfmFootnoteDefinition:oP},exit:{gfmFootnoteCallString:uP,gfmFootnoteCall:cP,gfmFootnoteDefinitionLabelString:dP,gfmFootnoteDefinition:fP}}}function pP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:VC},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,u){const f=o.createTracker(u);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?`
356
- `:" ")+o.indentLines(o.containerFlow(a,f.current()),t?QC:gP))),h(),m}}function gP(e,t,n){return t===0?e:QC(e,t,n)}function QC(e,t,n){return(n?"":" ")+e}const yP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];GC.peek=wP;function vP(){return{canContainEols:["delete"],enter:{strikethrough:xP},exit:{strikethrough:SP}}}function bP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yP}],handlers:{delete:GC}}}function xP(e){this.enter({type:"delete",children:[]},e)}function SP(e){this.exit(e)}function GC(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let u=l.move("~~");return u+=n.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),o(),u}function wP(){return"~"}function kP(e){return e.length}function jP(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||kP,o=[],u=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],E=[];let C=-1;for(e[y].length>h&&(h=e[y].length);++C<e[y].length;){const T=CP(e[y][C]);if(n.alignDelimiters!==!1){const O=l(T);E[C]=O,(m[C]===void 0||O>m[C])&&(m[C]=O)}j.push(T)}u[y]=j,f[y]=E}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=wS(a[g]);else{const j=wS(a);for(;++g<h;)o[g]=j}g=-1;const b=[],S=[];for(;++g<h;){const j=o[g];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let T=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-C.length);const O=E+"-".repeat(T)+C;n.alignDelimiters!==!1&&(T=E.length+T+C.length,T>m[g]&&(m[g]=T),S[g]=T),b[g]=O}u.splice(1,0,b),f.splice(1,0,S),y=-1;const k=[];for(;++y<u.length;){const j=u[y],E=f[y];g=-1;const C=[];for(;++g<h;){const T=j[g]||"";let O="",B="";if(n.alignDelimiters!==!1){const D=m[g]-(E[g]||0),R=o[g];R===114?O=" ".repeat(D):R===99?D%2?(O=" ".repeat(D/2+.5),B=" ".repeat(D/2-.5)):(O=" ".repeat(D/2),B=O):B=" ".repeat(D)}n.delimiterStart!==!1&&!g&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||g)&&C.push(" "),n.alignDelimiters!==!1&&C.push(O),C.push(T),n.alignDelimiters!==!1&&C.push(B),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
357
- `)}function CP(e){return e==null?"":String(e)}function wS(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 EP(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),NP);return l(),u}function NP(e,t,n){return">"+(n?"":" ")+e}function _P(e,t){return kS(e,t.inConstruct,!0)&&!kS(e,t.notInConstruct,!1)}function kS(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 jS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
358
- `&&_P(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
359
- `}function AP(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>u&&(u=o):o=1,l=a+t.length,a=n.indexOf(t,l);return u}function TP(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 RP(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 zP(e,t,n,a){const l=RP(n),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(TP(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,OP);return g(),b}const f=n.createTracker(a),m=l.repeat(Math.max(AP(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${u}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${u}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
360
- `,encode:["`"],...f.current()})),g()}return y+=f.move(`
361
- `),o&&(y+=f.move(o+`
362
- `)),y+=f.move(m),h(),y}function OP(e,t,n){return(n?"":" ")+e}function Sy(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 DP(e,t,n,a){const l=Sy(n),o=l==='"'?"Quote":"Apostrophe",u=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?" ":`
363
- `,...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()),u(),h}function MP(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 ku(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Vd(e,t,n){const a=Vs(e),l=Vs(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}}KC.peek=LP;function KC(e,t,n,a){const l=MP(n),o=n.enter("emphasis"),u=n.createTracker(a),f=u.move(l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=Vd(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=ku(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=Vd(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+ku(g));const S=u.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+S}function LP(e,t,n){return n.options.emphasis||"*"}function IP(e,t){let n=!1;return by(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,cg}),!!((!e.depth||e.depth<3)&&fy(e)&&(t.options.setext||n))}function UP(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(IP(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
364
- `,after:`
365
- `});return g(),y(),b+`
366
- `+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
367
- `))+1))}const u="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
368
- `,...o.current()});return/^[\t ]/.test(h)&&(h=ku(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),m(),f(),h}YC.peek=BP;function YC(e){return e.value||""}function BP(){return"<"}XC.peek=PP;function XC(e,t,n,a){const l=Sy(n),o=l==='"'?"Quote":"Apostrophe",u=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(")"),u(),h}function PP(){return"!"}JC.peek=$P;function JC(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let u=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+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),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 $P(){return"!"}WC.peek=FP;function WC(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 u=n.unsafe[o],f=n.compilePattern(u);let m;if(u.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 FP(){return"`"}function eE(e,t){const n=fy(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))}tE.peek=qP;function tE(e,t,n,a){const l=Sy(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let f,m;if(eE(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=u.move("<");return g+=u.move(n.containerPhrasing(e,{before:g,after:">",...u.current()})),g+=u.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(m=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=u.move(" "+l),h+=u.move(n.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),m()),h+=u.move(")"),f(),h}function qP(e,t,n){return eE(e,n)?"<":"["}nE.peek=HP;function nE(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let u=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+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),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 HP(){return"["}function wy(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 ZP(e){const t=wy(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 VP(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 rE(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 QP(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?VP(n):wy(n);const f=e.ordered?u==="."?")":".":ZP(n);let m=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&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),rE(n)===u&&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&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,a);return n.bulletLastUsed=u,n.bulletCurrent=o,l(),h}function GP(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 KP(e,t,n,a){const l=GP(n);let o=n.bulletCurrent||wy(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 u=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(u-o.length)),f.shift(u);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(u))+g:(S?o:o+" ".repeat(u-o.length))+g}}function YP(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,a);return o(),l(),u}const XP=yf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function JP(e,t,n,a){return(e.children.some(function(u){return XP(u)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function WP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aE.peek=e$;function aE(e,t,n,a){const l=WP(n),o=n.enter("strong"),u=n.createTracker(a),f=u.move(l+l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=Vd(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=ku(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=Vd(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+ku(g));const S=u.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+S}function e$(e,t,n){return n.options.strong||"*"}function t$(e,t,n,a){return n.safe(e.value,a)}function n$(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 r$(e,t,n){const a=(rE(n)+(n.options.ruleSpaces?" ":"")).repeat(n$(n));return n.options.ruleSpaces?a.slice(0,-1):a}const iE={blockquote:EP,break:jS,code:zP,definition:DP,emphasis:KC,hardBreak:jS,heading:UP,html:YC,image:XC,imageReference:JC,inlineCode:WC,link:tE,linkReference:nE,list:QP,listItem:KP,paragraph:YP,root:JP,strong:aE,text:t$,thematicBreak:r$};function a$(){return{enter:{table:i$,tableData:CS,tableHeader:CS,tableRow:s$},exit:{codeText:o$,table:l$,tableData:vp,tableHeader:vp,tableRow:vp}}}function i$(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 l$(e){this.exit(e),this.data.inTable=void 0}function s$(e){this.enter({type:"tableRow",children:[]},e)}function vp(e){this.exit(e)}function CS(e){this.enter({type:"tableCell",children:[]},e)}function o$(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,u$));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function u$(e,t){return t==="|"?t:e}function c$(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
369
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:m,tableRow:f}};function u(S,k,j,E){return h(y(S,j,E),S.align)}function f(S,k,j,E){const C=g(S,j,E),T=h([C]);return T.slice(0,T.indexOf(`
370
- `))}function m(S,k,j,E){const C=j.enter("tableCell"),T=j.enter("phrasing"),O=j.containerPhrasing(S,{...E,before:o,after:o});return T(),C(),O}function h(S,k){return jP(S,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(S,k,j){const E=S.children;let C=-1;const T=[],O=k.enter("table");for(;++C<E.length;)T[C]=g(E[C],k,j);return O(),T}function g(S,k,j){const E=S.children;let C=-1;const T=[],O=k.enter("tableRow");for(;++C<E.length;)T[C]=m(E[C],S,k,j);return O(),T}function b(S,k,j){let E=iE.inlineCode(S,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function d$(){return{exit:{taskListCheckValueChecked:ES,taskListCheckValueUnchecked:ES,paragraph:h$}}}function f$(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:m$}}}function ES(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function h$(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,u;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){u=f;break}}u===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 m$(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(u);let m=iE.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+u}}function p$(){return[Q8(),mP(),vP(),a$(),d$()]}function g$(e){return{extensions:[G8(),pP(e),bP(),c$(e),f$()]}}const y$={tokenize:k$,partial:!0},lE={tokenize:j$,partial:!0},sE={tokenize:C$,partial:!0},oE={tokenize:E$,partial:!0},v$={tokenize:N$,partial:!0},uE={name:"wwwAutolink",tokenize:S$,previous:dE},cE={name:"protocolAutolink",tokenize:w$,previous:fE},za={name:"emailAutolink",tokenize:x$,previous:hE},Qr={};function b$(){return{text:Qr}}let il=48;for(;il<123;)Qr[il]=za,il++,il===58?il=65:il===91&&(il=97);Qr[43]=za;Qr[45]=za;Qr[46]=za;Qr[95]=za;Qr[72]=[za,cE];Qr[104]=[za,cE];Qr[87]=[za,uE];Qr[119]=[za,uE];function x$(e,t,n){const a=this;let l,o;return u;function u(g){return!mg(g)||!hE.call(a,a.previous)||ky(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return mg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(v$,y,h)(g):g===45||g===95||pn(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&&Cn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function S$(e,t,n){const a=this;return l;function l(u){return u!==87&&u!==119||!dE.call(a,a.previous)||ky(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(y$,e.attempt(lE,e.attempt(sE,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function w$(e,t,n){const a=this;let l="",o=!1;return u;function u(g){return(g===72||g===104)&&fE.call(a,a.previous)&&!ky(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(Cn(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||qd(g)||xt(g)||xl(g)||mf(g)?n(g):e.attempt(lE,e.attempt(sE,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function k$(e,t,n){let a=0;return l;function l(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),l):u===46&&a===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function j$(e,t,n){let a,l,o;return u;function u(h){return h===46||h===95?e.check(oE,m,f)(h):h===null||xt(h)||xl(h)||h!==45&&mf(h)?m(h):(o=!0,e.consume(h),u)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),u}function m(h){return l||a||!o?n(h):t(h)}}function C$(e,t){let n=0,a=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&a<n?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(oE,t,o)(u):u===null||xt(u)||xl(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&a++,e.consume(u),l}}function E$(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||xt(f)||xl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||xt(f)||xl(f)?t(f):a(f)}function o(f){return Cn(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),a):Cn(f)?(e.consume(f),u):n(f)}}function N$(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return pn(o)?n(o):t(o)}}function dE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xt(e)}function fE(e){return!Cn(e)}function hE(e){return!(e===47||mg(e))}function mg(e){return e===43||e===45||e===46||e===95||pn(e)}function ky(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 _$={tokenize:L$,partial:!0};function A$(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:O$,continuation:{tokenize:D$},exit:M$}},text:{91:{name:"gfmFootnoteCall",tokenize:z$},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:T$,resolveTo:R$}}}}function T$(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){u=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(!u||!u._balanced)return n(m);const h=Cr(a.sliceSerialize({start:u.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 R$(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)},u={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",u,t],["exit",u,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 z$(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;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&&!u||g===null||g===91||xt(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Cr(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return xt(g)||(u=!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 O$(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,u=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(u>999||k===93&&!f||k===null||k===91||xt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Cr(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return xt(k)||(f=!0),u++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),at(e,S,"gfmFootnoteDefinitionWhitespace")):n(k)}function S(k){return t(k)}}function D$(e,t,n){return e.check(Iu,t,e.attempt(_$,t,n))}function M$(e){e.exit("gfmFootnoteDefinition")}function L$(e,t,n){const a=this;return at(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function I$(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(u,f){let m=-1;for(;++m<u.length;)if(u[m][0]==="enter"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._close){let h=m;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[m][1].end.offset-u[m][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[m][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[m][1].end)},g={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[m][1].start)},b=[["enter",y,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",g,f]],S=f.parser.constructs.insideSpan.null;S&&Xn(b,b.length,0,pf(S,u.slice(h+1,m),f)),Xn(b,b.length,0,[["exit",g,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",y,f]]),Xn(u,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<u.length;)u[m][1].type==="strikethroughSequenceTemporary"&&(u[m][1].type="data");return u}function o(u,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):(u.enter("strikethroughSequenceTemporary"),S(k))}function S(k){const j=Vs(h);if(k===126)return g>1?m(k):(u.consume(k),g++,S);if(g<2&&!n)return m(k);const E=u.exit("strikethroughSequenceTemporary"),C=Vs(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class U${constructor(){this.map=[]}add(t,n,a){B$(this,t,n,a)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[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 B$(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 P$(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 $$(){return{flow:{null:{name:"table",tokenize:F$,resolveAll:q$}}}}function F$(e,t,n){const a=this;let l=0,o=0,u;return f;function f(F){let de=a.events.length-1;for(;de>-1;){const me=a.events[de][1].type;if(me==="lineEnding"||me==="linePrefix")de--;else break}const W=de>-1?a.events[de][1].type:null,ye=W==="tableHead"||W==="tableRow"?R:m;return ye===R&&a.parser.lazy[a.now().line]?n(F):ye(F)}function m(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(u=!0,o+=1),y(F)}function y(F){return F===null?n(F):Oe(F)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),S):n(F):Xe(F)?at(e,y,"whitespace")(F):(o+=1,u&&(u=!1,l+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),g(F)))}function g(F){return F===null||F===124||xt(F)?(e.exit("data"),y(F)):(e.consume(F),F===92?b:g)}function b(F){return F===92||F===124?(e.consume(F),g):g(F)}function S(F){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(F):(e.enter("tableDelimiterRow"),u=!1,Xe(F)?at(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):k(F))}function k(F){return F===45||F===58?E(F):F===124?(u=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),j):D(F)}function j(F){return Xe(F)?at(e,E,"whitespace")(F):E(F)}function E(F){return F===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),C):F===45?(o+=1,C(F)):F===null||Oe(F)?B(F):D(F)}function C(F){return F===45?(e.enter("tableDelimiterFiller"),T(F)):D(F)}function T(F){return F===45?(e.consume(F),T):F===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(F))}function O(F){return Xe(F)?at(e,B,"whitespace")(F):B(F)}function B(F){return F===124?k(F):F===null||Oe(F)?!u||l!==o?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function R(F){return e.enter("tableRow"),P(F)}function P(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),P):F===null||Oe(F)?(e.exit("tableRow"),t(F)):Xe(F)?at(e,P,"whitespace")(F):(e.enter("data"),Z(F))}function Z(F){return F===null||F===124||xt(F)?(e.exit("data"),P(F)):(e.consume(F),F===92?re:Z)}function re(F){return F===92||F===124?(e.consume(F),Z):Z(F)}}function q$(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,m=0,h,y,g;const b=new U$;for(;++n<e.length;){const S=e[n],k=S[1];S[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(NS(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],u=[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,u[2]===0&&(o[1]!==0&&(u[0]=u[1],g=xd(b,t,o,l,void 0,g),o=[0,0,0,0]),u[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],g=xd(b,t,o,l,void 0,g)),o=u,u=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(u[0]=u[1],g=xd(b,t,o,l,n,g)):u[1]!==0&&(g=xd(b,t,u,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(m!==0&&NS(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=P$(t.events,n))}return e}function xd(e,t,n,a,l,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ks(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ks(t.events,n[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ks(t.events,n[2]),y=ks(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({},ks(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function NS(e,t,n,a,l){const o=[],u=ks(t.events,n);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),a.end=Object.assign({},u),o.push(["exit",a,t]),e.add(n+1,0,o)}function ks(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const H$={name:"tasklistCheck",tokenize:V$};function Z$(){return{text:{91:H$}}}function V$(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 xt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),u):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),u):n(m)}function u(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return Oe(m)?t(m):Xe(m)?e.check({tokenize:Q$},t,n)(m):n(m)}}function Q$(e,t,n){return at(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function G$(e){return kC([b$(),A$(),I$(e),$$(),Z$()])}const K$={};function Y$(e){const t=this,n=e||K$,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(G$(n)),o.push(p$()),u.push(g$(n))}function mE({children:e,className:t}){return d.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:d.jsx(M8,{remarkPlugins:[Y$,V8],children:e})})}function X$({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,u]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),d.jsxs("section",{style:{background:"var(--bg-raised)",border:`var(--hairline) solid ${m?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["System Prompt Append",m&&d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),d.jsx("div",{className:"flex gap-2",children:!o&&!l&&d.jsxs(xe,{size:"xs",variant:"outline",onClick:()=>u(!0),children:[d.jsx(Jd,{className:"h-3 w-3"})," Edit"]})})]}),d.jsx("div",{className:"px-4 py-3",children:o?d.jsxs("div",{className:"space-y-2",children:[d.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u(!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}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(xe,{size:"xs",variant:"ghost",onClick:()=>{a(),u(!1)},disabled:!m,children:"Revert"}),d.jsx(xe,{size:"xs",onClick:()=>u(!1),children:"Done"})]}),d.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."})]}):d.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?d.jsx(mE,{children:e}):d.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}const J$={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function W$(e){return!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved?null:d.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 border-t bg-warn-soft/95 px-6 py-3 backdrop-blur",children:d.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{className:"flex flex-col gap-1 text-body",children:[e.summary.anyDirty&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{"aria-hidden":!0,children:"🟡"}),d.jsxs("span",{className:"font-medium",children:[e.summary.dirtySections.length," section",e.summary.dirtySections.length===1?"":"s"," with unsaved changes"]}),d.jsx("span",{className:"text-muted-foreground",children:"·"}),d.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(t=>d.jsx("button",{type:"button",className:"rounded bg-card px-2 py-0.5 text-caption border hover:bg-warn-soft",onClick:()=>e.onJumpTo(t),children:J$[t]},t))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&d.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[d.jsx(Ru,{className:"h-3.5 w-3.5"}),"Saved"]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:e.saveHint}),e.conflictMessage&&d.jsx("p",{className:"text-caption text-warn font-medium",children:e.conflictMessage}),e.errorMessage&&d.jsx("p",{className:"text-caption text-error font-medium",children:e.errorMessage})]}),d.jsxs("div",{className:"flex gap-2",children:[e.conflictMessage&&d.jsx(xe,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),d.jsx(xe,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),d.jsx(xe,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(FT,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function du(e){return`agent-cfg-${e}`}function nu({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:u}){return d.jsxs("section",{id:e,className:_e("space-y-3",o),...u,children:[d.jsxs("div",{className:"flex items-end justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&d.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),d.jsx("div",{className:"space-y-3",children:l})]})}function eF(){return d.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const tF={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Fixed after creation — create a new agent to switch."},kael:{name:"Kael",caption:"Kael runtime (coming soon). Fixed after creation — create a new agent to switch."}};function nF(e){const t=tF[e.runtimeKind];return d.jsxs("div",{className:"space-y-3",children:[d.jsx(rF,{name:t.name,caption:t.caption,locked:!0}),d.jsx(aF,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer}),e.modelSlot]})}function rF({name:e,caption:t,locked:n}){return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsx("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["Where it runs",n&&d.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[d.jsx(Dw,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),d.jsxs("div",{className:"px-4 py-3 text-body space-y-1",children:[d.jsxs("div",{className:"inline-flex items-center gap-2",children:[d.jsx(Mw,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),d.jsx("span",{className:"font-medium",children:e})]}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function aF(e){const t=!!e.computerLabel;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&d.jsxs(xe,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[d.jsx(Mg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]})]}),d.jsx("div",{className:"px-4 py-3 text-body",children:t?d.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):d.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 iF(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 lF(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function sF(e,t){return JSON.stringify(e)===JSON.stringify(t)}function bp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function _S(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:sF(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function xp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=lF(n,u),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:_S(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:_S(f)}}),remove:a=>t(l=>{const u=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:u}}),undo:a=>t(l=>{const u=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:u}})}}function oF(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:bp(e.payload.mcpServers,"mcp"),env:bp(e.payload.env,"env"),git:bp(e.payload.gitRepos,"git")}}function uF(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(oF(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)??"",u=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const O=[],B=Z=>Z.reduce((re,F)=>F.status==="unchanged"?re:re+1,0),D=B(a.mcp),R=B(a.env),P=B(a.git);return u&&O.push("prompt"),f&&O.push("model"),D>0&&O.push("mcp"),R>0&&O.push("env"),P>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:u?1:0,model:f?1:0,mcp:D,env:R,git:P}}},[a,u,f]),h=x.useCallback(O=>{n(B=>B&&O(B))},[]),y=x.useCallback(O=>h(B=>({...B,promptAppend:O})),[h]),g=x.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),b=x.useCallback(O=>h(B=>({...B,model:O})),[h]),S=x.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=x.useMemo(()=>xp("mcp",h),[h]),j=x.useMemo(()=>xp("env",h),[h]),E=x.useMemo(()=>xp("git",h),[h]),C=x.useCallback(()=>{n(null)},[]),T=x.useCallback(()=>{if(!t||!e)return{};const O={};u&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const B=m.counts.mcp>0,D=m.counts.env>0,R=m.counts.git>0;return B&&(O.mcpServers=t.mcp.filter(P=>P.status!=="deleted").map(P=>P.value)),D&&(O.env=t.env.filter(P=>P.status!=="deleted").map(P=>{const Z=P.value;return Z.sensitive&&Z.value===Pd?{key:Z.key,value:Pd,sensitive:!0}:Z})),R&&(O.gitRepos=t.git.filter(P=>P.status!=="deleted").map(P=>P.value)),O},[t,e,u,f,m]);return{draft:a,summary:m,promptDirty:u,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:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:C,buildPayloadPatch:T}}const cF=Object.values(D6),jr={overview:"ad-overview",setup:"ad-setup",prompt:du("prompt"),tools:du("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function dF(e){const t=[{key:"overview",label:"Overview",anchor:jr.overview}];return e||t.push({key:"setup",label:"Setup",anchor:jr.setup},{key:"prompt",label:"Prompt",anchor:jr.prompt},{key:"tools",label:"Tools",anchor:jr.tools},{key:"advanced",label:"Advanced",anchor:jr.advanced}),t.push({key:"danger",label:"Danger zone",anchor:jr.danger,divider:!0,danger:!0}),t}function fF(){var br,Ut,ln,Kr,Dl,Fu,qu,ro,Ia,Ml,Yr,Xr,Ua,Jr;const t=pA().uuid??"",n=Vr(),a=Jn(),l=Ve({queryKey:["agent",t],queryFn:()=>Jk(t),enabled:!!t}),o=Ve({queryKey:["agent-config",t],queryFn:()=>XL(t),enabled:!!t&&((br=l.data)==null?void 0:br.type)!=="human"}),u=Ve({queryKey:["agent-client-status",t],queryFn:()=>eI(t),enabled:!!t&&((Ut=l.data)==null?void 0:Ut.type)!=="human"}),f=Ve({queryKey:["agent-sessions-active",t],queryFn:()=>Js(t,{state:"active"}),enabled:!!t&&((ln=l.data)==null?void 0:ln.type)!=="human"}),m=Ve({queryKey:["adapters"],queryFn:sC}),h=Ve({queryKey:["adapter-mappings"],queryFn:iC}),{data:y}=Ve({queryKey:["adapter-statuses"],queryFn:lC,refetchInterval:15e3}),g=((Kr=m.data)==null?void 0:Kr.filter(X=>X.agentId===t))??[],b=((Dl=h.data)==null?void 0:Dl.filter(X=>X.agentId===t))??[],S=Ve({queryKey:["clients"],queryFn:gu,enabled:!!t&&((Fu=l.data)==null?void 0:Fu.type)!=="human",refetchInterval:3e4}),k=uF(o.data),[j,E]=x.useState(null),[C,T]=x.useState(null),[O,B]=x.useState(!1),D=vt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const X=k.buildPayloadPatch();return JL(t,{expectedVersion:o.data.version,payload:X})},onSuccess:X=>{a.setQueryData(["agent-config",t],X),E(null),T(null),B(!0)},onError:X=>{if(B(!1),X instanceof Xd&&X.status===409){T("Someone else saved a newer version while you were editing."),E(null);return}E(X instanceof Error?X.message:String(X))}});x.useEffect(()=>{if(!O)return;const X=setTimeout(()=>B(!1),2500);return()=>clearTimeout(X)},[O]),x.useEffect(()=>{k.summary.anyDirty&&B(!1)},[k.summary.anyDirty]);const R=x.useCallback(()=>{T(null),E(null),a.invalidateQueries({queryKey:["agent-config",t]}),k.resetAll()},[a,t,k]),P=x.useCallback(X=>{const $e=document.getElementById(X);$e&&$e.scrollIntoView({behavior:"smooth",block:"start"})},[]),Z=vt({mutationFn:X=>u1(t,X),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),re=vt({mutationFn:()=>B3(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),F=vt({mutationFn:()=>P3(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),de=vt({mutationFn:()=>U3(t),onSuccess:()=>n("/agents")}),W=vt({mutationFn:()=>$3(t)}),[ye,me]=x.useState(!1),[te,q]=x.useState(""),[oe,K]=x.useState(null),he=Ve({queryKey:["clients"],queryFn:gu,enabled:ye}),A=vt({mutationFn:X=>u1(t,{clientId:X}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),me(!1),q(""),K(null)},onError:X=>K(X instanceof Error?X.message:String(X))}),[I,U]=x.useState(!1),[_,le]=x.useState(null),[V,ue]=x.useState(wp),[Se,ee]=x.useState(""),[fe,Ie]=x.useState(null),[Be,St]=x.useState(null),[Vt,Jt]=x.useState(!1),Nr=vt({mutationFn:async()=>{const X=AS(V);if(!X)throw new Error("Credentials are required");return GL({platform:V.platform,agentId:t,credentials:X,status:V.status})},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),_l()}}),_r=vt({mutationFn:()=>{if(!_)throw new Error("No adapter selected");const X={status:V.status},$e=AS(V);return $e&&(X.credentials=$e),KL(_,X)},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),_l()}}),Oa=vt({mutationFn:YL,onSuccess:()=>a.invalidateQueries({queryKey:["adapters"]})}),Da=vt({mutationFn:()=>VL({platform:V.platform,externalUserId:V.externalUserId,agentId:t,boundVia:"manual",displayName:V.displayName||void 0}),onSuccess:()=>{a.invalidateQueries({queryKey:["adapter-mappings"]}),_l()}}),Ar=vt({mutationFn:QL,onSuccess:()=>a.invalidateQueries({queryKey:["adapter-mappings"]})}),[Gr,Ma]=x.useState(null),Mi=vt({mutationFn:()=>WL(t,k.buildPayloadPatch()),onSuccess:X=>{const $e=X.diff.length?X.diff.map(Pn=>`${Pn.op} ${Pn.path}`).join(`
371
- `):"(no changes)";Ma($e)},onError:X=>Ma(`Dry run failed: ${X instanceof Error?X.message:String(X)}`)});x.useEffect(()=>{if(!k.summary.anyDirty)return;const X=$e=>{$e.preventDefault(),$e.returnValue=""};return window.addEventListener("beforeunload",X),()=>window.removeEventListener("beforeunload",X)},[k.summary.anyDirty]);const La=((qu=l.data)==null?void 0:qu.type)==="human",tn=x.useMemo(()=>dF(La),[La]),Nl=x.useRef(null),[ae,ve]=x.useState(!1);if(x.useEffect(()=>{if(La)return;const X=Nl.current;if(!X||typeof IntersectionObserver>"u")return;const $e=new IntersectionObserver(Pn=>{const Nn=Pn[0];Nn&&ve(!Nn.isIntersecting&&Nn.boundingClientRect.top<0)},{threshold:0});return $e.observe(X),()=>$e.disconnect()},[La]),l.isLoading)return d.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:d.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return d.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 we=l.data;if(!we)return d.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const De=we.type==="human",Pe=u.data,nn=((ro=f.data)==null?void 0:ro.length)??0,er=!De&&!(Pe!=null&&Pe.clientId),rn=!De&&Pe?!Pe.online&&!!Pe.clientId:!1,At=we,an=At.runtimeState??null,ot=At.runtimeType??null,Tr=At.totalSessions??null,fn=we.uuid.slice(0,8);function _l(){U(!1),le(null),ue(wp),ee("")}function Al(X){le(X.id),ue({...wp,platform:X.platform,status:X.status}),U(!0)}function Tl(X){if(X.preventDefault(),ee(""),De){if(!V.externalUserId)return;Da.mutate();return}if(V.platform==="feishu"){if(!_&&(!V.feishuAppId||!V.feishuAppSecret)){ee("App ID and App Secret are required");return}}else if(V.platform==="kael"){if(!_&&(!V.kaelUserId||!V.kaelProjectId)){ee("User ID and Project ID are required");return}}else{const $e=V.credentialsJson.trim();if(!_&&!$e){ee("Credentials are required");return}if($e)try{JSON.parse($e)}catch{ee("Invalid JSON");return}}_?_r.mutate():Nr.mutate()}const Li=Nr.error??_r.error??Da.error,Rr=Nr.isPending||_r.isPending||Da.isPending,Rl=iF({activeSessions:nn,isUnclaimed:er,isOffline:rn}),Ii=k.draft.mcp.filter(X=>X.status!=="deleted"),xf=k.draft.env.filter(X=>X.status!=="deleted"),Bu=k.draft.git.filter(X=>X.status!=="deleted"),no=X=>new Set(Ii.filter($e=>$e.key!==X).map($e=>$e.value.name.toLowerCase())),Ui=X=>new Set(xf.filter($e=>$e.key!==X).map($e=>$e.value.key)),Sf=X=>new Set(Bu.filter($e=>$e.key!==X).map($e=>{const{value:Pn}=$e;return Pn.localPath?Pn.localPath:((Pn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),tr={sessions:Tr??"—",active:nn,runtime:ot??(De?"human":"—"),model:((Ml=(Ia=o.data)==null?void 0:Ia.payload.model)==null?void 0:Ml.trim())||"—"},Bi=(Pe==null?void 0:Pe.clientId)??null,zl=Bi?((Yr=S.data)==null?void 0:Yr.find(X=>X.id===Bi))??null:null,Ol=Bi?(zl==null?void 0:zl.hostname)??Bi:null,Pi=ot==="kael"?"kael":"claude-code",Pu=Pi==="kael"?"Kael":Pi==="claude-code"?"Claude Code":ot??"—",$u=d.jsxs(Zr,{children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"inline-flex items-center gap-2 text-body font-semibold",children:[De?d.jsx(Mg,{className:"h-3.5 w-3.5"}):d.jsx(CT,{className:"h-3.5 w-3.5"}),"Platform bindings"]}),d.jsxs(xe,{size:"xs",variant:"outline",onClick:()=>U(!0),children:[d.jsx(Sl,{className:"h-3 w-3"}),De?"Bind user":"Bind bot"]})]}),De?d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Yt,{children:[d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"External user ID"}),d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Bound via"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{style:{width:32}})]})}),d.jsx(_a,{children:b.length===0?d.jsx(Yt,{children:d.jsx(Ne,{colSpan:6,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):b.map(X=>d.jsxs(Yt,{children:[d.jsx(Ne,{children:d.jsx(Xt,{children:X.platform})}),d.jsx(Ne,{className:"mono text-label",children:X.externalUserId}),d.jsx(Ne,{children:X.displayName??"—"}),d.jsx(Ne,{children:d.jsx(Xt,{tone:"outline",children:X.boundVia??"—"})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(X.createdAt)}),d.jsx(Ne,{children:d.jsx(xe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Ie(X.id),disabled:Ar.isPending,children:d.jsx(pu,{className:"h-3.5 w-3.5"})})})]},X.id))})]}):d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Yt,{children:[d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Connection"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{style:{width:64}})]})}),d.jsx(_a,{children:g.length===0?d.jsx(Yt,{children:d.jsx(Ne,{colSpan:5,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):g.map(X=>{const $e=y==null?void 0:y.find(Nn=>Nn.configId===X.id),Pn=X.platform==="kael"?X.status==="active":!!($e!=null&&$e.connected);return d.jsxs(Yt,{children:[d.jsx(Ne,{children:d.jsx(Xt,{children:X.platform})}),d.jsx(Ne,{children:d.jsx(Xt,{tone:X.status==="active"?"accent":"outline",children:X.status})}),d.jsx(Ne,{children:d.jsx(Ti,{state:Pn?"idle":"offline"})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(X.createdAt)}),d.jsx(Ne,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(xe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Al(X),title:"Edit",children:"…"}),d.jsx(xe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>St(X.id),disabled:Oa.isPending,title:"Delete",children:d.jsx(pu,{className:"h-3.5 w-3.5"})})]})})]},X.id)})})]})]});return d.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[d.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:[d.jsx(hf,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),tn.map(X=>d.jsxs("div",{children:[X.divider&&d.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),d.jsx("button",{type:"button",onClick:()=>P(X.anchor),className:"block w-full text-left bg-transparent text-body",style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",color:X.danger?"var(--state-error)":"var(--fg-3)",border:"none",borderLeft:"var(--hairline-bold) solid transparent",cursor:"pointer"},onMouseEnter:$e=>{$e.currentTarget.style.color=X.danger?"var(--state-error)":"var(--fg)",$e.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:$e=>{$e.currentTarget.style.color=X.danger?"var(--state-error)":"var(--fg-3)",$e.currentTarget.style.background="transparent"},children:X.label})]},X.key))]}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[d.jsxs(tI,{style:{marginBottom:8},children:[d.jsx(nI,{onClick:()=>n("/agents"),children:"Agents"}),d.jsx(rI,{}),d.jsx(aI,{mono:!0,children:we.name??fn})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.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:d.jsx(Du,{width:18,height:20,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-title",children:we.displayName??we.name??fn}),d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",we.name??fn]})]}),d.jsxs("div",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:["agt_",fn," · ",we.type,we.visibility?` · ${we.visibility}`:""]})]}),d.jsx(Ti,{state:an})]}),d.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[d.jsx(gd,{label:"sessions",value:tr.sessions}),d.jsx(gd,{label:"active",value:tr.active,accent:typeof tr.active=="number"&&tr.active>0?"var(--accent)":void 0}),d.jsx(gd,{label:"runtime",value:tr.runtime}),d.jsx(gd,{label:"model",value:tr.model})]})]}),!De&&d.jsx(lI,{runtimeLabel:Pu,computerLabel:Ol,modelLabel:tr.model,visible:ae}),d.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:[(W.data||W.error)&&d.jsx(yF,{result:W.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>W.reset()}),d.jsx(nu,{anchorId:jr.overview,title:"Overview",children:d.jsx(kI,{agent:we,isHuman:De,profileSlot:d.jsx(gI,{agent:we,onSave:async X=>{await Z.mutateAsync(X)}}),bindingsSlot:$u,health:{runtimeState:an,model:tr.model,activeSessions:nn,totalSessions:tr.sessions,offlineSince:(Pe==null?void 0:Pe.offlineSince)??null},onOpenChat:()=>n(`/?a=${we.uuid}`),onTest:()=>{W.reset(),W.mutate()},testPending:W.isPending})}),d.jsx("div",{ref:Nl,"aria-hidden":!0,style:{height:0}}),!De&&d.jsxs(d.Fragment,{children:[d.jsxs(nu,{anchorId:jr.setup,title:"Setup",caption:((Xr=o.data)==null?void 0:Xr.version)!=null?d.jsxs("span",{className:"mono",children:["config v",o.data.version,k.summary.anyDirty&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&d.jsx(nF,{runtimeKind:Pi,computerLabel:Ol,canBindComputer:er&&we.status==="active",bindComputerPending:A.isPending,onBindComputer:()=>me(!0),modelSlot:d.jsx(wI,{value:k.draft.model,baseline:((Ua=o.data)==null?void 0:Ua.payload.model)??"",onChange:k.setModel,onRevert:k.revertModel,disabled:we.status!=="active"})})]}),d.jsx(nu,{anchorId:jr.prompt,title:"Prompt",children:o.data?d.jsx(X$,{value:k.draft.promptAppend,baseline:((Jr=o.data)==null?void 0:Jr.payload.prompt.append)??"",onChange:k.setPromptAppend,onRevert:k.revertPrompt,disabled:we.status!=="active"}):null}),d.jsx(nu,{anchorId:jr.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?d.jsx(bI,{items:k.draft.mcp,otherNames:no,onAdd:k.addMcp,onUpdate:k.updateMcp,onDelete:k.deleteMcp,onUndoDelete:k.undoDeleteMcp,disabled:we.status!=="active"}):null}),d.jsx(nu,{anchorId:jr.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{id:du("env"),className:"space-y-2",children:[d.jsx("h3",{className:"text-body font-medium",style:{color:"var(--fg)"},children:"Environment variables"}),d.jsx(fI,{items:k.draft.env,otherKeys:Ui,onAdd:k.addEnv,onUpdate:k.updateEnv,onDelete:k.deleteEnv,onUndoDelete:k.undoDeleteEnv,disabled:we.status!=="active"})]}),d.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border-faint)"}}),d.jsxs("div",{id:du("git"),className:"space-y-2",children:[d.jsx("h3",{className:"text-body font-medium",style:{color:"var(--fg)"},children:"Git repositories"}),d.jsx(mI,{items:k.draft.git,otherPaths:Sf,onAdd:k.addGit,onUpdate:k.updateGit,onDelete:k.deleteGit,onUndoDelete:k.undoDeleteGit,disabled:we.status!=="active"})]}),Gr&&d.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:8,borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:Gr}),k.summary.anyDirty&&d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:d.jsx("button",{type:"button",onClick:()=>Mi.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:Mi.isPending,children:Mi.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),d.jsx(eF,{}),d.jsx(sI,{agent:we,suspendPending:re.isPending,reactivatePending:F.isPending,deletePending:de.isPending,onSuspend:()=>re.mutate(),onReactivate:()=>F.mutate(),onDelete:()=>de.mutate()})]}),!De&&d.jsx(W$,{summary:k.summary,saveHint:Rl,conflictMessage:C,errorMessage:j,saving:D.isPending,justSaved:O,onSave:()=>D.mutate(),onDiscard:()=>{k.summary.anyDirty&&Jt(!0)},onReloadRemote:R,onJumpTo:X=>P(du(X))})]}),d.jsx(Sp,{open:fe!=null,onOpenChange:X=>!X&&Ie(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:Ar.isPending,onConfirm:()=>{fe!=null&&(Ar.mutate(fe),Ie(null))}}),d.jsx(Sp,{open:Be!=null,onOpenChange:X=>!X&&St(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:Oa.isPending,onConfirm:()=>{Be!=null&&(Oa.mutate(Be),St(null))}}),d.jsx(Sp,{open:Vt,onOpenChange:Jt,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:()=>{k.resetAll(),E(null),T(null),Jt(!1)}}),d.jsx(gn,{open:ye,onOpenChange:X=>{me(X),X||(q(""),K(null),A.reset())},children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:"Bind computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.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."}),he.isLoading?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):he.error?d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",he.error instanceof Error?he.error.message:"Unknown"]}):d.jsx(hF,{clients:he.data??[],selected:te,onSelect:q}),oe&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:oe})]}),d.jsxs(yn,{children:[d.jsx(xe,{variant:"outline",onClick:()=>me(!1),children:"Cancel"}),d.jsx(xe,{disabled:!te||A.isPending,onClick:()=>{K(null),A.mutate(te)},children:A.isPending?"Binding…":"Bind"})]})]})}),d.jsx(gn,{open:I,onOpenChange:X=>X?U(!0):_l(),children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:De?"Bind External User":_?"Edit Bot Binding":"Bind Bot"})}),d.jsxs("form",{onSubmit:Tl,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"binding-platform",children:"Platform"}),d.jsx("select",{id:"binding-platform",value:V.platform,onChange:X=>ue({...V,platform:X.target.value}),disabled:!!_,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:cF.map(X=>d.jsx("option",{value:X,children:X},X))})]}),De?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"binding-ext-id",children:"External User ID"}),d.jsx(bt,{id:"binding-ext-id",value:V.externalUserId,onChange:X=>ue({...V,externalUserId:X.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"binding-name",children:"Display Name (optional)"}),d.jsx(bt,{id:"binding-name",value:V.displayName,onChange:X=>ue({...V,displayName:X.target.value})})]})]}):d.jsxs(d.Fragment,{children:[V.platform==="feishu"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"feishu-app-id",children:["App ID",_?" — leave empty to keep existing":""]}),d.jsx(bt,{id:"feishu-app-id",value:V.feishuAppId,onChange:X=>ue({...V,feishuAppId:X.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"feishu-app-secret",children:["App Secret",_?" — leave empty to keep existing":""]}),d.jsx(bt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:V.feishuAppSecret,onChange:X=>ue({...V,feishuAppSecret:X.target.value}),placeholder:"••••••••"})]})]}):V.platform==="kael"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"kael-user-id",children:["User ID",_?" — leave empty to keep existing":""]}),d.jsx(bt,{id:"kael-user-id",value:V.kaelUserId,onChange:X=>ue({...V,kaelUserId:X.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"kael-project-id",children:["Project ID",_?" — leave empty to keep existing":""]}),d.jsx(bt,{id:"kael-project-id",value:V.kaelProjectId,onChange:X=>ue({...V,kaelProjectId:X.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!_&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs(rt,{htmlFor:"binding-creds",children:["Credentials (JSON)",_?" — leave empty to keep existing":""]}),d.jsx("textarea",{id:"binding-creds",value:V.credentialsJson,onChange:X=>ue({...V,credentialsJson:X.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": "..."}'})]}),Se&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:Se}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"binding-status",children:"Status"}),d.jsxs("select",{id:"binding-status",value:V.status,onChange:X=>ue({...V,status:X.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:[d.jsx("option",{value:"active",children:"active"}),d.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),Li instanceof Error&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:Li.message}),d.jsx(yn,{children:d.jsx(xe,{type:"submit",disabled:Rr,children:Rr?"Saving...":_?"Update":"Create"})})]})]})})]})}function Sp(e){return d.jsx(gn,{open:e.open,onOpenChange:e.onOpenChange,children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:e.title})}),d.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),d.jsxs(yn,{children:[d.jsx(xe,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),d.jsx(xe,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}const wp={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""};function AS(e){if(e.platform==="feishu"){if(!e.feishuAppId&&!e.feishuAppSecret)return null;if(!e.feishuAppId||!e.feishuAppSecret)throw new Error("Both App ID and App Secret are required");return{app_id:e.feishuAppId,app_secret:e.feishuAppSecret}}if(e.platform==="kael"){if(!e.kaelUserId&&!e.kaelProjectId)return null;if(!e.kaelUserId||!e.kaelProjectId)throw new Error("User ID and Project ID are required");return{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId}}const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function hF({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?d.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"," ",d.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."]}):d.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,u=l.status==="online"||l.status==="active";return d.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:d.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:[d.jsx("span",{className:_e("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:u?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),d.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}`:""]})]}),d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const mF={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},pF={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},gF={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function yF({result:e,onDismiss:t}){const n=pF[e.status],a=gF[e.status],l=e.connection;return d.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:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Xt,{tone:a,children:mF[e.status]}),e.responseTime!=null&&d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&d.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[d.jsx("div",{children:l.runtimeState&&d.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?d.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):d.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&d.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&d.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})]}),d.jsx(xe,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function vF(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function bF({agent:e,open:t,onClose:n,onBound:a}){var g;const[l,o]=x.useState(!1),u=Ve({queryKey:["connect-token",e.uuid],queryFn:()=>Jw(),enabled:t,staleTime:6e4}),f=Ve({queryKey:["agent-poll",e.uuid],queryFn:()=>Jk(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=u.data)==null?void 0:g.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${vF(e.name)} --agent-id ${e.uuid} && `+m:m;function y(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return d.jsx(gn,{open:t,onOpenChange:b=>!b&&n(),children:d.jsxs(dn,{className:"max-w-lg",children:[d.jsx(En,{children:d.jsx(vn,{children:"Last step — connect your computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.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."}),d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[d.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),d.jsx(xe,{variant:"outline",size:"icon",className:"shrink-0",onClick:y,disabled:!h,children:l?d.jsx(Ru,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):d.jsx(Dg,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[d.jsx(bl,{state:"working",size:8}),d.jsx("span",{children:"Waiting for your computer to connect…"})]}),d.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."})]}),d.jsx(yn,{children:d.jsx(xe,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const kp=200;function xF(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 TS(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,Es)}function SF(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,Es)}function wF(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 kF({open:e,onOpenChange:t,onCreated:n}){const a=Jn(),[l,o]=x.useState(""),[u,f]=x.useState(""),[m,h]=x.useState(!1),[y,g]=x.useState("claude-code"),[b,S]=x.useState("form"),[k,j]=x.useState([]),[E,C]=x.useState(null),[T,O]=x.useState(!1),[B,D]=x.useState({}),[R,P]=x.useState({status:"idle"});x.useEffect(()=>{e&&(o(""),f(""),h(!1),g("claude-code"),S("form"),j([]),C(null),O(!1),D({}),P({status:"idle"}))},[e]),x.useEffect(()=>{m||f(TS(l))},[l,m]);const Z=x.useRef(0);x.useEffect(()=>{if(!e||!u){P({status:"idle"});return}if(!tg.test(u)){P({status:"bad",reason:"invalid"});return}if(ng(u)){P({status:"bad",reason:"reserved"});return}const K=++Z.current;P({status:"checking"});const he=window.setTimeout(()=>{I3(u).then(A=>{K===Z.current&&(A.available?P({status:"ok"}):P({status:"bad",reason:A.reason}))}).catch(()=>{K===Z.current&&P({status:"idle"})})},300);return()=>window.clearTimeout(he)},[u,e]);const re=vt({mutationFn:async K=>{const he=l.trim()||u.trim()||"Untitled assistant";return L3({name:u||void 0,type:"personal_assistant",displayName:he,clientId:K.clientId})},onSuccess:K=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),n(K,y)}}),F=x.useMemo(()=>{const K=re.error;if(!K)return{};if(K instanceof Xd){const he=xF(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}:{}},[re.error]),de=R.status==="bad"?wF(R.reason):void 0,W={...de?{name:de}:{},...F,...B};function ye(){const K={};return u?u.length>Es?K.name=`Agent name must be at most ${Es} characters (got ${u.length}).`:tg.test(u)?ng(u)&&(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>kp&&(K.displayName=`Display name must be at most ${kp} characters (got ${l.length}).`),K}async function me(K){var A,I;K.preventDefault();const he=ye();if(D(he),!(Object.keys(he).length>0)&&R.status!=="bad"){if(y!=="claude-code"){re.mutate({clientId:void 0});return}O(!0);try{const _=(await gu()).filter(V=>V.status==="connected");if(_.length===0){re.mutate({clientId:void 0});return}if(_.length===1){re.mutate({clientId:(A=_[0])==null?void 0:A.id});return}const le=[..._].sort((V,ue)=>ue.lastSeenAt.localeCompare(V.lastSeenAt));j(le),C(((I=le[0])==null?void 0:I.id)??null),S("pick-computer")}catch{re.mutate({clientId:void 0})}finally{O(!1)}}}function te(){E&&re.mutate({clientId:E})}const q=R.status==="bad",oe=l.trim().length>0&&!q&&!re.isPending&&!T;return b==="pick-computer"?d.jsx(gn,{open:e,onOpenChange:t,children:d.jsxs(dn,{className:"max-w-lg",children:[d.jsx(En,{children:d.jsx(vn,{children:"Choose a computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",d.jsx("span",{className:"font-medium",children:l||u})," ","should run:"]}),d.jsx("div",{className:"space-y-2",children:k.map(K=>{const he=E===K.id;return d.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:[d.jsx("input",{type:"radio",name:"target-computer",checked:he,onChange:()=>C(K.id),className:"mt-1"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-body font-medium truncate",children:K.hostname??K.id}),d.jsxs("div",{className:"text-caption text-muted-foreground",children:[K.os??"unknown OS"," · last seen ",new Date(K.lastSeenAt).toLocaleString()]})]})]},K.id)})}),W.clientId&&d.jsx("p",{className:"text-body text-destructive",children:W.clientId}),W._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:W._root})]}),d.jsxs(yn,{children:[d.jsx(xe,{variant:"outline",onClick:()=>S("form"),disabled:re.isPending,children:"Back"}),d.jsx(xe,{onClick:te,disabled:!E||re.isPending,children:re.isPending?"Creating…":"Create"})]})]})}):d.jsx(gn,{open:e,onOpenChange:t,children:d.jsxs(dn,{className:"max-w-lg",children:[d.jsx(En,{children:d.jsx(vn,{children:"New Agent"})}),d.jsxs("form",{onSubmit:me,className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"new-agent-display-name",children:"Display name"}),d.jsx(bt,{id:"new-agent-display-name",value:l,onChange:K=>{o(K.target.value),B.displayName&&D(he=>({...he,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:kp,"aria-invalid":W.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),d.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."}),W.displayName&&d.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:W.displayName})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"new-agent-name",children:"Agent name"}),d.jsxs("div",{className:"flex items-stretch",children:[d.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:"@"}),d.jsx(bt,{id:"new-agent-name",value:u,onChange:K=>{const he=SF(K.target.value);f(he),h(!0),B.name&&D(A=>({...A,name:void 0}))},onBlur:K=>{const he=TS(K.target.value);he!==u&&f(he)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:Es,"aria-invalid":W.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),d.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"," ",Es," characters. Permanent after creation."]}),u&&!W.name&&R.status!=="idle"&&d.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:R.status==="ok"?"var(--state-idle)":R.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[R.status==="checking"&&"Checking availability…",R.status==="ok"&&"Available."]}),W.name&&d.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:W.name})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{children:"Where it runs"}),d.jsxs("div",{className:"space-y-2",children:[d.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:[d.jsx("input",{type:"radio",name:"runtime",checked:y==="claude-code",onChange:()=>g("claude-code"),className:"mt-1"}),d.jsxs("div",{children:[d.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Runs on your computer, can access your local files. (default)"})]})]}),d.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border p-3 cursor-not-allowed opacity-60",title:"Coming soon",children:[d.jsx("input",{type:"radio",name:"runtime",disabled:!0,className:"mt-1"}),d.jsxs("div",{children:[d.jsxs("div",{className:"text-body font-medium",children:["Kael ",d.jsx("span",{className:"ml-1 text-caption font-normal text-muted-foreground",children:"— coming soon"})]}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),W._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:W._root}),d.jsx(yn,{children:d.jsx(xe,{type:"submit",disabled:!oe,children:T?"Checking computers…":re.isPending?"Creating…":"Create"})})]})]})})}function lu({active:e,count:t,warn:n,className:a,children:l,style:o,...u}){return d.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},...u,children:[l,t!==void 0&&d.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const jF=Object.values(I6);function RS(e){return[...e].sort((t,n)=>{const a=(t.name??t.displayName??"").toLowerCase(),l=(n.name??n.displayName??"").toLowerCase();return a.localeCompare(l)})}function CF(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null}}function xs(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 EF(){const e=Vr(),{memberId:t}=Aa(),[n,a]=x.useState(),[l,o]=x.useState(""),[u,f]=x.useState(!1),[m,h]=x.useState(null),[y,g]=x.useState("all"),[b,S]=x.useState(""),k=jl(),j=qg(),E=ay(),{data:C,isLoading:T,error:O}=Ve({queryKey:["agents",n,l],queryFn:()=>af({limit:100,cursor:n,type:l||void 0})}),{data:B}=Ve({queryKey:["activity"],queryFn:zu,refetchInterval:1e4}),D=x.useMemo(()=>{const K=new Map;for(const he of(B==null?void 0:B.agents)??[])K.set(he.agentId,he);return K},[B==null?void 0:B.agents]),{myAgents:R,teamAgents:P}=x.useMemo(()=>{if(!(C!=null&&C.items))return{myAgents:[],teamAgents:[]};const K=[],he=[];for(const A of C.items)t&&A.managerId===t?K.push(A):he.push(A);return{myAgents:RS(K),teamAgents:RS(he)}},[C,t]),Z=(C==null?void 0:C.items.length)??0,re=R.length,F=P.length,de=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var he;return((he=D.get(K.uuid))==null?void 0:he.runtimeState)==="working"}).length,[C==null?void 0:C.items,D]),W=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var A;const he=(A=D.get(K.uuid))==null?void 0:A.runtimeState;return he==="blocked"||he==="error"}).length,[C==null?void 0:C.items,D]);function ye(K){var A;const he=(A=D.get(K.uuid))==null?void 0:A.runtimeState;return y==="mine"?t!=null&&K.managerId===t:y==="running"?he==="working":y==="attn"?he==="blocked"||he==="error":!0}function me(K){if(!b.trim())return!0;const he=b.toLowerCase(),A=K.delegateMention?k(K.delegateMention):"",I=E(K.managerId);return(K.name??"").toLowerCase().includes(he)||(K.displayName??"").toLowerCase().includes(he)||A.toLowerCase().includes(he)||I.toLowerCase().includes(he)}const te=R.filter(K=>ye(K)&&me(K)),q=P.filter(K=>ye(K)&&me(K));function oe(K,he){if(f(!1),K.clientId){e(`/?a=${K.uuid}`);return}if(he==="claude-code"){h(K);return}e(`/?a=${K.uuid}`)}return d.jsxs("div",{className:"-m-6",children:[d.jsx(ff,{title:"Agents",subtitle:Z>0?d.jsxs(d.Fragment,{children:[Z," total · ",re," mine · ",F," team"]}):null,right:d.jsx("div",{className:"flex items-center gap-1.5",children:d.jsxs(xe,{size:"xs",onClick:()=>f(!0),children:[d.jsx(Sl,{className:"h-3 w-3"}),"New agent"]})})}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.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:[d.jsxs("div",{className:"relative",style:{width:240},children:[d.jsx(Wd,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),d.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)"}})]}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(lu,{active:y==="all",count:Z,onClick:()=>g("all"),children:"all"}),d.jsx(lu,{active:y==="mine",count:re,onClick:()=>g("mine"),children:"mine"}),d.jsx(lu,{active:y==="running",count:de,onClick:()=>g("running"),children:"running"}),d.jsx(lu,{active:y==="attn",count:W,warn:!0,onClick:()=>g("attn"),children:"attn"})]}),d.jsx("div",{style:{flex:1}}),d.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:[d.jsx("option",{value:"",children:"all types"}),jF.map(K=>d.jsx("option",{value:K,children:K},K))]})]}),T?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):O?d.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",O instanceof Error?O.message:"Unknown error"]}):d.jsxs(d.Fragment,{children:[d.jsx(zS,{title:`My agents · ${te.length}`,agents:te,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!1,emptyLabel:R.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:d.jsx(OS,{items:[{state:"working",count:xs(R,D,"working")},{state:"blocked",count:xs(R,D,"blocked")},{state:"error",count:xs(R,D,"error")}]}),className:"mb-4"}),P.length>0&&d.jsx(zS,{title:`Team agents · ${q.length}`,agents:q,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!0,emptyLabel:"No agents match the current filter",breakdown:d.jsx(OS,{items:[{state:"working",count:xs(P,D,"working")},{state:"blocked",count:xs(P,D,"blocked")},{state:"error",count:xs(P,D,"error")}]})})]}),(C==null?void 0:C.nextCursor)&&d.jsx("div",{className:"flex justify-end mt-4",children:d.jsx(xe,{variant:"outline",size:"xs",onClick:()=>a(C.nextCursor??void 0),children:"Next page"})})]}),d.jsx(kF,{open:u,onOpenChange:f,onCreated:oe}),m&&d.jsx(bF,{agent:m,open:m!==null,onClose:()=>{const K=m.uuid;h(null),e(`/?a=${K}`)},onBound:K=>{h(null),e(`/?a=${K.uuid}`)}})]})}function zS({title:e,agents:t,runtimeMap:n,resolveAgentIdentity:a,resolveMemberName:l,navigate:o,emptyLabel:u,breakdown:f,className:m,showOwner:h}){return d.jsxs(Zr,{className:m,children:[d.jsx(Zs,{right:f,children:e}),t.length===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:u}):d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Yt,{children:[d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Agent name"}),d.jsx(ze,{children:"Type"}),d.jsx(ze,{children:"Delegate"}),h&&d.jsx(ze,{children:"Owner"}),d.jsx(ze,{children:"Runtime"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Created"})]})}),d.jsx(_a,{children:t.map(y=>d.jsx(NF,{agent:y,runtime:CF(y,n),resolveAgentIdentity:a,resolveMemberName:l,navigate:o,showOwner:h},y.uuid))})]})]})}function OS({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:d.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>d.jsxs("span",{className:"inline-flex items-center",children:[a>0&&d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function NF({agent:e,runtime:t,resolveAgentIdentity:n,resolveMemberName:a,navigate:l,showOwner:o}){const{runtimeState:u}=t,f=u==="idle"||u==="working"||u==="blocked"||u==="error"||u==="offline",m=e.delegateMention?n(e.delegateMention):null;return d.jsxs(Yt,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[d.jsx(Ne,{children:d.jsx("span",{className:"font-medium",children:e.displayName??d.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})})}),d.jsx(Ne,{children:e.name?d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",e.name]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),d.jsx(Ne,{children:d.jsx(Xt,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),d.jsx(Ne,{children:e.delegateMention?d.jsx(oC,{name:(m==null?void 0:m.name)??null,displayName:(m==null?void 0:m.displayName)??null,tone:"accent"}):d.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),o&&d.jsx(Ne,{className:"text-label",style:{color:"var(--fg-2)"},children:a(e.managerId)}),d.jsx(Ne,{children:u&&f?d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(bl,{state:u,size:7}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:u})]}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),d.jsx(Ne,{children:d.jsx(Xt,{tone:e.status==="active"?"accent":"outline",children:e.status})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(e.createdAt)})]})}function _F(){const{data:e}=Ve({queryKey:["members","user-name-map"],queryFn:ry,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])}function AF(){const[e,t]=x.useState(null),[n,a]=x.useState(!1),l=vt({mutationFn:Jw,onSuccess:u=>{t(u),a(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),a(!0),setTimeout(()=>a(!1),2e3))};return d.jsxs("div",{className:"grid items-center gap-2.5 mb-3.5",style:{gridTemplateColumns:"auto 1fr auto auto",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("span",{className:"inline-flex items-center gap-2 text-body",style:{color:"var(--fg-2)"},children:[d.jsx(cR,{className:"h-3.5 w-3.5"}),"Connect a computer"]}),e?d.jsxs("code",{className:"mono whitespace-nowrap overflow-hidden text-ellipsis text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)"},title:e.command,children:[e.command," ",d.jsxs("span",{style:{color:"var(--fg-4)"},children:["# expires in ",Math.round(e.expiresIn/60),"m"]})]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"Generate a single-use command to pair a new machine with this Hub."}),d.jsxs(xe,{variant:"outline",size:"xs",onClick:o,disabled:!e,children:[n?d.jsx(Ru,{className:"h-3 w-3"}):d.jsx(Dg,{className:"h-3 w-3"}),n?"Copied":"Copy"]}),d.jsx(xe,{variant:"outline",size:"xs",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating…":e?"Regenerate":"Generate"})]})}function TF(){const e=Jn(),t=jl(),n=_F(),{role:a}=Aa(),l=a==="admin",[o,u]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(null),{data:S}=Ve({queryKey:["clients"],queryFn:gu,refetchInterval:1e4}),{data:k}=Ve({queryKey:["activity"],queryFn:zu,refetchInterval:1e4}),j=vt({mutationFn:uz,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),E=vt({mutationFn:oz,onSuccess:()=>{y(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:D=>{D instanceof Xd?b(D.message):b(D instanceof Error?D.message:String(D))}}),C=x.useMemo(()=>{const D=new Map;for(const R of(k==null?void 0:k.agents)??[]){if(!R.clientId)continue;const P=D.get(R.clientId)??[];P.push(R),D.set(R.clientId,P)}return D},[k==null?void 0:k.agents]),T=D=>C.get(D)??[],O=(S??[]).filter(D=>D.status==="connected").length,B=(S??[]).reduce((D,R)=>D+R.agentCount,0);return d.jsxs("div",{className:"-m-6",children:[d.jsx(ff,{title:"Computers",subtitle:S&&S.length>0?d.jsxs(d.Fragment,{children:[S.length," total · ",O," connected · ",B," agents bound"]}):null}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.jsx(AF,{}),h&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.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:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",d.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)."]}),T(h.id).length>0&&d.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:[d.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),d.jsx("ul",{className:"text-body space-y-0.5",children:T(h.id).map(D=>d.jsx("li",{className:"font-medium",children:t(D.agentId)},D.agentId))})]}),g&&d.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}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(xe,{variant:"outline",size:"sm",onClick:()=>{y(null),b(null)},children:"Cancel"}),d.jsx(xe,{variant:"destructive",size:"sm",onClick:()=>E.mutate(h.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),f&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.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:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",d.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),d.jsx("ul",{className:"mb-4 space-y-1",children:T(f.id).length===0?d.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):T(f.id).map(D=>d.jsxs("li",{className:"text-body flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:t(D.agentId)}),d.jsx(Ti,{state:D.runtimeState})]},D.agentId))}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(xe,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),d.jsx(xe,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!S||S.length===0?d.jsx(Zr,{children:d.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."})}):d.jsxs(Zr,{children:[d.jsxs(Zs,{right:d.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",S.length]}),d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Yt,{children:[d.jsx(ze,{style:{width:16}}),d.jsx(ze,{children:"Hostname"}),l&&d.jsx(ze,{children:"Owner"}),d.jsx(ze,{children:"OS"}),d.jsx(ze,{children:"SDK"}),d.jsx(ze,{children:"Agents"}),d.jsx(ze,{children:"Connected"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{})]})}),d.jsx(_a,{children:S.map(D=>{const R=o===D.id,P=T(D.id);return d.jsx(RF,{client:D,boundAgents:P,isExpanded:R,agentName:t,showOwner:l,ownerName:n,onToggle:()=>u(R?null:D.id),onDisconnect:()=>m(D),onRetire:()=>{b(null),y(D)}},D.id)})})]})]})]})]})}function RF({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m}){const h=l?9:8,y=e.status==="connected"?"idle":"offline";return d.jsxs(d.Fragment,{children:[d.jsxs(Yt,{interactive:!0,selected:n,onClick:u,children:[d.jsx(Ne,{style:{width:16},children:d.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?d.jsx(_T,{className:"h-3.5 w-3.5"}):d.jsx(TT,{className:"h-3.5 w-3.5"})})}),d.jsx(Ne,{className:"font-medium",children:e.hostname??"—"}),l&&d.jsx(Ne,{style:{color:"var(--fg-2)"},children:o(e.userId)}),d.jsx(Ne,{style:{color:"var(--fg-3)"},children:e.os??"—"}),d.jsx(Ne,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),d.jsx(Ne,{children:d.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?Hr(e.connectedAt):"—"}),d.jsx(Ne,{children:d.jsx(Ti,{state:y})}),d.jsx(Ne,{style:{width:1,whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-1 justify-end",children:[d.jsxs(xe,{variant:"ghost",size:"xs",className:"text-label",onClick:g=>{g.stopPropagation(),f()},children:[d.jsx(yR,{className:"h-3 w-3"})," Disconnect"]}),d.jsxs(xe,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:g=>{g.stopPropagation(),m()},children:[d.jsx(pu,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&d.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[d.jsx(Ne,{}),d.jsxs(Ne,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[d.jsxs(hf,{style:{display:"block",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):d.jsx("div",{className:"flex flex-col gap-1",children:t.map(g=>d.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[d.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(g.agentId)}),d.jsx(Ti,{state:g.runtimeState}),g.activeSessions!==null&&d.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[g.activeSessions," / ",g.totalSessions??0," sessions"]})]},g.agentId))})]})]})]})}const pE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));pE.displayName="Card";const gE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));gE.displayName="CardHeader";const yE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("text-subtitle leading-none",e),...t}));yE.displayName="CardTitle";const vE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("text-body text-muted-foreground",e),...t}));vE.displayName="CardDescription";const bE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));bE.displayName="CardContent";const zF=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));zF.displayName="CardFooter";function OF(){const{isAuthenticated:e,login:t}=Aa(),[n,a]=x.useState(""),[l,o]=x.useState(""),[u,f]=x.useState(null),[m,h]=x.useState(!1);if(e)return d.jsx(_g,{to:"/",replace:!0});const y=async g=>{g.preventDefault(),f(null),h(!0);try{await t(n,l)}catch(b){f(b instanceof Error?b.message:"Login failed")}finally{h(!1)}};return d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:d.jsxs(pE,{className:"w-full max-w-sm",children:[d.jsxs(gE,{className:"text-center",children:[d.jsx(yE,{className:"text-title",children:"First Tree"}),d.jsx(vE,{children:"Sign in to your workspace"})]}),d.jsx(bE,{children:d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u&&d.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-body text-destructive",children:u}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"username",children:"Username"}),d.jsx(bt,{id:"username",value:n,onChange:g=>a(g.target.value),required:!0,autoFocus:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(rt,{htmlFor:"password",children:"Password"}),d.jsx(bt,{id:"password",type:"password",value:l,onChange:g=>o(g.target.value),required:!0})]}),d.jsx(xe,{type:"submit",className:"w-full",disabled:m,children:m?"Signing in...":"Sign in"})]})})]})})}function DF(){const e=Vr(),t=jl(),{data:n,isLoading:a}=Ve({queryKey:["adapters"],queryFn:sC}),{data:l,isLoading:o}=Ve({queryKey:["adapter-mappings"],queryFn:iC}),{data:u}=Ve({queryKey:["adapter-statuses"],queryFn:lC,refetchInterval:15e3}),f=a||o,m=x.useMemo(()=>{const g=new Map;for(const b of u??[])g.set(b.configId,b);return g},[u]),{onlineBots:h,offlineBots:y}=x.useMemo(()=>{var S;let g=0,b=0;for(const k of n??[])(S=m.get(k.id))!=null&&S.connected?g++:b++;return{onlineBots:g,offlineBots:b}},[n,m]);return d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Overview of platform bindings for agents you can manage. Configure each binding from the Agent detail page."}),d.jsxs(Zr,{className:"mb-3.5",children:[d.jsxs(Zs,{right:d.jsxs("span",{className:"inline-flex items-center",children:[d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),h," online"]}),d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[d.jsx("span",{"aria-hidden":!0,children:"○"}),y," offline"]})]}),children:["Bot bindings · ",(n==null?void 0:n.length)??0]}),f?d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n!=null&&n.length?d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Yt,{children:[d.jsx(ze,{children:"Agent"}),d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Connection"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{})]})}),d.jsx(_a,{children:n.map(g=>{var S;const b=((S=m.get(g.id))==null?void 0:S.connected)??!1;return d.jsxs(Yt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ne,{children:d.jsx("span",{className:"mono font-medium",children:t(g.agentId)})}),d.jsx(Ne,{children:d.jsx(Xt,{children:g.platform})}),d.jsx(Ne,{children:d.jsx(Xt,{tone:g.status==="active"?"accent":"outline",children:g.status})}),d.jsx(Ne,{children:d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[d.jsx(bl,{state:b?"idle":"offline",size:7}),d.jsx("span",{style:{color:"var(--fg-3)"},children:b?"Online":"Offline"})]})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(g.createdAt)}),d.jsx(Ne,{style:{textAlign:"right",whiteSpace:"nowrap"},children:d.jsxs(xe,{variant:"ghost",size:"xs",className:"text-label",onClick:k=>{k.stopPropagation(),e(`/agents/${g.agentId}`)},children:[d.jsx(Mg,{className:"h-3 w-3"}),"Manage"]})})]},g.id)})})]}):d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"No bot bindings"})]}),d.jsxs(Zr,{children:[d.jsxs(Zs,{children:["User bindings · ",(l==null?void 0:l.length)??0]}),f?d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l!=null&&l.length?d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Yt,{children:[d.jsx(ze,{children:"Agent"}),d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"External user ID"}),d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Bound via"}),d.jsx(ze,{children:"Created"})]})}),d.jsx(_a,{children:l.map(g=>d.jsxs(Yt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ne,{children:d.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:t(g.agentId)})}),d.jsx(Ne,{children:d.jsx(Xt,{children:g.platform})}),d.jsx(Ne,{children:d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:g.externalUserId})}),d.jsx(Ne,{style:{color:"var(--fg-2)"},children:g.displayName??"—"}),d.jsx(Ne,{children:d.jsx(Xt,{tone:"outline",children:g.boundVia??"—"})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(g.createdAt)})]},g.id))})]}):d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"No user bindings"})]})]})}function MF(){return d.jsxs("div",{className:"-m-6",children:[d.jsx(ff,{title:"Settings",subtitle:"Per-member controls"}),d.jsx(Jj,{children:d.jsx(Wj,{active:!0,children:"Bindings"})}),d.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:d.jsx(DF,{})})]})}function LF(e){return Le.get(`/admin/chats/${encodeURIComponent(e)}`)}function IF(e,t){return Le.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function DS(e,t){return Le.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function UF(e,t){return Le.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function BF(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 PF(e){return Le.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function $F(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 Le.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const FF="first-tree-hub-images",qF=1,Qs="images";let Sd=null;function xE(){return Sd||(Sd=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(FF,qF);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Qs)||n.createObjectStore(Qs,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Sd)}async function HF(e){const t=await xE();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Qs,"readwrite"),o=l.objectStore(Qs),u={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(u),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 ZF(e){const t=await xE();return t?new Promise(n=>{const o=t.transaction(Qs,"readonly").objectStore(Qs).get(e);o.onsuccess=()=>{const u=o.result;if(!u){n(null);return}n({base64:u.base64,mimeType:u.mimeType})},o.onerror=()=>n(null)}):null}function VF(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 QF(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 u=1/0;l.startsWith(t)?u=0:o.startsWith(t)?u=1:o.includes(t)&&(u=2),u!==1/0&&n.push({c:a,score:u})}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 GF(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),u=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${u}${m}`,y=l.length+u.length+(f?1:0);return{text:h,cursor:y}}function KF({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,u]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:VF(e,t),[e,t,l]),y=x.useMemo(()=>h?QF(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{u(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(C){if(!h)return;const T=GF(e,h,t,C);T&&a(T)}return{trigger:S?h:null,results:S?y:[],highlightIndex:o,handleKey:C=>{if(!S||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),u(T=>y.length===0?0:(T+1)%y.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),u(T=>y.length===0?0:(T-1+y.length)%y.length),!0;if(C.key==="Enter"||C.key==="Tab"){const T=y[o]??y[0];return T?(C.preventDefault(),j(T),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function YF({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:d.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 d.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:[d.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&d.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function SE(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function XF(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=MS(l.payload);if(!o)continue;const u=a.get(o)??-1;l.seq>u&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=MS(l.payload);return o?a.get(o)===l.seq:!0})}function MS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function bf(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(u=>u.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function wE(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 JF(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function LS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function WF({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function eq({agentId:e,chatId:t,session:n}){const a=Jn(),[,l]=Rg(),[o,u]=x.useState(!1),[f,m]=x.useState(null),h=Ww(e,t),y=Zp(e),g=E=>{a.setQueryData(h,C=>C&&{...C,state:E}),a.setQueryData(y,C=>C&&C.map(T=>T.chatId===t?{...T,state:E}:T))},b=vt({mutationFn:()=>mz(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const E=a.getQueryData(h),C=a.getQueryData(y);return g("suspended"),{previousSession:E,previousList:C}},onError:(E,C,T)=>{T!=null&&T.previousSession&&a.setQueryData(h,T.previousSession),T!=null&&T.previousList&&a.setQueryData(y,T.previousList)},onSuccess:E=>{g(E.state)}}),S=vt({mutationFn:()=>pz(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const E=a.getQueryData(h),C=a.getQueryData(y);return a.setQueryData(y,T=>T&&T.filter(O=>O.chatId!==t)),{previousSession:E,previousList:C}},onError:(E,C,T)=>{T!=null&&T.previousSession&&a.setQueryData(h,T.previousSession),T!=null&&T.previousList&&a.setQueryData(y,T.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,C,T)=>{if(E.state!=="evicted"){T!=null&&T.previousList&&a.setQueryData(y,T.previousList),g(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),u(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:d.jsxs(d.Fragment,{children:[d.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&&d.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:E=>E.currentTarget.style.background="var(--bg-hover)",onMouseLeave:E=>E.currentTarget.style.background="transparent",children:[d.jsx(JT,{className:"h-3 w-3"})," Suspend",d.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&d.jsxs("button",{type:"button",onClick:()=>{m(null),u(!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:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[d.jsx(lR,{className:"h-3 w-3"})," Terminate"]})]}),d.jsx(tq,{open:o,onOpenChange:E=>{S.isPending||u(E),E||m(null)},session:n,chatId:t,error:f,pending:S.isPending,onConfirm:()=>S.mutate()})]})}function tq(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:u,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return d.jsx(gn,{open:t,onOpenChange:n,children:d.jsxs(dn,{children:[d.jsx(En,{children:d.jsx(vn,{children:"Terminate session?"})}),d.jsxs("form",{onSubmit:m,className:"space-y-4",children:[d.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."}),d.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:[d.jsxs("span",{children:["chat: ",d.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&d.jsxs("span",{children:["last activity: ",wE(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&d.jsxs("span",{children:["messages: ",a.messageCount]})]}),u&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:u}),d.jsxs(yn,{children:[d.jsx(xe,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),d.jsx(xe,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function nq({event:e}){const t=cz(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 d.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?d.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}}):d.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),d.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?LS(t.args):void 0,children:[d.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",d.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?d.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",LS(t.args),")"]}):null,t.durationMs!==void 0&&!a?d.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",JF(t.durationMs)]}):null]})]})}function rq({event:e,agentNameFn:t,agentId:n}){const a=fz(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[d.jsx(kE,{name:l,isSelf:!1}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bf(e.createdAt)}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function aq({event:e}){return d.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:[d.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}}),d.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bf(e.createdAt)})]})}function iq({event:e}){const t=dz(e.payload),n=bf(e.createdAt);return d.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:[d.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),d.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 kE({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return d.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:d.jsx(Du,{width:9,height:10,style:{color:"var(--accent)"}})})}function lq({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[d.jsx(kE,{name:a,isSelf:l}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bf(e.createdAt)}),d.jsx("span",{style:{marginLeft:"auto"},children:d.jsx(WF,{msg:e,myAgentId:t})})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&sq(e.content)?d.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"&&oq(e.content)?d.jsx(uq,{content:e.content}):e.format==="text"?d.jsx(mE,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):d.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 sq(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 oq(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 uq({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return ZF(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"?d.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?d.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):d.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function cq({agentId:e,chatId:t}){var Se;const n=Jn(),a=jl(),l=qg(),{agentId:o}=Aa(),[u,f]=x.useState(""),[m,h]=x.useState(0),[y,g]=x.useState([]),[b,S]=x.useState(!1),[k,j]=x.useState(null),E=x.useRef(null),C=x.useRef(null),T=x.useRef(null),{data:O}=Ve({queryKey:["chat-messages",t],queryFn:()=>$F(t,{limit:50}),refetchInterval:5e3}),{data:B}=Ve({queryKey:["session-events",e,t],queryFn:()=>hz(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:D}=Ve({queryKey:Ww(e,t),queryFn:()=>Js(e).then(ee=>ee.find(fe=>fe.chatId===t)??null),refetchInterval:5e3}),{data:R}=Ve({queryKey:["chat-detail",t],queryFn:()=>LF(t),enabled:!!t}),P=vt({mutationFn:ee=>DS(t,ee),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]})}}),Z=x.useCallback(ee=>{const Ie=ee.filter(Vt=>Vt.type.startsWith("image/"));if(Ie.length===0)return;const Be=Ie.find(Vt=>Vt.size>5242880);if(Be){j(`Image too large (${(Be.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const St=Ie.map(Vt=>({id:crypto.randomUUID(),file:Vt,previewUrl:URL.createObjectURL(Vt)}));g(Vt=>[...Vt,...St]),j(null)},[]),re=x.useCallback(ee=>{g(fe=>{const Ie=fe.find(Be=>Be.id===ee);return Ie&&URL.revokeObjectURL(Ie.previewUrl),fe.filter(Be=>Be.id!==ee)})},[]),F=async()=>{const ee=u.trim(),fe=y;if(!(!ee&&fe.length===0)&&!b){if(fe.length>0){S(!0),j(null);try{for(const Ie of fe){const Be=await BF(Ie.file),St=crypto.randomUUID();await HF({imageId:St,base64:Be,mimeType:Ie.file.type}),await UF(t,{data:Be,mimeType:Ie.file.type,filename:Ie.file.name,size:Ie.file.size,imageId:St}),URL.revokeObjectURL(Ie.previewUrl)}g([]),ee&&await DS(t,ee),f(""),n.invalidateQueries({queryKey:["chat-messages",t]})}catch(Ie){j(Ie instanceof Error?Ie.message:"Failed to send image")}finally{S(!1)}return}P.mutate(ee)}},[de,W]=x.useState(!1),[ye,me]=x.useState(""),te=x.useRef(null);x.useEffect(()=>{var ee;de&&((ee=te.current)==null||ee.focus())},[de]);const q=vt({mutationFn:ee=>IF(t,ee),onSuccess:()=>{W(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),oe=()=>{const ee=ye.trim();q.mutate(ee.length>0?ee:null)},K=x.useMemo(()=>{const ee=(O==null?void 0:O.items)??[],fe=XF((B==null?void 0:B.items)??[]),Ie=[...ee.map(Be=>({kind:"message",at:Be.createdAt,key:`m-${Be.id}`,data:Be})),...fe.map(Be=>({kind:"event",at:Be.createdAt,key:`e-${Be.id}`,data:Be}))];return Ie.sort((Be,St)=>Be.at.localeCompare(St.at)),Ie},[O,B]),he=K.length;x.useEffect(()=>{var ee;he>0&&((ee=T.current)==null||ee.scrollIntoView({behavior:"smooth"}))},[he]);const A=R!=null&&R.participants?R.participants.map(ee=>{const fe=a(ee.agentId);return`@${fe.length>20?`${fe.slice(0,17)}…`:fe}`}).join(" "):`@${a(e)}`,I=a(e),U=x.useMemo(()=>{var Ie;const ee=((Ie=R==null?void 0:R.participants)==null?void 0:Ie.map(Be=>Be.agentId))??[e],fe=[];for(const Be of ee){const St=l(Be);!St||!St.name||fe.push({agentId:Be,name:St.name,displayName:St.displayName})}return fe},[R==null?void 0:R.participants,e,l]),_=KF({value:u,cursor:m,candidates:U,disabled:P.isPending||b,onSelect:ee=>{f(ee.text),h(ee.cursor),requestAnimationFrame(()=>{const fe=C.current;fe&&(fe.focus(),fe.setSelectionRange(ee.cursor,ee.cursor))})}}),le=(D==null?void 0:D.runtimeState)??"idle",V=SE((D==null?void 0:D.runtimeState)??null,e?"connected":null),ue=(D==null?void 0:D.messageCount)??((Se=O==null?void 0:O.items)==null?void 0:Se.length)??0;return d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d.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:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center",style:{gap:8},children:[d.jsx(bl,{state:V,size:8}),de?d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:te,value:ye,onChange:ee=>me(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"?(ee.preventDefault(),oe()):ee.key==="Escape"&&(ee.preventDefault(),W(!1))},disabled:q.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)"}}),d.jsx("button",{type:"button",onClick:oe,disabled:q.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:d.jsx(Ru,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:()=>W(!1),disabled:q.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:d.jsx(qp,{className:"h-3.5 w-3.5"})})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(R==null?void 0:R.topic)||(D==null?void 0:D.summary)||`Chat · ${t.slice(0,8)}`}),d.jsx("button",{type:"button",onClick:()=>{me((R==null?void 0:R.topic)??""),W(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:ee=>ee.currentTarget.style.color="var(--fg-2)",onMouseLeave:ee=>ee.currentTarget.style.color="var(--fg-4)",children:d.jsx(Jd,{className:"h-3 w-3"})})]}),d.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})]}),d.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[d.jsx("span",{className:"mono",children:A}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["started ",wE((D==null?void 0:D.startedAt)??null)]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:[ue," msgs"]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["runtime"," ",d.jsx("span",{className:"mono",style:{color:V==="error"?"var(--state-error)":"var(--fg-2)"},children:le})]})]})]}),d.jsx(eq,{agentId:e,chatId:t,session:D??null})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[he===0&&d.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[d.jsx(Lg,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),d.jsx("div",{className:"flex flex-col",style:{gap:4},children:K.map(ee=>{if(ee.kind==="event"){const fe=ee.data;switch(fe.kind){case"tool_call":return d.jsx(nq,{event:fe},ee.key);case"assistant_text":return d.jsx(rq,{event:fe,agentId:e,agentNameFn:a},ee.key);case"thinking":return d.jsx(aq,{event:fe},ee.key);case"error":return d.jsx(iq,{event:fe},ee.key);default:return null}}return d.jsx(lq,{msg:ee.data,myAgentId:o,agentNameFn:a},ee.key)})}),d.jsx("div",{ref:T})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:ee=>ee.preventDefault(),onDrop:ee=>{ee.preventDefault(),Z(Array.from(ee.dataTransfer.files))},children:[y.length>0&&d.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:y.map(ee=>d.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[d.jsx("img",{src:ee.previewUrl,alt:ee.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),d.jsx("button",{type:"button",onClick:()=>re(ee.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:d.jsx(qp,{className:"h-2 w-2"})})]},ee.id))}),d.jsxs("div",{style:{position:"relative"},children:[d.jsx(YF,{trigger:_.trigger,results:_.results,highlightIndex:_.highlightIndex,anchorRef:C,onPick:_.pick}),d.jsx("textarea",{ref:C,value:u,onChange:ee=>{f(ee.target.value),h(ee.target.selectionStart??ee.target.value.length)},onSelect:ee=>{h(ee.currentTarget.selectionStart??u.length)},onPaste:ee=>{const fe=Array.from(ee.clipboardData.files);fe.length>0&&(ee.preventDefault(),Z(fe))},placeholder:`Message @${I} · / for commands · @ to mention`,rows:2,onKeyDown:ee=>{_.handleKey(ee)||ee.key==="Enter"&&!ee.shiftKey&&(ee.preventDefault(),F())},disabled:P.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)"}})]}),d.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[d.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[d.jsx("button",{type:"button",onClick:()=>{var ee;return(ee=E.current)==null?void 0:ee.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:d.jsx(YT,{className:"h-3.5 w-3.5"})}),d.jsx("input",{ref:E,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ee=>{ee.target.files&&(Z(Array.from(ee.target.files)),ee.target.value="")}}),d.jsx("span",{children:"/suspend"}),d.jsx("span",{children:"/resume"}),d.jsx("span",{children:"/branch"}),d.jsx("span",{children:"/promote"})]}),d.jsxs("span",{className:"flex items-center",style:{gap:8},children:[b&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),d.jsxs("span",{children:[d.jsx("span",{className:"kbd",children:"⏎"})," send ",d.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),d.jsxs("button",{type:"button",onClick:F,disabled:P.isPending||b||!u.trim()&&y.length===0,className:_e("inline-flex items-center transition-colors text-label font-semibold",(P.isPending||b||!u.trim()&&y.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:[d.jsx(aR,{className:"h-3 w-3"})," Send"]})]})]})]}),(P.isError||k)&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(P.error instanceof Error?P.error.message:"Failed to send")})]})]})}function dq(){return d.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:d.jsxs("div",{className:"text-center max-w-sm",children:[d.jsx(Du,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),d.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),d.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 fq({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(cq,{agentId:e,chatId:t}):d.jsx(dq,{})}function jE(){const{data:e}=Ve({queryKey:["clients"],queryFn:gu,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 pg({children:e}){return d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function CE({children:e}){return d.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Fr({label:e,children:t}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{color:"var(--fg-3)"},children:e}),d.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function IS(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 US(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 jp({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[d.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function hq({notifications:e,agentId:t}){const[,n]=Rg(),a=Jn(),l=vt({mutationFn:o=>Wk(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return d.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>d.jsx(ej,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function EE({agentId:e}){var h;const t=jl(),{resolve:n}=jE(),{data:a}=Ve({queryKey:["activity"],queryFn:zu,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:u}=Ve({queryKey:["notifications","agent",e],queryFn:()=>Xp({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.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:d.jsx(Du,{width:14,height:16,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),d.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),d.jsx(Ti,{state:m})]}),d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[d.jsx(jp,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),d.jsx(jp,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),d.jsx(jp,{label:"uptime",value:US((o==null?void 0:o.connectedAt)??null)})]})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(pg,{children:"Computer · runtime"}),d.jsxs(CE,{children:[d.jsx(Fr,{label:"host",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),d.jsx(Fr,{label:"os",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),d.jsx(Fr,{label:"runtime",children:d.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),d.jsx(Fr,{label:"sdk",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),d.jsx(Fr,{label:"connected",children:d.jsx("span",{className:"mono text-label",children:US((o==null?void 0:o.connectedAt)??null)})})]})]}),d.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[d.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),d.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[d.jsx(pg,{children:"Notifications"}),!(u!=null&&u.items)||u.items.length===0?d.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):d.jsx(hq,{notifications:u.items,agentId:e})]})]})}function mq({agentId:e,chatId:t}){const{data:n}=Ve({queryKey:["session",e,t],queryFn:()=>Js(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return d.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(pg,{children:"Session"}),d.jsxs(CE,{children:[d.jsx(Fr,{label:"state",children:d.jsx(Ti,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),d.jsx(Fr,{label:"chat",children:d.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),d.jsx(Fr,{label:"started",children:IS((n==null?void 0:n.startedAt)??null)}),d.jsx(Fr,{label:"last",children:IS((n==null?void 0:n.lastActivityAt)??null)}),d.jsx(Fr,{label:"messages",children:d.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),d.jsx(EE,{agentId:e})]})}function pq({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(mq,{agentId:e,chatId:t}):e?d.jsx(EE,{agentId:e}):null}const gq=32;function yq({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return d.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:gq}).map((l,o)=>{const u=e[o]??{workingCount:0,errorMask:!1},f=u.workingCount===0?.08:u.workingCount/a,m=.25+f*.7,h=u.errorMask?"var(--state-error)":"var(--accent)";return d.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const vq={error:0,blocked:1,working:2,idle:3};function bq(e,t){return t?e?vq[e]??4:4:5}function xq(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function Sq({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=jl(),{resolve:o}=jE(),u=Jn(),f=NL(),[m,h]=x.useState(""),[y,g]=x.useState("all"),{data:b}=Ve({queryKey:["activity"],queryFn:zu,refetchInterval:1e4}),{data:S}=Ve({queryKey:e?Zp(e):["agent-sessions",null],queryFn:()=>e?Js(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),k=vt({mutationFn:R=>PF(R),onSuccess:(R,P)=>{u.invalidateQueries({queryKey:Zp(P)}),a(P,R.id)}}),{humans:j,agents:E,totalAll:C}=x.useMemo(()=>{const R=(b==null?void 0:b.agents)??[],P=m.trim().toLowerCase(),Z=R.filter(W=>{var te;if(!xq(W,y))return!1;if(!P)return!0;const ye=l(W.agentId).toLowerCase(),me=W.clientId?(((te=o(W.clientId))==null?void 0:te.hostname)??"").toLowerCase():"";return ye.includes(P)||me.includes(P)||W.agentId.toLowerCase().includes(P)}),re=W=>bq(W.runtimeState,W.clientId),F=[],de=[];for(const W of Z)(W.type==="human"?F:de).push(W);return F.sort((W,ye)=>re(W)-re(ye)),de.sort((W,ye)=>re(W)-re(ye)),{humans:F,agents:de,totalAll:R.length}},[b,m,y,l,o]),T=x.useMemo(()=>{const R=(b==null?void 0:b.agents)??[];return{working:R.filter(P=>P.runtimeState==="working").length,blocked:R.filter(P=>P.runtimeState==="blocked").length,error:R.filter(P=>P.runtimeState==="error").length}},[b]),O=[{value:"all",label:"all",count:C},{value:"active",label:"active",count:T.working},{value:"attn",label:"attn",count:T.blocked+T.error,warn:T.blocked+T.error>0}],B=R=>{var W;const P=e===R.agentId,Z=SE(R.runtimeState,R.clientId),re=R.clientId?((W=o(R.clientId))==null?void 0:W.hostname)??R.clientId.slice(0,8):null,F=R.activeSessions??0,de=R.totalSessions??0;return d.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("button",{type:"button",onClick:()=>n(P?null:R.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:P?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${P?"var(--accent)":"transparent"}`},children:[d.jsx(bl,{state:Z,size:8}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(R.agentId)}),R.type==="human"&&d.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"})]}),d.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:Z==="offline"?"disconnected":re||"—"})]}),d.jsx("div",{className:"flex flex-col items-end gap-0.5",children:de>0&&d.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[F,d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",de]})]})})]}),P&&d.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!S||S.length===0)&&d.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"}),S==null?void 0:S.filter(ye=>ye.state!=="evicted").map(ye=>{const me=ye.state==="active"?"working":"idle";return d.jsxs("button",{type:"button",onClick:()=>a(R.agentId,ye.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===ye.chatId?"var(--bg-hover)":"transparent",color:ye.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:te=>{t!==ye.chatId&&(te.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:te=>{t!==ye.chatId&&(te.currentTarget.style.background="transparent")},children:[d.jsx(bl,{state:me,size:6}),d.jsx("span",{className:"truncate text-body",style:{color:ye.topic||ye.summary?"var(--fg-2)":"var(--fg-4)"},children:ye.topic||ye.summary||`Chat · ${ye.chatId.slice(0,8)}`})]},ye.chatId)}),d.jsxs("button",{type:"button",onClick:()=>k.mutate(R.agentId),disabled:k.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:ye=>{ye.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:ye=>{ye.currentTarget.style.background="transparent"},children:[d.jsx(Sl,{className:"h-3 w-3"}),"New chat"]})]})]},R.agentId)},D=j.length+E.length;return d.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[d.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:[d.jsx("div",{style:{marginBottom:8},children:d.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[C," members"]})}),d.jsxs("div",{className:"relative",children:[d.jsx(Wd,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),d.jsx("input",{value:m,onChange:R=>h(R.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)"}})]}),d.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:O.map(R=>d.jsx(lu,{active:y===R.value,count:R.count,warn:R.warn,onClick:()=>g(R.value),children:R.label},R.value))})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[d.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[d.jsx(wq,{}),"5m"]}),d.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:f.stale?"stale":"live"})]}),d.jsx(yq,{aggregated:f.aggregated,stale:f.stale}),d.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[d.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[T.working," working"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[T.blocked," blocked"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[T.error," error"]})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[D===0&&d.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:m||y!=="all"?"No matches":"No agents"}),E.length>0&&d.jsxs("div",{children:[d.jsx(BS,{label:"Agents",count:E.length}),E.map(B)]}),j.length>0&&d.jsxs("div",{children:[d.jsx(BS,{label:"Humans",count:j.length}),j.map(B)]})]})]})}function BS({label:e,count:t}){return d.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 wq(){return d.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[d.jsx("title",{children:"pulse"}),d.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 kq(){const[e,t]=Rg(),n=e.get("a"),a=e.get("c");Yj();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:u}=Ve({queryKey:["agent-sessions",n],queryFn:()=>n?Js(n):Promise.resolve([]),enabled:!!n&&!a});return x.useEffect(()=>{if(!n||a||!u||u.length===0)return;const f=[...u].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,u,t]),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsx(Sq,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),d.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:d.jsx(fq,{selectedAgentId:n,selectedChatId:a})}),n&&d.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:d.jsx(pq,{selectedAgentId:n,selectedChatId:a})})]})}const jq=new v2({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function Cq(){return d.jsx(b2,{client:jq,children:d.jsx(hT,{children:d.jsx(tT,{children:d.jsxs(TA,{children:[d.jsx(Lr,{path:"/login",element:d.jsx(OF,{})}),d.jsx(Lr,{element:d.jsx(mT,{}),children:d.jsxs(Lr,{element:d.jsx(EL,{children:d.jsx(X3,{})}),children:[d.jsx(Lr,{index:!0,element:d.jsx(kq,{})}),d.jsx(Lr,{path:"agents",element:d.jsx(EF,{})}),d.jsx(Lr,{path:"agents/:uuid",element:d.jsx(fF,{})}),d.jsx(Lr,{path:"clients",element:d.jsx(TF,{})}),d.jsx(Lr,{path:"settings",element:d.jsx(MF,{})}),d.jsx(Lr,{path:"admin",element:d.jsx(ZL,{})})]})})]})})})})}const NE=document.getElementById("root");if(!NE)throw new Error("Root element not found");Q_.createRoot(NE).render(d.jsx(x.StrictMode,{children:d.jsx(Cq,{})}));