@agent-team-foundation/first-tree-hub 0.10.11 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bootstrap-BTKiVIYk.mjs → bootstrap-CDeXqhkQ.mjs} +12 -4
- package/dist/cli/index.mjs +8 -8
- package/dist/index.mjs +2 -2
- package/dist/{saas-connect-D-7x9KRd.mjs → saas-connect-DLVGb8OH.mjs} +15 -5
- package/dist/web/assets/index-BGMkYsML.js +383 -0
- package/dist/web/assets/index-CKoTjI0J.css +1 -0
- package/dist/web/assets/{index-iNiy68VO.js → index-dk86IMMq.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-BR-pWR44.css +0 -1
- package/dist/web/assets/index-CJ9XbSvm.js +0 -388
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
var e1=e=>{throw TypeError(e)};var Xm=(e,t,n)=>t.has(e)||e1("Cannot "+n);var I=(e,t,n)=>(Xm(e,t,"read from private field"),n?n.call(e):t.get(e)),je=(e,t,n)=>t.has(e)?e1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ge=(e,t,n,a)=>(Xm(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Me=(e,t,n)=>(Xm(e,t,"access private method"),n);var yd=(e,t,n,a)=>({set _(l){ge(e,t,l,n)},get _(){return I(e,t,a)}});function U2(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(a,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function ff(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jm={exports:{}},nu={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var t1;function P2(){if(t1)return nu;t1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:c,ref:l!==void 0?l:null,props:o}}return nu.Fragment=t,nu.jsx=n,nu.jsxs=n,nu}var n1;function B2(){return n1||(n1=1,Jm.exports=P2()),Jm.exports}var u=B2(),Wm={exports:{}},qe={};/**
|
|
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 r1;function $2(){if(r1)return qe;r1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function w(P){return P===null||typeof P!="object"?null:(P=b&&P[b]||P["@@iterator"],typeof P=="function"?P:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(P,B,A){this.props=P,this.context=B,this.refs=E,this.updater=A||k}C.prototype.isReactComponent={},C.prototype.setState=function(P,B){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,B,"setState")},C.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=C.prototype;function z(P,B,A){this.props=P,this.context=B,this.refs=E,this.updater=A||k}var L=z.prototype=new N;L.constructor=z,j(L,C.prototype),L.isPureReactComponent=!0;var D=Array.isArray;function O(){}var M={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function Y(P,B,A){var q=A.ref;return{$$typeof:e,type:P,key:B,ref:q!==void 0?q:null,props:A}}function F(P,B){return Y(P.type,B,P.props)}function J(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function ee(P){var B={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(A){return B[A]})}var we=/\/+/g;function le(P,B){return typeof P=="object"&&P!==null&&P.key!=null?ee(""+P.key):B.toString(36)}function ne(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(O,O):(P.status="pending",P.then(function(B){P.status==="pending"&&(P.status="fulfilled",P.value=B)},function(B){P.status==="pending"&&(P.status="rejected",P.reason=B)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function Z(P,B,A,q,G){var ce=typeof P;(ce==="undefined"||ce==="boolean")&&(P=null);var be=!1;if(P===null)be=!0;else switch(ce){case"bigint":case"string":case"number":be=!0;break;case"object":switch(P.$$typeof){case e:case t:be=!0;break;case y:return be=P._init,Z(be(P._payload),B,A,q,G)}}if(be)return G=G(P),be=q===""?"."+le(P,0):q,D(G)?(A="",be!=null&&(A=be.replace(we,"$&/")+"/"),Z(G,B,A,"",function(Xe){return Xe})):G!=null&&(J(G)&&(G=F(G,A+(G.key==null||P&&P.key===G.key?"":(""+G.key).replace(we,"$&/")+"/")+be)),B.push(G)),1;be=0;var xe=q===""?".":q+":";if(D(P))for(var me=0;me<P.length;me++)q=P[me],ce=xe+le(q,me),be+=Z(q,B,A,ce,G);else if(me=w(P),typeof me=="function")for(P=me.call(P),me=0;!(q=P.next()).done;)q=q.value,ce=xe+le(q,me++),be+=Z(q,B,A,ce,G);else if(ce==="object"){if(typeof P.then=="function")return Z(ne(P),B,A,q,G);throw B=String(P),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return be}function te(P,B,A){if(P==null)return P;var q=[],G=0;return Z(P,q,"","",function(ce){return B.call(A,ce,G++)}),q}function ie(P){if(P._status===-1){var B=P._result;B=B(),B.then(function(A){(P._status===0||P._status===-1)&&(P._status=1,P._result=A)},function(A){(P._status===0||P._status===-1)&&(P._status=2,P._result=A)}),P._status===-1&&(P._status=0,P._result=B)}if(P._status===1)return P._result.default;throw P._result}var ve=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},_={map:te,forEach:function(P,B,A){te(P,function(){B.apply(this,arguments)},A)},count:function(P){var B=0;return te(P,function(){B++}),B},toArray:function(P){return te(P,function(B){return B})||[]},only:function(P){if(!J(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return qe.Activity=g,qe.Children=_,qe.Component=C,qe.Fragment=n,qe.Profiler=l,qe.PureComponent=z,qe.StrictMode=a,qe.Suspense=m,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,qe.__COMPILER_RUNTIME={__proto__:null,c:function(P){return M.H.useMemoCache(P)}},qe.cache=function(P){return function(){return P.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(P,B,A){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var q=j({},P.props),G=P.key;if(B!=null)for(ce in B.key!==void 0&&(G=""+B.key),B)!U.call(B,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&B.ref===void 0||(q[ce]=B[ce]);var ce=arguments.length-2;if(ce===1)q.children=A;else if(1<ce){for(var be=Array(ce),xe=0;xe<ce;xe++)be[xe]=arguments[xe+2];q.children=be}return Y(P.type,G,q)},qe.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},qe.createElement=function(P,B,A){var q,G={},ce=null;if(B!=null)for(q in B.key!==void 0&&(ce=""+B.key),B)U.call(B,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(G[q]=B[q]);var be=arguments.length-2;if(be===1)G.children=A;else if(1<be){for(var xe=Array(be),me=0;me<be;me++)xe[me]=arguments[me+2];G.children=xe}if(P&&P.defaultProps)for(q in be=P.defaultProps,be)G[q]===void 0&&(G[q]=be[q]);return Y(P,ce,G)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(P){return{$$typeof:f,render:P}},qe.isValidElement=J,qe.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:ie}},qe.memo=function(P,B){return{$$typeof:h,type:P,compare:B===void 0?null:B}},qe.startTransition=function(P){var B=M.T,A={};M.T=A;try{var q=P(),G=M.S;G!==null&&G(A,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(O,ve)}catch(ce){ve(ce)}finally{B!==null&&A.types!==null&&(B.types=A.types),M.T=B}},qe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},qe.use=function(P){return M.H.use(P)},qe.useActionState=function(P,B,A){return M.H.useActionState(P,B,A)},qe.useCallback=function(P,B){return M.H.useCallback(P,B)},qe.useContext=function(P){return M.H.useContext(P)},qe.useDebugValue=function(){},qe.useDeferredValue=function(P,B){return M.H.useDeferredValue(P,B)},qe.useEffect=function(P,B){return M.H.useEffect(P,B)},qe.useEffectEvent=function(P){return M.H.useEffectEvent(P)},qe.useId=function(){return M.H.useId()},qe.useImperativeHandle=function(P,B,A){return M.H.useImperativeHandle(P,B,A)},qe.useInsertionEffect=function(P,B){return M.H.useInsertionEffect(P,B)},qe.useLayoutEffect=function(P,B){return M.H.useLayoutEffect(P,B)},qe.useMemo=function(P,B){return M.H.useMemo(P,B)},qe.useOptimistic=function(P,B){return M.H.useOptimistic(P,B)},qe.useReducer=function(P,B,A){return M.H.useReducer(P,B,A)},qe.useRef=function(P){return M.H.useRef(P)},qe.useState=function(P){return M.H.useState(P)},qe.useSyncExternalStore=function(P,B,A){return M.H.useSyncExternalStore(P,B,A)},qe.useTransition=function(){return M.H.useTransition()},qe.version="19.2.4",qe}var a1;function Gg(){return a1||(a1=1,Wm.exports=$2()),Wm.exports}var x=Gg();const F2=ff(x),Yg=U2({__proto__:null,default:F2},[x]);var ep={exports:{}},ru={},tp={exports:{}},np={};/**
|
|
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 i1;function q2(){return i1||(i1=1,(function(e){function t(Z,te){var ie=Z.length;Z.push(te);e:for(;0<ie;){var ve=ie-1>>>1,_=Z[ve];if(0<l(_,te))Z[ve]=te,Z[ie]=_,ie=ve;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var te=Z[0],ie=Z.pop();if(ie!==te){Z[0]=ie;e:for(var ve=0,_=Z.length,P=_>>>1;ve<P;){var B=2*(ve+1)-1,A=Z[B],q=B+1,G=Z[q];if(0>l(A,ie))q<_&&0>l(G,A)?(Z[ve]=G,Z[q]=ie,ve=q):(Z[ve]=A,Z[B]=ie,ve=B);else if(q<_&&0>l(G,ie))Z[ve]=G,Z[q]=ie,ve=q;else break e}}return te}function l(Z,te){var ie=Z.sortIndex-te.sortIndex;return ie!==0?ie:Z.id-te.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],y=1,g=null,b=3,w=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function L(Z){for(var te=n(h);te!==null;){if(te.callback===null)a(h);else if(te.startTime<=Z)a(h),te.sortIndex=te.expirationTime,t(m,te);else break;te=n(h)}}function D(Z){if(j=!1,L(Z),!k)if(n(m)!==null)k=!0,O||(O=!0,ee());else{var te=n(h);te!==null&&ne(D,te.startTime-Z)}}var O=!1,M=-1,U=5,Y=-1;function F(){return E?!0:!(e.unstable_now()-Y<U)}function J(){if(E=!1,O){var Z=e.unstable_now();Y=Z;var te=!0;try{e:{k=!1,j&&(j=!1,N(M),M=-1),w=!0;var ie=b;try{t:{for(L(Z),g=n(m);g!==null&&!(g.expirationTime>Z&&F());){var ve=g.callback;if(typeof ve=="function"){g.callback=null,b=g.priorityLevel;var _=ve(g.expirationTime<=Z);if(Z=e.unstable_now(),typeof _=="function"){g.callback=_,L(Z),te=!0;break t}g===n(m)&&a(m),L(Z)}else a(m);g=n(m)}if(g!==null)te=!0;else{var P=n(h);P!==null&&ne(D,P.startTime-Z),te=!1}}break e}finally{g=null,b=ie,w=!1}te=void 0}}finally{te?ee():O=!1}}}var ee;if(typeof z=="function")ee=function(){z(J)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,le=we.port2;we.port1.onmessage=J,ee=function(){le.postMessage(null)}}else ee=function(){C(J,0)};function ne(Z,te){M=C(function(){Z(e.unstable_now())},te)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(Z){switch(b){case 1:case 2:case 3:var te=3;break;default:te=b}var ie=b;b=te;try{return Z()}finally{b=ie}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(Z,te){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var ie=b;b=Z;try{return te()}finally{b=ie}},e.unstable_scheduleCallback=function(Z,te,ie){var ve=e.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?ve+ie:ve):ie=ve,Z){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=ie+_,Z={id:y++,callback:te,priorityLevel:Z,startTime:ie,expirationTime:_,sortIndex:-1},ie>ve?(Z.sortIndex=ie,t(h,Z),n(m)===null&&Z===n(h)&&(j?(N(M),M=-1):j=!0,ne(D,ie-ve))):(Z.sortIndex=_,t(m,Z),k||w||(k=!0,O||(O=!0,ee()))),Z},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(Z){var te=b;return function(){var ie=b;b=te;try{return Z.apply(this,arguments)}finally{b=ie}}}})(np)),np}var l1;function H2(){return l1||(l1=1,tp.exports=q2()),tp.exports}var rp={exports:{}},Cn={};/**
|
|
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 s1;function Z2(){if(s1)return Cn;s1=1;var e=Gg();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(m,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:h,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Cn.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)},Cn.flushSync=function(m){var h=c.T,y=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=y,a.d.f()}},Cn.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))},Cn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Cn.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,w=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:w}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Cn.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)},Cn.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})}},Cn.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)},Cn.requestFormReset=function(m){a.d.r(m)},Cn.unstable_batchedUpdates=function(m,h){return m(h)},Cn.useFormState=function(m,h,y){return c.H.useFormState(m,h,y)},Cn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Cn.version="19.2.4",Cn}var o1;function KS(){if(o1)return rp.exports;o1=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(),rp.exports=Z2(),rp.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 u1;function V2(){if(u1)return ru;u1=1;var e=H2(),t=Gg(),n=KS();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===d)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=v;else{for(var S=!1,T=p.child;T;){if(T===s){S=!0,s=p,d=v;break}if(T===d){S=!0,d=p,s=v;break}T=T.sibling}if(!S){for(T=v.child;T;){if(T===s){S=!0,s=v,d=p;break}if(T===d){S=!0,d=v,s=p;break}T=T.sibling}if(!S)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function y(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=y(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),w=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"),N=Symbol.for("react.consumer"),z=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function ee(r){return r===null||typeof r!="object"?null:(r=J&&r[J]||r["@@iterator"],typeof r=="function"?r:null)}var we=Symbol.for("react.client.reference");function le(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===we?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 O:return"SuspenseList";case Y:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case z:return r.displayName||"Context";case N:return(r._context.displayName||"Context")+".Consumer";case L:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case M:return i=r.displayName||null,i!==null?i:le(r.type)||"Memo";case U:i=r._payload,r=r._init;try{return le(r(i))}catch{}}return null}var ne=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ve=[],_=-1;function P(r){return{current:r}}function B(r){0>_||(r.current=ve[_],ve[_]=null,_--)}function A(r,i){_++,ve[_]=r.current,r.current=i}var q=P(null),G=P(null),ce=P(null),be=P(null);function xe(r,i){switch(A(ce,i),A(G,r),A(q,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?k0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=k0(i),r=j0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}B(q),A(q,r)}function me(){B(q),B(G),B(ce)}function Xe(r){r.memoizedState!==null&&A(be,r);var i=q.current,s=j0(i,r.type);i!==s&&(A(G,r),A(q,s))}function Le(r){G.current===r&&(B(q),B(G)),be.current===r&&(B(be),Jo._currentValue=ie)}var re,Ee;function Ie(r){if(re===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);re=i&&i[1]||"",Ee=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+re+r+Ee}var Pe=!1;function Lt(r,i){if(!r||Pe)return"";Pe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(W){var X=W}Reflect.construct(r,[],fe)}else{try{fe.call()}catch(W){X=W}r.call(fe.prototype)}}else{try{throw Error()}catch(W){X=W}(fe=r())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(W){if(W&&X&&typeof W.stack=="string")return[W.stack,X.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),S=v[0],T=v[1];if(S&&T){var $=S.split(`
|
|
44
|
-
`),K=T.split(`
|
|
45
|
-
`);for(p=d=0;d<$.length&&!$[d].includes("DetermineComponentFrameRoot");)d++;for(;p<K.length&&!K[p].includes("DetermineComponentFrameRoot");)p++;if(d===$.length||p===K.length)for(d=$.length-1,p=K.length-1;1<=d&&0<=p&&$[d]!==K[p];)p--;for(;1<=d&&0<=p;d--,p--)if($[d]!==K[p]){if(d!==1||p!==1)do if(d--,p--,0>p||$[d]!==K[p]){var ae=`
|
|
46
|
-
`+$[d].replace(" at new "," at ");return r.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",r.displayName)),ae}while(1<=d&&0<=p);break}}}finally{Pe=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Ie(s):""}function hn(r,i){switch(r.tag){case 26:case 27:case 5:return Ie(r.type);case 16:return Ie("Lazy");case 13:return r.child!==i&&i!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return Lt(r.type,!1);case 11:return Lt(r.type.render,!1);case 1:return Lt(r.type,!0);case 31:return Ie("Activity");default:return""}}function _l(r){try{var i="",s=null;do i+=hn(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
|
|
47
|
-
Error generating stack: `+d.message+`
|
|
48
|
-
`+d.stack}}var Ma=Object.prototype.hasOwnProperty,La=e.unstable_scheduleCallback,na=e.unstable_cancelCallback,oo=e.unstable_shouldYield,uo=e.unstable_requestPaint,mn=e.unstable_now,co=e.unstable_getCurrentPriorityLevel,se=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Ue=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,at=e.unstable_IdlePriority,pn=e.log,fr=e.unstable_setDisableYieldValue,nn=null,Zt=null;function gn(r){if(typeof pn=="function"&&fr(r),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(nn,r)}catch{}}var ht=Math.clz32?Math.clz32:nc,zr=Math.log,Ln=Math.LN2;function nc(r){return r>>>=0,r===0?32:31-(zr(r)/Ln|0)|0}var Li=256,Ii=262144,Ui=4194304;function Pr(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Pi(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var T=d&134217727;return T!==0?(d=T&~v,d!==0?p=Pr(d):(S&=T,S!==0?p=Pr(S):s||(s=T&~r,s!==0&&(p=Pr(s))))):(T=d&~v,T!==0?p=Pr(T):S!==0?p=Pr(S):s||(s=d&~r,s!==0&&(p=Pr(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 Ia(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function rc(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 Se(){var r=Ui;return Ui<<=1,(Ui&62914560)===0&&(Ui=4194304),r}function Je(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function yn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function ra(r,i,s,d,p,v){var S=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 T=r.entanglements,$=r.expirationTimes,K=r.hiddenUpdates;for(s=S&~s;0<s;){var ae=31-ht(s),fe=1<<ae;T[ae]=0,$[ae]=-1;var X=K[ae];if(X!==null)for(K[ae]=null,ae=0;ae<X.length;ae++){var W=X[ae];W!==null&&(W.lane&=-536870913)}s&=~fe}d!==0&&fo(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(S&~i))}function fo(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-ht(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function ac(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-ht(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function sv(r,i){var s=i&-i;return s=(s&42)!==0?1:Bf(s),(s&(r.suspendedLanes|i))!==0?0:s}function Bf(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 $f(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ov(){var r=te.p;return r!==0?r:(r=window.event,r===void 0?32:Q0(r.type))}function uv(r,i){var s=te.p;try{return te.p=r,i()}finally{te.p=s}}var Ua=Math.random().toString(36).slice(2),vn="__reactFiber$"+Ua,In="__reactProps$"+Ua,Tl="__reactContainer$"+Ua,Ff="__reactEvents$"+Ua,NN="__reactListeners$"+Ua,_N="__reactHandles$"+Ua,cv="__reactResources$"+Ua,ho="__reactMarker$"+Ua;function qf(r){delete r[vn],delete r[In],delete r[Ff],delete r[NN],delete r[_N]}function Al(r){var i=r[vn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Tl]||s[vn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=R0(r);r!==null;){if(s=r[vn])return s;r=R0(r)}return i}r=s,s=r.parentNode}return null}function Rl(r){if(r=r[vn]||r[Tl]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function mo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function zl(r){var i=r[cv];return i||(i=r[cv]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function on(r){r[ho]=!0}var dv=new Set,fv={};function Bi(r,i){Ol(r,i),Ol(r+"Capture",i)}function Ol(r,i){for(fv[r]=i,r=0;r<i.length;r++)dv.add(i[r])}var TN=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]*$"),hv={},mv={};function AN(r){return Ma.call(mv,r)?!0:Ma.call(hv,r)?!1:TN.test(r)?mv[r]=!0:(hv[r]=!0,!1)}function ic(r,i,s){if(AN(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function lc(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 aa(r,i,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+d)}}function hr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function pv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function RN(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,v=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(S){s=""+S,v.call(this,S)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(S){s=""+S},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Hf(r){if(!r._valueTracker){var i=pv(r)?"checked":"value";r._valueTracker=RN(r,i,""+r[i])}}function gv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=pv(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function sc(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 zN=/[\n"\\]/g;function mr(r){return r.replace(zN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Zf(r,i,s,d,p,v,S,T){r.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?r.type=S:r.removeAttribute("type"),i!=null?S==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+hr(i)):r.value!==""+hr(i)&&(r.value=""+hr(i)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),i!=null?Vf(r,S,hr(i)):s!=null?Vf(r,S,hr(s)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?r.name=""+hr(T):r.removeAttribute("name")}function yv(r,i,s,d,p,v,S,T){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)){Hf(r);return}s=s!=null?""+hr(s):"",i=i!=null?""+hr(i):s,T||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=T?r.checked:!!d,r.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),Hf(r)}function Vf(r,i,s){i==="number"&&sc(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Dl(r,i,s,d){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&d&&(r[s].defaultSelected=!0)}else{for(s=""+hr(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function vv(r,i,s){if(i!=null&&(i=""+hr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+hr(s):""}function bv(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(ne(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=hr(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),Hf(r)}function Ml(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var ON=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 xv(r,i,s){var d=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,s):typeof s!="number"||s===0||ON.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function wv(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&s[p]!==d&&xv(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&xv(r,v,i[v])}function Qf(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 DN=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"]]),MN=/^[\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 oc(r){return MN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ia(){}var Kf=null;function Gf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ll=null,Il=null;function Sv(r){var i=Rl(r);if(i&&(r=i.stateNode)){var s=r[In]||null;e:switch(r=i.stateNode,i.type){case"input":if(Zf(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="'+mr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[In]||null;if(!p)throw Error(a(90));Zf(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&gv(d)}break e;case"textarea":vv(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Dl(r,!!s.multiple,i,!1)}}}var Yf=!1;function kv(r,i,s){if(Yf)return r(i,s);Yf=!0;try{var d=r(i);return d}finally{if(Yf=!1,(Ll!==null||Il!==null)&&(Gc(),Ll&&(i=Ll,r=Il,Il=Ll=null,Sv(i),r)))for(i=0;i<r.length;i++)Sv(r[i])}}function po(r,i){var s=r.stateNode;if(s===null)return null;var d=s[In]||null;if(d===null)return null;s=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var la=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xf=!1;if(la)try{var go={};Object.defineProperty(go,"passive",{get:function(){Xf=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{Xf=!1}var Pa=null,Jf=null,uc=null;function jv(){if(uc)return uc;var r,i=Jf,s=i.length,d,p="value"in Pa?Pa.value:Pa.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var S=s-r;for(d=1;d<=S&&i[s-d]===p[v-d];d++);return uc=p.slice(r,1<d?1-d:void 0)}function cc(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 dc(){return!0}function Cv(){return!1}function Un(r){function i(s,d,p,v,S){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=S,this.currentTarget=null;for(var T in r)r.hasOwnProperty(T)&&(s=r[T],this[T]=s?s(v):v[T]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?dc:Cv,this.isPropagationStopped=Cv,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=dc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=dc)},persist:function(){},isPersistent:dc}),i}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fc=Un($i),yo=g({},$i,{view:0,detail:0}),LN=Un(yo),Wf,eh,vo,hc=g({},yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nh,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==vo&&(vo&&r.type==="mousemove"?(Wf=r.screenX-vo.screenX,eh=r.screenY-vo.screenY):eh=Wf=0,vo=r),Wf)},movementY:function(r){return"movementY"in r?r.movementY:eh}}),Ev=Un(hc),IN=g({},hc,{dataTransfer:0}),UN=Un(IN),PN=g({},yo,{relatedTarget:0}),th=Un(PN),BN=g({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),$N=Un(BN),FN=g({},$i,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),qN=Un(FN),HN=g({},$i,{data:0}),Nv=Un(HN),ZN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VN={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"},QN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KN(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=QN[r])?!!i[r]:!1}function nh(){return KN}var GN=g({},yo,{key:function(r){if(r.key){var i=ZN[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=cc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?VN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nh,charCode:function(r){return r.type==="keypress"?cc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?cc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),YN=Un(GN),XN=g({},hc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_v=Un(XN),JN=g({},yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nh}),WN=Un(JN),e_=g({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),t_=Un(e_),n_=g({},hc,{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}),r_=Un(n_),a_=g({},$i,{newState:0,oldState:0}),i_=Un(a_),l_=[9,13,27,32],rh=la&&"CompositionEvent"in window,bo=null;la&&"documentMode"in document&&(bo=document.documentMode);var s_=la&&"TextEvent"in window&&!bo,Tv=la&&(!rh||bo&&8<bo&&11>=bo),Av=" ",Rv=!1;function zv(r,i){switch(r){case"keyup":return l_.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ov(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ul=!1;function o_(r,i){switch(r){case"compositionend":return Ov(i);case"keypress":return i.which!==32?null:(Rv=!0,Av);case"textInput":return r=i.data,r===Av&&Rv?null:r;default:return null}}function u_(r,i){if(Ul)return r==="compositionend"||!rh&&zv(r,i)?(r=jv(),uc=Jf=Pa=null,Ul=!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 Tv&&i.locale!=="ko"?null:i.data;default:return null}}var c_={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 Dv(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!c_[r.type]:i==="textarea"}function Mv(r,i,s,d){Ll?Il?Il.push(d):Il=[d]:Ll=d,i=nd(i,"onChange"),0<i.length&&(s=new fc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var xo=null,wo=null;function d_(r){y0(r,0)}function mc(r){var i=mo(r);if(gv(i))return r}function Lv(r,i){if(r==="change")return i}var Iv=!1;if(la){var ah;if(la){var ih="oninput"in document;if(!ih){var Uv=document.createElement("div");Uv.setAttribute("oninput","return;"),ih=typeof Uv.oninput=="function"}ah=ih}else ah=!1;Iv=ah&&(!document.documentMode||9<document.documentMode)}function Pv(){xo&&(xo.detachEvent("onpropertychange",Bv),wo=xo=null)}function Bv(r){if(r.propertyName==="value"&&mc(wo)){var i=[];Mv(i,wo,r,Gf(r)),kv(d_,i)}}function f_(r,i,s){r==="focusin"?(Pv(),xo=i,wo=s,xo.attachEvent("onpropertychange",Bv)):r==="focusout"&&Pv()}function h_(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return mc(wo)}function m_(r,i){if(r==="click")return mc(i)}function p_(r,i){if(r==="input"||r==="change")return mc(i)}function g_(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Xn=typeof Object.is=="function"?Object.is:g_;function So(r,i){if(Xn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),d=Object.keys(i);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var p=s[d];if(!Ma.call(i,p)||!Xn(r[p],i[p]))return!1}return!0}function $v(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Fv(r,i){var s=$v(r);r=0;for(var d;s;){if(s.nodeType===3){if(d=r+s.textContent.length,r<=i&&d>=i)return{node:s,offset:i-r};r=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=$v(s)}}function qv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?qv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Hv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=sc(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=sc(r.document)}return i}function lh(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 y_=la&&"documentMode"in document&&11>=document.documentMode,Pl=null,sh=null,ko=null,oh=!1;function Zv(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;oh||Pl==null||Pl!==sc(d)||(d=Pl,"selectionStart"in d&&lh(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ko&&So(ko,d)||(ko=d,d=nd(sh,"onSelect"),0<d.length&&(i=new fc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Pl)))}function Fi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Bl={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},uh={},Vv={};la&&(Vv=document.createElement("div").style,"AnimationEvent"in window||(delete Bl.animationend.animation,delete Bl.animationiteration.animation,delete Bl.animationstart.animation),"TransitionEvent"in window||delete Bl.transitionend.transition);function qi(r){if(uh[r])return uh[r];if(!Bl[r])return r;var i=Bl[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Vv)return uh[r]=i[s];return r}var Qv=qi("animationend"),Kv=qi("animationiteration"),Gv=qi("animationstart"),v_=qi("transitionrun"),b_=qi("transitionstart"),x_=qi("transitioncancel"),Yv=qi("transitionend"),Xv=new Map,ch="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(" ");ch.push("scrollEnd");function Or(r,i){Xv.set(r,i),Bi(i,[r])}var pc=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)},pr=[],$l=0,dh=0;function gc(){for(var r=$l,i=dh=$l=0;i<r;){var s=pr[i];pr[i++]=null;var d=pr[i];pr[i++]=null;var p=pr[i];pr[i++]=null;var v=pr[i];if(pr[i++]=null,d!==null&&p!==null){var S=d.pending;S===null?p.next=p:(p.next=S.next,S.next=p),d.pending=p}v!==0&&Jv(s,p,v)}}function yc(r,i,s,d){pr[$l++]=r,pr[$l++]=i,pr[$l++]=s,pr[$l++]=d,dh|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function fh(r,i,s,d){return yc(r,i,s,d),vc(r)}function Hi(r,i){return yc(r,null,null,i),vc(r)}function Jv(r,i,s){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,d=v.alternate,d!==null&&(d.childLanes|=s),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&i!==null&&(p=31-ht(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function vc(r){if(50<Zo)throw Zo=0,wm=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Fl={};function w_(r,i,s,d){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(r,i,s,d){return new w_(r,i,s,d)}function hh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function sa(r,i){var s=r.alternate;return s===null?(s=Jn(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 Wv(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 bc(r,i,s,d,p,v){var S=0;if(d=r,typeof r=="function")hh(r)&&(S=1);else if(typeof r=="string")S=E2(r,s,q.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case Y:return r=Jn(31,s,i,p),r.elementType=Y,r.lanes=v,r;case j:return Zi(s.children,p,v,i);case E:S=8,p|=24;break;case C:return r=Jn(12,s,i,p|2),r.elementType=C,r.lanes=v,r;case D:return r=Jn(13,s,i,p),r.elementType=D,r.lanes=v,r;case O:return r=Jn(19,s,i,p),r.elementType=O,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case z:S=10;break e;case N:S=9;break e;case L:S=11;break e;case M:S=14;break e;case U:S=16,d=null;break e}S=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Jn(S,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Zi(r,i,s,d){return r=Jn(7,r,d,i),r.lanes=s,r}function mh(r,i,s){return r=Jn(6,r,null,i),r.lanes=s,r}function eb(r){var i=Jn(18,null,null,0);return i.stateNode=r,i}function ph(r,i,s){return i=Jn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var tb=new WeakMap;function gr(r,i){if(typeof r=="object"&&r!==null){var s=tb.get(r);return s!==void 0?s:(i={value:r,source:i,stack:_l(i)},tb.set(r,i),i)}return{value:r,source:i,stack:_l(i)}}var ql=[],Hl=0,xc=null,jo=0,yr=[],vr=0,Ba=null,Br=1,$r="";function oa(r,i){ql[Hl++]=jo,ql[Hl++]=xc,xc=r,jo=i}function nb(r,i,s){yr[vr++]=Br,yr[vr++]=$r,yr[vr++]=Ba,Ba=r;var d=Br;r=$r;var p=32-ht(d)-1;d&=~(1<<p),s+=1;var v=32-ht(i)+p;if(30<v){var S=p-p%5;v=(d&(1<<S)-1).toString(32),d>>=S,p-=S,Br=1<<32-ht(i)+p|s<<p|d,$r=v+r}else Br=1<<v|s<<p|d,$r=r}function gh(r){r.return!==null&&(oa(r,1),nb(r,1,0))}function yh(r){for(;r===xc;)xc=ql[--Hl],ql[Hl]=null,jo=ql[--Hl],ql[Hl]=null;for(;r===Ba;)Ba=yr[--vr],yr[vr]=null,$r=yr[--vr],yr[vr]=null,Br=yr[--vr],yr[vr]=null}function rb(r,i){yr[vr++]=Br,yr[vr++]=$r,yr[vr++]=Ba,Br=i.id,$r=i.overflow,Ba=r}var bn=null,Nt=null,it=!1,$a=null,br=!1,vh=Error(a(519));function Fa(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(gr(i,r)),vh}function ab(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[vn]=r,i[In]=d,s){case"dialog":et("cancel",i),et("close",i);break;case"iframe":case"object":case"embed":et("load",i);break;case"video":case"audio":for(s=0;s<Qo.length;s++)et(Qo[s],i);break;case"source":et("error",i);break;case"img":case"image":case"link":et("error",i),et("load",i);break;case"details":et("toggle",i);break;case"input":et("invalid",i),yv(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":et("invalid",i);break;case"textarea":et("invalid",i),bv(i,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||d.suppressHydrationWarning===!0||w0(i.textContent,s)?(d.popover!=null&&(et("beforetoggle",i),et("toggle",i)),d.onScroll!=null&&et("scroll",i),d.onScrollEnd!=null&&et("scrollend",i),d.onClick!=null&&(i.onclick=ia),i=!0):i=!1,i||Fa(r,!0)}function ib(r){for(bn=r.return;bn;)switch(bn.tag){case 5:case 31:case 13:br=!1;return;case 27:case 3:br=!0;return;default:bn=bn.return}}function Zl(r){if(r!==bn)return!1;if(!it)return ib(r),it=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Lm(r.type,r.memoizedProps)),s=!s),s&&Nt&&Fa(r),ib(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Nt=A0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Nt=A0(r)}else i===27?(i=Nt,ni(r.type)?(r=$m,$m=null,Nt=r):Nt=i):Nt=bn?wr(r.stateNode.nextSibling):null;return!0}function Vi(){Nt=bn=null,it=!1}function bh(){var r=$a;return r!==null&&(Fn===null?Fn=r:Fn.push.apply(Fn,r),$a=null),r}function Co(r){$a===null?$a=[r]:$a.push(r)}var xh=P(null),Qi=null,ua=null;function qa(r,i,s){A(xh,i._currentValue),i._currentValue=s}function ca(r){r._currentValue=xh.current,B(xh)}function wh(r,i,s){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===s)break;r=r.return}}function Sh(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var S=p.child;v=v.firstContext;e:for(;v!==null;){var T=v;v=p;for(var $=0;$<i.length;$++)if(T.context===i[$]){v.lanes|=s,T=v.alternate,T!==null&&(T.lanes|=s),wh(v.return,s,r),d||(S=null);break e}v=T.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=s,v=S.alternate,v!==null&&(v.lanes|=s),wh(S,s,r),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===r){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Vl(r,i,s,d){r=null;for(var p=i,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var T=p.type;Xn(p.pendingProps.value,S.value)||(r!==null?r.push(T):r=[T])}}else if(p===be.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Jo):r=[Jo])}p=p.return}r!==null&&Sh(i,r,s,d),i.flags|=262144}function wc(r){for(r=r.firstContext;r!==null;){if(!Xn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ki(r){Qi=r,ua=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function xn(r){return lb(Qi,r)}function Sc(r,i){return Qi===null&&Ki(r),lb(r,i)}function lb(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ua===null){if(r===null)throw Error(a(308));ua=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ua=ua.next=i;return s}var S_=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},k_=e.unstable_scheduleCallback,j_=e.unstable_NormalPriority,Gt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kh(){return{controller:new S_,data:new Map,refCount:0}}function Eo(r){r.refCount--,r.refCount===0&&k_(j_,function(){r.controller.abort()})}var No=null,jh=0,Ql=0,Kl=null;function C_(r,i){if(No===null){var s=No=[];jh=0,Ql=Nm(),Kl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return jh++,i.then(sb,sb),i}function sb(){if(--jh===0&&No!==null){Kl!==null&&(Kl.status="fulfilled");var r=No;No=null,Ql=0,Kl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function E_(r,i){var s=[],d={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),d}var ob=Z.S;Z.S=function(r,i){Zx=mn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&C_(r,i),ob!==null&&ob(r,i)};var Gi=P(null);function Ch(){var r=Gi.current;return r!==null?r:kt.pooledCache}function kc(r,i){i===null?A(Gi,Gi.current):A(Gi,i.pool)}function ub(){var r=Ch();return r===null?null:{parent:Gt._currentValue,pool:r}}var Gl=Error(a(460)),Eh=Error(a(474)),jc=Error(a(542)),Cc={then:function(){}};function cb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function db(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(ia,ia),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,hb(r),r;default:if(typeof i.status=="string")i.then(ia,ia);else{if(r=kt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,hb(r),r}throw Xi=i,Gl}}function Yi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Xi=s,Gl):s}}var Xi=null;function fb(){if(Xi===null)throw Error(a(459));var r=Xi;return Xi=null,r}function hb(r){if(r===Gl||r===jc)throw Error(a(483))}var Yl=null,_o=0;function Ec(r){var i=_o;return _o+=1,Yl===null&&(Yl=[]),db(Yl,r,i)}function To(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Nc(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 mb(r){function i(V,H){if(r){var Q=V.deletions;Q===null?(V.deletions=[H],V.flags|=16):Q.push(H)}}function s(V,H){if(!r)return null;for(;H!==null;)i(V,H),H=H.sibling;return null}function d(V){for(var H=new Map;V!==null;)V.key!==null?H.set(V.key,V):H.set(V.index,V),V=V.sibling;return H}function p(V,H){return V=sa(V,H),V.index=0,V.sibling=null,V}function v(V,H,Q){return V.index=Q,r?(Q=V.alternate,Q!==null?(Q=Q.index,Q<H?(V.flags|=67108866,H):Q):(V.flags|=67108866,H)):(V.flags|=1048576,H)}function S(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function T(V,H,Q,ue){return H===null||H.tag!==6?(H=mh(Q,V.mode,ue),H.return=V,H):(H=p(H,Q),H.return=V,H)}function $(V,H,Q,ue){var ze=Q.type;return ze===j?ae(V,H,Q.props.children,ue,Q.key):H!==null&&(H.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===U&&Yi(ze)===H.type)?(H=p(H,Q.props),To(H,Q),H.return=V,H):(H=bc(Q.type,Q.key,Q.props,null,V.mode,ue),To(H,Q),H.return=V,H)}function K(V,H,Q,ue){return H===null||H.tag!==4||H.stateNode.containerInfo!==Q.containerInfo||H.stateNode.implementation!==Q.implementation?(H=ph(Q,V.mode,ue),H.return=V,H):(H=p(H,Q.children||[]),H.return=V,H)}function ae(V,H,Q,ue,ze){return H===null||H.tag!==7?(H=Zi(Q,V.mode,ue,ze),H.return=V,H):(H=p(H,Q),H.return=V,H)}function fe(V,H,Q){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=mh(""+H,V.mode,Q),H.return=V,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return Q=bc(H.type,H.key,H.props,null,V.mode,Q),To(Q,H),Q.return=V,Q;case k:return H=ph(H,V.mode,Q),H.return=V,H;case U:return H=Yi(H),fe(V,H,Q)}if(ne(H)||ee(H))return H=Zi(H,V.mode,Q,null),H.return=V,H;if(typeof H.then=="function")return fe(V,Ec(H),Q);if(H.$$typeof===z)return fe(V,Sc(V,H),Q);Nc(V,H)}return null}function X(V,H,Q,ue){var ze=H!==null?H.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return ze!==null?null:T(V,H,""+Q,ue);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:return Q.key===ze?$(V,H,Q,ue):null;case k:return Q.key===ze?K(V,H,Q,ue):null;case U:return Q=Yi(Q),X(V,H,Q,ue)}if(ne(Q)||ee(Q))return ze!==null?null:ae(V,H,Q,ue,null);if(typeof Q.then=="function")return X(V,H,Ec(Q),ue);if(Q.$$typeof===z)return X(V,H,Sc(V,Q),ue);Nc(V,Q)}return null}function W(V,H,Q,ue,ze){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return V=V.get(Q)||null,T(H,V,""+ue,ze);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case w:return V=V.get(ue.key===null?Q:ue.key)||null,$(H,V,ue,ze);case k:return V=V.get(ue.key===null?Q:ue.key)||null,K(H,V,ue,ze);case U:return ue=Yi(ue),W(V,H,Q,ue,ze)}if(ne(ue)||ee(ue))return V=V.get(Q)||null,ae(H,V,ue,ze,null);if(typeof ue.then=="function")return W(V,H,Q,Ec(ue),ze);if(ue.$$typeof===z)return W(V,H,Q,Sc(H,ue),ze);Nc(H,ue)}return null}function Ce(V,H,Q,ue){for(var ze=null,ct=null,Te=H,Qe=H=0,rt=null;Te!==null&&Qe<Q.length;Qe++){Te.index>Qe?(rt=Te,Te=null):rt=Te.sibling;var dt=X(V,Te,Q[Qe],ue);if(dt===null){Te===null&&(Te=rt);break}r&&Te&&dt.alternate===null&&i(V,Te),H=v(dt,H,Qe),ct===null?ze=dt:ct.sibling=dt,ct=dt,Te=rt}if(Qe===Q.length)return s(V,Te),it&&oa(V,Qe),ze;if(Te===null){for(;Qe<Q.length;Qe++)Te=fe(V,Q[Qe],ue),Te!==null&&(H=v(Te,H,Qe),ct===null?ze=Te:ct.sibling=Te,ct=Te);return it&&oa(V,Qe),ze}for(Te=d(Te);Qe<Q.length;Qe++)rt=W(Te,V,Qe,Q[Qe],ue),rt!==null&&(r&&rt.alternate!==null&&Te.delete(rt.key===null?Qe:rt.key),H=v(rt,H,Qe),ct===null?ze=rt:ct.sibling=rt,ct=rt);return r&&Te.forEach(function(si){return i(V,si)}),it&&oa(V,Qe),ze}function De(V,H,Q,ue){if(Q==null)throw Error(a(151));for(var ze=null,ct=null,Te=H,Qe=H=0,rt=null,dt=Q.next();Te!==null&&!dt.done;Qe++,dt=Q.next()){Te.index>Qe?(rt=Te,Te=null):rt=Te.sibling;var si=X(V,Te,dt.value,ue);if(si===null){Te===null&&(Te=rt);break}r&&Te&&si.alternate===null&&i(V,Te),H=v(si,H,Qe),ct===null?ze=si:ct.sibling=si,ct=si,Te=rt}if(dt.done)return s(V,Te),it&&oa(V,Qe),ze;if(Te===null){for(;!dt.done;Qe++,dt=Q.next())dt=fe(V,dt.value,ue),dt!==null&&(H=v(dt,H,Qe),ct===null?ze=dt:ct.sibling=dt,ct=dt);return it&&oa(V,Qe),ze}for(Te=d(Te);!dt.done;Qe++,dt=Q.next())dt=W(Te,V,Qe,dt.value,ue),dt!==null&&(r&&dt.alternate!==null&&Te.delete(dt.key===null?Qe:dt.key),H=v(dt,H,Qe),ct===null?ze=dt:ct.sibling=dt,ct=dt);return r&&Te.forEach(function(I2){return i(V,I2)}),it&&oa(V,Qe),ze}function xt(V,H,Q,ue){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 w:e:{for(var ze=Q.key;H!==null;){if(H.key===ze){if(ze=Q.type,ze===j){if(H.tag===7){s(V,H.sibling),ue=p(H,Q.props.children),ue.return=V,V=ue;break e}}else if(H.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===U&&Yi(ze)===H.type){s(V,H.sibling),ue=p(H,Q.props),To(ue,Q),ue.return=V,V=ue;break e}s(V,H);break}else i(V,H);H=H.sibling}Q.type===j?(ue=Zi(Q.props.children,V.mode,ue,Q.key),ue.return=V,V=ue):(ue=bc(Q.type,Q.key,Q.props,null,V.mode,ue),To(ue,Q),ue.return=V,V=ue)}return S(V);case k:e:{for(ze=Q.key;H!==null;){if(H.key===ze)if(H.tag===4&&H.stateNode.containerInfo===Q.containerInfo&&H.stateNode.implementation===Q.implementation){s(V,H.sibling),ue=p(H,Q.children||[]),ue.return=V,V=ue;break e}else{s(V,H);break}else i(V,H);H=H.sibling}ue=ph(Q,V.mode,ue),ue.return=V,V=ue}return S(V);case U:return Q=Yi(Q),xt(V,H,Q,ue)}if(ne(Q))return Ce(V,H,Q,ue);if(ee(Q)){if(ze=ee(Q),typeof ze!="function")throw Error(a(150));return Q=ze.call(Q),De(V,H,Q,ue)}if(typeof Q.then=="function")return xt(V,H,Ec(Q),ue);if(Q.$$typeof===z)return xt(V,H,Sc(V,Q),ue);Nc(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,H!==null&&H.tag===6?(s(V,H.sibling),ue=p(H,Q),ue.return=V,V=ue):(s(V,H),ue=mh(Q,V.mode,ue),ue.return=V,V=ue),S(V)):s(V,H)}return function(V,H,Q,ue){try{_o=0;var ze=xt(V,H,Q,ue);return Yl=null,ze}catch(Te){if(Te===Gl||Te===jc)throw Te;var ct=Jn(29,Te,null,V.mode);return ct.lanes=ue,ct.return=V,ct}finally{}}}var Ji=mb(!0),pb=mb(!1),Ha=!1;function Nh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _h(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 d=r.updateQueue;if(d===null)return null;if(d=d.shared,(ft&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=vc(r),Jv(r,null,s),i}return yc(r,d,i,s),vc(r)}function Ao(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,ac(r,s)}}function Th(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var S={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=S:v=v.next=S,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var Ah=!1;function Ro(){if(Ah){var r=Kl;if(r!==null)throw r}}function zo(r,i,s,d){Ah=!1;var p=r.updateQueue;Ha=!1;var v=p.firstBaseUpdate,S=p.lastBaseUpdate,T=p.shared.pending;if(T!==null){p.shared.pending=null;var $=T,K=$.next;$.next=null,S===null?v=K:S.next=K,S=$;var ae=r.alternate;ae!==null&&(ae=ae.updateQueue,T=ae.lastBaseUpdate,T!==S&&(T===null?ae.firstBaseUpdate=K:T.next=K,ae.lastBaseUpdate=$))}if(v!==null){var fe=p.baseState;S=0,ae=K=$=null,T=v;do{var X=T.lane&-536870913,W=X!==T.lane;if(W?(nt&X)===X:(d&X)===X){X!==0&&X===Ql&&(Ah=!0),ae!==null&&(ae=ae.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var Ce=r,De=T;X=i;var xt=s;switch(De.tag){case 1:if(Ce=De.payload,typeof Ce=="function"){fe=Ce.call(xt,fe,X);break e}fe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=De.payload,X=typeof Ce=="function"?Ce.call(xt,fe,X):Ce,X==null)break e;fe=g({},fe,X);break e;case 2:Ha=!0}}X=T.callback,X!==null&&(r.flags|=64,W&&(r.flags|=8192),W=p.callbacks,W===null?p.callbacks=[X]:W.push(X))}else W={lane:X,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ae===null?(K=ae=W,$=fe):ae=ae.next=W,S|=X;if(T=T.next,T===null){if(T=p.shared.pending,T===null)break;W=T,T=W.next,W.next=null,p.lastBaseUpdate=W,p.shared.pending=null}}while(!0);ae===null&&($=fe),p.baseState=$,p.firstBaseUpdate=K,p.lastBaseUpdate=ae,v===null&&(p.shared.lanes=0),Xa|=S,r.lanes=S,r.memoizedState=fe}}function gb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function yb(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)gb(s[r],i)}var Xl=P(null),_c=P(0);function vb(r,i){r=ba,A(_c,r),A(Xl,i),ba=r|i.baseLanes}function Rh(){A(_c,ba),A(Xl,Xl.current)}function zh(){ba=_c.current,B(Xl),B(_c)}var Wn=P(null),xr=null;function Qa(r){var i=r.alternate;A(Vt,Vt.current&1),A(Wn,r),xr===null&&(i===null||Xl.current!==null||i.memoizedState!==null)&&(xr=r)}function Oh(r){A(Vt,Vt.current),A(Wn,r),xr===null&&(xr=r)}function bb(r){r.tag===22?(A(Vt,Vt.current),A(Wn,r),xr===null&&(xr=r)):Ka()}function Ka(){A(Vt,Vt.current),A(Wn,Wn.current)}function er(r){B(Wn),xr===r&&(xr=null),B(Vt)}var Vt=P(0);function Tc(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Pm(s)||Bm(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 da=0,Ze=null,vt=null,Yt=null,Ac=!1,Jl=!1,Wi=!1,Rc=0,Oo=0,Wl=null,N_=0;function It(){throw Error(a(321))}function Dh(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Xn(r[s],i[s]))return!1;return!0}function Mh(r,i,s,d,p,v){return da=v,Ze=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?nx:Yh,Wi=!1,v=s(d,p),Wi=!1,Jl&&(v=wb(i,s,d,p)),xb(r),v}function xb(r){Z.H=Lo;var i=vt!==null&&vt.next!==null;if(da=0,Yt=vt=Ze=null,Ac=!1,Oo=0,Wl=null,i)throw Error(a(300));r===null||Xt||(r=r.dependencies,r!==null&&wc(r)&&(Xt=!0))}function wb(r,i,s,d){Ze=r;var p=0;do{if(Jl&&(Wl=null),Oo=0,Jl=!1,25<=p)throw Error(a(301));if(p+=1,Yt=vt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}Z.H=rx,v=i(s,d)}while(Jl);return v}function __(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?Do(i):i,r=r.useState()[0],(vt!==null?vt.memoizedState:null)!==r&&(Ze.flags|=1024),i}function Lh(){var r=Rc!==0;return Rc=0,r}function Ih(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Uh(r){if(Ac){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ac=!1}da=0,Yt=vt=Ze=null,Jl=!1,Oo=Rc=0,Wl=null}function Rn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?Ze.memoizedState=Yt=r:Yt=Yt.next=r,Yt}function Qt(){if(vt===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=vt.next;var i=Yt===null?Ze.memoizedState:Yt.next;if(i!==null)Yt=i,vt=r;else{if(r===null)throw Ze.alternate===null?Error(a(467)):Error(a(310));vt=r,r={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Yt===null?Ze.memoizedState=Yt=r:Yt=Yt.next=r}return Yt}function zc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(r){var i=Oo;return Oo+=1,Wl===null&&(Wl=[]),r=db(Wl,r,i),i=Ze,(Yt===null?i.memoizedState:Yt.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?nx:Yh),r}function Oc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Do(r);if(r.$$typeof===z)return xn(r)}throw Error(a(438,String(r)))}function Ph(r){var i=null,s=Ze.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=Ze.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=zc(),Ze.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),d=0;d<r;d++)s[d]=F;return i.index++,s}function fa(r,i){return typeof i=="function"?i(r):i}function Dc(r){var i=Qt();return Bh(i,vt,r)}function Bh(r,i,s){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=s;var p=r.baseQueue,v=d.pending;if(v!==null){if(p!==null){var S=p.next;p.next=v.next,v.next=S}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var T=S=null,$=null,K=i,ae=!1;do{var fe=K.lane&-536870913;if(fe!==K.lane?(nt&fe)===fe:(da&fe)===fe){var X=K.revertLane;if(X===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),fe===Ql&&(ae=!0);else if((da&X)===X){K=K.next,X===Ql&&(ae=!0);continue}else fe={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},$===null?(T=$=fe,S=v):$=$.next=fe,Ze.lanes|=X,Xa|=X;fe=K.action,Wi&&s(v,fe),v=K.hasEagerState?K.eagerState:s(v,fe)}else X={lane:fe,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},$===null?(T=$=X,S=v):$=$.next=X,Ze.lanes|=fe,Xa|=fe;K=K.next}while(K!==null&&K!==i);if($===null?S=v:$.next=T,!Xn(v,r.memoizedState)&&(Xt=!0,ae&&(s=Kl,s!==null)))throw s;r.memoizedState=v,r.baseState=S,r.baseQueue=$,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function $h(r){var i=Qt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var S=p=p.next;do v=r(v,S.action),S=S.next;while(S!==p);Xn(v,i.memoizedState)||(Xt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function Sb(r,i,s){var d=Ze,p=Qt(),v=it;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var S=!Xn((vt||p).memoizedState,s);if(S&&(p.memoizedState=s,Xt=!0),p=p.queue,Hh(Cb.bind(null,d,p,r),[r]),p.getSnapshot!==i||S||Yt!==null&&Yt.memoizedState.tag&1){if(d.flags|=2048,es(9,{destroy:void 0},jb.bind(null,d,p,s,i),null),kt===null)throw Error(a(349));v||(da&127)!==0||kb(d,i,s)}return s}function kb(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=Ze.updateQueue,i===null?(i=zc(),Ze.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function jb(r,i,s,d){i.value=s,i.getSnapshot=d,Eb(i)&&Nb(r)}function Cb(r,i,s){return s(function(){Eb(i)&&Nb(r)})}function Eb(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Xn(r,s)}catch{return!0}}function Nb(r){var i=Hi(r,2);i!==null&&qn(i,r,2)}function Fh(r){var i=Rn();if(typeof r=="function"){var s=r;if(r=s(),Wi){gn(!0);try{s()}finally{gn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:r},i}function _b(r,i,s,d){return r.baseState=s,Bh(r,vt,typeof d=="function"?d:fa)}function T_(r,i,s,d,p){if(Ic(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(S){v.listeners.push(S)}};Z.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,Tb(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Tb(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=Z.T,S={};Z.T=S;try{var T=s(p,d),$=Z.S;$!==null&&$(S,T),Ab(r,i,T)}catch(K){qh(r,i,K)}finally{v!==null&&S.types!==null&&(v.types=S.types),Z.T=v}}else try{v=s(p,d),Ab(r,i,v)}catch(K){qh(r,i,K)}}function Ab(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){Rb(r,i,d)},function(d){return qh(r,i,d)}):Rb(r,i,s)}function Rb(r,i,s){i.status="fulfilled",i.value=s,zb(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Tb(r,s)))}function qh(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,zb(i),i=i.next;while(i!==d)}r.action=null}function zb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Ob(r,i){return i}function Db(r,i){if(it){var s=kt.formState;if(s!==null){e:{var d=Ze;if(it){if(Nt){t:{for(var p=Nt,v=br;p.nodeType!==8;){if(!v){p=null;break t}if(p=wr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Nt=wr(p.nextSibling),d=p.data==="F!";break e}}Fa(d)}d=!1}d&&(i=s[0])}}return s=Rn(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ob,lastRenderedState:i},s.queue=d,s=Wb.bind(null,Ze,d),d.dispatch=s,d=Fh(!1),v=Gh.bind(null,Ze,!1,d.queue),d=Rn(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=T_.bind(null,Ze,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function Mb(r){var i=Qt();return Lb(i,vt,r)}function Lb(r,i,s){if(i=Bh(r,i,Ob)[0],r=Dc(fa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Do(i)}catch(S){throw S===Gl?jc:S}else d=i;i=Qt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(Ze.flags|=2048,es(9,{destroy:void 0},A_.bind(null,p,s),null)),[d,v,r]}function A_(r,i){r.action=i}function Ib(r){var i=Qt(),s=vt;if(s!==null)return Lb(i,s,r);Qt(),i=i.memoizedState,s=Qt();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function es(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=Ze.updateQueue,i===null&&(i=zc(),Ze.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(d=s.next,s.next=r,r.next=d,i.lastEffect=r),r}function Ub(){return Qt().memoizedState}function Mc(r,i,s,d){var p=Rn();Ze.flags|=r,p.memoizedState=es(1|i,{destroy:void 0},s,d===void 0?null:d)}function Lc(r,i,s,d){var p=Qt();d=d===void 0?null:d;var v=p.memoizedState.inst;vt!==null&&d!==null&&Dh(d,vt.memoizedState.deps)?p.memoizedState=es(i,v,s,d):(Ze.flags|=r,p.memoizedState=es(1|i,v,s,d))}function Pb(r,i){Mc(8390656,8,r,i)}function Hh(r,i){Lc(2048,8,r,i)}function R_(r){Ze.flags|=4;var i=Ze.updateQueue;if(i===null)i=zc(),Ze.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Bb(r){var i=Qt().memoizedState;return R_({ref:i,nextImpl:r}),function(){if((ft&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function $b(r,i){return Lc(4,2,r,i)}function Fb(r,i){return Lc(4,4,r,i)}function qb(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 Hb(r,i,s){s=s!=null?s.concat([r]):null,Lc(4,4,qb.bind(null,i,r),s)}function Zh(){}function Zb(r,i){var s=Qt();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&Dh(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function Vb(r,i){var s=Qt();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&Dh(i,d[1]))return d[0];if(d=r(),Wi){gn(!0);try{r()}finally{gn(!1)}}return s.memoizedState=[d,i],d}function Vh(r,i,s){return s===void 0||(da&1073741824)!==0&&(nt&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Qx(),Ze.lanes|=r,Xa|=r,s)}function Qb(r,i,s,d){return Xn(s,i)?s:Xl.current!==null?(r=Vh(r,s,d),Xn(r,i)||(Xt=!0),r):(da&42)===0||(da&1073741824)!==0&&(nt&261930)===0?(Xt=!0,r.memoizedState=s):(r=Qx(),Ze.lanes|=r,Xa|=r,i)}function Kb(r,i,s,d,p){var v=te.p;te.p=v!==0&&8>v?v:8;var S=Z.T,T={};Z.T=T,Gh(r,!1,i,s);try{var $=p(),K=Z.S;if(K!==null&&K(T,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ae=E_($,d);Mo(r,i,ae,rr(r))}else Mo(r,i,d,rr(r))}catch(fe){Mo(r,i,{then:function(){},status:"rejected",reason:fe},rr())}finally{te.p=v,S!==null&&T.types!==null&&(S.types=T.types),Z.T=S}}function z_(){}function Qh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=Gb(r).queue;Kb(r,p,i,ie,s===null?z_:function(){return Yb(r),s(d)})}function Gb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:ie},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Yb(r){var i=Gb(r);i.next===null&&(i=r.alternate.memoizedState),Mo(r,i.next.queue,{},rr())}function Kh(){return xn(Jo)}function Xb(){return Qt().memoizedState}function Jb(){return Qt().memoizedState}function O_(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=rr();r=Za(s);var d=Va(i,r,s);d!==null&&(qn(d,i,s),Ao(d,i,s)),i={cache:kh()},r.payload=i;return}i=i.return}}function D_(r,i,s){var d=rr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ic(r)?ex(i,s):(s=fh(r,i,s,d),s!==null&&(qn(s,r,d),tx(s,i,d)))}function Wb(r,i,s){var d=rr();Mo(r,i,s,d)}function Mo(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ic(r))ex(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var S=i.lastRenderedState,T=v(S,s);if(p.hasEagerState=!0,p.eagerState=T,Xn(T,S))return yc(r,i,p,0),kt===null&&gc(),!1}catch{}finally{}if(s=fh(r,i,p,d),s!==null)return qn(s,r,d),tx(s,i,d),!0}return!1}function Gh(r,i,s,d){if(d={lane:2,revertLane:Nm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Ic(r)){if(i)throw Error(a(479))}else i=fh(r,s,d,2),i!==null&&qn(i,r,2)}function Ic(r){var i=r.alternate;return r===Ze||i!==null&&i===Ze}function ex(r,i){Jl=Ac=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function tx(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,ac(r,s)}}var Lo={readContext:xn,use:Oc,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};Lo.useEffectEvent=It;var nx={readContext:xn,use:Oc,useCallback:function(r,i){return Rn().memoizedState=[r,i===void 0?null:i],r},useContext:xn,useEffect:Pb,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Mc(4194308,4,qb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Mc(4194308,4,r,i)},useInsertionEffect:function(r,i){Mc(4,2,r,i)},useMemo:function(r,i){var s=Rn();i=i===void 0?null:i;var d=r();if(Wi){gn(!0);try{r()}finally{gn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=Rn();if(s!==void 0){var p=s(i);if(Wi){gn(!0);try{s(i)}finally{gn(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=D_.bind(null,Ze,r),[d.memoizedState,r]},useRef:function(r){var i=Rn();return r={current:r},i.memoizedState=r},useState:function(r){r=Fh(r);var i=r.queue,s=Wb.bind(null,Ze,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:Zh,useDeferredValue:function(r,i){var s=Rn();return Vh(s,r,i)},useTransition:function(){var r=Fh(!1);return r=Kb.bind(null,Ze,r.queue,!0,!1),Rn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=Ze,p=Rn();if(it){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),kt===null)throw Error(a(349));(nt&127)!==0||kb(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Pb(Cb.bind(null,d,v,r),[r]),d.flags|=2048,es(9,{destroy:void 0},jb.bind(null,d,v,s,i),null),s},useId:function(){var r=Rn(),i=kt.identifierPrefix;if(it){var s=$r,d=Br;s=(d&~(1<<32-ht(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Rc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=N_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Kh,useFormState:Db,useActionState:Db,useOptimistic:function(r){var i=Rn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Gh.bind(null,Ze,!0,s),s.dispatch=i,[r,i]},useMemoCache:Ph,useCacheRefresh:function(){return Rn().memoizedState=O_.bind(null,Ze)},useEffectEvent:function(r){var i=Rn(),s={impl:r};return i.memoizedState=s,function(){if((ft&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Yh={readContext:xn,use:Oc,useCallback:Zb,useContext:xn,useEffect:Hh,useImperativeHandle:Hb,useInsertionEffect:$b,useLayoutEffect:Fb,useMemo:Vb,useReducer:Dc,useRef:Ub,useState:function(){return Dc(fa)},useDebugValue:Zh,useDeferredValue:function(r,i){var s=Qt();return Qb(s,vt.memoizedState,r,i)},useTransition:function(){var r=Dc(fa)[0],i=Qt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:Sb,useId:Xb,useHostTransitionStatus:Kh,useFormState:Mb,useActionState:Mb,useOptimistic:function(r,i){var s=Qt();return _b(s,vt,r,i)},useMemoCache:Ph,useCacheRefresh:Jb};Yh.useEffectEvent=Bb;var rx={readContext:xn,use:Oc,useCallback:Zb,useContext:xn,useEffect:Hh,useImperativeHandle:Hb,useInsertionEffect:$b,useLayoutEffect:Fb,useMemo:Vb,useReducer:$h,useRef:Ub,useState:function(){return $h(fa)},useDebugValue:Zh,useDeferredValue:function(r,i){var s=Qt();return vt===null?Vh(s,r,i):Qb(s,vt.memoizedState,r,i)},useTransition:function(){var r=$h(fa)[0],i=Qt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:Sb,useId:Xb,useHostTransitionStatus:Kh,useFormState:Ib,useActionState:Ib,useOptimistic:function(r,i){var s=Qt();return vt!==null?_b(s,vt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Ph,useCacheRefresh:Jb};rx.useEffectEvent=Bb;function Xh(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Jh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=rr(),p=Za(d);p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&(qn(i,r,d),Ao(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=rr(),p=Za(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&(qn(i,r,d),Ao(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=rr(),d=Za(s);d.tag=2,i!=null&&(d.callback=i),i=Va(r,d,s),i!==null&&(qn(i,r,s),Ao(i,r,s))}};function ax(r,i,s,d,p,v,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,S):i.prototype&&i.prototype.isPureReactComponent?!So(s,d)||!So(p,v):!0}function ix(r,i,s,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,d),i.state!==r&&Jh.enqueueReplaceState(i,i.state,null)}function el(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function lx(r){pc(r)}function sx(r){console.error(r)}function ox(r){pc(r)}function Uc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function ux(r,i,s){try{var d=r.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Wh(r,i,s){return s=Za(s),s.tag=3,s.payload={element:null},s.callback=function(){Uc(r,i)},s}function cx(r){return r=Za(r),r.tag=3,r}function dx(r,i,s,d){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=d.value;r.payload=function(){return p(v)},r.callback=function(){ux(i,s,d)}}var S=s.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(r.callback=function(){ux(i,s,d),typeof p!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var T=d.stack;this.componentDidCatch(d.value,{componentStack:T!==null?T:""})})}function M_(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Vl(i,s,p,!0),s=Wn.current,s!==null){switch(s.tag){case 31:case 13:return xr===null?Yc():s.alternate===null&&Ut===0&&(Ut=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===Cc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),jm(r,d,p)),!1;case 22:return s.flags|=65536,d===Cc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([d]):s.add(d)),jm(r,d,p)),!1}throw Error(a(435,s.tag))}return jm(r,d,p),Yc(),!1}if(it)return i=Wn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==vh&&(r=Error(a(422),{cause:d}),Co(gr(r,s)))):(d!==vh&&(i=Error(a(423),{cause:d}),Co(gr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=gr(d,s),p=Wh(r.stateNode,d,p),Th(r,p),Ut!==4&&(Ut=2)),!1;var v=Error(a(520),{cause:d});if(v=gr(v,s),Ho===null?Ho=[v]:Ho.push(v),Ut!==4&&(Ut=2),i===null)return!0;d=gr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Wh(s.stateNode,d,r),Th(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=cx(p),dx(p,r,s,d),Th(s,p),!1}s=s.return}while(s!==null);return!1}var em=Error(a(461)),Xt=!1;function wn(r,i,s,d){i.child=r===null?pb(i,null,s,d):Ji(i,r.child,s,d)}function fx(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var S={};for(var T in d)T!=="ref"&&(S[T]=d[T])}else S=d;return Ki(i),d=Mh(r,i,s,S,v,p),T=Lh(),r!==null&&!Xt?(Ih(r,i,p),ha(r,i,p)):(it&&T&&gh(i),i.flags|=1,wn(r,i,d,p),i.child)}function hx(r,i,s,d,p){if(r===null){var v=s.type;return typeof v=="function"&&!hh(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,mx(r,i,v,d,p)):(r=bc(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!om(r,p)){var S=v.memoizedProps;if(s=s.compare,s=s!==null?s:So,s(S,d)&&r.ref===i.ref)return ha(r,i,p)}return i.flags|=1,r=sa(v,d),r.ref=i.ref,r.return=i,i.child=r}function mx(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(So(v,d)&&r.ref===i.ref)if(Xt=!1,i.pendingProps=d=v,om(r,p))(r.flags&131072)!==0&&(Xt=!0);else return i.lanes=r.lanes,ha(r,i,p)}return tm(r,i,s,d,p)}function px(r,i,s,d){var p=d.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~v}else d=0,i.child=null;return gx(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&kc(i,v!==null?v.cachePool:null),v!==null?vb(i,v):Rh(),bb(i);else return d=i.lanes=536870912,gx(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(kc(i,v.cachePool),vb(i,v),Ka(),i.memoizedState=null):(r!==null&&kc(i,null),Rh(),Ka());return wn(r,i,p,s),i.child}function Io(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function gx(r,i,s,d,p){var v=Ch();return v=v===null?null:{parent:Gt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&kc(i,null),Rh(),bb(i),r!==null&&Vl(r,i,d,!0),i.childLanes=p,null}function Pc(r,i){return i=$c({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function yx(r,i,s){return Ji(i,r.child,null,s),r=Pc(i,i.pendingProps),r.flags|=2,er(i),i.memoizedState=null,r}function L_(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(it){if(d.mode==="hidden")return r=Pc(i,d),i.lanes=536870912,Io(null,r);if(Oh(i),(r=Nt)?(r=T0(r,br),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Br,overflow:$r}:null,retryLane:536870912,hydrationErrors:null},s=eb(r),s.return=i,i.child=s,bn=i,Nt=null)):r=null,r===null)throw Fa(i);return i.lanes=536870912,null}return Pc(i,d)}var v=r.memoizedState;if(v!==null){var S=v.dehydrated;if(Oh(i),p)if(i.flags&256)i.flags&=-257,i=yx(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Xt||Vl(r,i,s,!1),p=(s&r.childLanes)!==0,Xt||p){if(d=kt,d!==null&&(S=sv(d,s),S!==0&&S!==v.retryLane))throw v.retryLane=S,Hi(r,S),qn(d,r,S),em;Yc(),i=yx(r,i,s)}else r=v.treeContext,Nt=wr(S.nextSibling),bn=i,it=!0,$a=null,br=!1,r!==null&&rb(i,r),i=Pc(i,d),i.flags|=4096;return i}return r=sa(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Bc(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 tm(r,i,s,d,p){return Ki(i),s=Mh(r,i,s,d,void 0,p),d=Lh(),r!==null&&!Xt?(Ih(r,i,p),ha(r,i,p)):(it&&d&&gh(i),i.flags|=1,wn(r,i,s,p),i.child)}function vx(r,i,s,d,p,v){return Ki(i),i.updateQueue=null,s=wb(i,d,s,p),xb(r),d=Lh(),r!==null&&!Xt?(Ih(r,i,v),ha(r,i,v)):(it&&d&&gh(i),i.flags|=1,wn(r,i,s,v),i.child)}function bx(r,i,s,d,p){if(Ki(i),i.stateNode===null){var v=Fl,S=s.contextType;typeof S=="object"&&S!==null&&(v=xn(S)),v=new s(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Jh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},Nh(i),S=s.contextType,v.context=typeof S=="object"&&S!==null?xn(S):Fl,v.state=i.memoizedState,S=s.getDerivedStateFromProps,typeof S=="function"&&(Xh(i,s,S,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(S=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),S!==v.state&&Jh.enqueueReplaceState(v,v.state,null),zo(i,d,v,p),Ro(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var T=i.memoizedProps,$=el(s,T);v.props=$;var K=v.context,ae=s.contextType;S=Fl,typeof ae=="object"&&ae!==null&&(S=xn(ae));var fe=s.getDerivedStateFromProps;ae=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function",T=i.pendingProps!==T,ae||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T||K!==S)&&ix(i,v,d,S),Ha=!1;var X=i.memoizedState;v.state=X,zo(i,d,v,p),Ro(),K=i.memoizedState,T||X!==K||Ha?(typeof fe=="function"&&(Xh(i,s,fe,d),K=i.memoizedState),($=Ha||ax(i,s,$,d,X,K,S))?(ae||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=K),v.props=d,v.state=K,v.context=S,d=$):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,_h(r,i),S=i.memoizedProps,ae=el(s,S),v.props=ae,fe=i.pendingProps,X=v.context,K=s.contextType,$=Fl,typeof K=="object"&&K!==null&&($=xn(K)),T=s.getDerivedStateFromProps,(K=typeof T=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==fe||X!==$)&&ix(i,v,d,$),Ha=!1,X=i.memoizedState,v.state=X,zo(i,d,v,p),Ro();var W=i.memoizedState;S!==fe||X!==W||Ha||r!==null&&r.dependencies!==null&&wc(r.dependencies)?(typeof T=="function"&&(Xh(i,s,T,d),W=i.memoizedState),(ae=Ha||ax(i,s,ae,d,X,W,$)||r!==null&&r.dependencies!==null&&wc(r.dependencies))?(K||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,W,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,W,$)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=W),v.props=d,v.state=W,v.context=$,d=ae):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,Bc(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=Ji(i,r.child,null,p),i.child=Ji(i,null,s,p)):wn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=ha(r,i,p),r}function xx(r,i,s,d){return Vi(),i.flags|=256,wn(r,i,s,d),i.child}var nm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rm(r){return{baseLanes:r,cachePool:ub()}}function am(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=nr),r}function wx(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,S;if((S=v)||(S=r!==null&&r.memoizedState===null?!1:(Vt.current&2)!==0),S&&(p=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,r===null){if(it){if(p?Qa(i):Ka(),(r=Nt)?(r=T0(r,br),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Br,overflow:$r}:null,retryLane:536870912,hydrationErrors:null},s=eb(r),s.return=i,i.child=s,bn=i,Nt=null)):r=null,r===null)throw Fa(i);return Bm(r)?i.lanes=32:i.lanes=536870912,null}var T=d.children;return d=d.fallback,p?(Ka(),p=i.mode,T=$c({mode:"hidden",children:T},p),d=Zi(d,p,s,null),T.return=i,d.return=i,T.sibling=d,i.child=T,d=i.child,d.memoizedState=rm(s),d.childLanes=am(r,S,s),i.memoizedState=nm,Io(null,d)):(Qa(i),im(i,T))}var $=r.memoizedState;if($!==null&&(T=$.dehydrated,T!==null)){if(v)i.flags&256?(Qa(i),i.flags&=-257,i=lm(r,i,s)):i.memoizedState!==null?(Ka(),i.child=r.child,i.flags|=128,i=null):(Ka(),T=d.fallback,p=i.mode,d=$c({mode:"visible",children:d.children},p),T=Zi(T,p,s,null),T.flags|=2,d.return=i,T.return=i,d.sibling=T,i.child=d,Ji(i,r.child,null,s),d=i.child,d.memoizedState=rm(s),d.childLanes=am(r,S,s),i.memoizedState=nm,i=Io(null,d));else if(Qa(i),Bm(T)){if(S=T.nextSibling&&T.nextSibling.dataset,S)var K=S.dgst;S=K,d=Error(a(419)),d.stack="",d.digest=S,Co({value:d,source:null,stack:null}),i=lm(r,i,s)}else if(Xt||Vl(r,i,s,!1),S=(s&r.childLanes)!==0,Xt||S){if(S=kt,S!==null&&(d=sv(S,s),d!==0&&d!==$.retryLane))throw $.retryLane=d,Hi(r,d),qn(S,r,d),em;Pm(T)||Yc(),i=lm(r,i,s)}else Pm(T)?(i.flags|=192,i.child=r.child,i=null):(r=$.treeContext,Nt=wr(T.nextSibling),bn=i,it=!0,$a=null,br=!1,r!==null&&rb(i,r),i=im(i,d.children),i.flags|=4096);return i}return p?(Ka(),T=d.fallback,p=i.mode,$=r.child,K=$.sibling,d=sa($,{mode:"hidden",children:d.children}),d.subtreeFlags=$.subtreeFlags&65011712,K!==null?T=sa(K,T):(T=Zi(T,p,s,null),T.flags|=2),T.return=i,d.return=i,d.sibling=T,i.child=d,Io(null,d),d=i.child,T=r.child.memoizedState,T===null?T=rm(s):(p=T.cachePool,p!==null?($=Gt._currentValue,p=p.parent!==$?{parent:$,pool:$}:p):p=ub(),T={baseLanes:T.baseLanes|s,cachePool:p}),d.memoizedState=T,d.childLanes=am(r,S,s),i.memoizedState=nm,Io(r.child,d)):(Qa(i),s=r.child,r=s.sibling,s=sa(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(S=i.deletions,S===null?(i.deletions=[r],i.flags|=16):S.push(r)),i.child=s,i.memoizedState=null,s)}function im(r,i){return i=$c({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function $c(r,i){return r=Jn(22,r,null,i),r.lanes=0,r}function lm(r,i,s){return Ji(i,r.child,null,s),r=im(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Sx(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),wh(r.return,i,s)}function sm(r,i,s,d,p,v){var S=r.memoizedState;S===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=s,S.tailMode=p,S.treeForkCount=v)}function kx(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var S=Vt.current,T=(S&2)!==0;if(T?(S=S&1|2,i.flags|=128):S&=1,A(Vt,S),wn(r,i,d,s),d=it?jo:0,!T&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Sx(r,s,i);else if(r.tag===19)Sx(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&Tc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),sm(i,!1,p,s,v,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&Tc(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}sm(i,!0,s,null,v,d);break;case"together":sm(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function ha(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Xa|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Vl(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=sa(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=sa(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function om(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&wc(r)))}function I_(r,i,s){switch(i.tag){case 3:xe(i,i.stateNode.containerInfo),qa(i,Gt,r.memoizedState.cache),Vi();break;case 27:case 5:Xe(i);break;case 4:xe(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,Oh(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Qa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?wx(r,i,s):(Qa(i),r=ha(r,i,s),r!==null?r.sibling:null);Qa(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Vl(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return kx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),A(Vt,Vt.current),d)break;return null;case 22:return i.lanes=0,px(r,i,s,i.pendingProps);case 24:qa(i,Gt,r.memoizedState.cache)}return ha(r,i,s)}function jx(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Xt=!0;else{if(!om(r,s)&&(i.flags&128)===0)return Xt=!1,I_(r,i,s);Xt=(r.flags&131072)!==0}else Xt=!1,it&&(i.flags&1048576)!==0&&nb(i,jo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Yi(i.elementType),i.type=r,typeof r=="function")hh(r)?(d=el(r,d),i.tag=1,i=bx(null,i,r,d,s)):(i.tag=0,i=tm(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===L){i.tag=11,i=fx(null,i,r,d,s);break e}else if(p===M){i.tag=14,i=hx(null,i,r,d,s);break e}}throw i=le(r)||r,Error(a(306,i,""))}}return i;case 0:return tm(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=el(d,i.pendingProps),bx(r,i,d,p,s);case 3:e:{if(xe(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,_h(r,i),zo(i,d,null,s);var S=i.memoizedState;if(d=S.cache,qa(i,Gt,d),d!==v.cache&&Sh(i,[Gt],s,!0),Ro(),d=S.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=xx(r,i,d,s);break e}else if(d!==p){p=gr(Error(a(424)),i),Co(p),i=xx(r,i,d,s);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Nt=wr(r.firstChild),bn=i,it=!0,$a=null,br=!0,s=pb(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Vi(),d===p){i=ha(r,i,s);break e}wn(r,i,d,s)}i=i.child}return i;case 26:return Bc(r,i),r===null?(s=M0(i.type,null,i.pendingProps,null))?i.memoizedState=s:it||(s=i.type,r=i.pendingProps,d=rd(ce.current).createElement(s),d[vn]=i,d[In]=r,Sn(d,s,r),on(d),i.stateNode=d):i.memoizedState=M0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Xe(i),r===null&&it&&(d=i.stateNode=z0(i.type,i.pendingProps,ce.current),bn=i,br=!0,p=Nt,ni(i.type)?($m=p,Nt=wr(d.firstChild)):Nt=p),wn(r,i,i.pendingProps.children,s),Bc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&it&&((p=d=Nt)&&(d=h2(d,i.type,i.pendingProps,br),d!==null?(i.stateNode=d,bn=i,Nt=wr(d.firstChild),br=!1,p=!0):p=!1),p||Fa(i)),Xe(i),p=i.type,v=i.pendingProps,S=r!==null?r.memoizedProps:null,d=v.children,Lm(p,v)?d=null:S!==null&&Lm(p,S)&&(i.flags|=32),i.memoizedState!==null&&(p=Mh(r,i,__,null,null,s),Jo._currentValue=p),Bc(r,i),wn(r,i,d,s),i.child;case 6:return r===null&&it&&((r=s=Nt)&&(s=m2(s,i.pendingProps,br),s!==null?(i.stateNode=s,bn=i,Nt=null,r=!0):r=!1),r||Fa(i)),null;case 13:return wx(r,i,s);case 4:return xe(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Ji(i,null,d,s):wn(r,i,d,s),i.child;case 11:return fx(r,i,i.type,i.pendingProps,s);case 7:return wn(r,i,i.pendingProps,s),i.child;case 8:return wn(r,i,i.pendingProps.children,s),i.child;case 12:return wn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,qa(i,i.type,d.value),wn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Ki(i),p=xn(p),d=d(p),i.flags|=1,wn(r,i,d,s),i.child;case 14:return hx(r,i,i.type,i.pendingProps,s);case 15:return mx(r,i,i.type,i.pendingProps,s);case 19:return kx(r,i,s);case 31:return L_(r,i,s);case 22:return px(r,i,s,i.pendingProps);case 24:return Ki(i),d=xn(Gt),r===null?(p=Ch(),p===null&&(p=kt,v=kh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},Nh(i),qa(i,Gt,p)):((r.lanes&s)!==0&&(_h(r,i),zo(i,null,null,s),Ro()),p=r.memoizedState,v=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),qa(i,Gt,d)):(d=v.cache,qa(i,Gt,d),d!==p.cache&&Sh(i,[Gt],s,!0))),wn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ma(r){r.flags|=4}function um(r,i,s,d,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Xx())r.flags|=8192;else throw Xi=Cc,Eh}else r.flags&=-16777217}function Cx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!B0(i))if(Xx())r.flags|=8192;else throw Xi=Cc,Eh}function Fc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Se():536870912,r.lanes|=i,as|=i)}function Uo(r,i){if(!it)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function _t(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,d=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=s,i}function U_(r,i,s){var d=i.pendingProps;switch(yh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(i),null;case 1:return _t(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),ca(Gt),me(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Zl(i)?ma(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,bh())),_t(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ma(i),v!==null?(_t(i),Cx(i,v)):(_t(i),um(i,p,null,d,s))):v?v!==r.memoizedState?(ma(i),_t(i),Cx(i,v)):(_t(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&ma(i),_t(i),um(i,p,r,d,s)),null;case 27:if(Le(i),s=ce.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ma(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return _t(i),null}r=q.current,Zl(i)?ab(i):(r=z0(p,d,s),i.stateNode=r,ma(i))}return _t(i),null;case 5:if(Le(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ma(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return _t(i),null}if(v=q.current,Zl(i))ab(i);else{var S=rd(ce.current);switch(v){case 1:v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=S.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?S.createElement(p,{is:d.is}):S.createElement(p)}}v[vn]=i,v[In]=d;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)v.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=v;e:switch(Sn(v,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ma(i)}}return _t(i),um(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&ma(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ce.current,Zl(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=bn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[vn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||w0(r.nodeValue,s)),r||Fa(i,!0)}else r=rd(r).createTextNode(d),r[vn]=i,i.stateNode=r}return _t(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=Zl(i),s!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[vn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;_t(i),r=!1}else s=bh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(er(i),i):(er(i),null);if((i.flags&128)!==0)throw Error(a(558))}return _t(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Zl(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[vn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;_t(i),p=!1}else p=bh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(er(i),i):(er(i),null)}return er(i),(i.flags&128)!==0?(i.lanes=s,i):(s=d!==null,r=r!==null&&r.memoizedState!==null,s&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Fc(i,i.updateQueue),_t(i),null);case 4:return me(),r===null&&Rm(i.stateNode.containerInfo),_t(i),null;case 10:return ca(i.type),_t(i),null;case 19:if(B(Vt),d=i.memoizedState,d===null)return _t(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Uo(d,!1);else{if(Ut!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=Tc(r),v!==null){for(i.flags|=128,Uo(d,!1),r=v.updateQueue,i.updateQueue=r,Fc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Wv(s,r),s=s.sibling;return A(Vt,Vt.current&1|2),it&&oa(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&mn()>Qc&&(i.flags|=128,p=!0,Uo(d,!1),i.lanes=4194304)}else{if(!p)if(r=Tc(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Fc(i,r),Uo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!it)return _t(i),null}else 2*mn()-d.renderingStartTime>Qc&&s!==536870912&&(i.flags|=128,p=!0,Uo(d,!1),i.lanes=4194304);d.isBackwards?(v.sibling=i.child,i.child=v):(r=d.last,r!==null?r.sibling=v:i.child=v,d.last=v)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=mn(),r.sibling=null,s=Vt.current,A(Vt,p?s&1|2:s&1),it&&oa(i,d.treeForkCount),r):(_t(i),null);case 22:case 23:return er(i),zh(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(s&536870912)!==0&&(i.flags&128)===0&&(_t(i),i.subtreeFlags&6&&(i.flags|=8192)):_t(i),s=i.updateQueue,s!==null&&Fc(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&B(Gi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ca(Gt),_t(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function P_(r,i){switch(yh(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ca(Gt),me(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Le(i),null;case 31:if(i.memoizedState!==null){if(er(i),i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(er(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return B(Vt),null;case 4:return me(),null;case 10:return ca(i.type),null;case 22:case 23:return er(i),zh(),r!==null&&B(Gi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ca(Gt),null;case 25:return null;default:return null}}function Ex(r,i){switch(yh(i),i.tag){case 3:ca(Gt),me();break;case 26:case 27:case 5:Le(i);break;case 4:me();break;case 31:i.memoizedState!==null&&er(i);break;case 13:er(i);break;case 19:B(Vt);break;case 10:ca(i.type);break;case 22:case 23:er(i),zh(),r!==null&&B(Gi);break;case 24:ca(Gt)}}function Po(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var v=s.create,S=s.inst;d=v(),S.destroy=d}s=s.next}while(s!==p)}}catch(T){yt(i,i.return,T)}}function Ga(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var S=d.inst,T=S.destroy;if(T!==void 0){S.destroy=void 0,p=i;var $=s,K=T;try{K()}catch(ae){yt(p,$,ae)}}}d=d.next}while(d!==v)}}catch(ae){yt(i,i.return,ae)}}function Nx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{yb(i,s)}catch(d){yt(r,r.return,d)}}}function _x(r,i,s){s.props=el(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){yt(r,i,d)}}function Bo(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof s=="function"?r.refCleanup=s(d):s.current=d}}catch(p){yt(r,i,p)}}function Fr(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){yt(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){yt(r,i,p)}else s.current=null}function Tx(r){var i=r.type,s=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(p){yt(r,r.return,p)}}function cm(r,i,s){try{var d=r.stateNode;s2(d,r.type,s,i),d[In]=i}catch(p){yt(r,r.return,p)}}function Ax(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ni(r.type)||r.tag===4}function dm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Ax(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 fm(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=ia));else if(d!==4&&(d===27&&ni(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(fm(r,i,s),r=r.sibling;r!==null;)fm(r,i,s),r=r.sibling}function qc(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&ni(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(qc(r,i,s),r=r.sibling;r!==null;)qc(r,i,s),r=r.sibling}function Rx(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Sn(i,d,s),i[vn]=r,i[In]=s}catch(v){yt(r,r.return,v)}}var pa=!1,Jt=!1,hm=!1,zx=typeof WeakSet=="function"?WeakSet:Set,un=null;function B_(r,i){if(r=r.containerInfo,Dm=cd,r=Hv(r),lh(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var S=0,T=-1,$=-1,K=0,ae=0,fe=r,X=null;t:for(;;){for(var W;fe!==s||p!==0&&fe.nodeType!==3||(T=S+p),fe!==v||d!==0&&fe.nodeType!==3||($=S+d),fe.nodeType===3&&(S+=fe.nodeValue.length),(W=fe.firstChild)!==null;)X=fe,fe=W;for(;;){if(fe===r)break t;if(X===s&&++K===p&&(T=S),X===v&&++ae===d&&($=S),(W=fe.nextSibling)!==null)break;fe=X,X=fe.parentNode}fe=W}s=T===-1||$===-1?null:{start:T,end:$}}else s=null}s=s||{start:0,end:0}}else s=null;for(Mm={focusedElem:r,selectionRange:s},cd=!1,un=i;un!==null;)if(i=un,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,un=r;else for(;un!==null;){switch(i=un,v=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,s=i,p=v.memoizedProps,v=v.memoizedState,d=s.stateNode;try{var Ce=el(s.type,p);r=d.getSnapshotBeforeUpdate(Ce,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(De){yt(s,s.return,De)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Um(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Um(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,un=r;break}un=i.return}}function Ox(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ya(r,s),d&4&&Po(5,s);break;case 1:if(ya(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(S){yt(s,s.return,S)}else{var p=el(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(S){yt(s,s.return,S)}}d&64&&Nx(s),d&512&&Bo(s,s.return);break;case 3:if(ya(r,s),d&64&&(r=s.updateQueue,r!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{yb(r,i)}catch(S){yt(s,s.return,S)}}break;case 27:i===null&&d&4&&Rx(s);case 26:case 5:ya(r,s),i===null&&d&4&&Tx(s),d&512&&Bo(s,s.return);break;case 12:ya(r,s);break;case 31:ya(r,s),d&4&&Lx(r,s);break;case 13:ya(r,s),d&4&&Ix(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=G_.bind(null,s),p2(r,s))));break;case 22:if(d=s.memoizedState!==null||pa,!d){i=i!==null&&i.memoizedState!==null||Jt,p=pa;var v=Jt;pa=d,(Jt=i)&&!v?va(r,s,(s.subtreeFlags&8772)!==0):ya(r,s),pa=p,Jt=v}break;case 30:break;default:ya(r,s)}}function Dx(r){var i=r.alternate;i!==null&&(r.alternate=null,Dx(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&qf(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 Tt=null,Pn=!1;function ga(r,i,s){for(s=s.child;s!==null;)Mx(r,i,s),s=s.sibling}function Mx(r,i,s){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(nn,s)}catch{}switch(s.tag){case 26:Jt||Fr(s,i),ga(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Jt||Fr(s,i);var d=Tt,p=Pn;ni(s.type)&&(Tt=s.stateNode,Pn=!1),ga(r,i,s),Go(s.stateNode),Tt=d,Pn=p;break;case 5:Jt||Fr(s,i);case 6:if(d=Tt,p=Pn,Tt=null,ga(r,i,s),Tt=d,Pn=p,Tt!==null)if(Pn)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(s.stateNode)}catch(v){yt(s,i,v)}else try{Tt.removeChild(s.stateNode)}catch(v){yt(s,i,v)}break;case 18:Tt!==null&&(Pn?(r=Tt,N0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),fs(r)):N0(Tt,s.stateNode));break;case 4:d=Tt,p=Pn,Tt=s.stateNode.containerInfo,Pn=!0,ga(r,i,s),Tt=d,Pn=p;break;case 0:case 11:case 14:case 15:Ga(2,s,i),Jt||Ga(4,s,i),ga(r,i,s);break;case 1:Jt||(Fr(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&_x(s,i,d)),ga(r,i,s);break;case 21:ga(r,i,s);break;case 22:Jt=(d=Jt)||s.memoizedState!==null,ga(r,i,s),Jt=d;break;default:ga(r,i,s)}}function Lx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{fs(r)}catch(s){yt(i,i.return,s)}}}function Ix(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{fs(r)}catch(s){yt(i,i.return,s)}}function $_(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new zx),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new zx),i;default:throw Error(a(435,r.tag))}}function Hc(r,i){var s=$_(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=Y_.bind(null,r,d);d.then(p,p)}})}function Bn(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,S=i,T=S;e:for(;T!==null;){switch(T.tag){case 27:if(ni(T.type)){Tt=T.stateNode,Pn=!1;break e}break;case 5:Tt=T.stateNode,Pn=!1;break e;case 3:case 4:Tt=T.stateNode.containerInfo,Pn=!0;break e}T=T.return}if(Tt===null)throw Error(a(160));Mx(v,S,p),Tt=null,Pn=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Ux(i,r),i=i.sibling}var Dr=null;function Ux(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Bn(i,r),$n(r),d&4&&(Ga(3,r,r.return),Po(3,r),Ga(5,r,r.return));break;case 1:Bn(i,r),$n(r),d&512&&(Jt||s===null||Fr(s,s.return)),d&64&&pa&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var p=Dr;if(Bn(i,r),$n(r),d&512&&(Jt||s===null||Fr(s,s.return)),d&4){var v=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":v=p.getElementsByTagName("title")[0],(!v||v[ho]||v[vn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),Sn(v,d,s),v[vn]=r,on(v),d=v;break e;case"link":var S=U0("link","href",p).get(d+(s.href||""));if(S){for(var T=0;T<S.length;T++)if(v=S[T],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)){S.splice(T,1);break t}}v=p.createElement(d),Sn(v,d,s),p.head.appendChild(v);break;case"meta":if(S=U0("meta","content",p).get(d+(s.content||""))){for(T=0;T<S.length;T++)if(v=S[T],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)){S.splice(T,1);break t}}v=p.createElement(d),Sn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[vn]=r,on(v),d=v}r.stateNode=d}else P0(p,r.type,r.stateNode);else r.stateNode=I0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?P0(p,r.type,r.stateNode):I0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&cm(r,r.memoizedProps,s.memoizedProps)}break;case 27:Bn(i,r),$n(r),d&512&&(Jt||s===null||Fr(s,s.return)),s!==null&&d&4&&cm(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Bn(i,r),$n(r),d&512&&(Jt||s===null||Fr(s,s.return)),r.flags&32){p=r.stateNode;try{Ml(p,"")}catch(Ce){yt(r,r.return,Ce)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,cm(r,p,s!==null?s.memoizedProps:p)),d&1024&&(hm=!0);break;case 6:if(Bn(i,r),$n(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(Ce){yt(r,r.return,Ce)}}break;case 3:if(ld=null,p=Dr,Dr=ad(i.containerInfo),Bn(i,r),Dr=p,$n(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{fs(i.containerInfo)}catch(Ce){yt(r,r.return,Ce)}hm&&(hm=!1,Px(r));break;case 4:d=Dr,Dr=ad(r.stateNode.containerInfo),Bn(i,r),$n(r),Dr=d;break;case 12:Bn(i,r),$n(r);break;case 31:Bn(i,r),$n(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Hc(r,d)));break;case 13:Bn(i,r),$n(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Vc=mn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Hc(r,d)));break;case 22:p=r.memoizedState!==null;var $=s!==null&&s.memoizedState!==null,K=pa,ae=Jt;if(pa=K||p,Jt=ae||$,Bn(i,r),Jt=ae,pa=K,$n(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||$||pa||Jt||tl(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){$=s=i;try{if(v=$.stateNode,p)S=v.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{T=$.stateNode;var fe=$.memoizedProps.style,X=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;T.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Ce){yt($,$.return,Ce)}}}else if(i.tag===6){if(s===null){$=i;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(Ce){yt($,$.return,Ce)}}}else if(i.tag===18){if(s===null){$=i;try{var W=$.stateNode;p?_0(W,!0):_0($.stateNode,!1)}catch(Ce){yt($,$.return,Ce)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,Hc(r,s))));break;case 19:Bn(i,r),$n(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Hc(r,d)));break;case 30:break;case 21:break;default:Bn(i,r),$n(r)}}function $n(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(Ax(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=dm(r);qc(r,v,p);break;case 5:var S=s.stateNode;s.flags&32&&(Ml(S,""),s.flags&=-33);var T=dm(r);qc(r,T,S);break;case 3:case 4:var $=s.stateNode.containerInfo,K=dm(r);fm(r,K,$);break;default:throw Error(a(161))}}catch(ae){yt(r,r.return,ae)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Px(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Px(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function ya(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Ox(r,i.alternate,i),i=i.sibling}function tl(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ga(4,i,i.return),tl(i);break;case 1:Fr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&_x(i,i.return,s),tl(i);break;case 27:Go(i.stateNode);case 26:case 5:Fr(i,i.return),tl(i);break;case 22:i.memoizedState===null&&tl(i);break;case 30:tl(i);break;default:tl(i)}r=r.sibling}}function va(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,S=v.flags;switch(v.tag){case 0:case 11:case 15:va(p,v,s),Po(4,v);break;case 1:if(va(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(K){yt(d,d.return,K)}if(d=v,p=d.updateQueue,p!==null){var T=d.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)gb($[p],T)}catch(K){yt(d,d.return,K)}}s&&S&64&&Nx(v),Bo(v,v.return);break;case 27:Rx(v);case 26:case 5:va(p,v,s),s&&d===null&&S&4&&Tx(v),Bo(v,v.return);break;case 12:va(p,v,s);break;case 31:va(p,v,s),s&&S&4&&Lx(p,v);break;case 13:va(p,v,s),s&&S&4&&Ix(p,v);break;case 22:v.memoizedState===null&&va(p,v,s),Bo(v,v.return);break;case 30:break;default:va(p,v,s)}i=i.sibling}}function mm(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&Eo(s))}function pm(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Eo(r))}function Mr(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Bx(r,i,s,d),i=i.sibling}function Bx(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Mr(r,i,s,d),p&2048&&Po(9,i);break;case 1:Mr(r,i,s,d);break;case 3:Mr(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Eo(r)));break;case 12:if(p&2048){Mr(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,S=v.id,T=v.onPostCommit;typeof T=="function"&&T(S,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){yt(i,i.return,$)}}else Mr(r,i,s,d);break;case 31:Mr(r,i,s,d);break;case 13:Mr(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,S=i.alternate,i.memoizedState!==null?v._visibility&2?Mr(r,i,s,d):$o(r,i):v._visibility&2?Mr(r,i,s,d):(v._visibility|=2,ts(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&mm(S,i);break;case 24:Mr(r,i,s,d),p&2048&&pm(i.alternate,i);break;default:Mr(r,i,s,d)}}function ts(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,S=i,T=s,$=d,K=S.flags;switch(S.tag){case 0:case 11:case 15:ts(v,S,T,$,p),Po(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&2?ts(v,S,T,$,p):$o(v,S):(ae._visibility|=2,ts(v,S,T,$,p)),p&&K&2048&&mm(S.alternate,S);break;case 24:ts(v,S,T,$,p),p&&K&2048&&pm(S.alternate,S);break;default:ts(v,S,T,$,p)}i=i.sibling}}function $o(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:$o(s,d),p&2048&&mm(d.alternate,d);break;case 24:$o(s,d),p&2048&&pm(d.alternate,d);break;default:$o(s,d)}i=i.sibling}}var Fo=8192;function ns(r,i,s){if(r.subtreeFlags&Fo)for(r=r.child;r!==null;)$x(r,i,s),r=r.sibling}function $x(r,i,s){switch(r.tag){case 26:ns(r,i,s),r.flags&Fo&&r.memoizedState!==null&&N2(s,Dr,r.memoizedState,r.memoizedProps);break;case 5:ns(r,i,s);break;case 3:case 4:var d=Dr;Dr=ad(r.stateNode.containerInfo),ns(r,i,s),Dr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Fo,Fo=16777216,ns(r,i,s),Fo=d):ns(r,i,s));break;default:ns(r,i,s)}}function Fx(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function qo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];un=d,Hx(d,r)}Fx(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)qx(r),r=r.sibling}function qx(r){switch(r.tag){case 0:case 11:case 15:qo(r),r.flags&2048&&Ga(9,r,r.return);break;case 3:qo(r);break;case 12:qo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Zc(r)):qo(r);break;default:qo(r)}}function Zc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];un=d,Hx(d,r)}Fx(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ga(8,i,i.return),Zc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Zc(i));break;default:Zc(i)}r=r.sibling}}function Hx(r,i){for(;un!==null;){var s=un;switch(s.tag){case 0:case 11:case 15:Ga(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Eo(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,un=d;else e:for(s=r;un!==null;){d=un;var p=d.sibling,v=d.return;if(Dx(d),d===s){un=null;break e}if(p!==null){p.return=v,un=p;break e}un=v}}}var F_={getCacheForType:function(r){var i=xn(Gt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return xn(Gt).controller.signal}},q_=typeof WeakMap=="function"?WeakMap:Map,ft=0,kt=null,We=null,nt=0,gt=0,tr=null,Ya=!1,rs=!1,gm=!1,ba=0,Ut=0,Xa=0,nl=0,ym=0,nr=0,as=0,Ho=null,Fn=null,vm=!1,Vc=0,Zx=0,Qc=1/0,Kc=null,Ja=null,rn=0,Wa=null,is=null,xa=0,bm=0,xm=null,Vx=null,Zo=0,wm=null;function rr(){return(ft&2)!==0&&nt!==0?nt&-nt:Z.T!==null?Nm():ov()}function Qx(){if(nr===0)if((nt&536870912)===0||it){var r=Ii;Ii<<=1,(Ii&3932160)===0&&(Ii=262144),nr=r}else nr=536870912;return r=Wn.current,r!==null&&(r.flags|=32),nr}function qn(r,i,s){(r===kt&&(gt===2||gt===9)||r.cancelPendingCommit!==null)&&(ls(r,0),ei(r,nt,nr,!1)),yn(r,s),((ft&2)===0||r!==kt)&&(r===kt&&((ft&2)===0&&(nl|=s),Ut===4&&ei(r,nt,nr,!1)),qr(r))}function Kx(r,i,s){if((ft&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ia(r,i),p=d?V_(r,i):km(r,i,!0),v=d;do{if(p===0){rs&&!d&&ei(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!H_(s)){p=km(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var S=0;else S=r.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var T=r;p=Ho;var $=T.current.memoizedState.isDehydrated;if($&&(ls(T,S).flags|=256),S=km(T,S,!1),S!==2){if(gm&&!$){T.errorRecoveryDisabledLanes|=v,nl|=v,p=4;break e}v=Fn,Fn=p,v!==null&&(Fn===null?Fn=v:Fn.push.apply(Fn,v))}p=S}if(v=!1,p!==2)continue}}if(p===1){ls(r,0),ei(r,i,0,!0);break}e:{switch(d=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ei(d,i,nr,!Ya);break e;case 2:Fn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Vc+300-mn(),10<p)){if(ei(d,i,nr,!Ya),Pi(d,0,!0)!==0)break e;xa=i,d.timeoutHandle=C0(Gx.bind(null,d,s,Fn,Kc,vm,i,nr,nl,as,Ya,v,"Throttled",-0,0),p);break e}Gx(d,s,Fn,Kc,vm,i,nr,nl,as,Ya,v,null,-0,0)}}break}while(!0);qr(r)}function Gx(r,i,s,d,p,v,S,T,$,K,ae,fe,X,W){if(r.timeoutHandle=-1,fe=i.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ia},$x(i,v,fe);var Ce=(v&62914560)===v?Vc-mn():(v&4194048)===v?Zx-mn():0;if(Ce=_2(fe,Ce),Ce!==null){xa=v,r.cancelPendingCommit=Ce(r0.bind(null,r,i,v,s,d,p,S,T,$,ae,fe,null,X,W)),ei(r,v,S,!K);return}}r0(r,i,v,s,d,p,S,T,$)}function H_(r){for(var i=r;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var d=0;d<s.length;d++){var p=s[d],v=p.getSnapshot;p=p.value;try{if(!Xn(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,d){i&=~ym,i&=~nl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-ht(p),S=1<<v;d[v]=-1,p&=~S}s!==0&&fo(r,s,i)}function Gc(){return(ft&6)===0?(Vo(0),!1):!0}function Sm(){if(We!==null){if(gt===0)var r=We.return;else r=We,ua=Qi=null,Uh(r),Yl=null,_o=0,r=We;for(;r!==null;)Ex(r.alternate,r),r=r.return;We=null}}function ls(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,c2(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),xa=0,Sm(),kt=r,We=s=sa(r.current,null),nt=i,gt=0,tr=null,Ya=!1,rs=Ia(r,i),gm=!1,as=nr=ym=nl=Xa=Ut=0,Fn=Ho=null,vm=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-ht(d),v=1<<p;i|=r[p],d&=~v}return ba=i,gc(),s}function Yx(r,i){Ze=null,Z.H=Lo,i===Gl||i===jc?(i=fb(),gt=3):i===Eh?(i=fb(),gt=4):gt=i===em?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,tr=i,We===null&&(Ut=1,Uc(r,gr(i,r.current)))}function Xx(){var r=Wn.current;return r===null?!0:(nt&4194048)===nt?xr===null:(nt&62914560)===nt||(nt&536870912)!==0?r===xr:!1}function Jx(){var r=Z.H;return Z.H=Lo,r===null?Lo:r}function Wx(){var r=Z.A;return Z.A=F_,r}function Yc(){Ut=4,Ya||(nt&4194048)!==nt&&Wn.current!==null||(rs=!0),(Xa&134217727)===0&&(nl&134217727)===0||kt===null||ei(kt,nt,nr,!1)}function km(r,i,s){var d=ft;ft|=2;var p=Jx(),v=Wx();(kt!==r||nt!==i)&&(Kc=null,ls(r,i)),i=!1;var S=Ut;e:do try{if(gt!==0&&We!==null){var T=We,$=tr;switch(gt){case 8:Sm(),S=6;break e;case 3:case 2:case 9:case 6:Wn.current===null&&(i=!0);var K=gt;if(gt=0,tr=null,ss(r,T,$,K),s&&rs){S=0;break e}break;default:K=gt,gt=0,tr=null,ss(r,T,$,K)}}Z_(),S=Ut;break}catch(ae){Yx(r,ae)}while(!0);return i&&r.shellSuspendCounter++,ua=Qi=null,ft=d,Z.H=p,Z.A=v,We===null&&(kt=null,nt=0,gc()),S}function Z_(){for(;We!==null;)e0(We)}function V_(r,i){var s=ft;ft|=2;var d=Jx(),p=Wx();kt!==r||nt!==i?(Kc=null,Qc=mn()+500,ls(r,i)):rs=Ia(r,i);e:do try{if(gt!==0&&We!==null){i=We;var v=tr;t:switch(gt){case 1:gt=0,tr=null,ss(r,i,v,1);break;case 2:case 9:if(cb(v)){gt=0,tr=null,t0(i);break}i=function(){gt!==2&>!==9||kt!==r||(gt=7),qr(r)},v.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:cb(v)?(gt=0,tr=null,t0(i)):(gt=0,tr=null,ss(r,i,v,7));break;case 5:var S=null;switch(We.tag){case 26:S=We.memoizedState;case 5:case 27:var T=We;if(S?B0(S):T.stateNode.complete){gt=0,tr=null;var $=T.sibling;if($!==null)We=$;else{var K=T.return;K!==null?(We=K,Xc(K)):We=null}break t}}gt=0,tr=null,ss(r,i,v,5);break;case 6:gt=0,tr=null,ss(r,i,v,6);break;case 8:Sm(),Ut=6;break e;default:throw Error(a(462))}}Q_();break}catch(ae){Yx(r,ae)}while(!0);return ua=Qi=null,Z.H=d,Z.A=p,ft=s,We!==null?0:(kt=null,nt=0,gc(),Ut)}function Q_(){for(;We!==null&&!oo();)e0(We)}function e0(r){var i=jx(r.alternate,r,ba);r.memoizedProps=r.pendingProps,i===null?Xc(r):We=i}function t0(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=vx(s,i,i.pendingProps,i.type,void 0,nt);break;case 11:i=vx(s,i,i.pendingProps,i.type.render,i.ref,nt);break;case 5:Uh(i);default:Ex(s,i),i=We=Wv(i,ba),i=jx(s,i,ba)}r.memoizedProps=r.pendingProps,i===null?Xc(r):We=i}function ss(r,i,s,d){ua=Qi=null,Uh(i),Yl=null,_o=0;var p=i.return;try{if(M_(r,p,i,s,nt)){Ut=1,Uc(r,gr(s,r.current)),We=null;return}}catch(v){if(p!==null)throw We=p,v;Ut=1,Uc(r,gr(s,r.current)),We=null;return}i.flags&32768?(it||d===1?r=!0:rs||(nt&536870912)!==0?r=!1:(Ya=r=!0,(d===2||d===9||d===3||d===6)&&(d=Wn.current,d!==null&&d.tag===13&&(d.flags|=16384))),n0(i,r)):Xc(i)}function Xc(r){var i=r;do{if((i.flags&32768)!==0){n0(i,Ya);return}r=i.return;var s=U_(i.alternate,i,ba);if(s!==null){We=s;return}if(i=i.sibling,i!==null){We=i;return}We=i=r}while(i!==null);Ut===0&&(Ut=5)}function n0(r,i){do{var s=P_(r.alternate,r);if(s!==null){s.flags&=32767,We=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){We=r;return}We=r=s}while(r!==null);Ut=6,We=null}function r0(r,i,s,d,p,v,S,T,$){r.cancelPendingCommit=null;do Jc();while(rn!==0);if((ft&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=dh,ra(r,s,v,S,T,$),r===kt&&(We=kt=null,nt=0),is=i,Wa=r,xa=s,bm=v,xm=p,Vx=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,X_(Ue,function(){return o0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null,p=te.p,te.p=2,S=ft,ft|=4;try{B_(r,i,s)}finally{ft=S,te.p=p,Z.T=d}}rn=1,a0(),i0(),l0()}}function a0(){if(rn===1){rn=0;var r=Wa,i=is,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null;var d=te.p;te.p=2;var p=ft;ft|=4;try{Ux(i,r);var v=Mm,S=Hv(r.containerInfo),T=v.focusedElem,$=v.selectionRange;if(S!==T&&T&&T.ownerDocument&&qv(T.ownerDocument.documentElement,T)){if($!==null&&lh(T)){var K=$.start,ae=$.end;if(ae===void 0&&(ae=K),"selectionStart"in T)T.selectionStart=K,T.selectionEnd=Math.min(ae,T.value.length);else{var fe=T.ownerDocument||document,X=fe&&fe.defaultView||window;if(X.getSelection){var W=X.getSelection(),Ce=T.textContent.length,De=Math.min($.start,Ce),xt=$.end===void 0?De:Math.min($.end,Ce);!W.extend&&De>xt&&(S=xt,xt=De,De=S);var V=Fv(T,De),H=Fv(T,xt);if(V&&H&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==H.node||W.focusOffset!==H.offset)){var Q=fe.createRange();Q.setStart(V.node,V.offset),W.removeAllRanges(),De>xt?(W.addRange(Q),W.extend(H.node,H.offset)):(Q.setEnd(H.node,H.offset),W.addRange(Q))}}}}for(fe=[],W=T;W=W.parentNode;)W.nodeType===1&&fe.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<fe.length;T++){var ue=fe[T];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}cd=!!Dm,Mm=Dm=null}finally{ft=p,te.p=d,Z.T=s}}r.current=i,rn=2}}function i0(){if(rn===2){rn=0;var r=Wa,i=is,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=Z.T,Z.T=null;var d=te.p;te.p=2;var p=ft;ft|=4;try{Ox(r,i.alternate,i)}finally{ft=p,te.p=d,Z.T=s}}rn=3}}function l0(){if(rn===4||rn===3){rn=0,uo();var r=Wa,i=is,s=xa,d=Vx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?rn=5:(rn=0,is=Wa=null,s0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ja=null),$f(s),i=i.stateNode,Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(nn,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Z.T,p=te.p,te.p=2,Z.T=null;try{for(var v=r.onRecoverableError,S=0;S<d.length;S++){var T=d[S];v(T.value,{componentStack:T.stack})}}finally{Z.T=i,te.p=p}}(xa&3)!==0&&Jc(),qr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===wm?Zo++:(Zo=0,wm=r):Zo=0,Vo(0)}}function s0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Eo(i)))}function Jc(){return a0(),i0(),l0(),o0()}function o0(){if(rn!==5)return!1;var r=Wa,i=bm;bm=0;var s=$f(xa),d=Z.T,p=te.p;try{te.p=32>s?32:s,Z.T=null,s=xm,xm=null;var v=Wa,S=xa;if(rn=0,is=Wa=null,xa=0,(ft&6)!==0)throw Error(a(331));var T=ft;if(ft|=4,qx(v.current),Bx(v,v.current,S,s),ft=T,Vo(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(nn,v)}catch{}return!0}finally{te.p=p,Z.T=d,s0(r,i)}}function u0(r,i,s){i=gr(s,i),i=Wh(r.stateNode,i,2),r=Va(r,i,2),r!==null&&(yn(r,2),qr(r))}function yt(r,i,s){if(r.tag===3)u0(r,r,s);else for(;i!==null;){if(i.tag===3){u0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ja===null||!Ja.has(d))){r=gr(s,r),s=cx(2),d=Va(i,s,2),d!==null&&(dx(s,d,i,r),yn(d,2),qr(d));break}}i=i.return}}function jm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new q_;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(s)||(gm=!0,p.add(s),r=K_.bind(null,r,i,s),i.then(r,r))}function K_(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,kt===r&&(nt&s)===s&&(Ut===4||Ut===3&&(nt&62914560)===nt&&300>mn()-Vc?(ft&2)===0&&ls(r,0):ym|=s,as===nt&&(as=0)),qr(r)}function c0(r,i){i===0&&(i=Se()),r=Hi(r,i),r!==null&&(yn(r,i),qr(r))}function G_(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),c0(r,s)}function Y_(r,i){var s=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),c0(r,s)}function X_(r,i){return La(r,i)}var Wc=null,os=null,Cm=!1,ed=!1,Em=!1,ti=0;function qr(r){r!==os&&r.next===null&&(os===null?Wc=os=r:os=os.next=r),ed=!0,Cm||(Cm=!0,W_())}function Vo(r,i){if(!Em&&ed){Em=!0;do for(var s=!1,d=Wc;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var S=d.suspendedLanes,T=d.pingedLanes;v=(1<<31-ht(42|r)+1)-1,v&=p&~(S&~T),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,m0(d,v))}else v=nt,v=Pi(d,d===kt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||Ia(d,v)||(s=!0,m0(d,v));d=d.next}while(s);Em=!1}}function J_(){d0()}function d0(){ed=Cm=!1;var r=0;ti!==0&&u2()&&(r=ti);for(var i=mn(),s=null,d=Wc;d!==null;){var p=d.next,v=f0(d,i);v===0?(d.next=null,s===null?Wc=p:s.next=p,p===null&&(os=s)):(s=d,(r!==0||(v&3)!==0)&&(ed=!0)),d=p}rn!==0&&rn!==5||Vo(r),ti!==0&&(ti=0)}function f0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var S=31-ht(v),T=1<<S,$=p[S];$===-1?((T&s)===0||(T&d)!==0)&&(p[S]=rc(T,i)):$<=i&&(r.expiredLanes|=T),v&=~T}if(i=kt,s=nt,s=Pi(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(gt===2||gt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&na(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ia(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&na(d),$f(s)){case 2:case 8:s=ye;break;case 32:s=Ue;break;case 268435456:s=at;break;default:s=Ue}return d=h0.bind(null,r),s=La(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&na(d),r.callbackPriority=2,r.callbackNode=null,2}function h0(r,i){if(rn!==0&&rn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Jc()&&r.callbackNode!==s)return null;var d=nt;return d=Pi(r,r===kt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Kx(r,d,i),f0(r,mn()),r.callbackNode!=null&&r.callbackNode===s?h0.bind(null,r):null)}function m0(r,i){if(Jc())return null;Kx(r,i,!0)}function W_(){d2(function(){(ft&6)!==0?La(se,J_):d0()})}function Nm(){if(ti===0){var r=Ql;r===0&&(r=Li,Li<<=1,(Li&261888)===0&&(Li=256)),ti=r}return ti}function p0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:oc(""+r)}function g0(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 e2(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=p0((p[In]||null).action),S=d.submitter;S&&(i=(i=S[In]||null)?p0(i.formAction):S.getAttribute("formAction"),i!==null&&(v=i,S=null));var T=new fc("action","action",null,d,p);r.push({event:T,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ti!==0){var $=S?g0(p,S):new FormData(p);Qh(s,{pending:!0,data:$,method:p.method,action:v},null,$)}}else typeof v=="function"&&(T.preventDefault(),$=S?g0(p,S):new FormData(p),Qh(s,{pending:!0,data:$,method:p.method,action:v},v,$))},currentTarget:p}]})}}for(var _m=0;_m<ch.length;_m++){var Tm=ch[_m],t2=Tm.toLowerCase(),n2=Tm[0].toUpperCase()+Tm.slice(1);Or(t2,"on"+n2)}Or(Qv,"onAnimationEnd"),Or(Kv,"onAnimationIteration"),Or(Gv,"onAnimationStart"),Or("dblclick","onDoubleClick"),Or("focusin","onFocus"),Or("focusout","onBlur"),Or(v_,"onTransitionRun"),Or(b_,"onTransitionStart"),Or(x_,"onTransitionCancel"),Or(Yv,"onTransitionEnd"),Ol("onMouseEnter",["mouseout","mouseover"]),Ol("onMouseLeave",["mouseout","mouseover"]),Ol("onPointerEnter",["pointerout","pointerover"]),Ol("onPointerLeave",["pointerout","pointerover"]),Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),r2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qo));function y0(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var S=d.length-1;0<=S;S--){var T=d[S],$=T.instance,K=T.currentTarget;if(T=T.listener,$!==v&&p.isPropagationStopped())break e;v=T,p.currentTarget=K;try{v(p)}catch(ae){pc(ae)}p.currentTarget=null,v=$}else for(S=0;S<d.length;S++){if(T=d[S],$=T.instance,K=T.currentTarget,T=T.listener,$!==v&&p.isPropagationStopped())break e;v=T,p.currentTarget=K;try{v(p)}catch(ae){pc(ae)}p.currentTarget=null,v=$}}}}function et(r,i){var s=i[Ff];s===void 0&&(s=i[Ff]=new Set);var d=r+"__bubble";s.has(d)||(v0(i,r,2,!1),s.add(d))}function Am(r,i,s){var d=0;i&&(d|=4),v0(s,r,d,i)}var td="_reactListening"+Math.random().toString(36).slice(2);function Rm(r){if(!r[td]){r[td]=!0,dv.forEach(function(s){s!=="selectionchange"&&(r2.has(s)||Am(s,!1,r),Am(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[td]||(i[td]=!0,Am("selectionchange",!1,i))}}function v0(r,i,s,d){switch(Q0(i)){case 2:var p=R2;break;case 8:p=z2;break;default:p=Vm}s=p.bind(null,i,s,r),p=void 0,!Xf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function zm(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var T=d.stateNode.containerInfo;if(T===p)break;if(S===4)for(S=d.return;S!==null;){var $=S.tag;if(($===3||$===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;T!==null;){if(S=Al(T),S===null)return;if($=S.tag,$===5||$===6||$===26||$===27){d=v=S;continue e}T=T.parentNode}}d=d.return}kv(function(){var K=v,ae=Gf(s),fe=[];e:{var X=Xv.get(r);if(X!==void 0){var W=fc,Ce=r;switch(r){case"keypress":if(cc(s)===0)break e;case"keydown":case"keyup":W=YN;break;case"focusin":Ce="focus",W=th;break;case"focusout":Ce="blur",W=th;break;case"beforeblur":case"afterblur":W=th;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":W=Ev;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=UN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=WN;break;case Qv:case Kv:case Gv:W=$N;break;case Yv:W=t_;break;case"scroll":case"scrollend":W=LN;break;case"wheel":W=r_;break;case"copy":case"cut":case"paste":W=qN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=_v;break;case"toggle":case"beforetoggle":W=i_}var De=(i&4)!==0,xt=!De&&(r==="scroll"||r==="scrollend"),V=De?X!==null?X+"Capture":null:X;De=[];for(var H=K,Q;H!==null;){var ue=H;if(Q=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||Q===null||V===null||(ue=po(H,V),ue!=null&&De.push(Ko(H,ue,Q))),xt)break;H=H.return}0<De.length&&(X=new W(X,Ce,null,s,ae),fe.push({event:X,listeners:De}))}}if((i&7)===0){e:{if(X=r==="mouseover"||r==="pointerover",W=r==="mouseout"||r==="pointerout",X&&s!==Kf&&(Ce=s.relatedTarget||s.fromElement)&&(Al(Ce)||Ce[Tl]))break e;if((W||X)&&(X=ae.window===ae?ae:(X=ae.ownerDocument)?X.defaultView||X.parentWindow:window,W?(Ce=s.relatedTarget||s.toElement,W=K,Ce=Ce?Al(Ce):null,Ce!==null&&(xt=o(Ce),De=Ce.tag,Ce!==xt||De!==5&&De!==27&&De!==6)&&(Ce=null)):(W=null,Ce=K),W!==Ce)){if(De=Ev,ue="onMouseLeave",V="onMouseEnter",H="mouse",(r==="pointerout"||r==="pointerover")&&(De=_v,ue="onPointerLeave",V="onPointerEnter",H="pointer"),xt=W==null?X:mo(W),Q=Ce==null?X:mo(Ce),X=new De(ue,H+"leave",W,s,ae),X.target=xt,X.relatedTarget=Q,ue=null,Al(ae)===K&&(De=new De(V,H+"enter",Ce,s,ae),De.target=Q,De.relatedTarget=xt,ue=De),xt=ue,W&&Ce)t:{for(De=a2,V=W,H=Ce,Q=0,ue=V;ue;ue=De(ue))Q++;ue=0;for(var ze=H;ze;ze=De(ze))ue++;for(;0<Q-ue;)V=De(V),Q--;for(;0<ue-Q;)H=De(H),ue--;for(;Q--;){if(V===H||H!==null&&V===H.alternate){De=V;break t}V=De(V),H=De(H)}De=null}else De=null;W!==null&&b0(fe,X,W,De,!1),Ce!==null&&xt!==null&&b0(fe,xt,Ce,De,!0)}}e:{if(X=K?mo(K):window,W=X.nodeName&&X.nodeName.toLowerCase(),W==="select"||W==="input"&&X.type==="file")var ct=Lv;else if(Dv(X))if(Iv)ct=p_;else{ct=h_;var Te=f_}else W=X.nodeName,!W||W.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?K&&Qf(K.elementType)&&(ct=Lv):ct=m_;if(ct&&(ct=ct(r,K))){Mv(fe,ct,s,ae);break e}Te&&Te(r,X,K),r==="focusout"&&K&&X.type==="number"&&K.memoizedProps.value!=null&&Vf(X,"number",X.value)}switch(Te=K?mo(K):window,r){case"focusin":(Dv(Te)||Te.contentEditable==="true")&&(Pl=Te,sh=K,ko=null);break;case"focusout":ko=sh=Pl=null;break;case"mousedown":oh=!0;break;case"contextmenu":case"mouseup":case"dragend":oh=!1,Zv(fe,s,ae);break;case"selectionchange":if(y_)break;case"keydown":case"keyup":Zv(fe,s,ae)}var Qe;if(rh)e:{switch(r){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else Ul?zv(r,s)&&(rt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(rt="onCompositionStart");rt&&(Tv&&s.locale!=="ko"&&(Ul||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&Ul&&(Qe=jv()):(Pa=ae,Jf="value"in Pa?Pa.value:Pa.textContent,Ul=!0)),Te=nd(K,rt),0<Te.length&&(rt=new Nv(rt,r,null,s,ae),fe.push({event:rt,listeners:Te}),Qe?rt.data=Qe:(Qe=Ov(s),Qe!==null&&(rt.data=Qe)))),(Qe=s_?o_(r,s):u_(r,s))&&(rt=nd(K,"onBeforeInput"),0<rt.length&&(Te=new Nv("onBeforeInput","beforeinput",null,s,ae),fe.push({event:Te,listeners:rt}),Te.data=Qe)),e2(fe,r,K,s,ae)}y0(fe,i)})}function Ko(r,i,s){return{instance:r,listener:i,currentTarget:s}}function nd(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=po(r,s),p!=null&&d.unshift(Ko(r,p,v)),p=po(r,i),p!=null&&d.push(Ko(r,p,v))),r.tag===3)return d;r=r.return}return[]}function a2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function b0(r,i,s,d,p){for(var v=i._reactName,S=[];s!==null&&s!==d;){var T=s,$=T.alternate,K=T.stateNode;if(T=T.tag,$!==null&&$===d)break;T!==5&&T!==26&&T!==27||K===null||($=K,p?(K=po(s,v),K!=null&&S.unshift(Ko(s,K,$))):p||(K=po(s,v),K!=null&&S.push(Ko(s,K,$)))),s=s.return}S.length!==0&&r.push({event:i,listeners:S})}var i2=/\r\n?/g,l2=/\u0000|\uFFFD/g;function x0(r){return(typeof r=="string"?r:""+r).replace(i2,`
|
|
49
|
-
`).replace(l2,"")}function w0(r,i){return i=x0(i),x0(r)===i}function bt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ml(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ml(r,""+d);break;case"className":lc(r,"class",d);break;case"tabIndex":lc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":lc(r,s,d);break;case"style":wv(r,d,v);break;case"data":if(i!=="object"){lc(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=oc(""+d),r.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(s==="formAction"?(i!=="input"&&bt(r,i,"name",p.name,p,null),bt(r,i,"formEncType",p.formEncType,p,null),bt(r,i,"formMethod",p.formMethod,p,null),bt(r,i,"formTarget",p.formTarget,p,null)):(bt(r,i,"encType",p.encType,p,null),bt(r,i,"method",p.method,p,null),bt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=oc(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=ia);break;case"onScroll":d!=null&&et("scroll",r);break;case"onScrollEnd":d!=null&&et("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}s=oc(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""+d):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":d===!0?r.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,d):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(s,d):r.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(s):r.setAttribute(s,d);break;case"popover":et("beforetoggle",r),et("toggle",r),ic(r,"popover",d);break;case"xlinkActuate":aa(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":aa(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":aa(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":aa(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":aa(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":aa(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":aa(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":aa(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":aa(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":ic(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=DN.get(s)||s,ic(r,s,d))}}function Om(r,i,s,d,p,v){switch(s){case"style":wv(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof d=="string"?Ml(r,d):(typeof d=="number"||typeof d=="bigint")&&Ml(r,""+d);break;case"onScroll":d!=null&&et("scroll",r);break;case"onScrollEnd":d!=null&&et("scrollend",r);break;case"onClick":d!=null&&(r.onclick=ia);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fv.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[In]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof d=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,d,p);break e}s in r?r[s]=d:d===!0?r.setAttribute(s,""):ic(r,s,d)}}}function Sn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",r),et("load",r);var d=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var S=s[v];if(S!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(r,i,v,S,s,null)}}p&&bt(r,i,"srcSet",s.srcSet,s,null),d&&bt(r,i,"src",s.src,s,null);return;case"input":et("invalid",r);var T=v=S=p=null,$=null,K=null;for(d in s)if(s.hasOwnProperty(d)){var ae=s[d];if(ae!=null)switch(d){case"name":p=ae;break;case"type":S=ae;break;case"checked":$=ae;break;case"defaultChecked":K=ae;break;case"value":v=ae;break;case"defaultValue":T=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:bt(r,i,d,ae,s,null)}}yv(r,v,T,$,K,S,p,!1);return;case"select":et("invalid",r),d=S=v=null;for(p in s)if(s.hasOwnProperty(p)&&(T=s[p],T!=null))switch(p){case"value":v=T;break;case"defaultValue":S=T;break;case"multiple":d=T;default:bt(r,i,p,T,s,null)}i=v,s=S,r.multiple=!!d,i!=null?Dl(r,!!d,i,!1):s!=null&&Dl(r,!!d,s,!0);return;case"textarea":et("invalid",r),v=p=d=null;for(S in s)if(s.hasOwnProperty(S)&&(T=s[S],T!=null))switch(S){case"value":d=T;break;case"defaultValue":p=T;break;case"children":v=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(a(91));break;default:bt(r,i,S,T,s,null)}bv(r,d,p,v);return;case"option":for($ in s)if(s.hasOwnProperty($)&&(d=s[$],d!=null))switch($){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:bt(r,i,$,d,s,null)}return;case"dialog":et("beforetoggle",r),et("toggle",r),et("cancel",r),et("close",r);break;case"iframe":case"object":et("load",r);break;case"video":case"audio":for(d=0;d<Qo.length;d++)et(Qo[d],r);break;case"image":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"embed":case"source":case"link":et("error",r),et("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(K in s)if(s.hasOwnProperty(K)&&(d=s[K],d!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(r,i,K,d,s,null)}return;default:if(Qf(i)){for(ae in s)s.hasOwnProperty(ae)&&(d=s[ae],d!==void 0&&Om(r,i,ae,d,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(d=s[T],d!=null&&bt(r,i,T,d,s,null))}function s2(r,i,s,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,S=null,T=null,$=null,K=null,ae=null;for(W in s){var fe=s[W];if(s.hasOwnProperty(W)&&fe!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":$=fe;default:d.hasOwnProperty(W)||bt(r,i,W,null,d,fe)}}for(var X in d){var W=d[X];if(fe=s[X],d.hasOwnProperty(X)&&(W!=null||fe!=null))switch(X){case"type":v=W;break;case"name":p=W;break;case"checked":K=W;break;case"defaultChecked":ae=W;break;case"value":S=W;break;case"defaultValue":T=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:W!==fe&&bt(r,i,X,W,d,fe)}}Zf(r,S,T,$,K,ae,v,p);return;case"select":W=S=T=X=null;for(v in s)if($=s[v],s.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":W=$;default:d.hasOwnProperty(v)||bt(r,i,v,null,d,$)}for(p in d)if(v=d[p],$=s[p],d.hasOwnProperty(p)&&(v!=null||$!=null))switch(p){case"value":X=v;break;case"defaultValue":T=v;break;case"multiple":S=v;default:v!==$&&bt(r,i,p,v,d,$)}i=T,s=S,d=W,X!=null?Dl(r,!!s,X,!1):!!d!=!!s&&(i!=null?Dl(r,!!s,i,!0):Dl(r,!!s,s?[]:"",!1));return;case"textarea":W=X=null;for(T in s)if(p=s[T],s.hasOwnProperty(T)&&p!=null&&!d.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:bt(r,i,T,null,d,p)}for(S in d)if(p=d[S],v=s[S],d.hasOwnProperty(S)&&(p!=null||v!=null))switch(S){case"value":X=p;break;case"defaultValue":W=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&bt(r,i,S,p,d,v)}vv(r,X,W);return;case"option":for(var Ce in s)if(X=s[Ce],s.hasOwnProperty(Ce)&&X!=null&&!d.hasOwnProperty(Ce))switch(Ce){case"selected":r.selected=!1;break;default:bt(r,i,Ce,null,d,X)}for($ in d)if(X=d[$],W=s[$],d.hasOwnProperty($)&&X!==W&&(X!=null||W!=null))switch($){case"selected":r.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:bt(r,i,$,X,d,W)}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 De in s)X=s[De],s.hasOwnProperty(De)&&X!=null&&!d.hasOwnProperty(De)&&bt(r,i,De,null,d,X);for(K in d)if(X=d[K],W=s[K],d.hasOwnProperty(K)&&X!==W&&(X!=null||W!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:bt(r,i,K,X,d,W)}return;default:if(Qf(i)){for(var xt in s)X=s[xt],s.hasOwnProperty(xt)&&X!==void 0&&!d.hasOwnProperty(xt)&&Om(r,i,xt,void 0,d,X);for(ae in d)X=d[ae],W=s[ae],!d.hasOwnProperty(ae)||X===W||X===void 0&&W===void 0||Om(r,i,ae,X,d,W);return}}for(var V in s)X=s[V],s.hasOwnProperty(V)&&X!=null&&!d.hasOwnProperty(V)&&bt(r,i,V,null,d,X);for(fe in d)X=d[fe],W=s[fe],!d.hasOwnProperty(fe)||X===W||X==null&&W==null||bt(r,i,fe,X,d,W)}function S0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],v=p.transferSize,S=p.initiatorType,T=p.duration;if(v&&T&&S0(S)){for(S=0,T=p.responseEnd,d+=1;d<s.length;d++){var $=s[d],K=$.startTime;if(K>T)break;var ae=$.transferSize,fe=$.initiatorType;ae&&S0(fe)&&($=$.responseEnd,S+=ae*($<T?1:(T-K)/($-K)))}if(--d,i+=8*(v+S)/(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 Dm=null,Mm=null;function rd(r){return r.nodeType===9?r:r.ownerDocument}function k0(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 j0(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 Lm(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 Im=null;function u2(){var r=window.event;return r&&r.type==="popstate"?r===Im?!1:(Im=r,!0):(Im=null,!1)}var C0=typeof setTimeout=="function"?setTimeout:void 0,c2=typeof clearTimeout=="function"?clearTimeout:void 0,E0=typeof Promise=="function"?Promise:void 0,d2=typeof queueMicrotask=="function"?queueMicrotask:typeof E0<"u"?function(r){return E0.resolve(null).then(r).catch(f2)}:C0;function f2(r){setTimeout(function(){throw r})}function ni(r){return r==="head"}function N0(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),fs(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Go(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Go(s);for(var v=s.firstChild;v;){var S=v.nextSibling,T=v.nodeName;v[ho]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=S}}else s==="body"&&Go(r.ownerDocument.body);s=p}while(s);fs(i)}function _0(r,i){var s=r;r=0;do{var d=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=d}while(s)}function Um(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":Um(s),qf(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function h2(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[ho])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=wr(r.nextSibling),r===null)break}return null}function m2(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=wr(r.nextSibling),r===null))return null;return r}function T0(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=wr(r.nextSibling),r===null))return null;return r}function Pm(r){return r.data==="$?"||r.data==="$~"}function Bm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function p2(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var d=function(){i(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function wr(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 $m=null;function A0(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return wr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function R0(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 z0(r,i,s){switch(i=rd(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 Go(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);qf(r)}var Sr=new Map,O0=new Set;function ad(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var wa=te.d;te.d={f:g2,r:y2,D:v2,C:b2,L:x2,m:w2,X:k2,S:S2,M:j2};function g2(){var r=wa.f(),i=Gc();return r||i}function y2(r){var i=Rl(r);i!==null&&i.tag===5&&i.type==="form"?Yb(i):wa.r(r)}var us=typeof document>"u"?null:document;function D0(r,i,s){var d=us;if(d&&typeof i=="string"&&i){var p=mr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),O0.has(p)||(O0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Sn(i,"link",r),on(i),d.head.appendChild(i)))}}function v2(r){wa.D(r),D0("dns-prefetch",r,null)}function b2(r,i){wa.C(r,i),D0("preconnect",r,i)}function x2(r,i,s){wa.L(r,i,s);var d=us;if(d&&r&&i){var p='link[rel="preload"][as="'+mr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+mr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+mr(s.imageSizes)+'"]')):p+='[href="'+mr(r)+'"]';var v=p;switch(i){case"style":v=cs(r);break;case"script":v=ds(r)}Sr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),Sr.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Yo(v))||i==="script"&&d.querySelector(Xo(v))||(i=d.createElement("link"),Sn(i,"link",r),on(i),d.head.appendChild(i)))}}function w2(r,i){wa.m(r,i);var s=us;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+mr(d)+'"][href="'+mr(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ds(r)}if(!Sr.has(v)&&(r=g({rel:"modulepreload",href:r},i),Sr.set(v,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Xo(v)))return}d=s.createElement("link"),Sn(d,"link",r),on(d),s.head.appendChild(d)}}}function S2(r,i,s){wa.S(r,i,s);var d=us;if(d&&r){var p=zl(d).hoistableStyles,v=cs(r);i=i||"default";var S=p.get(v);if(!S){var T={loading:0,preload:null};if(S=d.querySelector(Yo(v)))T.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=Sr.get(v))&&Fm(r,s);var $=S=d.createElement("link");on($),Sn($,"link",r),$._p=new Promise(function(K,ae){$.onload=K,$.onerror=ae}),$.addEventListener("load",function(){T.loading|=1}),$.addEventListener("error",function(){T.loading|=2}),T.loading|=4,id(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:T},p.set(v,S)}}}function k2(r,i){wa.X(r,i);var s=us;if(s&&r){var d=zl(s).hoistableScripts,p=ds(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0},i),(i=Sr.get(p))&&qm(r,i),v=s.createElement("script"),on(v),Sn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function j2(r,i){wa.M(r,i);var s=us;if(s&&r){var d=zl(s).hoistableScripts,p=ds(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=Sr.get(p))&&qm(r,i),v=s.createElement("script"),on(v),Sn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function M0(r,i,s,d){var p=(p=ce.current)?ad(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=cs(s.href),s=zl(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=cs(s.href);var v=zl(p).hoistableStyles,S=v.get(r);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,S),(v=p.querySelector(Yo(r)))&&!v._p&&(S.instance=v,S.state.loading=5),Sr.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},Sr.set(r,s),v||C2(p,r,s,S.state))),i&&d===null)throw Error(a(528,""));return S}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ds(s),s=zl(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function cs(r){return'href="'+mr(r)+'"'}function Yo(r){return'link[rel="stylesheet"]['+r+"]"}function L0(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function C2(r,i,s,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Sn(i,"link",s),on(i),r.head.appendChild(i))}function ds(r){return'[src="'+mr(r)+'"]'}function Xo(r){return"script[async]"+r}function I0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+mr(s.href)+'"]');if(d)return i.instance=d,on(d),d;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),on(d),Sn(d,"style",p),id(d,s.precedence,r),i.instance=d;case"stylesheet":p=cs(s.href);var v=r.querySelector(Yo(p));if(v)return i.state.loading|=4,i.instance=v,on(v),v;d=L0(s),(p=Sr.get(p))&&Fm(d,p),v=(r.ownerDocument||r).createElement("link"),on(v);var S=v;return S._p=new Promise(function(T,$){S.onload=T,S.onerror=$}),Sn(v,"link",d),i.state.loading|=4,id(v,s.precedence,r),i.instance=v;case"script":return v=ds(s.src),(p=r.querySelector(Xo(v)))?(i.instance=p,on(p),p):(d=s,(p=Sr.get(v))&&(d=g({},s),qm(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),on(p),Sn(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,id(d,s.precedence,r));return i.instance}function id(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,S=0;S<d.length;S++){var T=d[S];if(T.dataset.precedence===i)v=T;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 Fm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function qm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var ld=null;function U0(r,i,s){if(ld===null){var d=new Map,p=ld=new Map;p.set(s,d)}else p=ld,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[ho]||v[vn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var S=v.getAttribute(i)||"";S=r+S;var T=d.get(S);T?T.push(v):d.set(S,[v])}}return d}function P0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function E2(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 B0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function N2(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=cs(d.href),v=i.querySelector(Yo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=sd.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,on(v);return}v=i.ownerDocument||i,d=L0(d),(p=Sr.get(p))&&Fm(d,p),v=v.createElement("link"),on(v);var S=v;S._p=new Promise(function(T,$){S.onload=T,S.onerror=$}),Sn(v,"link",d),s.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=sd.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Hm=0;function _2(r,i){return r.stylesheets&&r.count===0&&ud(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&ud(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Hm===0&&(Hm=62500*o2());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&ud(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Hm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function sd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ud(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var od=null;function ud(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,od=new Map,i.forEach(T2,r),od=null,sd.call(r))}function T2(r,i){if(!(i.state.loading&4)){var s=od.get(r);if(s)var d=s.get(null);else{s=new Map,od.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var S=p[v];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(s.set(S.dataset.precedence,S),d=S)}d&&s.set(null,d)}p=i.instance,S=p.getAttribute("data-precedence"),v=s.get(S)||d,v===d&&s.set(null,p),s.set(S,p),this.count++,d=sd.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Jo={$$typeof:z,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function A2(r,i,s,d,p,v,S,T,$){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=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function $0(r,i,s,d,p,v,S,T,$,K,ae,fe){return r=new A2(r,i,s,S,$,K,ae,fe,T),i=1,v===!0&&(i|=24),v=Jn(3,null,null,i),r.current=v,v.stateNode=r,i=kh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},Nh(v),r}function F0(r){return r?(r=Fl,r):Fl}function q0(r,i,s,d,p,v){p=F0(p),d.context===null?d.context=p:d.pendingContext=p,d=Za(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Va(r,d,i),s!==null&&(qn(s,r,i),Ao(s,r,i))}function H0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function Zm(r,i){H0(r,i),(r=r.alternate)&&H0(r,i)}function Z0(r){if(r.tag===13||r.tag===31){var i=Hi(r,67108864);i!==null&&qn(i,r,67108864),Zm(r,67108864)}}function V0(r){if(r.tag===13||r.tag===31){var i=rr();i=Bf(i);var s=Hi(r,i);s!==null&&qn(s,r,i),Zm(r,i)}}var cd=!0;function R2(r,i,s,d){var p=Z.T;Z.T=null;var v=te.p;try{te.p=2,Vm(r,i,s,d)}finally{te.p=v,Z.T=p}}function z2(r,i,s,d){var p=Z.T;Z.T=null;var v=te.p;try{te.p=8,Vm(r,i,s,d)}finally{te.p=v,Z.T=p}}function Vm(r,i,s,d){if(cd){var p=Qm(d);if(p===null)zm(r,i,d,dd,s),K0(r,d);else if(D2(p,r,i,s,d))d.stopPropagation();else if(K0(r,d),i&4&&-1<O2.indexOf(r)){for(;p!==null;){var v=Rl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var S=Pr(v.pendingLanes);if(S!==0){var T=v;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var $=1<<31-ht(S);T.entanglements[1]|=$,S&=~$}qr(v),(ft&6)===0&&(Qc=mn()+500,Vo(0))}}break;case 31:case 13:T=Hi(v,2),T!==null&&qn(T,v,2),Gc(),Zm(v,2)}if(v=Qm(d),v===null&&zm(r,i,d,dd,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else zm(r,i,d,null,s)}}function Qm(r){return r=Gf(r),Km(r)}var dd=null;function Km(r){if(dd=null,r=Al(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=c(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return dd=r,null}function Q0(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(co()){case se:return 2;case ye:return 8;case Ue:case Fe:return 32;case at:return 268435456;default:return 32}default:return 32}}var Gm=!1,ri=null,ai=null,ii=null,Wo=new Map,eu=new Map,li=[],O2="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 K0(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":Wo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":eu.delete(i.pointerId)}}function tu(r,i,s,d,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:v,targetContainers:[p]},i!==null&&(i=Rl(i),i!==null&&Z0(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function D2(r,i,s,d,p){switch(i){case"focusin":return ri=tu(ri,r,i,s,d,p),!0;case"dragenter":return ai=tu(ai,r,i,s,d,p),!0;case"mouseover":return ii=tu(ii,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Wo.set(v,tu(Wo.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,eu.set(v,tu(eu.get(v)||null,r,i,s,d,p)),!0}return!1}function G0(r){var i=Al(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){r.blockedOn=i,uv(r.priority,function(){V0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,uv(r.priority,function(){V0(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 fd(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Qm(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);Kf=d,s.target.dispatchEvent(d),Kf=null}else return i=Rl(s),i!==null&&Z0(i),r.blockedOn=s,!1;i.shift()}return!0}function Y0(r,i,s){fd(r)&&s.delete(i)}function M2(){Gm=!1,ri!==null&&fd(ri)&&(ri=null),ai!==null&&fd(ai)&&(ai=null),ii!==null&&fd(ii)&&(ii=null),Wo.forEach(Y0),eu.forEach(Y0)}function hd(r,i){r.blockedOn===i&&(r.blockedOn=null,Gm||(Gm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,M2)))}var md=null;function X0(r){md!==r&&(md=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){md===r&&(md=null);for(var i=0;i<r.length;i+=3){var s=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(Km(d||s)===null)continue;break}var v=Rl(s);v!==null&&(r.splice(i,3),i-=3,Qh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function fs(r){function i($){return hd($,r)}ri!==null&&hd(ri,r),ai!==null&&hd(ai,r),ii!==null&&hd(ii,r),Wo.forEach(i),eu.forEach(i);for(var s=0;s<li.length;s++){var d=li[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<li.length&&(s=li[0],s.blockedOn===null);)G0(s),s.blockedOn===null&&li.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],v=s[d+1],S=p[In]||null;if(typeof v=="function")S||X0(s);else if(S){var T=null;if(v&&v.hasAttribute("formAction")){if(p=v,S=v[In]||null)T=S.formAction;else if(Km(p)!==null)continue}else T=S.action;typeof T=="function"?s[d+1]=T:(s.splice(d,3),d-=3),X0(s)}}}function J0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Ym(r){this._internalRoot=r}pd.prototype.render=Ym.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=rr();q0(s,d,r,i,null,null)},pd.prototype.unmount=Ym.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;q0(r.current,2,null,r,null,null),Gc(),i[Tl]=null}};function pd(r){this._internalRoot=r}pd.prototype.unstable_scheduleHydration=function(r){if(r){var i=ov();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&&G0(r)}};var W0=t.version;if(W0!=="19.2.4")throw Error(a(527,W0,"19.2.4"));te.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 L2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gd.isDisabled&&gd.supportsFiber)try{nn=gd.inject(L2),Zt=gd}catch{}}return ru.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=lx,v=sx,S=ox;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),i=$0(r,1,!1,null,null,s,d,null,p,v,S,J0),r[Tl]=i.current,Rm(r),new Ym(i)},ru.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=lx,S=sx,T=ox,$=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&($=s.formState)),i=$0(r,1,!0,i,s??null,d,p,$,v,S,T,J0),i.context=F0(null),s=i.current,d=rr(),d=Bf(d),p=Za(d),p.callback=null,Va(s,p,d),s=d,i.current.lanes=s,yn(i,s),qr(i),r[Tl]=i.current,Rm(r),new pd(i)},ru.version="19.2.4",ru}var c1;function Q2(){if(c1)return ep.exports;c1=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(),ep.exports=V2(),ep.exports}var K2=Q2(),Sl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ll,mi,Ts,LS,G2=(LS=class extends Sl{constructor(){super();je(this,ll);je(this,mi);je(this,Ts);ge(this,Ts,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){I(this,mi)||this.setEventListener(I(this,Ts))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,mi))==null||t.call(this),ge(this,mi,void 0))}setEventListener(t){var n;ge(this,Ts,t),(n=I(this,mi))==null||n.call(this),ge(this,mi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){I(this,ll)!==t&&(ge(this,ll,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof I(this,ll)=="boolean"?I(this,ll):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ll=new WeakMap,mi=new WeakMap,Ts=new WeakMap,LS),Xg=new G2,Y2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pi,Kg,IS,X2=(IS=class{constructor(){je(this,pi,Y2);je(this,Kg,!1)}setTimeoutProvider(e){ge(this,pi,e)}setTimeout(e,t){return I(this,pi).setTimeout(e,t)}clearTimeout(e){I(this,pi).clearTimeout(e)}setInterval(e,t){return I(this,pi).setInterval(e,t)}clearInterval(e){I(this,pi).clearInterval(e)}},pi=new WeakMap,Kg=new WeakMap,IS),il=new X2;function J2(e){setTimeout(e,0)}var W2=typeof window>"u"||"Deno"in globalThis;function _n(){}function eT(e,t){return typeof e=="function"?e(t):e}function Vp(e){return typeof e=="number"&&e>=0&&e!==1/0}function GS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ci(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function d1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==Jg(c,t.options))return!1}else if(!ku(t.queryKey,c))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function f1(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(pl(t.options.mutationKey)!==pl(o))return!1}else if(!ku(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function Jg(e,t){return((t==null?void 0:t.queryKeyHashFn)||pl)(e)}function pl(e){return JSON.stringify(e,(t,n)=>Qp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function ku(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ku(e[n],t[n])):!1}var tT=Object.prototype.hasOwnProperty;function Wg(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=h1(e)&&h1(t);if(!a&&!(Qp(e)&&Qp(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),f=c.length,m=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:c[y],b=e[g],w=t[g];if(b===w){m[g]=b,(a?y<o:tT.call(e,g))&&h++;continue}if(b===null||w===null||typeof b!="object"||typeof w!="object"){m[g]=w;continue}const k=Wg(b,w,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function ju(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 h1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qp(e){if(!m1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!m1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function m1(e){return Object.prototype.toString.call(e)==="[object Object]"}function nT(e){return new Promise(t=>{il.setTimeout(t,e)})}function Kp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Wg(e,t):t}function rT(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function aT(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var ey=Symbol();function YS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ey?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ty(e,t){return typeof e=="function"?e(...t):!!e}function iT(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 Cu=(()=>{let e=()=>W2;return{isServer(){return e()},setIsServer(t){e=t}}})();function Gp(){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 lT=J2;function sT(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=lT;const o=f=>{t?e.push(f):l(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&l(()=>{a(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||c()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Bt=sT(),As,gi,Rs,US,oT=(US=class extends Sl{constructor(){super();je(this,As,!0);je(this,gi);je(this,Rs);ge(this,Rs,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(){I(this,gi)||this.setEventListener(I(this,Rs))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,gi))==null||t.call(this),ge(this,gi,void 0))}setEventListener(t){var n;ge(this,Rs,t),(n=I(this,gi))==null||n.call(this),ge(this,gi,t(this.setOnline.bind(this)))}setOnline(t){I(this,As)!==t&&(ge(this,As,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return I(this,As)}},As=new WeakMap,gi=new WeakMap,Rs=new WeakMap,US),Qd=new oT;function uT(e){return Math.min(1e3*2**e,3e4)}function XS(e){return(e??"online")==="online"?Qd.isOnline():!0}var Yp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function JS(e){let t=!1,n=0,a;const l=Gp(),o=()=>l.status!=="pending",c=j=>{var E;if(!o()){const C=new Yp(j);b(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Xg.isFocused()&&(e.networkMode==="always"||Qd.isOnline())&&e.canRun(),y=()=>XS(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},w=()=>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 O;if(o())return;const N=e.retry??(Cu.isServer()?0:3),z=e.retryDelay??uT,L=typeof z=="function"?z(n,C):z,D=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,C);if(t||!D){b(C);return}n++,(O=e.onFail)==null||O.call(e,n,C),nT(L).then(()=>h()?void 0:w()).then(()=>{t?b(C):k()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():w().then(k),l)}}var sl,PS,WS=(PS=class{constructor(){je(this,sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vp(this.gcTime)&&ge(this,sl,il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cu.isServer()?1/0:300*1e3))}clearGcTimeout(){I(this,sl)&&(il.clearTimeout(I(this,sl)),ge(this,sl,void 0))}},sl=new WeakMap,PS),ol,zs,kr,ul,cn,Du,cl,sr,ek,ka,BS,cT=(BS=class extends WS{constructor(t){super();je(this,sr);je(this,ol);je(this,zs);je(this,kr);je(this,ul);je(this,cn);je(this,Du);je(this,cl);ge(this,cl,!1),ge(this,Du,t.defaultOptions),this.setOptions(t.options),this.observers=[],ge(this,ul,t.client),ge(this,kr,I(this,ul).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ge(this,ol,g1(this.options)),this.state=t.state??I(this,ol),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=I(this,cn))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,Du),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=g1(this.options);n.data!==void 0&&(this.setState(p1(n.data,n.dataUpdatedAt)),ge(this,ol,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,kr).remove(this)}setData(t,n){const a=Kp(this.state.data,t,this.options);return Me(this,sr,ka).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Me(this,sr,ka).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=I(this,cn))==null?void 0:a.promise;return(l=I(this,cn))==null||l.cancel(t),n?n.then(_n).catch(_n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,ol)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ey||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ci(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:!GS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=I(this,cn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=I(this,cn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,kr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(I(this,cn)&&(I(this,cl)||Me(this,sr,ek).call(this)?I(this,cn).cancel({revert:!0}):I(this,cn).cancelRetry()),this.scheduleGc()),I(this,kr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Me(this,sr,ka).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,w,k,j,E,C,N,z;if(this.state.fetchStatus!=="idle"&&((m=I(this,cn))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(I(this,cn))return I(this,cn).continueRetry(),I(this,cn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const L=this.observers.find(D=>D.options.queryFn);L&&this.setOptions(L.options)}const a=new AbortController,l=L=>{Object.defineProperty(L,"signal",{enumerable:!0,get:()=>(ge(this,cl,!0),a.signal)})},o=()=>{const L=YS(this.options,n),O=(()=>{const M={client:I(this,ul),queryKey:this.queryKey,meta:this.meta};return l(M),M})();return ge(this,cl,!1),this.options.persister?this.options.persister(L,O,this):L(O)},f=(()=>{const L={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:I(this,ul),state:this.state,fetchFn:o};return l(L),L})();(h=this.options.behavior)==null||h.onFetch(f,this),ge(this,zs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Me(this,sr,ka).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),ge(this,cn,JS({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:L=>{L instanceof Yp&&L.revert&&this.setState({...I(this,zs),fetchStatus:"idle"}),a.abort()},onFail:(L,D)=>{Me(this,sr,ka).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{Me(this,sr,ka).call(this,{type:"pause"})},onContinue:()=>{Me(this,sr,ka).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const L=await I(this,cn).start();if(L===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(L),(w=(b=I(this,kr).config).onSuccess)==null||w.call(b,L,this),(j=(k=I(this,kr).config).onSettled)==null||j.call(k,L,this.state.error,this),L}catch(L){if(L instanceof Yp){if(L.silent)return I(this,cn).promise;if(L.revert){if(this.state.data===void 0)throw L;return this.state.data}}throw Me(this,sr,ka).call(this,{type:"error",error:L}),(C=(E=I(this,kr).config).onError)==null||C.call(E,L,this),(z=(N=I(this,kr).config).onSettled)==null||z.call(N,this.state.data,L,this),L}finally{this.scheduleGc()}}},ol=new WeakMap,zs=new WeakMap,kr=new WeakMap,ul=new WeakMap,cn=new WeakMap,Du=new WeakMap,cl=new WeakMap,sr=new WeakSet,ek=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ka=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,...tk(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...p1(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,zs,t.manual?l:void 0),l;case"error":const o=t.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),Bt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),I(this,kr).notify({query:this,type:"updated",action:t})})},BS);function tk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:XS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function p1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function g1(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 Zn,lt,Mu,On,dl,Os,ja,yi,Lu,Ds,Ms,fl,hl,vi,Ls,pt,mu,Xp,Jp,Wp,eg,tg,ng,rg,nk,$S,ny=($S=class extends Sl{constructor(t,n){super();je(this,pt);je(this,Zn);je(this,lt);je(this,Mu);je(this,On);je(this,dl);je(this,Os);je(this,ja);je(this,yi);je(this,Lu);je(this,Ds);je(this,Ms);je(this,fl);je(this,hl);je(this,vi);je(this,Ls,new Set);this.options=n,ge(this,Zn,t),ge(this,yi,null),ge(this,ja,Gp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,lt).addObserver(this),y1(I(this,lt),this.options)?Me(this,pt,mu).call(this):this.updateResult(),Me(this,pt,eg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ag(I(this,lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ag(I(this,lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Me(this,pt,tg).call(this),Me(this,pt,ng).call(this),I(this,lt).removeObserver(this)}setOptions(t){const n=this.options,a=I(this,lt);if(this.options=I(this,Zn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,I(this,lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Me(this,pt,rg).call(this),I(this,lt).setOptions(this.options),n._defaulted&&!ju(this.options,n)&&I(this,Zn).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,lt),observer:this});const l=this.hasListeners();l&&v1(I(this,lt),a,this.options,n)&&Me(this,pt,mu).call(this),this.updateResult(),l&&(I(this,lt)!==a||Cr(this.options.enabled,I(this,lt))!==Cr(n.enabled,I(this,lt))||Ci(this.options.staleTime,I(this,lt))!==Ci(n.staleTime,I(this,lt)))&&Me(this,pt,Xp).call(this);const o=Me(this,pt,Jp).call(this);l&&(I(this,lt)!==a||Cr(this.options.enabled,I(this,lt))!==Cr(n.enabled,I(this,lt))||o!==I(this,vi))&&Me(this,pt,Wp).call(this,o)}getOptimisticResult(t){const n=I(this,Zn).getQueryCache().build(I(this,Zn),t),a=this.createResult(n,t);return fT(this,a)&&(ge(this,On,a),ge(this,Os,this.options),ge(this,dl,I(this,lt).state)),a}getCurrentResult(){return I(this,On)}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&&I(this,ja).status==="pending"&&I(this,ja).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){I(this,Ls).add(t)}getCurrentQuery(){return I(this,lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=I(this,Zn).defaultQueryOptions(t),a=I(this,Zn).getQueryCache().build(I(this,Zn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Me(this,pt,mu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,On)))}createResult(t,n){var Y;const a=I(this,lt),l=this.options,o=I(this,On),c=I(this,dl),f=I(this,Os),h=t!==a?t.state:I(this,Mu),{state:y}=t;let g={...y},b=!1,w;if(n._optimisticResults){const F=this.hasListeners(),J=!F&&y1(t,n),ee=F&&v1(t,a,n,l);(J||ee)&&(g={...g,...tk(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;w=g.data;let C=!1;if(n.placeholderData!==void 0&&w===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((Y=I(this,Ms))==null?void 0:Y.state.data,I(this,Ms)):n.placeholderData,F!==void 0&&(E="success",w=Kp(o==null?void 0:o.data,F,n),b=!0)}if(n.select&&w!==void 0&&!C)if(o&&w===(c==null?void 0:c.data)&&n.select===I(this,Lu))w=I(this,Ds);else try{ge(this,Lu,n.select),w=n.select(w),w=Kp(o==null?void 0:o.data,w,n),ge(this,Ds,w),ge(this,yi,null)}catch(F){ge(this,yi,F)}I(this,yi)&&(k=I(this,yi),w=I(this,Ds),j=Date.now(),E="error");const N=g.fetchStatus==="fetching",z=E==="pending",L=E==="error",D=z&&N,O=w!==void 0,U={status:E,fetchStatus:g.fetchStatus,isPending:z,isSuccess:E==="success",isError:L,isInitialLoading:D,isLoading:D,data:w,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:N,isRefetching:N&&!z,isLoadingError:L&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:L&&O,isStale:ry(t,n),refetch:this.refetch,promise:I(this,ja),isEnabled:Cr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=U.data!==void 0,J=U.status==="error"&&!F,ee=ne=>{J?ne.reject(U.error):F&&ne.resolve(U.data)},we=()=>{const ne=ge(this,ja,U.promise=Gp());ee(ne)},le=I(this,ja);switch(le.status){case"pending":t.queryHash===a.queryHash&&ee(le);break;case"fulfilled":(J||U.data!==le.value)&&we();break;case"rejected":(!J||U.error!==le.reason)&&we();break}}return U}updateResult(){const t=I(this,On),n=this.createResult(I(this,lt),this.options);if(ge(this,dl,I(this,lt).state),ge(this,Os,this.options),I(this,dl).data!==void 0&&ge(this,Ms,I(this,lt)),ju(n,t))return;ge(this,On,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!I(this,Ls).size)return!0;const c=new Set(o??I(this,Ls));return this.options.throwOnError&&c.add("error"),Object.keys(I(this,On)).some(f=>{const m=f;return I(this,On)[m]!==t[m]&&c.has(m)})};Me(this,pt,nk).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Me(this,pt,eg).call(this)}},Zn=new WeakMap,lt=new WeakMap,Mu=new WeakMap,On=new WeakMap,dl=new WeakMap,Os=new WeakMap,ja=new WeakMap,yi=new WeakMap,Lu=new WeakMap,Ds=new WeakMap,Ms=new WeakMap,fl=new WeakMap,hl=new WeakMap,vi=new WeakMap,Ls=new WeakMap,pt=new WeakSet,mu=function(t){Me(this,pt,rg).call(this);let n=I(this,lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(_n)),n},Xp=function(){Me(this,pt,tg).call(this);const t=Ci(this.options.staleTime,I(this,lt));if(Cu.isServer()||I(this,On).isStale||!Vp(t))return;const a=GS(I(this,On).dataUpdatedAt,t)+1;ge(this,fl,il.setTimeout(()=>{I(this,On).isStale||this.updateResult()},a))},Jp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,lt)):this.options.refetchInterval)??!1},Wp=function(t){Me(this,pt,ng).call(this),ge(this,vi,t),!(Cu.isServer()||Cr(this.options.enabled,I(this,lt))===!1||!Vp(I(this,vi))||I(this,vi)===0)&&ge(this,hl,il.setInterval(()=>{(this.options.refetchIntervalInBackground||Xg.isFocused())&&Me(this,pt,mu).call(this)},I(this,vi)))},eg=function(){Me(this,pt,Xp).call(this),Me(this,pt,Wp).call(this,Me(this,pt,Jp).call(this))},tg=function(){I(this,fl)&&(il.clearTimeout(I(this,fl)),ge(this,fl,void 0))},ng=function(){I(this,hl)&&(il.clearInterval(I(this,hl)),ge(this,hl,void 0))},rg=function(){const t=I(this,Zn).getQueryCache().build(I(this,Zn),this.options);if(t===I(this,lt))return;const n=I(this,lt);ge(this,lt,t),ge(this,Mu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},nk=function(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(I(this,On))}),I(this,Zn).getQueryCache().notify({query:I(this,lt),type:"observerResultsUpdated"})})},$S);function dT(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function y1(e,t){return dT(e,t)||e.state.data!==void 0&&ag(e,t,t.refetchOnMount)}function ag(e,t,n){if(Cr(t.enabled,e)!==!1&&Ci(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&ry(e,t)}return!1}function v1(e,t,n,a){return(e!==t||Cr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ry(e,n)}function ry(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(Ci(t.staleTime,e))}function fT(e,t){return!ju(e.getCurrentResult(),t)}function b1(e){return{onFetch:(t,n)=>{var y,g,b,w,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=((w=t.state.data)==null?void 0:w.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=z=>{iT(z,()=>t.signal,()=>j=!0)},C=YS(t.options,t.fetchOptions),N=async(z,L,D)=>{if(j)return Promise.reject();if(L==null&&z.pages.length)return Promise.resolve(z);const M=(()=>{const J={client:t.client,queryKey:t.queryKey,pageParam:L,direction:D?"backward":"forward",meta:t.options.meta};return E(J),J})(),U=await C(M),{maxPages:Y}=t.options,F=D?aT:rT;return{pages:F(z.pages,U,Y),pageParams:F(z.pageParams,L,Y)}};if(l&&o.length){const z=l==="backward",L=z?hT:x1,D={pages:o,pageParams:c},O=L(a,D);f=await N(D,O,z)}else{const z=e??o.length;do{const L=m===0?c[0]??a.initialPageParam:x1(a,f);if(m>0&&L==null)break;f=await N(f,L),m++}while(m<z)}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 x1(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 hT(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var Iu,Zr,En,ml,Vr,di,FS,mT=(FS=class extends WS{constructor(t){super();je(this,Vr);je(this,Iu);je(this,Zr);je(this,En);je(this,ml);ge(this,Iu,t.client),this.mutationId=t.mutationId,ge(this,En,t.mutationCache),ge(this,Zr,[]),this.state=t.state||rk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){I(this,Zr).includes(t)||(I(this,Zr).push(t),this.clearGcTimeout(),I(this,En).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ge(this,Zr,I(this,Zr).filter(n=>n!==t)),this.scheduleGc(),I(this,En).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,Zr).length||(this.state.status==="pending"?this.scheduleGc():I(this,En).remove(this))}continue(){var t;return((t=I(this,ml))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,y,g,b,w,k,j,E,C,N,z,L,D,O,M;const n=()=>{Me(this,Vr,di).call(this,{type:"continue"})},a={client:I(this,Iu),meta:this.options.meta,mutationKey:this.options.mutationKey};ge(this,ml,JS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(U,Y)=>{Me(this,Vr,di).call(this,{type:"failed",failureCount:U,error:Y})},onPause:()=>{Me(this,Vr,di).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,En).canRun(this)}));const l=this.state.status==="pending",o=!I(this,ml).canStart();try{if(l)n();else{Me(this,Vr,di).call(this,{type:"pending",variables:t,isPaused:o}),I(this,En).config.onMutate&&await I(this,En).config.onMutate(t,this,a);const Y=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));Y!==this.state.context&&Me(this,Vr,di).call(this,{type:"pending",context:Y,variables:t,isPaused:o})}const U=await I(this,ml).start();return await((h=(m=I(this,En).config).onSuccess)==null?void 0:h.call(m,U,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,U,t,this.state.context,a)),await((w=(b=I(this,En).config).onSettled)==null?void 0:w.call(b,U,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,U,null,t,this.state.context,a)),Me(this,Vr,di).call(this,{type:"success",data:U}),U}catch(U){try{await((C=(E=I(this,En).config).onError)==null?void 0:C.call(E,U,t,this.state.context,this,a))}catch(Y){Promise.reject(Y)}try{await((z=(N=this.options).onError)==null?void 0:z.call(N,U,t,this.state.context,a))}catch(Y){Promise.reject(Y)}try{await((D=(L=I(this,En).config).onSettled)==null?void 0:D.call(L,void 0,U,this.state.variables,this.state.context,this,a))}catch(Y){Promise.reject(Y)}try{await((M=(O=this.options).onSettled)==null?void 0:M.call(O,void 0,U,t,this.state.context,a))}catch(Y){Promise.reject(Y)}throw Me(this,Vr,di).call(this,{type:"error",error:U}),U}finally{I(this,En).runNext(this)}}},Iu=new WeakMap,Zr=new WeakMap,En=new WeakMap,ml=new WeakMap,Vr=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),Bt.batch(()=>{I(this,Zr).forEach(a=>{a.onMutationUpdate(t)}),I(this,En).notify({mutation:this,type:"updated",action:t})})},FS);function rk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ca,Lr,Uu,qS,pT=(qS=class extends Sl{constructor(t={}){super();je(this,Ca);je(this,Lr);je(this,Uu);this.config=t,ge(this,Ca,new Set),ge(this,Lr,new Map),ge(this,Uu,0)}build(t,n,a){const l=new mT({client:t,mutationCache:this,mutationId:++yd(this,Uu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){I(this,Ca).add(t);const n=vd(t);if(typeof n=="string"){const a=I(this,Lr).get(n);a?a.push(t):I(this,Lr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,Ca).delete(t)){const n=vd(t);if(typeof n=="string"){const a=I(this,Lr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&I(this,Lr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=vd(t);if(typeof n=="string"){const a=I(this,Lr).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=vd(t);if(typeof n=="string"){const l=(a=I(this,Lr).get(n))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Bt.batch(()=>{I(this,Ca).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,Ca).clear(),I(this,Lr).clear()})}getAll(){return Array.from(I(this,Ca))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>f1(n,a))}findAll(t={}){return this.getAll().filter(n=>f1(t,n))}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Bt.batch(()=>Promise.all(t.map(n=>n.continue().catch(_n))))}},Ca=new WeakMap,Lr=new WeakMap,Uu=new WeakMap,qS);function vd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ea,bi,Vn,Na,Ta,Ud,ig,HS,gT=(HS=class extends Sl{constructor(n,a){super();je(this,Ta);je(this,Ea);je(this,bi);je(this,Vn);je(this,Na);ge(this,Ea,n),this.setOptions(a),this.bindMethods(),Me(this,Ta,Ud).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=I(this,Ea).defaultMutationOptions(n),ju(this.options,a)||I(this,Ea).getMutationCache().notify({type:"observerOptionsUpdated",mutation:I(this,Vn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&pl(a.mutationKey)!==pl(this.options.mutationKey)?this.reset():((l=I(this,Vn))==null?void 0:l.state.status)==="pending"&&I(this,Vn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=I(this,Vn))==null||n.removeObserver(this)}onMutationUpdate(n){Me(this,Ta,Ud).call(this),Me(this,Ta,ig).call(this,n)}getCurrentResult(){return I(this,bi)}reset(){var n;(n=I(this,Vn))==null||n.removeObserver(this),ge(this,Vn,void 0),Me(this,Ta,Ud).call(this),Me(this,Ta,ig).call(this)}mutate(n,a){var l;return ge(this,Na,a),(l=I(this,Vn))==null||l.removeObserver(this),ge(this,Vn,I(this,Ea).getMutationCache().build(I(this,Ea),this.options)),I(this,Vn).addObserver(this),I(this,Vn).execute(n)}},Ea=new WeakMap,bi=new WeakMap,Vn=new WeakMap,Na=new WeakMap,Ta=new WeakSet,Ud=function(){var a;const n=((a=I(this,Vn))==null?void 0:a.state)??rk();ge(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})},ig=function(n){Bt.batch(()=>{var a,l,o,c,f,m,h,y;if(I(this,Na)&&this.hasListeners()){const g=I(this,bi).variables,b=I(this,bi).context,w={client:I(this,Ea),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=I(this,Na)).onSuccess)==null||l.call(a,n.data,g,b,w)}catch(k){Promise.reject(k)}try{(c=(o=I(this,Na)).onSettled)==null||c.call(o,n.data,null,g,b,w)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=I(this,Na)).onError)==null||m.call(f,n.error,g,b,w)}catch(k){Promise.reject(k)}try{(y=(h=I(this,Na)).onSettled)==null||y.call(h,void 0,n.error,g,b,w)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(I(this,bi))})})},HS);function w1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function yT(e,t,n){const a=e.slice(0);return a[t]=n,a}var Is,lr,Us,Ps,jr,xi,Pu,Bu,$u,Fu,jn,lg,sg,og,ug,cg,ZS,vT=(ZS=class extends Sl{constructor(t,n,a){super();je(this,jn);je(this,Is);je(this,lr);je(this,Us);je(this,Ps);je(this,jr);je(this,xi);je(this,Pu);je(this,Bu);je(this,$u);je(this,Fu,[]);ge(this,Is,t),ge(this,Ps,a),ge(this,Us,[]),ge(this,jr,[]),ge(this,lr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&I(this,jr).forEach(t=>{t.subscribe(n=>{Me(this,jn,ug).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,I(this,jr).forEach(t=>{t.destroy()})}setQueries(t,n){ge(this,Us,t),ge(this,Ps,n),Bt.batch(()=>{const a=I(this,jr),l=Me(this,jn,og).call(this,I(this,Us));l.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=l.map(g=>g.observer),c=o.map(g=>g.getCurrentResult()),f=a.length!==o.length,m=o.some((g,b)=>g!==a[b]),h=f||m,y=h?!0:c.some((g,b)=>{const w=I(this,lr)[b];return!w||!ju(g,w)});!h&&!y||(h&&(ge(this,Fu,l),ge(this,jr,o)),ge(this,lr,c),this.hasListeners()&&(h&&(w1(a,o).forEach(g=>{g.destroy()}),w1(o,a).forEach(g=>{g.subscribe(b=>{Me(this,jn,ug).call(this,g,b)})})),Me(this,jn,cg).call(this)))})}getCurrentResult(){return I(this,lr)}getQueries(){return I(this,jr).map(t=>t.getCurrentQuery())}getObservers(){return I(this,jr)}getOptimisticResult(t,n){const a=Me(this,jn,og).call(this,t),l=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[l,c=>Me(this,jn,sg).call(this,c??l,n,o),()=>Me(this,jn,lg).call(this,l,a)]}},Is=new WeakMap,lr=new WeakMap,Us=new WeakMap,Ps=new WeakMap,jr=new WeakMap,xi=new WeakMap,Pu=new WeakMap,Bu=new WeakMap,$u=new WeakMap,Fu=new WeakMap,jn=new WeakSet,lg=function(t,n){return n.map((a,l)=>{const o=t[l];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{n.forEach(f=>{f.observer.trackProp(c)})})})},sg=function(t,n,a){if(n){const l=I(this,$u),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((c,f)=>c!==l[f]));return(!I(this,xi)||I(this,lr)!==I(this,Bu)||o||n!==I(this,Pu))&&(ge(this,Pu,n),ge(this,Bu,I(this,lr)),a!==void 0&&ge(this,$u,a),ge(this,xi,Wg(I(this,xi),n(t)))),I(this,xi)}return t},og=function(t){const n=new Map;I(this,jr).forEach(l=>{const o=l.options.queryHash;if(!o)return;const c=n.get(o);c?c.push(l):n.set(o,[l])});const a=[];return t.forEach(l=>{var m;const o=I(this,Is).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new ny(I(this,Is),o);a.push({defaultedQueryOptions:o,observer:f})}),a},ug=function(t,n){const a=I(this,jr).indexOf(t);a!==-1&&(ge(this,lr,yT(I(this,lr),a,n)),Me(this,jn,cg).call(this))},cg=function(){var t;if(this.hasListeners()){const n=I(this,xi),a=Me(this,jn,lg).call(this,I(this,lr),I(this,Fu)),l=Me(this,jn,sg).call(this,a,(t=I(this,Ps))==null?void 0:t.combine);n!==l&&Bt.batch(()=>{this.listeners.forEach(o=>{o(I(this,lr))})})}},ZS),Qr,VS,bT=(VS=class extends Sl{constructor(t={}){super();je(this,Qr);this.config=t,ge(this,Qr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??Jg(l,n);let c=this.get(o);return c||(c=new cT({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(c)),c}add(t){I(this,Qr).has(t.queryHash)||(I(this,Qr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=I(this,Qr).get(t.queryHash);n&&(t.destroy(),n===t&&I(this,Qr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,Qr).get(t)}getAll(){return[...I(this,Qr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>d1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>d1(t,a)):n}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qr=new WeakMap,VS),Pt,wi,Si,Bs,$s,ki,Fs,qs,QS,xT=(QS=class{constructor(e={}){je(this,Pt);je(this,wi);je(this,Si);je(this,Bs);je(this,$s);je(this,ki);je(this,Fs);je(this,qs);ge(this,Pt,e.queryCache||new bT),ge(this,wi,e.mutationCache||new pT),ge(this,Si,e.defaultOptions||{}),ge(this,Bs,new Map),ge(this,$s,new Map),ge(this,ki,0)}mount(){yd(this,ki)._++,I(this,ki)===1&&(ge(this,Fs,Xg.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Pt).onFocus())})),ge(this,qs,Qd.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Pt).onOnline())})))}unmount(){var e,t;yd(this,ki)._--,I(this,ki)===0&&((e=I(this,Fs))==null||e.call(this),ge(this,Fs,void 0),(t=I(this,qs))==null||t.call(this),ge(this,qs,void 0))}isFetching(e){return I(this,Pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,wi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=I(this,Pt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=I(this,Pt).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ci(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return I(this,Pt).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),l=I(this,Pt).get(a.queryHash),o=l==null?void 0:l.state.data,c=eT(t,o);if(c!==void 0)return I(this,Pt).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Bt.batch(()=>I(this,Pt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=I(this,Pt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=I(this,Pt);Bt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=I(this,Pt);return Bt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Bt.batch(()=>I(this,Pt).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(_n).catch(_n)}invalidateQueries(e,t={}){return Bt.batch(()=>(I(this,Pt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=Bt.batch(()=>I(this,Pt).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(_n)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(_n)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=I(this,Pt).build(this,t);return n.isStaleByTime(Ci(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_n).catch(_n)}fetchInfiniteQuery(e){return e.behavior=b1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_n).catch(_n)}ensureInfiniteQueryData(e){return e.behavior=b1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qd.isOnline()?I(this,wi).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,Pt)}getMutationCache(){return I(this,wi)}getDefaultOptions(){return I(this,Si)}setDefaultOptions(e){ge(this,Si,e)}setQueryDefaults(e,t){I(this,Bs).set(pl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,Bs).values()],n={};return t.forEach(a=>{ku(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){I(this,$s).set(pl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,$s).values()],n={};return t.forEach(a=>{ku(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,Si).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Jg(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===ey&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,Si).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,Pt).clear(),I(this,wi).clear()}},Pt=new WeakMap,wi=new WeakMap,Si=new WeakMap,Bs=new WeakMap,$s=new WeakMap,ki=new WeakMap,Fs=new WeakMap,qs=new WeakMap,QS),ak=x.createContext(void 0),dn=e=>{const t=x.useContext(ak);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},wT=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(ak.Provider,{value:e,children:t})),ik=x.createContext(!1),lk=()=>x.useContext(ik);ik.Provider;function ST(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kT=x.createContext(ST()),sk=()=>x.useContext(kT),ok=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?ty(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},uk=e=>{x.useEffect(()=>{e.clearReset()},[e])},ck=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||ty(n,[e.error,a])),dk=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))}},jT=(e,t)=>e.isLoading&&e.isFetching&&!t,dg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,fg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function CT({queries:e,...t},n){const a=dn(),l=lk(),o=sk(),c=x.useMemo(()=>e.map(j=>{const E=a.defaultQueryOptions(j);return E._optimisticResults=l?"isRestoring":"optimistic",E}),[e,a,l]);c.forEach(j=>{dk(j);const E=a.getQueryCache().get(j.queryHash);ok(j,o,E)}),uk(o);const[f]=x.useState(()=>new vT(a,c,t)),[m,h,y]=f.getOptimisticResult(c,t.combine),g=!l&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(j=>g?f.subscribe(Bt.batchCalls(j)):_n,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const w=m.some((j,E)=>dg(c[E],j))?m.flatMap((j,E)=>{const C=c[E];if(C&&dg(C,j)){const N=new ny(a,C);return fg(C,N,o)}return[]}):[];if(w.length>0)throw Promise.all(w);const k=m.find((j,E)=>{const C=c[E];return C&&ck({result:j,errorResetBoundary:o,throwOnError:C.throwOnError,query:a.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(k!=null&&k.error)throw k.error;return h(y())}function ET(e,t,n){var b,w,k,j;const a=lk(),l=sk(),o=dn(),c=o.defaultQueryOptions(e);(w=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||w.call(b,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",dk(c),ok(c,l,f),uk(l);const m=!o.getQueryCache().get(c.queryHash),[h]=x.useState(()=>new t(o,c)),y=h.getOptimisticResult(c),g=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(E=>{const C=g?h.subscribe(Bt.batchCalls(E)):_n;return h.updateResult(),C},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(c)},[c,h]),dg(c,y))throw fg(c,h,l);if(ck({result:y,errorResetBoundary:l,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,c,y),c.experimental_prefetchInRender&&!Cu.isServer()&&jT(y,a)){const E=m?fg(c,h,l):f==null?void 0:f.promise;E==null||E.catch(_n).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?y:h.trackResult(y)}function $e(e,t){return ET(e,ny)}function wt(e,t){const n=dn(),[a]=x.useState(()=>new gT(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(c=>a.subscribe(Bt.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((c,f)=>{a.mutate(c,f).catch(_n)},[a]);if(l.error&&ty(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 S1="popstate";function k1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function NT(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=o||a.location;return hg("",{pathname:c,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,l){return typeof l=="string"?l:Eu(l)}return TT(t,n,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Nr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _T(){return Math.random().toString(36).substring(2,10)}function j1(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 hg(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Xs(t):t,state:n,key:t&&t.key||a||_T(),unstable_mask:l}}function Eu({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 Xs(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 TT(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,c=l.history,f="POP",m=null,h=y();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let 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 N=k1(E)?E:hg(j.location,E,C);h=y()+1;let z=j1(N,h),L=j.createHref(N.unstable_mask||N);try{c.pushState(z,"",L)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;l.location.assign(L)}o&&m&&m({action:f,location:j.location,delta:1})}function w(E,C){f="REPLACE";let N=k1(E)?E:hg(j.location,E,C);h=y();let z=j1(N,h),L=j.createHref(N.unstable_mask||N);c.replaceState(z,"",L),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return AT(E)}let j={get action(){return f},get location(){return e(l,c)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(S1,g),m=E,()=>{l.removeEventListener(S1,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:w,go(E){return c.go(E)}};return j}function AT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),At(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Eu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function fk(e,t,n="/"){return RT(e,t,n,!1)}function RT(e,t,n,a){let l=typeof t=="string"?Xs(t):t,o=Aa(l.pathname||"/",n);if(o==null)return null;let c=hk(e);zT(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=qT(o);f=$T(c[m],h,a)}return f}function hk(e,t=[],n=[],a="",l=!1){let o=(c,f,m=l,h)=>{let y={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;At(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=Yr([a,y.relativePath]),b=n.concat(y);c.children&&c.children.length>0&&(At(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),hk(c.children,t,b,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:PT(g,c.index),routesMeta:b})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))o(c,f);else for(let h of mk(c.path))o(c,f,!0,h)}),t}function mk(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return l?[o,""]:[o];let c=mk(a.join("/")),f=[];return f.push(...c.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function zT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:BT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var OT=/^:[\w-]+$/,DT=3,MT=2,LT=1,IT=10,UT=-2,C1=e=>e==="*";function PT(e,t){let n=e.split("/"),a=n.length;return n.some(C1)&&(a+=UT),t&&(a+=MT),n.filter(l=>!C1(l)).reduce((l,o)=>l+(OT.test(o)?DT:o===""?LT:IT),a)}function BT(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 $T(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",c=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=Kd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Kd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),c.push({params:l,pathname:Yr([o,g.pathname]),pathnameBase:QT(Yr([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=Yr([o,g.pathnameBase]))}return c}function Kd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=FT(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],c=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";c=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const w=f[b];return g&&!w?h[y]=void 0:h[y]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function FT(e,t=!1,n=!0){Nr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,m,h,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function qT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Nr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Aa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var HT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ZT(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Xs(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=E1(n.substring(1),"/"):o=E1(n,t)):o=t,{pathname:o,search:KT(a),hash:GT(l)}}function E1(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 ap(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 VT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ay(e){let t=VT(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function hf(e,t,n,a=!1){let l;typeof e=="string"?l=Xs(e):(l={...e},At(!l.pathname||!l.pathname.includes("?"),ap("?","pathname","search",l)),At(!l.pathname||!l.pathname.includes("#"),ap("#","pathname","hash",l)),At(!l.search||!l.search.includes("#"),ap("#","search","hash",l)));let o=e===""||l.pathname==="",c=o?"/":l.pathname,f;if(c==null)f=n;else{let g=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=ZT(l,f),h=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var Yr=e=>e.join("/").replace(/\/\/+/g,"/"),QT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),KT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,GT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,YT=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 XT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function JT(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var pk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gk(e,t){let n=e;if(typeof n!="string"||!HT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(pk)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Aa(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:l=!0}catch{Nr(!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 yk=["POST","PUT","PATCH","DELETE"];new Set(yk);var WT=["GET",...yk];new Set(WT);var Js=x.createContext(null);Js.displayName="DataRouter";var mf=x.createContext(null);mf.displayName="DataRouterState";var eA=x.createContext(!1),vk=x.createContext({isTransitioning:!1});vk.displayName="ViewTransition";var tA=x.createContext(new Map);tA.displayName="Fetchers";var nA=x.createContext(null);nA.displayName="Await";var dr=x.createContext(null);dr.displayName="Navigation";var qu=x.createContext(null);qu.displayName="Location";var _r=x.createContext({outlet:null,matches:[],isDataRoute:!1});_r.displayName="Route";var iy=x.createContext(null);iy.displayName="RouteError";var bk="REACT_ROUTER_ERROR",rA="REDIRECT",aA="ROUTE_ERROR_RESPONSE";function iA(e){if(e.startsWith(`${bk}:${rA}:{`))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 lA(e){if(e.startsWith(`${bk}:${aA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new YT(t.status,t.statusText,t.data)}catch{}}function sA(e,{relative:t}={}){At(Ws(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(dr),{hash:l,pathname:o,search:c}=Hu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Yr([n,o])),a.createHref({pathname:f,search:c,hash:l})}function Ws(){return x.useContext(qu)!=null}function Mn(){return At(Ws(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(qu).location}var xk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wk(e){x.useContext(dr).static||x.useLayoutEffect(e)}function fn(){let{isDataRoute:e}=x.useContext(_r);return e?SA():oA()}function oA(){At(Ws(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Js),{basename:t,navigator:n}=x.useContext(dr),{matches:a}=x.useContext(_r),{pathname:l}=Mn(),o=JSON.stringify(ay(a)),c=x.useRef(!1);return wk(()=>{c.current=!0}),x.useCallback((m,h={})=>{if(Nr(c.current,xk),!c.current)return;if(typeof m=="number"){n.go(m);return}let y=hf(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Yr([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var uA=x.createContext(null);function cA(e){let t=x.useContext(_r).outlet;return x.useMemo(()=>t&&x.createElement(uA.Provider,{value:e},t),[t,e])}function Sk(){let{matches:e}=x.useContext(_r),t=e[e.length-1];return t?t.params:{}}function Hu(e,{relative:t}={}){let{matches:n}=x.useContext(_r),{pathname:a}=Mn(),l=JSON.stringify(ay(n));return x.useMemo(()=>hf(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function dA(e,t){return kk(e,t)}function kk(e,t,n){var E;At(Ws(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(dr),{matches:l}=x.useContext(_r),o=l[l.length-1],c=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";Ck(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=Mn(),g;if(t){let C=typeof t=="string"?Xs(t):t;At(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||"/",w=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=fk(e,{pathname:w});Nr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Nr(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=gA(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:Yr([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Yr([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n);return t&&j?x.createElement(qu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function fA(){let e=wA(),t=XT(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:o},"ErrorBoundary")," or"," ",x.createElement("code",{style:o},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:l},n):null,c)}var hA=x.createElement(fA,null),jk=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=lA(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(_r.Provider,{value:this.props.routeContext},x.createElement(iy.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(mA,{error:e},t):t}};jk.contextType=eA;var ip=new WeakMap;function mA({children:e,error:t}){let{basename:n}=x.useContext(dr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=iA(t.digest);if(a){let l=ip.get(t);if(l)throw l;let o=gk(a.location,n);if(pk&&!ip.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw ip.set(t,c),c}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function pA({routeContext:e,match:t,children:n}){let a=x.useContext(Js);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(_r.Provider,{value:e},n)}function gA(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,o=a==null?void 0:a.errors;if(o!=null){let y=l.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);At(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let c=!1,f=-1;if(n&&a){c=a.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:b,errors:w}=a,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(c=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(y,g)=>{var b,w;m(y,{location:a.location,params:((w=(b=a.matches)==null?void 0:b[0])==null?void 0:w.params)??{},unstable_pattern:JT(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let w,k=!1,j=null,E=null;a&&(w=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||hA,c&&(f<0&&b===0?(Ck("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)),N=()=>{let z;return w?z=j:k?z=E:g.route.Component?z=x.createElement(g.route.Component,null):g.route.element?z=g.route.element:z=y,x.createElement(pA,{match:g,routeContext:{outlet:y,matches:C,isDataRoute:a!=null},children:z})};return a&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(jk,{location:a.location,revalidation:a.revalidation,component:j,error:w,children:N(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):N()},null)}function ly(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yA(e){let t=x.useContext(Js);return At(t,ly(e)),t}function vA(e){let t=x.useContext(mf);return At(t,ly(e)),t}function bA(e){let t=x.useContext(_r);return At(t,ly(e)),t}function sy(e){let t=bA(e),n=t.matches[t.matches.length-1];return At(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function xA(){return sy("useRouteId")}function wA(){var a;let e=x.useContext(iy),t=vA("useRouteError"),n=sy("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function SA(){let{router:e}=yA("useNavigate"),t=sy("useNavigate"),n=x.useRef(!1);return wk(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{Nr(n.current,xk),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var N1={};function Ck(e,t,n){!t&&!N1[e]&&(N1[e]=!0,Nr(!1,n))}x.memo(kA);function kA({routes:e,future:t,state:n,isStatic:a,onError:l}){return kk(e,void 0,{state:n,isStatic:a,onError:l})}function pf({to:e,replace:t,state:n,relative:a}){At(Ws(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(dr);Nr(!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(_r),{pathname:c}=Mn(),f=fn(),m=hf(e,ay(o),c,a==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function mg(e){return cA(e.context)}function ar(e){At(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function jA({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:c}){At(!Ws(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:c,future:{}}),[f,l,o,c]);typeof n=="string"&&(n=Xs(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:w="default",unstable_mask:k}=n,j=x.useMemo(()=>{let E=Aa(h,f);return E==null?null:{location:{pathname:E,search:y,hash:g,state:b,key:w,unstable_mask:k},navigationType:a}},[f,h,y,g,b,w,a,k]);return Nr(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(dr.Provider,{value:m},x.createElement(qu.Provider,{children:t,value:j}))}function CA({children:e,location:t}){return dA(pg(e),t)}function pg(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,pg(a.props.children,o));return}At(a.type===ar,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),At(!a.props.index||!a.props.children,"An index route cannot have child routes.");let c={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(c.children=pg(a.props.children,o)),n.push(c)}),n}var Pd="get",Bd="application/x-www-form-urlencoded";function gf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function EA(e){return gf(e)&&e.tagName.toLowerCase()==="button"}function NA(e){return gf(e)&&e.tagName.toLowerCase()==="form"}function _A(e){return gf(e)&&e.tagName.toLowerCase()==="input"}function TA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function AA(e,t){return e.button===0&&(!t||t==="_self")&&!TA(e)}function gg(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 RA(e,t){let n=gg(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var bd=null;function zA(){if(bd===null)try{new FormData(document.createElement("form"),0),bd=!1}catch{bd=!0}return bd}var OA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lp(e){return e!=null&&!OA.has(e)?(Nr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bd}"`),null):e}function DA(e,t){let n,a,l,o,c;if(NA(e)){let f=e.getAttribute("action");a=f?Aa(f,t):null,n=e.getAttribute("method")||Pd,l=lp(e.getAttribute("enctype"))||Bd,o=new FormData(e)}else if(EA(e)||_A(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(a=m?Aa(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Pd,l=lp(e.getAttribute("formenctype"))||lp(f.getAttribute("enctype"))||Bd,o=new FormData(f,e),!zA()){let{name:h,type:y,value:g}=e;if(y==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,g)}}else{if(gf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Pd,a=null,l=Bd,c=e}return o&&l==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oy(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function MA(e,t,n,a){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:t&&Aa(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function LA(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 IA(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 UA(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let c=await LA(o,n);return c.links?c.links():[]}return[]}));return FA(a.flat(1).filter(IA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function _1(e,t,n,a,l,o){let c=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var y;return n[h].pathname!==m.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>c(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var g;let y=a.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(c(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function PA(e,t,{includeHydrateFallback:n}={}){return BA(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 BA(e){return[...new Set(e)]}function $A(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function FA(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify($A(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function Ek(){let e=x.useContext(Js);return oy(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function qA(){let e=x.useContext(mf);return oy(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var uy=x.createContext(void 0);uy.displayName="FrameworkContext";function Nk(){let e=x.useContext(uy);return oy(e,"You must render this element inside a <HydratedRouter> element"),e}function HA(e,t){let n=x.useContext(uy),[a,l]=x.useState(!1),[o,c]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=C=>{C.forEach(N=>{c(N.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[a]);let w=()=>{l(!0)},k=()=>{l(!1),c(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:au(f,w),onBlur:au(m,k),onMouseEnter:au(h,w),onMouseLeave:au(y,k),onTouchStart:au(g,w)}]:[!1,b,{}]}function au(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ZA({page:e,...t}){let{router:n}=Ek(),a=x.useMemo(()=>fk(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(QA,{page:e,matches:a,...t}):null}function VA(e){let{manifest:t,routeModules:n}=Nk(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return UA(e,t,n).then(c=>{o||l(c)}),()=>{o=!0}},[e,t,n]),a}function QA({page:e,matches:t,...n}){let a=Mn(),{future:l,manifest:o,routeModules:c}=Nk(),{basename:f}=Ek(),{loaderData:m,matches:h}=qA(),y=x.useMemo(()=>_1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=x.useMemo(()=>_1(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(N=>{var L;let z=o.routes[N.route.id];!z||!z.hasLoader||(!y.some(D=>D.route.id===N.route.id)&&N.route.id in m&&((L=c[N.route.id])!=null&&L.shouldRevalidate)||z.hasClientLoader?E=!0:j.add(N.route.id))}),j.size===0)return[];let C=MA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(N=>j.has(N.route.id)).map(N=>N.route.id).join(",")),[C.pathname+C.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,c]),w=x.useMemo(()=>PA(g,o),[g,o]),k=VA(g);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),w.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 KA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var GA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{GA&&(window.__reactRouterVersion="7.13.1")}catch{}function YA({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=NT({window:a,v5Compat:!0}));let o=l.current,[c,f]=x.useState({action:o.action,location:o.location}),m=x.useCallback(h=>{n===!1?f(h):x.startTransition(()=>f(h))},[n]);return x.useLayoutEffect(()=>o.listen(m),[o,m]),x.createElement(jA,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var _k=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zu=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:c,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:w,...k},j){let{basename:E,navigator:C,unstable_useTransitions:N}=x.useContext(dr),z=typeof y=="string"&&_k.test(y),L=gk(y,E);y=L.to;let D=sA(y,{relative:l}),O=Mn(),M=null;if(f){let ne=hf(f,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);E!=="/"&&(ne.pathname=ne.pathname==="/"?E:Yr([E,ne.pathname])),M=C.createHref(ne)}let[U,Y,F]=HA(a,k),J=WA(y,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:w,unstable_useTransitions:N});function ee(ne){t&&t(ne),ne.defaultPrevented||J(ne)}let we=!(L.isExternal||o),le=x.createElement("a",{...k,...F,href:(we?M:void 0)||L.absoluteURL||D,onClick:we?ee:t,ref:KA(j,Y),target:h,"data-discover":!z&&n==="render"?"true":void 0});return U&&!z?x.createElement(x.Fragment,null,le,x.createElement(ZA,{page:D})):le});Zu.displayName="Link";var Tk=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:c,viewTransition:f,children:m,...h},y){let g=Hu(c,{relative:h.relative}),b=Mn(),w=x.useContext(mf),{navigator:k,basename:j}=x.useContext(dr),E=w!=null&&aR(g)&&f===!0,C=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,N=b.pathname,z=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(N=N.toLowerCase(),z=z?z.toLowerCase():null,C=C.toLowerCase()),z&&j&&(z=Aa(z,j)||z);const L=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let D=N===C||!l&&N.startsWith(C)&&N.charAt(L)==="/",O=z!=null&&(z===C||!l&&z.startsWith(C)&&z.charAt(C.length)==="/"),M={isActive:D,isPending:O,isTransitioning:E},U=D?t:void 0,Y;typeof a=="function"?Y=a(M):Y=[a,D?"active":null,O?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(M):o;return x.createElement(Zu,{...h,"aria-current":U,className:Y,ref:y,style:F,to:c,viewTransition:f},typeof m=="function"?m(M):m)});Tk.displayName="NavLink";var XA=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:c=Pd,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...w},k)=>{let{unstable_useTransitions:j}=x.useContext(dr),E=nR(),C=rR(f,{relative:h}),N=c.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&_k.test(f),L=D=>{if(m&&m(D),D.defaultPrevented)return;D.preventDefault();let O=D.nativeEvent.submitter,M=(O==null?void 0:O.getAttribute("formmethod"))||c,U=()=>E(O||D.currentTarget,{fetcherKey:t,method:M,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>U()):U()};return x.createElement("form",{ref:k,method:N,action:C,onSubmit:a?m:L,...w,"data-discover":!z&&e==="render"?"true":void 0})});XA.displayName="Form";function JA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ak(e){let t=x.useContext(Js);return At(t,JA(e)),t}function WA(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=fn(),g=Mn(),b=Hu(e,{relative:c});return x.useCallback(w=>{if(AA(w,t)){w.preventDefault();let k=n!==void 0?n:Eu(g)===Eu(b),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[g,y,b,n,a,l,t,e,o,c,f,m,h])}function yf(e){Nr(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(gg(e)),n=x.useRef(!1),a=Mn(),l=x.useMemo(()=>RA(a.search,n.current?null:t.current),[a.search]),o=fn(),c=x.useCallback((f,m)=>{const h=gg(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,c]}var eR=0,tR=()=>`__${String(++eR)}__`;function nR(){let{router:e}=Ak("useSubmit"),{basename:t}=x.useContext(dr),n=xA(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,c={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=DA(o,t);if(c.navigate===!1){let b=c.fetcherKey||tR();await a(b,n,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await l(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,l,t,n])}function rR(e,{relative:t}={}){let{basename:n}=x.useContext(dr),a=x.useContext(_r);At(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...Hu(e||".",{relative:t})},c=Mn();if(e==null){o.search=c.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Yr([n,o.pathname])),Eu(o)}function aR(e,{relative:t}={}){let n=x.useContext(vk);At(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ak("useViewTransitionState"),l=Hu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Aa(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Aa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Kd(l.pathname,c)!=null||Kd(l.pathname,o)!=null}const iR="/api/v1";async function lR(e,t){const n=await fetch(`${iR}/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 Rk="/api/v1",cy="first-tree-hub:tokens";let yg=null;function iu(e){yg=e}function sR(e){if(!yg||!e.startsWith("/admin/")&&e!=="/admin"||/[?&]organizationId=/.test(e))return e;const t=e.includes("?")?"&":"?";return`${e}${t}organizationId=${encodeURIComponent(yg)}`}function dy(){const e=localStorage.getItem(cy);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function vg(e){localStorage.setItem(cy,JSON.stringify(e))}function zk(){localStorage.removeItem(cy)}class Vu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let lu=null;async function oR(e){return lu||(lu=(async()=>{try{const t=await fetch(`${Rk}/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 vg(a),a}catch{return null}finally{lu=null}})(),lu)}async function xd(e,t){const{method:n="GET",body:a}=t??{},l=sR(e),o=m=>{const h={};return m&&(h.Authorization=`Bearer ${m}`),a!==void 0&&(h["Content-Type"]="application/json"),fetch(`${Rk}${l}`,{method:n,headers:h,body:a!==void 0?JSON.stringify(a):void 0})},c=dy();let f=await o(c==null?void 0:c.accessToken);if(f.status===401&&(c!=null&&c.refreshToken)){const m=await oR(c.refreshToken);m&&(f=await o(m.accessToken))}if(!f.ok){f.status===401&&(zk(),window.dispatchEvent(new CustomEvent("auth:logout")));const m=await f.text();let h,y;try{const g=JSON.parse(m);h=g.error??m,Array.isArray(g.details)&&(y=g.details.filter(b=>typeof b=="object"&&b!==null&&Array.isArray(b.path)))}catch{h=m}throw new Vu(f.status,h,y)}if(f.status!==204)return await f.json()}const ke={get:e=>xd(e),post:(e,t)=>xd(e,{method:"POST",body:t}),patch:(e,t)=>xd(e,{method:"PATCH",body:t}),delete:e=>xd(e,{method:"DELETE"})},fy="onboarding:joinPath",uR="onboarding:draft";function Ok(e){typeof window>"u"||window.sessionStorage.setItem(fy,e)}function cR(){if(typeof window>"u")return null;const e=window.sessionStorage.getItem(fy);return e==="solo"||e==="invite"?e:null}function dR(){typeof window>"u"||window.sessionStorage.removeItem(fy)}function fR(e,t){return`${e??"unknown-org"}:${t??"unknown-member"}`}function hy(e){return`${uR}:${e}`}function hR(e){if(!e||typeof e!="object"||!("displayName"in e)||typeof e.displayName!="string")return null;const t="selectedRuntime"in e?e.selectedRuntime:null;if(t!==null&&typeof t!="string")return null;const n="connectToken"in e?e.connectToken:null;if(n!==null&&typeof n!="string")return null;const a="connectTokenExpiresAt"in e?e.connectTokenExpiresAt:null;return a!==null&&typeof a!="number"?null:{displayName:e.displayName,selectedRuntime:t,connectToken:n,connectTokenExpiresAt:a}}function mR(e){if(typeof window>"u")return null;const t=window.sessionStorage.getItem(hy(e));if(!t)return null;try{return hR(JSON.parse(t))}catch{return null}}function pR(e,t){typeof window>"u"||window.sessionStorage.setItem(hy(e),JSON.stringify(t))}function gR(e){typeof window>"u"||window.sessionStorage.removeItem(hy(e))}const Dk=x.createContext(null),bg="first-tree-hub:selectedOrganizationId";function yR(){try{return localStorage.getItem(bg)}catch{return null}}function sp(e){try{e===null?localStorage.removeItem(bg):localStorage.setItem(bg,e)}catch{}}function vR({children:e}){const t=dn(),[n,a]=x.useState(()=>!!dy()),[l,o]=x.useState(null),[c,f]=x.useState([]),[m,h]=x.useState(()=>{const L=yR();return iu(L),L}),[y,g]=x.useState(null),[b,w]=x.useState(null),k=x.useCallback(()=>{zk(),sp(null),iu(null),t.clear(),a(!1),o(null),f([]),h(null),g(null),w(null)},[t]),j=x.useCallback(async()=>{var L;try{const D=await ke.get("/me");o(D.user??null),g(D.member);const O=D.memberships??[];f(O);const M=((L=D.wizard)==null?void 0:L.step)??null;w(M),M==="completed"&&dR(),h(U=>{var J;const Y=U&&O.some(ee=>ee.organizationId===U)?U:null;if(Y)return iu(Y),Y;const F=D.member.organizationId??((J=O[0])==null?void 0:J.organizationId)??null;return sp(F),iu(F),F})}catch{}},[]),E=x.useCallback(async(L,D)=>{const O=await lR(L,D);vg({accessToken:O.accessToken,refreshToken:O.refreshToken}),a(!0),await j()},[j]),C=x.useCallback(async L=>{vg(L),a(!0),await j()},[j]),N=x.useCallback(async L=>{await ke.post("/auth/switch-org",{organizationId:L}),sp(L),iu(L),t.clear(),h(L),await j()},[j,t]);x.useEffect(()=>{n&&!l&&j()},[n,l,j]),x.useEffect(()=>{const L=()=>k();return window.addEventListener("auth:logout",L),()=>window.removeEventListener("auth:logout",L)},[k]);const z=x.useMemo(()=>{if(c.length>0){const L=c.find(D=>D.organizationId===m);return L||(c[0]??null)}if(y){const L=y.role==="admin"?"admin":"member";return{id:y.id,organizationId:y.organizationId,organizationName:"",role:L,agentId:y.agentId}}return null},[c,m,y]);return u.jsx(Dk.Provider,{value:{isAuthenticated:n,user:l,memberships:c,currentMembership:z,organizationId:(z==null?void 0:z.organizationId)??null,memberId:(z==null?void 0:z.id)??null,role:(z==null?void 0:z.role)??null,agentId:(z==null?void 0:z.agentId)??null,wizardStep:b,login:E,adoptTokens:C,selectOrganization:N,refreshMe:j,logout:k},children:e})}function qt(){const e=x.useContext(Dk);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const bR="modulepreload",xR=function(e){return"/"+e},T1={},wR=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=c(n.map(h=>{if(h=xR(h),h in T1)return;T1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":bR,y||(b.as="script"),b.crossOrigin="",b.href=h,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((w,k)=>{b.addEventListener("load",w),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})},SR=x.lazy(()=>wR(()=>import("./index-iNiy68VO.js"),[]).then(e=>({default:e.LandingPage}))),kR=()=>u.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function jR(){const{isAuthenticated:e}=qt(),t=Mn();return e?u.jsx(mg,{}):t.pathname==="/"?u.jsx(x.Suspense,{fallback:u.jsx(kR,{}),children:u.jsx(SR,{})}):u.jsx(pf,{to:"/login",replace:!0,state:{from:t}})}/**
|
|
61
|
-
* @license lucide-react v0.577.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const Mk=(...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 CR=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 ER=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 A1=e=>{const t=ER(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 NR={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 _R=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 TR=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},m)=>x.createElement("svg",{ref:m,...NR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Mk("lucide",l),...!o&&!_R(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,y])=>x.createElement(h,y)),...Array.isArray(o)?o:[o]]));/**
|
|
96
|
-
* @license lucide-react v0.577.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const ot=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(TR,{ref:o,iconNode:t,className:Mk(`lucide-${CR(A1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=A1(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 AR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],my=ot("arrow-left",AR);/**
|
|
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 RR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],zR=ot("arrow-right",RR);/**
|
|
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 OR=[["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"}]],DR=ot("bell",OR);/**
|
|
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 MR=[["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"}]],LR=ot("bot",MR);/**
|
|
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 IR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cr=ot("check",IR);/**
|
|
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 UR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Lk=ot("chevron-down",UR);/**
|
|
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 PR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],BR=ot("chevron-right",PR);/**
|
|
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 $R=[["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"}]],vf=ot("copy",$R);/**
|
|
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 FR=[["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"}]],qR=ot("eye-off",FR);/**
|
|
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 HR=[["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"}]],ZR=ot("eye",HR);/**
|
|
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 VR=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Ik=ot("github",VR);/**
|
|
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 QR=[["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"}]],KR=ot("layout-dashboard",QR);/**
|
|
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 GR=[["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"}]],xg=ot("link-2",GR);/**
|
|
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 YR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],XR=ot("loader-circle",YR);/**
|
|
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 JR=[["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"}]],Uk=ot("lock",JR);/**
|
|
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 WR=[["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"}]],ez=ot("log-out",WR);/**
|
|
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 tz=[["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"}]],py=ot("message-square",tz);/**
|
|
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 nz=[["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"}]],rz=ot("moon",nz);/**
|
|
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 az=[["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"}]],iz=ot("paperclip",az);/**
|
|
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 lz=[["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"}]],sz=ot("pause",lz);/**
|
|
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 oz=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Qu=ot("pencil",oz);/**
|
|
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 uz=[["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"}]],Pk=ot("play",uz);/**
|
|
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 cz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jr=ot("plus",cz);/**
|
|
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 dz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],bf=ot("search",dz);/**
|
|
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 fz=[["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"}]],hz=ot("send",fz);/**
|
|
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 mz=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],pz=ot("settings",mz);/**
|
|
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 gz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],yz=ot("square",gz);/**
|
|
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 vz=[["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"}]],bz=ot("sun",vz);/**
|
|
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 xz=[["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"}]],Hs=ot("trash-2",xz);/**
|
|
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 wz=[["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"}]],gy=ot("triangle-alert",wz);/**
|
|
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 Sz=[["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"}]],kz=ot("undo-2",Sz);/**
|
|
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 jz=[["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"}]],Cz=ot("unplug",jz);/**
|
|
261
|
-
* @license lucide-react v0.577.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const Ez=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Nz=ot("user-plus",Ez);/**
|
|
266
|
-
* @license lucide-react v0.577.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const _z=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gd=ot("x",_z);/**
|
|
271
|
-
* @license lucide-react v0.577.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const Tz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Az=ot("zap",Tz);function Bk(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=Bk(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function $k(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Bk(e))&&(a&&(a+=" "),a+=t);return a}const Rz=(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},zz=(e,t)=>({classGroupId:e,validator:t}),Fk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Yd="-",R1=[],Oz="arbitrary..",Dz=e=>{const t=Lz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Mz(c);const f=c.split(Yd),m=f[0]===""&&f.length>1?1:0;return qk(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=a[c],h=n[c];return m?h?Rz(h,m):m:h||R1}return n[c]||R1}}},qk=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=qk(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const f=t===0?e.join(Yd):e.slice(t).join(Yd),m=c.length;for(let h=0;h<m;h++){const y=c[h];if(y.validator(f))return y.classGroupId}},Mz=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?Oz+a:void 0})(),Lz=e=>{const{theme:t,classGroups:n}=e;return Iz(n,t)},Iz=(e,t)=>{const n=Fk();for(const a in e){const l=e[a];yy(l,n,a,t)}return n},yy=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];Uz(c,t,n,a)}},Uz=(e,t,n,a)=>{if(typeof e=="string"){Pz(e,t,n);return}if(typeof e=="function"){Bz(e,t,n,a);return}$z(e,t,n,a)},Pz=(e,t,n)=>{const a=e===""?t:Hk(t,e);a.classGroupId=n},Bz=(e,t,n,a)=>{if(Fz(e)){yy(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(zz(n,e))},$z=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[f,m]=l[c];yy(m,Hk(t,f),n,a)}},Hk=(e,t)=>{let n=e;const a=t.split(Yd),l=a.length;for(let o=0;o<l;o++){const c=a[o];let f=n.nextPart.get(c);f||(f=Fk(),n.nextPart.set(c,f)),n=f}return n},Fz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,qz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return l(o,c),c},set(o,c){o in n?n[o]=c:l(o,c)}}},wg="!",z1=":",Hz=[],O1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Zz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const E=l[j];if(c===0&&f===0){if(E===z1){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?c++:E==="]"?c--:E==="("?f++:E===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,w=!1;g.endsWith(wg)?(b=g.slice(0,-1),w=!0):g.startsWith(wg)&&(b=g.slice(1),w=!0);const k=h&&h>m?h-m:void 0;return O1(o,w,b,k)};if(t){const l=t+z1,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):O1(Hz,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Vz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const c=n[o],f=c[0]==="[",m=t.has(c);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(c)):l.push(c)}return l.length>0&&(l.sort(),a.push(...l)),a}},Qz=e=>({cache:qz(e.cacheSize),parseClassName:Zz(e),sortModifiers:Vz(e),...Dz(e)}),Kz=/\s+/,Gz=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],f=e.trim().split(Kz);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:w,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 N=b.length===0?"":b.length===1?b[0]:o(b).join(":"),z=w?N+wg:N,L=z+C;if(c.indexOf(L)>-1)continue;c.push(L);const D=l(C,E);for(let O=0;O<D.length;++O){const M=D[O];c.push(z+M)}m=y+(m.length>0?" "+m:m)}return m},Yz=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=Zk(n))&&(l&&(l+=" "),l+=a);return l},Zk=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Zk(e[a]))&&(n&&(n+=" "),n+=t);return n},Xz=(e,...t)=>{let n,a,l,o;const c=m=>{const h=t.reduce((y,g)=>g(y),e());return n=Qz(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=Gz(m,n);return l(m,y),y};return o=c,(...m)=>o(Yz(...m))},Jz=[],an=e=>{const t=n=>n[e]||Jz;return t.isThemeGetter=!0,t},Vk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Wz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,e3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t3=/\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$/,n3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,r3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oi=e=>Wz.test(e),Ye=e=>!!e&&!Number.isNaN(Number(e)),ui=e=>!!e&&Number.isInteger(Number(e)),op=e=>e.endsWith("%")&&Ye(e.slice(0,-1)),Sa=e=>e3.test(e),Kk=()=>!0,i3=e=>t3.test(e)&&!n3.test(e),vy=()=>!1,l3=e=>r3.test(e),s3=e=>a3.test(e),o3=e=>!Ne(e)&&!_e(e),u3=e=>zi(e,Xk,vy),Ne=e=>Vk.test(e),rl=e=>zi(e,Jk,i3),D1=e=>zi(e,y3,Ye),c3=e=>zi(e,ej,Kk),d3=e=>zi(e,Wk,vy),M1=e=>zi(e,Gk,vy),f3=e=>zi(e,Yk,s3),wd=e=>zi(e,tj,l3),_e=e=>Qk.test(e),su=e=>kl(e,Jk),h3=e=>kl(e,Wk),L1=e=>kl(e,Gk),m3=e=>kl(e,Xk),p3=e=>kl(e,Yk),Sd=e=>kl(e,tj,!0),g3=e=>kl(e,ej,!0),zi=(e,t,n)=>{const a=Vk.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},kl=(e,t,n=!1)=>{const a=Qk.exec(e);return a?a[1]?t(a[1]):n:!1},Gk=e=>e==="position"||e==="percentage",Yk=e=>e==="image"||e==="url",Xk=e=>e==="length"||e==="size"||e==="bg-size",Jk=e=>e==="length",y3=e=>e==="number",Wk=e=>e==="family-name",ej=e=>e==="number"||e==="weight",tj=e=>e==="shadow",v3=()=>{const e=an("color"),t=an("font"),n=an("text"),a=an("font-weight"),l=an("tracking"),o=an("leading"),c=an("breakpoint"),f=an("container"),m=an("spacing"),h=an("radius"),y=an("shadow"),g=an("inset-shadow"),b=an("text-shadow"),w=an("drop-shadow"),k=an("blur"),j=an("perspective"),E=an("aspect"),C=an("ease"),N=an("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...L(),_e,Ne],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],U=()=>[_e,Ne,m],Y=()=>[oi,"full","auto",...U()],F=()=>[ui,"none","subgrid",_e,Ne],J=()=>["auto",{span:["full",ui,_e,Ne]},ui,_e,Ne],ee=()=>[ui,"auto",_e,Ne],we=()=>["auto","min","max","fr",_e,Ne],le=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...U()],te=()=>[oi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],ie=()=>[oi,"screen","full","dvw","lvw","svw","min","max","fit",...U()],ve=()=>[oi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],_=()=>[e,_e,Ne],P=()=>[...L(),L1,M1,{position:[_e,Ne]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",m3,u3,{size:[_e,Ne]}],q=()=>[op,su,rl],G=()=>["","none","full",h,_e,Ne],ce=()=>["",Ye,su,rl],be=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Ye,op,L1,M1],Xe=()=>["","none",k,_e,Ne],Le=()=>["none",Ye,_e,Ne],re=()=>["none",Ye,_e,Ne],Ee=()=>[Ye,_e,Ne],Ie=()=>[oi,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Sa],breakpoint:[Sa],color:[Kk],container:[Sa],"drop-shadow":[Sa],ease:["in","out","in-out"],font:[o3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Sa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Sa],shadow:[Sa],spacing:["px",Ye],text:[Sa],"text-shadow":[Sa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oi,Ne,_e,E]}],container:["container"],columns:[{columns:[Ye,Ne,_e,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[ui,"auto",_e,Ne]}],basis:[{basis:[oi,"full","auto",f,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,oi,"auto","initial","none",Ne]}],grow:[{grow:["",Ye,_e,Ne]}],shrink:[{shrink:["",Ye,_e,Ne]}],order:[{order:[ui,"first","last","none",_e,Ne]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":we()}],"auto-rows":[{"auto-rows":we()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...le(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...le()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":le()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mbs:[{mbs:Z()}],mbe:[{mbe:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...ie()]}],"min-inline-size":[{"min-inline":["auto",...ie()]}],"max-inline-size":[{"max-inline":["none",...ie()]}],"block-size":[{block:["auto",...ve()]}],"min-block-size":[{"min-block":["auto",...ve()]}],"max-block-size":[{"max-block":["none",...ve()]}],w:[{w:[f,"screen",...te()]}],"min-w":[{"min-w":[f,"screen","none",...te()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",n,su,rl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,g3,c3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",op,Ne]}],"font-family":[{font:[h3,d3,t]}],"font-features":[{"font-features":[Ne]}],"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,_e,Ne]}],"line-clamp":[{"line-clamp":[Ye,"none",_e,D1]}],leading:[{leading:[o,...U()]}],"list-image":[{"list-image":["none",_e,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",_e,rl]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Ye,"auto",_e,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e,Ne]}],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",_e,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ui,_e,Ne],radial:["",_e,Ne],conic:[ui,_e,Ne]},p3,f3]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,_e,Ne]}],"outline-w":[{outline:["",Ye,su,rl]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",y,Sd,wd]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",g,Sd,wd]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Ye,rl]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",b,Sd,wd]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Ye,_e,Ne]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"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":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[_e,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"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":L()}],"mask-image-conic-pos":[{"mask-conic":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,Ne]}],filter:[{filter:["","none",_e,Ne]}],blur:[{blur:Xe()}],brightness:[{brightness:[Ye,_e,Ne]}],contrast:[{contrast:[Ye,_e,Ne]}],"drop-shadow":[{"drop-shadow":["","none",w,Sd,wd]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Ye,_e,Ne]}],"hue-rotate":[{"hue-rotate":[Ye,_e,Ne]}],invert:[{invert:["",Ye,_e,Ne]}],saturate:[{saturate:[Ye,_e,Ne]}],sepia:[{sepia:["",Ye,_e,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,Ne]}],"backdrop-blur":[{"backdrop-blur":Xe()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,_e,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,_e,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,_e,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,_e,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Ye,_e,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,_e,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,_e,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,_e,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_e,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",_e,Ne]}],ease:[{ease:["linear","initial",C,_e,Ne]}],delay:[{delay:[Ye,_e,Ne]}],animate:[{animate:["none",N,_e,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,_e,Ne]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[_e,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ie()}],"translate-x":[{"translate-x":Ie()}],"translate-y":[{"translate-y":Ie()}],"translate-z":[{"translate-z":Ie()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"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",_e,Ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_e,Ne]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Ye,su,rl,D1]}],stroke:[{stroke:["none",..._()]}],"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"]}},b3=Xz(v3);function Ae(...e){return b3($k(e))}function Ni(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 x3(e){return ke.delete(`/clients/${encodeURIComponent(e)}`)}function Ku(){return ke.get("/admin/agents/activity")}function Ra(){return ke.get("/clients")}function by(e){return ke.get(`/clients/${e}`)}function w3(e){return ke.post(`/clients/${e}/disconnect`)}function nj(){return ke.post("/connect-tokens")}const rj=(e,t)=>["session",e,t],Xd=e=>["agent-sessions",e];function S3(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 k3(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 j3(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function eo(e,t){const n=new URLSearchParams;t!=null&&t.state&&n.set("state",t.state),t!=null&&t.runtimeState&&n.set("runtimeState",t.runtimeState);const a=n.toString();return ke.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function C3(e,t,n){const a=new URLSearchParams;a.set("limit",String(n.limit)),(n==null?void 0:n.cursor)!==void 0&&a.set("cursor",String(n.cursor)),n!=null&&n.direction&&a.set("direction",n.direction);const l=a.toString();return ke.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function E3(e,t){return ke.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function N3(e,t){return ke.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var I1=1,_3=.9,T3=.8,A3=.17,up=.1,cp=.999,R3=.9999,z3=.99,O3=/[\\\/_+.#"@\[\(\{&]/,D3=/[\\\/_+.#"@\[\(\{&]/g,M3=/[\s-]/,aj=/[\s-]/g;function Sg(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?I1:z3;var f=`${l},${o}`;if(c[f]!==void 0)return c[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,b,w,k;h>=0;)g=Sg(e,t,n,a,h+1,o+1,c),g>y&&(h===l?g*=I1:O3.test(e.charAt(h-1))?(g*=T3,w=e.slice(l,h-1).match(D3),w&&l>0&&(g*=Math.pow(cp,w.length))):M3.test(e.charAt(h-1))?(g*=_3,k=e.slice(l,h-1).match(aj),k&&l>0&&(g*=Math.pow(cp,k.length))):(g*=A3,l>0&&(g*=Math.pow(cp,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=R3)),(g<up&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=Sg(e,t,n,a,h+1,o+2,c),b*up>g&&(g=b*up)),g>y&&(y=g),h=n.indexOf(m,h+1);return c[f]=y,y}function U1(e){return e.toLowerCase().replace(aj," ")}function L3(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Sg(e,t,U1(e),U1(t),0,0,{})}function Ei(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 P1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _i(...e){return t=>{let n=!1;const a=e.map(l=>{const o=P1(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():P1(e[l],null)}}}}function jl(...e){return x.useCallback(_i(...e),e)}function I3(e,t){const n=x.createContext(t),a=o=>{const{children:c,...f}=o,m=x.useMemo(()=>f,Object.values(f));return u.jsx(n.Provider,{value:m,children:c})};a.displayName=e+"Provider";function l(o){const c=x.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function U3(e,t=[]){let n=[];function a(o,c){const f=x.createContext(c),m=n.length;n=[...n,c];const h=g=>{var C;const{scope:b,children:w,...k}=g,j=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,E=x.useMemo(()=>k,Object.values(k));return u.jsx(j.Provider,{value:E,children:w})};h.displayName=o+"Provider";function y(g,b){var j;const w=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(w);if(k)return k;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(c=>x.createContext(c));return function(f){const m=(f==null?void 0:f[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,P3(l,...t)]}function P3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const c=a.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Nu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},B3=Yg[" useId ".trim().toString()]||(()=>{}),$3=0;function _a(e){const[t,n]=x.useState(B3());return Nu(()=>{n(a=>a??String($3++))},[e]),t?`radix-${t}`:""}var F3=Yg[" useInsertionEffect ".trim().toString()]||Nu;function q3({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,c]=H3({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=x.useRef(e!==void 0);x.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,a])}const h=x.useCallback(y=>{var g;if(f){const b=Z3(y)?y(e):y;b!==e&&((g=c.current)==null||g.call(c,b))}else o(y)},[f,e,o,c]);return[m,h]}function H3({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return F3(()=>{o.current=t},[t]),x.useEffect(()=>{var c;l.current!==n&&((c=o.current)==null||c.call(o,n),l.current=n)},[n,l]),[n,a,o]}function Z3(e){return typeof e=="function"}var xy=KS();const V3=ff(xy);function ij(e){const t=Q3(e),n=x.forwardRef((a,l)=>{const{children:o,...c}=a,f=x.Children.toArray(o),m=f.find(G3);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function Q3(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const c=X3(l),f=Y3(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var K3=Symbol("radix.slottable");function G3(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===K3}function Y3(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 X3(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 J3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],za=J3.reduce((e,t)=>{const n=ij(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function W3(e,t){e&&xy.flushSync(()=>e.dispatchEvent(t))}function _u(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function eO(e,t=globalThis==null?void 0:globalThis.document){const n=_u(e);x.useEffect(()=>{const a=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var tO="DismissableLayer",kg="dismissableLayer.update",nO="dismissableLayer.pointerDownOutside",rO="dismissableLayer.focusOutside",B1,lj=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sj=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:c,onDismiss:f,...m}=e,h=x.useContext(lj),[y,g]=x.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=x.useState({}),k=jl(t,M=>g(M)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),N=y?j.indexOf(y):-1,z=h.layersWithOutsidePointerEventsDisabled.size>0,L=N>=C,D=lO(M=>{const U=M.target,Y=[...h.branches].some(F=>F.contains(U));!L||Y||(l==null||l(M),c==null||c(M),M.defaultPrevented||f==null||f())},b),O=sO(M=>{const U=M.target;[...h.branches].some(F=>F.contains(U))||(o==null||o(M),c==null||c(M),M.defaultPrevented||f==null||f())},b);return eO(M=>{N===h.layers.size-1&&(a==null||a(M),!M.defaultPrevented&&f&&(M.preventDefault(),f()))},b),x.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(B1=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),$1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=B1)}},[y,b,n,h]),x.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),$1())},[y,h]),x.useEffect(()=>{const M=()=>w({});return document.addEventListener(kg,M),()=>document.removeEventListener(kg,M)},[]),u.jsx(za.div,{...m,ref:k,style:{pointerEvents:z?L?"auto":"none":void 0,...e.style},onFocusCapture:Ei(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ei(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ei(e.onPointerDownCapture,D.onPointerDownCapture)})});sj.displayName=tO;var aO="DismissableLayerBranch",iO=x.forwardRef((e,t)=>{const n=x.useContext(lj),a=x.useRef(null),l=jl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(za.div,{...e,ref:l})});iO.displayName=aO;function lO(e,t=globalThis==null?void 0:globalThis.document){const n=_u(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){oj(nO,n,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function sO(e,t=globalThis==null?void 0:globalThis.document){const n=_u(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&oj(rO,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 $1(){const e=new CustomEvent(kg);document.dispatchEvent(e)}function oj(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?W3(l,o):l.dispatchEvent(o)}var dp="focusScope.autoFocusOnMount",fp="focusScope.autoFocusOnUnmount",F1={bubbles:!1,cancelable:!0},oO="FocusScope",uj=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...c}=e,[f,m]=x.useState(null),h=_u(l),y=_u(o),g=x.useRef(null),b=jl(t,j=>m(j)),w=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(z){if(w.paused||!f)return;const L=z.target;f.contains(L)?g.current=L:fi(g.current,{select:!0})},E=function(z){if(w.paused||!f)return;const L=z.relatedTarget;L!==null&&(f.contains(L)||fi(g.current,{select:!0}))},C=function(z){if(document.activeElement===document.body)for(const D of z)D.removedNodes.length>0&&fi(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const N=new MutationObserver(C);return f&&N.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),N.disconnect()}}},[a,f,w.paused]),x.useEffect(()=>{if(f){H1.add(w);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(dp,F1);f.addEventListener(dp,h),f.dispatchEvent(C),C.defaultPrevented||(uO(mO(cj(f)),{select:!0}),document.activeElement===j&&fi(f))}return()=>{f.removeEventListener(dp,h),setTimeout(()=>{const C=new CustomEvent(fp,F1);f.addEventListener(fp,y),f.dispatchEvent(C),C.defaultPrevented||fi(j??document.body,{select:!0}),f.removeEventListener(fp,y),H1.remove(w)},0)}}},[f,h,y,w]);const k=x.useCallback(j=>{if(!n&&!a||w.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const N=j.currentTarget,[z,L]=cO(N);z&&L?!j.shiftKey&&C===L?(j.preventDefault(),n&&fi(z,{select:!0})):j.shiftKey&&C===z&&(j.preventDefault(),n&&fi(L,{select:!0})):C===N&&j.preventDefault()}},[n,a,w.paused]);return u.jsx(za.div,{tabIndex:-1,...c,ref:b,onKeyDown:k})});uj.displayName=oO;function uO(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(fi(a,{select:t}),document.activeElement!==n)return}function cO(e){const t=cj(e),n=q1(t,e),a=q1(t.reverse(),e);return[n,a]}function cj(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 q1(e,t){for(const n of e)if(!dO(n,{upTo:t}))return n}function dO(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 fO(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&&fO(e)&&t&&e.select()}}var H1=hO();function hO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Z1(e,t),e.unshift(t)},remove(t){var n;e=Z1(e,t),(n=e[0])==null||n.resume()}}}function Z1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function mO(e){return e.filter(t=>t.tagName!=="A")}var pO="Portal",dj=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);Nu(()=>o(!0),[]);const c=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?V3.createPortal(u.jsx(za.div,{...a,ref:t}),c):null});dj.displayName=pO;function gO(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var xf=e=>{const{present:t,children:n}=e,a=yO(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=jl(a.ref,vO(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};xf.displayName="Presence";function yO(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[f,m]=gO(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=kd(a.current);o.current=f==="mounted"?h:"none"},[f]),Nu(()=>{const h=a.current,y=l.current;if(y!==e){const b=o.current,w=kd(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Nu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=w=>{const j=kd(a.current).includes(CSS.escape(w.animationName));if(w.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=w=>{w.target===t&&(o.current=kd(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 kd(e){return(e==null?void 0:e.animationName)||"none"}function vO(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 hp=0;function bO(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??V1()),document.body.insertAdjacentElement("beforeend",e[1]??V1()),hp++,()=>{hp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hp--}},[])}function V1(){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 Kr=function(){return Kr=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},Kr.apply(this,arguments)};function fj(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 xO(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 $d="right-scroll-bar-position",Fd="width-before-scroll-bar",wO="with-scroll-bars-hidden",SO="--removed-body-scroll-bar-size";function mp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function kO(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 jO=typeof window<"u"?x.useLayoutEffect:x.useEffect,Q1=new WeakMap;function CO(e,t){var n=kO(null,function(a){return e.forEach(function(l){return mp(l,a)})});return jO(function(){var a=Q1.get(n);if(a){var l=new Set(a),o=new Set(e),c=n.current;l.forEach(function(f){o.has(f)||mp(f,null)}),o.forEach(function(f){l.has(f)||mp(f,c)})}Q1.set(n,e)},[e]),n}function EO(e){return e}function NO(e,t){t===void 0&&(t=EO);var n=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var c=t(o,a);return n.push(c),function(){n=n.filter(function(f){return f!==c})}},assignSyncMedium:function(o){for(a=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var c=[];if(n.length){var f=n;n=[],f.forEach(o),c=n}var m=function(){var y=c;c=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){c.push(y),h()},filter:function(y){return c=c.filter(y),n}}}};return l}function _O(e){e===void 0&&(e={});var t=NO(null);return t.options=Kr({async:!0,ssr:!1},e),t}var hj=function(e){var t=e.sideCar,n=fj(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,Kr({},n))};hj.isSideCarExport=!0;function TO(e,t){return e.useMedium(t),hj}var mj=_O(),pp=function(){},wf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:pp,onWheelCapture:pp,onTouchMoveCapture:pp}),l=a[0],o=a[1],c=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,w=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,C=e.as,N=C===void 0?"div":C,z=e.gapMode,L=fj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=b,O=CO([n,t]),M=Kr(Kr({},L),l);return x.createElement(x.Fragment,null,y&&x.createElement(D,{sideCar:mj,removeScrollBar:h,shards:g,noRelative:w,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:z}),c?x.cloneElement(x.Children.only(f),Kr(Kr({},M),{ref:O})):x.createElement(N,Kr({},M,{className:m,ref:O}),f))});wf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wf.classNames={fullWidth:Fd,zeroRight:$d};var AO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=AO();return t&&e.setAttribute("nonce",t),e}function zO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function OO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var DO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=RO())&&(zO(t,n),OO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},MO=function(){var e=DO();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pj=function(){var e=MO(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},LO={left:0,top:0,right:0,gap:0},gp=function(e){return parseInt(e||"",10)||0},IO=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[gp(n),gp(a),gp(l)]},UO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return LO;var t=IO(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])}},PO=pj(),Es="data-scroll-locked",BO=function(e,t,n,a){var l=e.left,o=e.top,c=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
276
|
-
.`.concat(wO,` {
|
|
277
|
-
overflow: hidden `).concat(a,`;
|
|
278
|
-
padding-right: `).concat(f,"px ").concat(a,`;
|
|
279
|
-
}
|
|
280
|
-
body[`).concat(Es,`] {
|
|
281
|
-
overflow: hidden `).concat(a,`;
|
|
282
|
-
overscroll-behavior: contain;
|
|
283
|
-
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
284
|
-
padding-left: `.concat(l,`px;
|
|
285
|
-
padding-top: `).concat(o,`px;
|
|
286
|
-
padding-right: `).concat(c,`px;
|
|
287
|
-
margin-left:0;
|
|
288
|
-
margin-top:0;
|
|
289
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
290
|
-
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.`).concat($d,` {
|
|
294
|
-
right: `).concat(f,"px ").concat(a,`;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.`).concat(Fd,` {
|
|
298
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.`).concat($d," .").concat($d,` {
|
|
302
|
-
right: 0 `).concat(a,`;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.`).concat(Fd," .").concat(Fd,` {
|
|
306
|
-
margin-right: 0 `).concat(a,`;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
body[`).concat(Es,`] {
|
|
310
|
-
`).concat(SO,": ").concat(f,`px;
|
|
311
|
-
}
|
|
312
|
-
`)},K1=function(){var e=parseInt(document.body.getAttribute(Es)||"0",10);return isFinite(e)?e:0},$O=function(){x.useEffect(function(){return document.body.setAttribute(Es,(K1()+1).toString()),function(){var e=K1()-1;e<=0?document.body.removeAttribute(Es):document.body.setAttribute(Es,e.toString())}},[])},FO=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;$O();var o=x.useMemo(function(){return UO(l)},[l]);return x.createElement(PO,{styles:BO(o,!t,l,n?"":"!important")})},jg=!1;if(typeof window<"u")try{var jd=Object.defineProperty({},"passive",{get:function(){return jg=!0,!0}});window.addEventListener("test",jd,jd),window.removeEventListener("test",jd,jd)}catch{jg=!1}var hs=jg?{passive:!1}:!1,qO=function(e){return e.tagName==="TEXTAREA"},gj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!qO(e)&&n[t]==="visible")},HO=function(e){return gj(e,"overflowY")},ZO=function(e){return gj(e,"overflowX")},G1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=yj(e,a);if(l){var o=vj(e,a),c=o[1],f=o[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},VO=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},QO=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},yj=function(e,t){return e==="v"?HO(t):ZO(t)},vj=function(e,t){return e==="v"?VO(t):QO(t)},KO=function(e,t){return e==="h"&&t==="rtl"?-1:1},GO=function(e,t,n,a,l){var o=KO(e,window.getComputedStyle(t).direction),c=o*a,f=n.target,m=t.contains(f),h=!1,y=c>0,g=0,b=0;do{if(!f)break;var w=vj(e,f),k=w[0],j=w[1],E=w[2],C=j-E-o*k;(k||C)&&yj(e,f)&&(g+=C,b+=k);var N=f.parentNode;f=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}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]},Y1=function(e){return[e.deltaX,e.deltaY]},X1=function(e){return e&&"current"in e?e.current:e},YO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},XO=function(e){return`
|
|
313
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
314
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
315
|
-
`)},JO=0,ms=[];function WO(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(JO++)[0],o=x.useState(pj)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=xO([e.lockRef.current],(e.shards||[]).map(X1),!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!c.current.allowPinchZoom;var C=Cd(j),N=n.current,z="deltaX"in j?j.deltaX:N[0]-C[0],L="deltaY"in j?j.deltaY:N[1]-C[1],D,O=j.target,M=Math.abs(z)>Math.abs(L)?"h":"v";if("touches"in j&&M==="h"&&O.type==="range")return!1;var U=window.getSelection(),Y=U&&U.anchorNode,F=Y?Y===O||Y.contains(O):!1;if(F)return!1;var J=G1(M,O);if(!J)return!0;if(J?D=M:(D=M==="v"?"h":"v",J=G1(M,O)),!J)return!1;if(!a.current&&"changedTouches"in j&&(z||L)&&(a.current=D),!D)return!0;var ee=a.current||D;return GO(ee,E,j,ee==="h"?z:L)},[]),m=x.useCallback(function(j){var E=j;if(!(!ms.length||ms[ms.length-1]!==o)){var C="deltaY"in E?Y1(E):Cd(E),N=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&YO(D.delta,C)})[0];if(N&&N.should){E.cancelable&&E.preventDefault();return}if(!N){var z=(c.current.shards||[]).map(X1).filter(Boolean).filter(function(D){return D.contains(E.target)}),L=z.length>0?f(E,z[0]):!c.current.noIsolation;L&&E.cancelable&&E.preventDefault()}}},[]),h=x.useCallback(function(j,E,C,N){var z={name:j,delta:E,target:C,should:N,shadowParent:eD(C)};t.current.push(z),setTimeout(function(){t.current=t.current.filter(function(L){return L!==z})},1)},[]),y=x.useCallback(function(j){n.current=Cd(j),a.current=void 0},[]),g=x.useCallback(function(j){h(j.type,Y1(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 ms.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,hs),document.addEventListener("touchmove",m,hs),document.addEventListener("touchstart",y,hs),function(){ms=ms.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,hs),document.removeEventListener("touchmove",m,hs),document.removeEventListener("touchstart",y,hs)}},[]);var w=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:XO(l)}):null,w?x.createElement(FO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function eD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const tD=TO(mj,WO);var bj=x.forwardRef(function(e,t){return x.createElement(wf,Kr({},e,{ref:t,sideCar:tD}))});bj.classNames=wf.classNames;var nD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ps=new WeakMap,Ed=new WeakMap,Nd={},yp=0,xj=function(e){return e&&(e.host||xj(e.parentNode))},rD=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=xj(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})},aD=function(e,t,n,a){var l=rD(t,Array.isArray(e)?e:[e]);Nd[n]||(Nd[n]=new WeakMap);var o=Nd[n],c=[],f=new Set,m=new Set(l),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};l.forEach(h);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))y(b);else try{var w=b.getAttribute(a),k=w!==null&&w!=="false",j=(ps.get(b)||0)+1,E=(o.get(b)||0)+1;ps.set(b,j),o.set(b,E),c.push(b),j===1&&k&&Ed.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(),yp++,function(){c.forEach(function(g){var b=ps.get(g)-1,w=o.get(g)-1;ps.set(g,b),o.set(g,w),b||(Ed.has(g)||g.removeAttribute(a),Ed.delete(g)),w||g.removeAttribute(n)}),yp--,yp||(ps=new WeakMap,ps=new WeakMap,Ed=new WeakMap,Nd={})}},iD=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=nD(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),aD(a,l,n,"aria-hidden")):function(){return null}},Sf="Dialog",[wj]=U3(Sf),[lD,Ur]=wj(Sf),Sj=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:c=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,y]=q3({prop:a,defaultProp:l??!1,onChange:o,caller:Sf});return u.jsx(lD,{scope:t,triggerRef:f,contentRef:m,contentId:_a(),titleId:_a(),descriptionId:_a(),open:h,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};Sj.displayName=Sf;var kj="DialogTrigger",jj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(kj,n),o=jl(t,l.triggerRef);return u.jsx(za.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":ky(l.open),...a,ref:o,onClick:Ei(e.onClick,l.onOpenToggle)})});jj.displayName=kj;var wy="DialogPortal",[sD,Cj]=wj(wy,{forceMount:void 0}),Ej=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Ur(wy,t);return u.jsx(sD,{scope:t,forceMount:n,children:x.Children.map(a,c=>u.jsx(xf,{present:n||o.open,children:u.jsx(dj,{asChild:!0,container:l,children:c})}))})};Ej.displayName=wy;var Jd="DialogOverlay",Nj=x.forwardRef((e,t)=>{const n=Cj(Jd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Ur(Jd,e.__scopeDialog);return o.modal?u.jsx(xf,{present:a||o.open,children:u.jsx(uD,{...l,ref:t})}):null});Nj.displayName=Jd;var oD=ij("DialogOverlay.RemoveScroll"),uD=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(Jd,n);return u.jsx(bj,{as:oD,allowPinchZoom:!0,shards:[l.contentRef],children:u.jsx(za.div,{"data-state":ky(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),gl="DialogContent",_j=x.forwardRef((e,t)=>{const n=Cj(gl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Ur(gl,e.__scopeDialog);return u.jsx(xf,{present:a||o.open,children:o.modal?u.jsx(cD,{...l,ref:t}):u.jsx(dD,{...l,ref:t})})});_j.displayName=gl;var cD=x.forwardRef((e,t)=>{const n=Ur(gl,e.__scopeDialog),a=x.useRef(null),l=jl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return iD(o)},[]),u.jsx(Tj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ei(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ei(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&o.preventDefault()}),onFocusOutside:Ei(e.onFocusOutside,o=>o.preventDefault())})}),dD=x.forwardRef((e,t)=>{const n=Ur(gl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return u.jsx(Tj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,f;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),Tj=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...c}=e,f=Ur(gl,n),m=x.useRef(null),h=jl(t,m);return bO(),u.jsxs(u.Fragment,{children:[u.jsx(uj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:u.jsx(sj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":ky(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(fD,{titleId:f.titleId}),u.jsx(mD,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Sy="DialogTitle",Aj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(Sy,n);return u.jsx(za.h2,{id:l.titleId,...a,ref:t})});Aj.displayName=Sy;var Rj="DialogDescription",zj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(Rj,n);return u.jsx(za.p,{id:l.descriptionId,...a,ref:t})});zj.displayName=Rj;var Oj="DialogClose",Dj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(Oj,n);return u.jsx(za.button,{type:"button",...a,ref:t,onClick:Ei(e.onClick,()=>l.onOpenChange(!1))})});Dj.displayName=Oj;function ky(e){return e?"open":"closed"}var Mj="DialogTitleWarning",[dZ,Lj]=I3(Mj,{contentName:gl,titleName:Sy,docsSlug:"dialog"}),fD=({titleId:e})=>{const t=Lj(Mj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
316
|
-
|
|
317
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
318
|
-
|
|
319
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},hD="DialogDescriptionWarning",mD=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Lj(hD).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},Ij=Sj,pD=jj,Uj=Ej,Pj=Nj,Bj=_j,gD=Aj,yD=zj,vD=Dj,bD=Symbol.for("react.lazy"),Wd=Yg[" use ".trim().toString()];function xD(e){return typeof e=="object"&&e!==null&&"then"in e}function $j(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===bD&&"_payload"in e&&xD(e._payload)}function Fj(e){const t=SD(e),n=x.forwardRef((a,l)=>{let{children:o,...c}=a;$j(o)&&typeof Wd=="function"&&(o=Wd(o._payload));const f=x.Children.toArray(o),m=f.find(jD);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var wD=Fj("Slot");function SD(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if($j(l)&&typeof Wd=="function"&&(l=Wd(l._payload)),x.isValidElement(l)){const c=ED(l),f=CD(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kD=Symbol("radix.slottable");function jD(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kD}function CD(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 ED(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 ND=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oa=ND.reduce((e,t)=>{const n=Fj(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),ou='[cmdk-group=""]',vp='[cmdk-group-items=""]',_D='[cmdk-group-heading=""]',qj='[cmdk-item=""]',J1=`${qj}:not([aria-disabled="true"])`,Cg="cmdk-item-select",bs="data-value",TD=(e,t,n)=>L3(e,t,n),Hj=x.createContext(void 0),Gu=()=>x.useContext(Hj),Zj=x.createContext(void 0),jy=()=>x.useContext(Zj),Vj=x.createContext(void 0),Qj=x.forwardRef((e,t)=>{let n=xs(()=>{var B,A;return{search:"",value:(A=(B=e.value)!=null?B:e.defaultValue)!=null?A:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=xs(()=>new Set),l=xs(()=>new Map),o=xs(()=>new Map),c=xs(()=>new Set),f=Kj(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:w,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,N=_a(),z=_a(),L=_a(),D=x.useRef(null),O=BD();yl(()=>{if(y!==void 0){let B=y.trim();n.current.value=B,M.emit()}},[y]),yl(()=>{O(6,we)},[]);let M=x.useMemo(()=>({subscribe:B=>(c.current.add(B),()=>c.current.delete(B)),snapshot:()=>n.current,setState:(B,A,q)=>{var G,ce,be,xe;if(!Object.is(n.current[B],A)){if(n.current[B]=A,B==="search")ee(),F(),O(1,J);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let me=document.getElementById(L);me?me.focus():(G=document.getElementById(N))==null||G.focus()}if(O(7,()=>{var me;n.current.selectedItemId=(me=le())==null?void 0:me.id,M.emit()}),q||O(5,we),((ce=f.current)==null?void 0:ce.value)!==void 0){let me=A??"";(xe=(be=f.current).onValueChange)==null||xe.call(be,me);return}}M.emit()}},emit:()=>{c.current.forEach(B=>B())}}),[]),U=x.useMemo(()=>({value:(B,A,q)=>{var G;A!==((G=o.current.get(B))==null?void 0:G.value)&&(o.current.set(B,{value:A,keywords:q}),n.current.filtered.items.set(B,Y(A,q)),O(2,()=>{F(),M.emit()}))},item:(B,A)=>(a.current.add(B),A&&(l.current.has(A)?l.current.get(A).add(B):l.current.set(A,new Set([B]))),O(3,()=>{ee(),F(),n.current.value||J(),M.emit()}),()=>{o.current.delete(B),a.current.delete(B),n.current.filtered.items.delete(B);let q=le();O(4,()=>{ee(),(q==null?void 0:q.getAttribute("id"))===B&&J(),M.emit()})}),group:B=>(l.current.has(B)||l.current.set(B,new Set),()=>{o.current.delete(B),l.current.delete(B)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:N,inputId:L,labelId:z,listInnerRef:D}),[]);function Y(B,A){var q,G;let ce=(G=(q=f.current)==null?void 0:q.filter)!=null?G:TD;return B?ce(B,n.current.search,A):0}function F(){if(!n.current.search||f.current.shouldFilter===!1)return;let B=n.current.filtered.items,A=[];n.current.filtered.groups.forEach(G=>{let ce=l.current.get(G),be=0;ce.forEach(xe=>{let me=B.get(xe);be=Math.max(me,be)}),A.push([G,be])});let q=D.current;ne().sort((G,ce)=>{var be,xe;let me=G.getAttribute("id"),Xe=ce.getAttribute("id");return((be=B.get(Xe))!=null?be:0)-((xe=B.get(me))!=null?xe:0)}).forEach(G=>{let ce=G.closest(vp);ce?ce.appendChild(G.parentElement===ce?G:G.closest(`${vp} > *`)):q.appendChild(G.parentElement===q?G:G.closest(`${vp} > *`))}),A.sort((G,ce)=>ce[1]-G[1]).forEach(G=>{var ce;let be=(ce=D.current)==null?void 0:ce.querySelector(`${ou}[${bs}="${encodeURIComponent(G[0])}"]`);be==null||be.parentElement.appendChild(be)})}function J(){let B=ne().find(q=>q.getAttribute("aria-disabled")!=="true"),A=B==null?void 0:B.getAttribute(bs);M.setState("value",A||void 0)}function ee(){var B,A,q,G;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ce=0;for(let be of a.current){let xe=(A=(B=o.current.get(be))==null?void 0:B.value)!=null?A:"",me=(G=(q=o.current.get(be))==null?void 0:q.keywords)!=null?G:[],Xe=Y(xe,me);n.current.filtered.items.set(be,Xe),Xe>0&&ce++}for(let[be,xe]of l.current)for(let me of xe)if(n.current.filtered.items.get(me)>0){n.current.filtered.groups.add(be);break}n.current.filtered.count=ce}function we(){var B,A,q;let G=le();G&&(((B=G.parentElement)==null?void 0:B.firstChild)===G&&((q=(A=G.closest(ou))==null?void 0:A.querySelector(_D))==null||q.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function le(){var B;return(B=D.current)==null?void 0:B.querySelector(`${qj}[aria-selected="true"]`)}function ne(){var B;return Array.from(((B=D.current)==null?void 0:B.querySelectorAll(J1))||[])}function Z(B){let A=ne()[B];A&&M.setState("value",A.getAttribute(bs))}function te(B){var A;let q=le(),G=ne(),ce=G.findIndex(xe=>xe===q),be=G[ce+B];(A=f.current)!=null&&A.loop&&(be=ce+B<0?G[G.length-1]:ce+B===G.length?G[0]:G[ce+B]),be&&M.setState("value",be.getAttribute(bs))}function ie(B){let A=le(),q=A==null?void 0:A.closest(ou),G;for(;q&&!G;)q=B>0?UD(q,ou):PD(q,ou),G=q==null?void 0:q.querySelector(J1);G?M.setState("value",G.getAttribute(bs)):te(B)}let ve=()=>Z(ne().length-1),_=B=>{B.preventDefault(),B.metaKey?ve():B.altKey?ie(1):te(1)},P=B=>{B.preventDefault(),B.metaKey?Z(0):B.altKey?ie(-1):te(-1)};return x.createElement(Oa.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:B=>{var A;(A=C.onKeyDown)==null||A.call(C,B);let q=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||q))switch(B.key){case"n":case"j":{E&&B.ctrlKey&&_(B);break}case"ArrowDown":{_(B);break}case"p":case"k":{E&&B.ctrlKey&&P(B);break}case"ArrowUp":{P(B);break}case"Home":{B.preventDefault(),Z(0);break}case"End":{B.preventDefault(),ve();break}case"Enter":{B.preventDefault();let G=le();if(G){let ce=new Event(Cg);G.dispatchEvent(ce)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:FD},m),kf(e,B=>x.createElement(Zj.Provider,{value:M},x.createElement(Hj.Provider,{value:U},B))))}),AD=x.forwardRef((e,t)=>{var n,a;let l=_a(),o=x.useRef(null),c=x.useContext(Vj),f=Gu(),m=Kj(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;yl(()=>{if(!h)return f.item(l,c==null?void 0:c.id)},[h]);let y=Gj(l,o,[e.value,e.children,o],e.keywords),g=jy(),b=Ti(O=>O.value&&O.value===y.current),w=Ti(O=>h||f.filter()===!1?!0:O.search?O.filtered.items.get(l)>0:!0);x.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(Cg,k),()=>O.removeEventListener(Cg,k)},[w,e.onSelect,e.disabled]);function k(){var O,M;j(),(M=(O=m.current).onSelect)==null||M.call(O,y.current)}function j(){g.setState("value",y.current,!0)}if(!w)return null;let{disabled:E,value:C,onSelect:N,forceMount:z,keywords:L,...D}=e;return x.createElement(Oa.div,{ref:_i(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)}),RD=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=_a(),f=x.useRef(null),m=x.useRef(null),h=_a(),y=Gu(),g=Ti(w=>l||y.filter()===!1?!0:w.search?w.filtered.groups.has(c):!0);yl(()=>y.group(c),[]),Gj(c,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:c,forceMount:l}),[l]);return x.createElement(Oa.div,{ref:_i(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),kf(e,w=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(Vj.Provider,{value:b},w))))}),zD=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Ti(c=>!c.search);return!n&&!o?null:x.createElement(Oa.div,{ref:_i(l,t),...a,"cmdk-separator":"",role:"separator"})}),OD=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=jy(),c=Ti(h=>h.search),f=Ti(h=>h.selectedItemId),m=Gu();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Oa.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:l?e.value:c,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),DD=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),c=x.useRef(null),f=Ti(h=>h.selectedItemId),m=Gu();return x.useEffect(()=>{if(c.current&&o.current){let h=c.current,y=o.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;y.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),x.createElement(Oa.div,{ref:_i(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},kf(e,h=>x.createElement("div",{ref:_i(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),MD=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...f}=e;return x.createElement(Ij,{open:n,onOpenChange:a},x.createElement(Uj,{container:c},x.createElement(Pj,{"cmdk-overlay":"",className:l}),x.createElement(Bj,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(Qj,{ref:t,...f}))))}),LD=x.forwardRef((e,t)=>Ti(n=>n.filtered.count===0)?x.createElement(Oa.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ID=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Oa.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},kf(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),Kn=Object.assign(Qj,{List:DD,Item:AD,Input:OD,Group:RD,Separator:zD,Dialog:MD,Empty:LD,Loading:ID});function UD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function PD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Kj(e){let t=x.useRef(e);return yl(()=>{t.current=e}),t}var yl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function xs(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ti(e){let t=jy(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Gj(e,t,n,a=[]){let l=x.useRef(),o=Gu();return yl(()=>{var c;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(c=t.current)==null||c.setAttribute(bs,f),l.current=f}),l}var BD=()=>{let[e,t]=x.useState(),n=xs(()=>new Map);return yl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function $D(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function kf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement($D(t),{ref:t.ref},n(t.props.children)):n(t)}var FD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const $t=Ij,qD=pD,HD=Uj,Yj=x.forwardRef(({className:e,...t},n)=>u.jsx(Pj,{ref:n,className:Ae("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}));Yj.displayName="DialogOverlay";const zt=x.forwardRef(({className:e,children:t,...n},a)=>u.jsxs(HD,{children:[u.jsx(Yj,{}),u.jsxs(Bj,{ref:a,className:Ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,u.jsxs(vD,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(Gd,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zt.displayName="DialogContent";function Kt({className:e,...t}){return u.jsx("div",{className:Ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function tn({className:e,...t}){return u.jsx("div",{className:Ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const Ft=x.forwardRef(({className:e,...t},n)=>u.jsx(gD,{ref:n,className:Ae("text-subtitle leading-none tracking-tight",e),...t}));Ft.displayName="DialogTitle";const jf=x.forwardRef(({className:e,...t},n)=>u.jsx(yD,{ref:n,className:Ae("text-body text-muted-foreground",e),...t}));jf.displayName="DialogDescription";const Xj=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn,{ref:n,className:Ae("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Xj.displayName=Kn.displayName;function ZD({open:e,onOpenChange:t,children:n}){return u.jsx($t,{open:e,onOpenChange:t,children:u.jsx(zt,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(Xj,{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 Jj=x.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(bf,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Kn.Input,{ref:n,className:Ae("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})]}));Jj.displayName=Kn.Input.displayName;const Wj=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn.List,{ref:n,className:Ae("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Wj.displayName=Kn.List.displayName;const eC=x.forwardRef((e,t)=>u.jsx(Kn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));eC.displayName=Kn.Empty.displayName;const qd=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn.Group,{ref:n,className:Ae("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}));qd.displayName=Kn.Group.displayName;const Eg=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn.Separator,{ref:n,className:Ae("-mx-1 h-px bg-border",e),...t}));Eg.displayName=Kn.Separator.displayName;const Hd=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn.Item,{ref:n,className:Ae("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}));Hd.displayName=Kn.Item.displayName;function Yu(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.type&&t.set("type",e.type);const n=t.toString();return ke.get(`/admin/agents${n?`?${n}`:""}`)}function tC(){return ke.get("/me/managed-agents")}function VD(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return ke.get(`/admin/agents/all${n?`?${n}`:""}`)}function nC(e){return ke.get(`/admin/agents/${encodeURIComponent(e)}`)}function QD(e){return ke.post("/admin/agents",e)}function KD(e){return ke.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function W1(e,t){return ke.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function GD(e,t){return ke.patch(`/admin/agents/${encodeURIComponent(e)}/rebind`,t)}function YD(e){return ke.delete(`/admin/agents/${encodeURIComponent(e)}`)}function XD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function JD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function WD(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function Cl(){const{data:e}=$e({queryKey:["agents","name-map"],queryFn:()=>Yu({limit:100}),staleTime:3e4}),{data:t}=$e({queryKey:["managed-agents","name-map"],queryFn:tC,staleTime:3e4});return x.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,a.displayName);if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,a.displayName);return a=>a?n.get(a)??a:"—"},[e,t])}function Cy(){const{data:e}=$e({queryKey:["agents","name-map"],queryFn:()=>Yu({limit:100}),staleTime:3e4}),{data:t}=$e({queryKey:["managed-agents","name-map"],queryFn:tC,staleTime:3e4});return x.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,{name:a.name,displayName:a.displayName});if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,{name:a.name,displayName:a.displayName});return a=>a?n.get(a)??null:null},[e,t])}const e4=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function t4({open:e,onOpenChange:t}){const n=fn(),a=Cl(),{data:l}=$e({queryKey:["activity"],queryFn:Ku,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=$e({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await eo(y.agentId);for(const b of g)h.push({agentId:y.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return u.jsxs(ZD,{open:e,onOpenChange:t,children:[u.jsx(Jj,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(Wj,{children:[u.jsx(eC,{children:"No results"}),o.length>0&&u.jsx(qd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return u.jsxs(Hd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[u.jsx(LR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:y}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(Eg,{}),u.jsx(qd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return u.jsxs(Hd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[u.jsx(py,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:g}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),u.jsx(Eg,{}),u.jsx(qd,{heading:"Pages",children:e4.map(h=>u.jsxs(Hd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[u.jsx(KR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:h.label})]},h.path))})]})]})}function n4(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function r4(){var a;const{user:e}=qt(),{data:t}=$e({queryKey:["clients"],queryFn:Ra,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=n4(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const a4=160;function i4(){const e=fn(),{rows:t,firstHostname:n}=r4();if(t.length===0)return null;const a=t.length>1,l=a?`${t.length} computers disconnected. Click to manage.`:`${n??"Your computer"} is disconnected. Click to manage.`;return u.jsxs("button",{type:"button",onClick:()=>e("/clients"),title:l,"aria-label":l,className:"inline-flex items-center cursor-pointer text-body font-medium",style:{gap:8,height:26,padding:"0 var(--sp-2_5) 0 var(--sp-2_25)",borderRadius:999,border:0,outline:"var(--hairline) solid color-mix(in oklch, var(--state-error) 38%, transparent)",outlineOffset:-1,background:"color-mix(in oklch, var(--state-error) 14%, transparent)",color:"color-mix(in oklch, var(--state-error) 80%, var(--fg))",minWidth:0},children:[u.jsx(l4,{}),a?u.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[u.jsx("span",{className:"font-semibold",children:t.length})," computers disconnected"]}):u.jsxs("span",{className:"inline-flex items-center",style:{gap:5,minWidth:0},children:[u.jsx("span",{className:"mono text-label font-medium",style:{maxWidth:a4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"color-mix(in oklch, var(--state-error) 60%, var(--fg))"},children:n??"computer"}),u.jsx("span",{style:{flexShrink:0},children:"disconnected"})]})]})}function l4(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:8,height:8,flexShrink:0,display:"inline-block"},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-error)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-error)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]})}function to(e){return u.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),u.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),u.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),u.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),u.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),u.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function Ng(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.severity&&t.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&t.set("read",String(e.read)),e!=null&&e.agentId&&t.set("agentId",e.agentId);const n=t.toString();return ke.get(`/admin/notifications${n?`?${n}`:""}`)}function rC(e){return ke.post(`/admin/notifications/${e}/read`)}function s4(){return ke.post("/admin/notifications/read-all")}const o4={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 u4(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function aC({notification:e,onClick:t,clickable:n}){const a=(o4[e.type]??e.type).toString(),l=u4(e.severity),o=n??!0;return u.jsxs("button",{type:"button",onClick:t,className:Ae("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:c=>{o&&(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{c.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[u.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[u.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:Ni(e.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function c4(){var w;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=fn(),c=dn(),{data:f}=$e({queryKey:["notifications","bell"],queryFn:()=>Ng({limit:8}),refetchInterval:1e4}),{data:m}=$e({queryKey:["notifications","unread-count"],queryFn:()=>Ng({read:!1,limit:100}),refetchInterval:1e4}),h=((w=m==null?void 0:m.items)==null?void 0:w.length)??0,y=h>0,g=x.useCallback(async k=>{k.read||(rC(k.id).catch(()=>{}),c.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,c]),b=x.useCallback(async()=>{a(null);try{await s4(),await c.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[c]);return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{type:"button",onClick:()=>t(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[u.jsx(DR,{className:"h-4 w-4"}),y&&u.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium text-label",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)"},children:h>99?"99+":h})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),u.jsxs("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50",style:{width:320,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6,boxShadow:"var(--shadow-md)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&u.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_5) var(--sp-3)",color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:n}),u.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(f!=null&&f.items)||f.items.length===0?u.jsx("div",{className:"text-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-4_5) 0"},children:"No notifications"}):f.items.map(k=>u.jsx(aC,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function d4(){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 f4(){const[e,t]=x.useState(d4);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),u.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:e==="dark"?u.jsx(bz,{className:"h-4 w-4"}):u.jsx(rz,{className:"h-4 w-4"})})}function h4(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function ew({src:e,name:t,size:n=28,className:a}){const l=`${n}px`;return e?u.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",display:"block"}}):u.jsx("span",{className:a,role:"img","aria-label":t,style:{width:l,height:l,borderRadius:"50%",background:"var(--accent)",color:"var(--bg-raised)",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,userSelect:"none"},children:u.jsx("span",{className:"text-subtitle font-semibold",children:h4(t)})})}const tw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,nw=$k,m4=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return nw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,c=Object.keys(l).map(h=>{const y=n==null?void 0:n[h],g=o==null?void 0:o[h];if(y===null)return null;const b=tw(y)||tw(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,...w}=y;return Object.entries(w).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,b]:h},[]);return nw(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},p4=m4("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"}}),he=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?wD:"button";return u.jsx(c,{className:Ae(p4({variant:t,size:n,className:e})),ref:o,...l})});he.displayName="Button";const jt=x.forwardRef(({className:e,type:t,...n},a)=>u.jsx("input",{type:t,className:Ae("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}));jt.displayName="Input";function g4({action:e,onClose:t}){const n=e!==null;return u.jsx($t,{open:n,onOpenChange:a=>!a&&t(),children:u.jsxs(zt,{children:[u.jsxs(Kt,{children:[u.jsx(Ft,{children:e==="join"?"Join a team":"Create a new team"}),u.jsx(jf,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&u.jsx(v4,{onDone:t}),e==="join"&&u.jsx(b4,{onDone:t})]})})}function y4(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function v4({onDone:e}){const{adoptTokens:t}=qt(),n=fn(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{y.preventDefault();const g=a.trim();if(g){m(!0),c(null);try{const b=await ke.post("/me/organizations",{name:y4(g),displayName:g});await t(b.tokens),e(),n("/",{replace:!0})}catch(b){c(b instanceof Error?b.message:"Failed to create team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(jt,{id:"team-display-name","aria-label":"Team name",value:a,onChange:y=>l(y.target.value),placeholder:"Acme Robotics",autoFocus:!0}),u.jsx(he,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function b4({onDone:e}){const{adoptTokens:t}=qt(),n=fn(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{if(y.preventDefault(),!!a.trim()){m(!0),c(null);try{const g=a.trim(),b=/\/invite\/([^/?#]+)/.exec(g),w=(b==null?void 0:b[1])??g,k=await ke.post("/me/organizations/join",{token:w});await t(k.tokens),e(),n("/",{replace:!0})}catch(g){c(g instanceof Error?g.message:"Failed to join team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(jt,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:y=>l(y.target.value),placeholder:"abc123… or https://hub/invite/abc123",autoFocus:!0}),u.jsx(he,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function x4(){var N;const{organizationId:e,user:t,selectOrganization:n,logout:a}=qt(),l=fn(),[o,c]=x.useState([]),[f,m]=x.useState(!1),[h,y]=x.useState(null),g=x.useRef(null);x.useEffect(()=>{(async()=>{try{const z=await ke.get("/me/organizations");c(z)}catch{}})()},[]),x.useEffect(()=>{const z=D=>{f&&g.current&&!g.current.contains(D.target)&&m(!1)},L=D=>{f&&D.key==="Escape"&&m(!1)};return window.addEventListener("mousedown",z),window.addEventListener("keydown",L),()=>{window.removeEventListener("mousedown",z),window.removeEventListener("keydown",L)}},[f]);const b=(t==null?void 0:t.displayName)??"User",w=(t==null?void 0:t.username)??"",k=(t==null?void 0:t.avatarUrl)??null,j=async z=>{if(z===e){m(!1);return}try{await n(z),m(!1),l("/",{replace:!0})}catch{}},E=()=>{m(!1),y("create")},C=()=>{m(!1),y("join")};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:g,className:"relative","data-testid":"user-menu",children:[u.jsx("button",{type:"button","aria-label":`User menu, ${b}`,"aria-haspopup":"menu","aria-expanded":f,onClick:()=>m(z=>!z),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:f?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:u.jsx(ew,{src:k,name:b,size:28})}),f&&u.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[u.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[u.jsx(ew,{src:k,name:b,size:32}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:b}),w&&w!==b&&u.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",w]})]})]}),o.length>0&&u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Team"}),o.length===1?u.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:u.jsx(cr,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"truncate",children:(N=o[0])==null?void 0:N.displayName})]}):u.jsx("div",{children:o.map(z=>u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void j(z.id),className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:z.id===e?u.jsx(cr,{className:"h-3.5 w-3.5"}):null}),u.jsx("span",{className:"truncate",children:z.displayName})]},z.id))})]}),u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:E,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(Jr,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Create new team"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:C,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(Nz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Join with invite link"})]})]}),u.jsxs("div",{className:"py-1",children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),l("/settings")},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(pz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Settings"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),a()},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(ez,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Sign out"})]})]})]})]}),u.jsx(g4,{action:h,onClose:()=>y(null)})]})}const rw=[{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"}],w4={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function S4(){const{role:e}=qt(),t=e==="admin",[n,a]=x.useState(!1),l=t?[...rw,w4]:rw,o=Mn(),c=o.pathname==="/"||o.search.includes("a=");return x.useEffect(()=>{const f=m=>{(m.metaKey||m.ctrlKey)&&m.key.toLowerCase()==="k"&&(m.preventDefault(),a(h=>!h))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]),u.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[u.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"1fr auto 1fr",gap:"var(--sp-3)",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3_5)",justifySelf:"start",minWidth:0},children:[u.jsxs("span",{className:"flex items-center",style:{gap:10,flexShrink:0},children:[u.jsx(to,{width:16,height:18,style:{color:"var(--fg)"}}),u.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",u.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),u.jsx(i4,{})]}),u.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:l.map(f=>u.jsx(Tk,{to:f.to,end:f.end,style:{pointerEvents:"auto"},className:({isActive:m})=>Ae("inline-flex items-center transition-colors",m?"":"hover:text-[var(--fg)]"),children:({isActive:m})=>u.jsxs("span",{className:"inline-flex items-center text-subtitle font-medium",style:{padding:"var(--sp-1_5) var(--sp-3)",gap:6,borderRadius:5,color:m?"var(--fg)":"var(--fg-3)",background:m?"var(--bg-hover)":"transparent"},children:[f.label,m&&u.jsx("span",{className:"kbd",children:f.kbd})]})},f.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6,justifySelf:"end"},children:[u.jsxs("button",{type:"button",onClick:()=>a(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors text-body",style:{gap:8,padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)"},onMouseEnter:f=>{f.currentTarget.style.color="var(--fg)"},onMouseLeave:f=>{f.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(bf,{className:"h-4 w-4"}),u.jsx("span",{children:"Jump to…"}),u.jsx("span",{className:"kbd",children:"⌘K"})]}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(c4,{}),u.jsx(f4,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(x4,{})]})]}),u.jsx(t4,{open:n,onOpenChange:a}),c?u.jsx(mg,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:u.jsx(mg,{})})})]})}function oe(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=c.prototype,y=Object.keys(h);for(let g=0;g<y.length;g++){const b=y[g];b in f||(f[b]=h[b].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function c(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class Ns extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class iC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const lC={};function Ai(e){return lC}function sC(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 _g(e,t){return typeof t=="bigint"?t.toString():t}function Cf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ey(e){return e==null}function Ny(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function k4(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let l=(a.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,c=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return c%f/10**o}const aw=Symbol("evaluating");function mt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==aw)return a===void 0&&(a=aw,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function El(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Oi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function iw(e){return JSON.stringify(e)}function j4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const oC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Tu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const C4=Cf(()=>{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 Zs(e){if(Tu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Tu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function uC(e){return Zs(e)?{...e}:Array.isArray(e)?[...e]:e}const E4=new Set(["string","number","symbol"]);function Vs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Di(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(a._zod.parent=e),a}function Re(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 N4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _4={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 T4(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Oi(e._zod.def,{get shape(){const c={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(c[f]=n.shape[f])}return El(this,"shape",c),c},checks:[]});return Di(e,o)}function A4(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Oi(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete c[f]}return El(this,"shape",c),c},checks:[]});return Di(e,o)}function R4(e,t){if(!Zs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const c in t)if(Object.getOwnPropertyDescriptor(o,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Oi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return El(this,"shape",o),o}});return Di(e,l)}function z4(e,t){if(!Zs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return El(this,"shape",a),a}});return Di(e,n)}function O4(e,t){const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return El(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Di(e,n)}function D4(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Oi(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return El(this,"shape",m),m},checks:[]});return Di(t,c)}function M4(e,t,n){const a=Oi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const c in n){if(!(c in o))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(o[c]=new e({type:"nonoptional",innerType:l[c]}))}else for(const c in l)o[c]=new e({type:"nonoptional",innerType:l[c]});return El(this,"shape",o),o}});return Di(t,a)}function Ss(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 ks(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function _d(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ri(e,t,n){var l,o,c,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=_d((c=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:c.call(o,e))??_d((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??_d((m=n.customError)==null?void 0:m.call(n,e))??_d((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 _y(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Au(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const cC=(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,_g,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},dC=oe("$ZodError",cC),fC=oe("$ZodError",cC,{Parent:Error});function L4(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 I4(e,t=n=>n.message){const n={_errors:[]},a=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>a({issues:c}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let c=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(o))):c[m]=c[m]||{_errors:[]},c=c[m],f++}}};return a(e),n}const Ty=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new Ns;if(c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ai())));throw oC(f,l==null?void 0:l.callee),f}return c.value},Ay=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ai())));throw oC(f,l==null?void 0:l.callee),f}return c.value},Ef=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 Ns;return o.issues.length?{success:!1,error:new(e??dC)(o.issues.map(c=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},U4=Ef(fC),Nf=e=>async(t,n,a)=>{const l=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(c=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},P4=Nf(fC),B4=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ty(e)(t,n,l)},$4=e=>(t,n,a)=>Ty(e)(t,n,a),F4=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ay(e)(t,n,l)},q4=e=>async(t,n,a)=>Ay(e)(t,n,a),H4=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ef(e)(t,n,l)},Z4=e=>(t,n,a)=>Ef(e)(t,n,a),V4=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Nf(e)(t,n,l)},Q4=e=>async(t,n,a)=>Nf(e)(t,n,a),K4=/^[cC][^\s-]{8,}$/,G4=/^[0-9a-z]+$/,Y4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,X4=/^[0-9a-vA-V]{20}$/,J4=/^[A-Za-z0-9]{27}$/,W4=/^[a-zA-Z0-9_-]{21}$/,eM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tM=/^([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})$/,lw=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)$/,nM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function aM(){return new RegExp(rM,"u")}const iM=/^(?:(?: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])$/,lM=/^(([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}|:))$/,sM=/^((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])$/,oM=/^(([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])$/,uM=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hC=/^[A-Za-z0-9_-]*$/,cM=/^\+[1-9]\d{6,14}$/,mC="(?:(?:\\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])))",dM=new RegExp(`^${mC}$`);function pC(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 fM(e){return new RegExp(`^${pC(e)}$`)}function hM(e){const t=pC({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(`^${mC}T(?:${a})$`)}const mM=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}$`)},pM=/^-?\d+$/,gC=/^-?\d+(?:\.\d+)?$/,gM=/^(?:true|false)$/i,yM=/^[^A-Z]*$/,vM=/^[^a-z]*$/,Gn=oe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),yC={number:"number",bigint:"bigint",object:"date"},vC=oe("$ZodCheckLessThan",(e,t)=>{Gn.init(e,t);const n=yC[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})}}),bC=oe("$ZodCheckGreaterThan",(e,t)=>{Gn.init(e,t);const n=yC[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})}}),bM=oe("$ZodCheckMultipleOf",(e,t)=>{Gn.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):k4(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})}}),xM=oe("$ZodCheckNumberFormat",(e,t)=>{var c;Gn.init(e,t),t.format=t.format||"float64";const n=(c=t.format)==null?void 0:c.includes("int"),a=n?"int":"number",[l,o]=_4[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=pM)}),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})}}),wM=oe("$ZodCheckMaxLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ey(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const l=a.value;if(l.length<=t.maximum)return;const c=_y(l);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),SM=oe("$ZodCheckMinLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ey(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const l=a.value;if(l.length>=t.minimum)return;const c=_y(l);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),kM=oe("$ZodCheckLengthEquals",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ey(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=a=>{const l=a.value,o=l.length;if(o===t.length)return;const c=_y(l),f=o>t.length;a.issues.push({origin:c,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),_f=oe("$ZodCheckStringFormat",(e,t)=>{var n,a;Gn.init(e,t),e._zod.onattach.push(l=>{const o=l._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),jM=oe("$ZodCheckRegex",(e,t)=>{_f.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})}}),CM=oe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yM),_f.init(e,t)}),EM=oe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=vM),_f.init(e,t)}),NM=oe("$ZodCheckIncludes",(e,t)=>{Gn.init(e,t);const n=Vs(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})}}),_M=oe("$ZodCheckStartsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`^${Vs(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})}}),TM=oe("$ZodCheckEndsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`.*${Vs(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})}}),AM=oe("$ZodCheckOverwrite",(e,t)=>{Gn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class RM{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(`
|
|
320
|
-
`).filter(c=>c),l=Math.min(...a.map(c=>c.length-c.trimStart().length)),o=a.map(c=>c.slice(l)).map(c=>" ".repeat(this.indent*2)+c);for(const c of o)this.content.push(c)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
|
|
321
|
-
`))}}const zM={major:4,minor:3,patch:6},Ot=oe("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zM;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const c of o._zod.onattach)c(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let y=Ss(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const w=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Ns;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==w&&(y||(y=Ss(f,w)))});else{if(f.issues.length===w)continue;y||(y=Ss(f,w))}}return g?g.then(()=>f):f},c=(f,m,h)=>{if(Ss(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new Ns;return y.then(g=>e._zod.parse(g,h))}return e._zod.parse(y,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const y=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return y instanceof Promise?y.then(g=>c(g,f,m)):c(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Ns;return h.then(y=>o(y,a,m))}return o(h,a,m)}}mt(e,"~standard",()=>({validate:o=>{var c;try{const f=U4(e,o);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return P4(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}))}),Ry=oe("$ZodString",(e,t)=>{var n;Ot.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??mM(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Rt=oe("$ZodStringFormat",(e,t)=>{_f.init(e,t),Ry.init(e,t)}),OM=oe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tM),Rt.init(e,t)}),DM=oe("$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=lw(a))}else t.pattern??(t.pattern=lw());Rt.init(e,t)}),MM=oe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=nM),Rt.init(e,t)}),LM=oe("$ZodURL",(e,t)=>{Rt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),l=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=l.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),IM=oe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=aM()),Rt.init(e,t)}),UM=oe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=W4),Rt.init(e,t)}),PM=oe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=K4),Rt.init(e,t)}),BM=oe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=G4),Rt.init(e,t)}),$M=oe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Y4),Rt.init(e,t)}),FM=oe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=X4),Rt.init(e,t)}),qM=oe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=J4),Rt.init(e,t)}),HM=oe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=hM(t)),Rt.init(e,t)}),ZM=oe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=dM),Rt.init(e,t)}),VM=oe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=fM(t)),Rt.init(e,t)}),QM=oe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eM),Rt.init(e,t)}),KM=oe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=iM),Rt.init(e,t),e._zod.bag.format="ipv4"}),GM=oe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=lM),Rt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),YM=oe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=sM),Rt.init(e,t)}),XM=oe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=oM),Rt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;if(!o)throw new Error;const c=Number(o);if(`${c}`!==o)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function xC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const JM=oe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=uM),Rt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{xC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function WM(e){if(!hC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return xC(n)}const e5=oe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=hC),Rt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{WM(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),t5=oe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=cM),Rt.init(e,t)});function n5(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const l=JSON.parse(atob(a));return!("typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const r5=oe("$ZodJWT",(e,t)=>{Rt.init(e,t),e._zod.check=n=>{n5(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),wC=oe("$ZodNumber",(e,t)=>{Ot.init(e,t),e._zod.pattern=e._zod.bag.pattern??gC,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const l=n.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return n;const o=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...o?{received:o}:{}}),n}}),a5=oe("$ZodNumberFormat",(e,t)=>{xM.init(e,t),wC.init(e,t)}),i5=oe("$ZodBoolean",(e,t)=>{Ot.init(e,t),e._zod.pattern=gM,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const l=n.value;return typeof l=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),n}}),l5=oe("$ZodUnknown",(e,t)=>{Ot.init(e,t),e._zod.parse=n=>n}),s5=oe("$ZodNever",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function sw(e,t,n){e.issues.length&&t.issues.push(...ks(n,e.issues)),t.value[n]=e.value}const o5=oe("$ZodArray",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let c=0;c<l.length;c++){const f=l[c],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>sw(h,n,c))):sw(m,n,c)}return o.length?Promise.all(o).then(()=>n):n}});function ef(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...ks(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function SC(e){var a,l,o,c;const t=Object.keys(e.shape);for(const f of t)if(!((c=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=N4(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function kC(e,t,n,a,l,o){const c=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,y=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){c.push(g);continue}const b=m.run({value:t[g],issues:[]},a);b instanceof Promise?e.push(b.then(w=>ef(w,n,g,t,y))):ef(b,n,g,t,y)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const u5=oe("$ZodObject",(e,t)=>{Ot.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=Cf(()=>SC(t));mt(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=Tu,o=t.catchall;let c;e._zod.parse=(f,m)=>{c??(c=a.value);const h=f.value;if(!l(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const y=[],g=c.shape;for(const b of c.keys){const w=g[b],k=w._zod.optout==="optional",j=w._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(E=>ef(E,f,b,h,k))):ef(j,f,b,h,k)}return o?kC(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),c5=oe("$ZodObjectJIT",(e,t)=>{u5.init(e,t);const n=e._zod.parse,a=Cf(()=>SC(t)),l=b=>{var z;const w=new RM(["shape","payload","ctx"]),k=a.value,j=L=>{const D=iw(L);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};w.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const L of k.keys)E[L]=`key_${C++}`;w.write("const newResult = {};");for(const L of k.keys){const D=E[L],O=iw(L),M=b[L],U=((z=M==null?void 0:M._zod)==null?void 0:z.optout)==="optional";w.write(`const ${D} = ${j(L)};`),U?w.write(`
|
|
322
|
-
if (${D}.issues.length) {
|
|
323
|
-
if (${O} in input) {
|
|
324
|
-
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
325
|
-
...iss,
|
|
326
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
327
|
-
})));
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
if (${D}.value === undefined) {
|
|
332
|
-
if (${O} in input) {
|
|
333
|
-
newResult[${O}] = undefined;
|
|
334
|
-
}
|
|
335
|
-
} else {
|
|
336
|
-
newResult[${O}] = ${D}.value;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
`):w.write(`
|
|
340
|
-
if (${D}.issues.length) {
|
|
341
|
-
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
342
|
-
...iss,
|
|
343
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
344
|
-
})));
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
if (${D}.value === undefined) {
|
|
348
|
-
if (${O} in input) {
|
|
349
|
-
newResult[${O}] = undefined;
|
|
350
|
-
}
|
|
351
|
-
} else {
|
|
352
|
-
newResult[${O}] = ${D}.value;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
`)}w.write("payload.value = newResult;"),w.write("return payload;");const N=w.compile();return(L,D)=>N(b,L,D)};let o;const c=Tu,f=!lC.jitless,h=f&&C4.value,y=t.catchall;let g;e._zod.parse=(b,w)=>{g??(g=a.value);const k=b.value;return c(k)?f&&h&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(o||(o=l(t.shape)),b=o(b,w),y?kC([],k,b,w,g,e):b):n(b,w):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function ow(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=>!Ss(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(c=>Ri(c,a,Ai())))}),t)}const jC=oe("$ZodUnion",(e,t)=>{Ot.init(e,t),mt(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),mt(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),mt(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),mt(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=>Ny(o.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return a(l,o);let c=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),c=!0;else{if(h.issues.length===0)return h;f.push(h)}}return c?Promise.all(f).then(m=>ow(m,l,e,o)):ow(f,l,e,o)}}),d5=oe("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,jC.init(e,t);const n=e._zod.parse;mt(e._zod,"propValues",()=>{const l={};for(const o of t.options){const c=o._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(c)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=Cf(()=>{var c;const l=t.options,o=new Map;for(const f of l){const m=(c=f._zod.propValues)==null?void 0:c[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const c=l.value;if(!Tu(c))return l.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),l;const f=a.value.get(c==null?void 0:c[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),l)}}),f5=oe("$ZodIntersection",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),c=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||c instanceof Promise?Promise.all([o,c]).then(([m,h])=>uw(n,m,h)):uw(n,o,c)}});function Tg(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(Zs(e)&&Zs(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const c=Tg(e[o],t[o]);if(!c.valid)return{valid:!1,mergeErrorPath:[o,...c.mergeErrorPath]};l[o]=c.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const l=e[a],o=t[a],c=Tg(l,o);if(!c.valid)return{valid:!1,mergeErrorPath:[a,...c.mergeErrorPath]};n.push(c.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function uw(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}),Ss(e))return e;const c=Tg(t.value,n.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const h5=oe("$ZodRecord",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Zs(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],c=t.keyType._zod.values;if(c){n.value={};const f=new Set;for(const h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const y=t.valueType._zod.run({value:l[h],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...ks(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...ks(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"&&gC.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},a);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>Ri(g,a,Ai())),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(...ks(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...ks(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),m5=oe("$ZodEnum",(e,t)=>{Ot.init(e,t);const n=sC(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>E4.has(typeof l)).map(l=>typeof l=="string"?Vs(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const c=l.value;return a.has(c)||l.issues.push({code:"invalid_value",values:n,input:c,inst:e}),l}}),p5=oe("$ZodLiteral",(e,t)=>{if(Ot.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"?Vs(a):a?Vs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,l)=>{const o=a.value;return n.has(o)||a.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),a}}),g5=oe("$ZodTransform",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new iC(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(c=>(n.value=c,n));if(l instanceof Promise)throw new Ns;return n.value=l,n}});function cw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const CC=oe("$ZodOptional",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",e._zod.optout="optional",mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ny(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=>cw(o,n.value)):cw(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),y5=oe("$ZodExactOptional",(e,t)=>{CC.init(e,t),mt(e._zod,"values",()=>t.innerType._zod.values),mt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),v5=oe("$ZodNullable",(e,t)=>{Ot.init(e,t),mt(e._zod,"optin",()=>t.innerType._zod.optin),mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ny(n.source)}|null)$`):void 0}),mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),b5=oe("$ZodDefault",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",mt(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=>dw(o,t)):dw(l,t)}});function dw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const x5=oe("$ZodPrefault",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",mt(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))}),w5=oe("$ZodNonOptional",(e,t)=>{Ot.init(e,t),mt(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=>fw(o,e)):fw(l,e)}});function fw(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 S5=oe("$ZodCatch",(e,t)=>{Ot.init(e,t),mt(e._zod,"optin",()=>t.innerType._zod.optin),mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(c=>Ri(c,a,Ai()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ri(o,a,Ai()))},input:n.value}),n.issues=[]),n)}}),k5=oe("$ZodPipe",(e,t)=>{Ot.init(e,t),mt(e._zod,"values",()=>t.in._zod.values),mt(e._zod,"optin",()=>t.in._zod.optin),mt(e._zod,"optout",()=>t.out._zod.optout),mt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const o=t.out._zod.run(n,a);return o instanceof Promise?o.then(c=>Td(c,t.in,a)):Td(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>Td(o,t.out,a)):Td(l,t.out,a)}});function Td(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const j5=oe("$ZodReadonly",(e,t)=>{Ot.init(e,t),mt(e._zod,"propValues",()=>t.innerType._zod.propValues),mt(e._zod,"values",()=>t.innerType._zod.values),mt(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),mt(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(hw):hw(l)}});function hw(e){return e.value=Object.freeze(e.value),e}const C5=oe("$ZodCustom",(e,t)=>{Gn.init(e,t),Ot.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=>mw(o,n,a,e));mw(l,n,a,e)}});function mw(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(Au(l))}}var pw;class E5{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const l={...a,...this._map.get(t)};return Object.keys(l).length?l:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function N5(){return new E5}(pw=globalThis).__zod_globalRegistry??(pw.__zod_globalRegistry=N5());const pu=globalThis.__zod_globalRegistry;function _5(e,t){return new e({type:"string",...Re(t)})}function T5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(t)})}function gw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(t)})}function A5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(t)})}function R5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(t)})}function z5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(t)})}function O5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(t)})}function D5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(t)})}function M5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(t)})}function L5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(t)})}function I5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(t)})}function U5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(t)})}function P5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(t)})}function B5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(t)})}function $5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(t)})}function F5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(t)})}function q5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(t)})}function H5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(t)})}function Z5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(t)})}function V5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(t)})}function Q5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(t)})}function K5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(t)})}function G5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(t)})}function Y5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(t)})}function X5(e,t){return new e({type:"string",format:"date",check:"string_format",...Re(t)})}function J5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(t)})}function W5(e,t){return new e({type:"string",format:"duration",check:"string_format",...Re(t)})}function eL(e,t){return new e({type:"number",checks:[],...Re(t)})}function tL(e,t){return new e({type:"number",coerce:!0,checks:[],...Re(t)})}function nL(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(t)})}function rL(e,t){return new e({type:"boolean",...Re(t)})}function aL(e){return new e({type:"unknown"})}function iL(e,t){return new e({type:"never",...Re(t)})}function yw(e,t){return new vC({check:"less_than",...Re(t),value:e,inclusive:!1})}function bp(e,t){return new vC({check:"less_than",...Re(t),value:e,inclusive:!0})}function vw(e,t){return new bC({check:"greater_than",...Re(t),value:e,inclusive:!1})}function xp(e,t){return new bC({check:"greater_than",...Re(t),value:e,inclusive:!0})}function bw(e,t){return new bM({check:"multiple_of",...Re(t),value:e})}function EC(e,t){return new wM({check:"max_length",...Re(t),maximum:e})}function tf(e,t){return new SM({check:"min_length",...Re(t),minimum:e})}function NC(e,t){return new kM({check:"length_equals",...Re(t),length:e})}function lL(e,t){return new jM({check:"string_format",format:"regex",...Re(t),pattern:e})}function sL(e){return new CM({check:"string_format",format:"lowercase",...Re(e)})}function oL(e){return new EM({check:"string_format",format:"uppercase",...Re(e)})}function uL(e,t){return new NM({check:"string_format",format:"includes",...Re(t),includes:e})}function cL(e,t){return new _M({check:"string_format",format:"starts_with",...Re(t),prefix:e})}function dL(e,t){return new TM({check:"string_format",format:"ends_with",...Re(t),suffix:e})}function no(e){return new AM({check:"overwrite",tx:e})}function fL(e){return no(t=>t.normalize(e))}function hL(){return no(e=>e.trim())}function mL(){return no(e=>e.toLowerCase())}function pL(){return no(e=>e.toUpperCase())}function gL(){return no(e=>j4(e))}function yL(e,t,n){return new e({type:"array",element:t,...Re(n)})}function vL(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Re(n)})}function bL(e){const t=xL(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Au(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(Au(l))}},e(n.value,n)));return t}function xL(e,t){const n=new Gn({check:"custom",...Re(t)});return n._zod.check=e,n}function _C(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)??pu,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 en(e,t,n={path:[],schemaPath:[]}){var y,g;var a;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)c.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,b);else{const k=c.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const w=e._zod.parent;w&&(c.ref||(c.ref=w),en(w,t,b),t.seen.get(w).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&zn(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&c.schema._prefault&&((a=c.schema).default??(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function TC(e,t){var c,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const y of e.seen.entries()){const g=(c=e.metadataRegistry.get(y[0]))==null?void 0:c.id;if(g){const b=a.get(g);if(b&&b!==y[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(g,y[0])}}const l=y=>{var j;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(j=e.external.registry.get(y[0]))==null?void 0:j.id,C=e.external.uri??(z=>z);if(E)return{ref:C(E)};const N=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=N,{defId:N,ref:`${C("__shared")}#/${g}/${N}`}}if(y[1]===n)return{ref:"#"};const w=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:w+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:b,defId:w}=l(y);g.def={...g.schema},w&&(g.defId=w);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>
|
|
356
|
-
|
|
357
|
-
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 w=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&w){o(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){o(y);continue}if(g.cycle){o(y);continue}if(g.count>1&&e.reused==="ref"){o(y);continue}}}function AC(e,t){var c,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,b={...g},w=y.ref;if(y.ref=null,w){a(w);const j=e.seen.get(w),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===w)for(const N in g)N==="$ref"||N==="allOf"||N in b||delete g[N];if(E.$ref&&j.def)for(const N in g)N==="$ref"||N==="allOf"||N in j.def&&JSON.stringify(g[N])===JSON.stringify(j.def[N])&&delete g[N]}const k=h._zod.parent;if(k&&k!==w){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,(c=e.external)!=null&&c.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const y=h[1];y.def&&y.defId&&(o[y.defId]=y.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:nf(t,"input",e.processors),output:nf(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function zn(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 zn(a.element,n);if(a.type==="set")return zn(a.valueType,n);if(a.type==="lazy")return zn(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 zn(a.innerType,n);if(a.type==="intersection")return zn(a.left,n)||zn(a.right,n);if(a.type==="record"||a.type==="map")return zn(a.keyType,n)||zn(a.valueType,n);if(a.type==="pipe")return zn(a.in,n)||zn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(zn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(zn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(zn(l,n))return!0;return!!(a.rest&&zn(a.rest,n))}return!1}const wL=(e,t={})=>n=>{const a=_C({...n,processors:t});return en(e,a),TC(a,e),AC(a,e)},nf=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},c=_C({...l??{},target:o,io:t,processors:n});return en(e,c),TC(c,e),AC(c,e)},SL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},kL=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:c,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof c=="number"&&(l.maxLength=c),f&&(l.format=SL[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const y=[...m];y.length===1?l.pattern=y[0].source:y.length>1&&(l.allOf=[...y.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},jL=(e,t,n,a)=>{const l=n,{minimum:o,maximum:c,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=y,l.exclusiveMinimum=!0):l.exclusiveMinimum=y),typeof o=="number"&&(l.minimum=o,typeof y=="number"&&t.target!=="draft-04"&&(y>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof c=="number"&&(l.maximum=c,typeof h=="number"&&t.target!=="draft-04"&&(h<=c?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},CL=(e,t,n,a)=>{n.type="boolean"},EL=(e,t,n,a)=>{n.not={}},NL=(e,t,n,a)=>{},_L=(e,t,n,a)=>{const l=e._zod.def,o=sC(l.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},TL=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const c of l.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(c))}else o.push(c);if(o.length!==0)if(o.length===1){const c=o[0];n.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[c]:n.const=c}else o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),o.every(c=>typeof c=="boolean")&&(n.type="boolean"),o.every(c=>c===null)&&(n.type="null"),n.enum=o},AL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},RL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},zL=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:c,maximum:f}=e._zod.bag;typeof c=="number"&&(l.minItems=c),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=en(o.element,t,{...a,path:[...a.path,"items"]})},OL=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const c=o.shape;for(const y in c)l.properties[y]=en(c[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(c)),m=new Set([...f].filter(y=>{const g=o.shape[y]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=en(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},DL=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,c=l.options.map((f,m)=>en(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=c:n.anyOf=c},ML=(e,t,n,a)=>{const l=e._zod.def,o=en(l.left,t,{...a,path:[...a.path,"allOf",0]}),c=en(l.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(c)?c.allOf:[c]];n.allOf=m},LL=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const c=o.keyType,f=c._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=en(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=en(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=en(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=c._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},IL=(e,t,n,a)=>{const l=e._zod.def,o=en(l.innerType,t,a),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},UL=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},PL=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},BL=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},$L=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let c;try{c=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},FL=(e,t,n,a)=>{const l=e._zod.def,o=t.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;en(o,t,a);const c=t.seen.get(e);c.ref=o},qL=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},RC=(e,t,n,a)=>{const l=e._zod.def;en(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},HL=oe("ZodISODateTime",(e,t)=>{HM.init(e,t),Mt.init(e,t)});function ZL(e){return Y5(HL,e)}const VL=oe("ZodISODate",(e,t)=>{ZM.init(e,t),Mt.init(e,t)});function QL(e){return X5(VL,e)}const KL=oe("ZodISOTime",(e,t)=>{VM.init(e,t),Mt.init(e,t)});function GL(e){return J5(KL,e)}const YL=oe("ZodISODuration",(e,t)=>{QM.init(e,t),Mt.init(e,t)});function XL(e){return W5(YL,e)}const JL=(e,t)=>{dC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>I4(e,n)},flatten:{value:n=>L4(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,_g,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,_g,2)}},isEmpty:{get(){return e.issues.length===0}}})},Tr=oe("ZodError",JL,{Parent:Error}),WL=Ty(Tr),eI=Ay(Tr),tI=Ef(Tr),nI=Nf(Tr),rI=B4(Tr),aI=$4(Tr),iI=F4(Tr),lI=q4(Tr),sI=H4(Tr),oI=Z4(Tr),uI=V4(Tr),cI=Q4(Tr),Dt=oe("ZodType",(e,t)=>(Ot.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nf(e,"input"),output:nf(e,"output")}}),e.toJSONSchema=wL(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Oi(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Di(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>WL(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>tI(e,n,a),e.parseAsync=async(n,a)=>eI(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>nI(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>rI(e,n,a),e.decode=(n,a)=>aI(e,n,a),e.encodeAsync=async(n,a)=>iI(e,n,a),e.decodeAsync=async(n,a)=>lI(e,n,a),e.safeEncode=(n,a)=>sI(e,n,a),e.safeDecode=(n,a)=>oI(e,n,a),e.safeEncodeAsync=async(n,a)=>uI(e,n,a),e.safeDecodeAsync=async(n,a)=>cI(e,n,a),e.refine=(n,a)=>e.check(n6(n,a)),e.superRefine=n=>e.check(r6(n)),e.overwrite=n=>e.check(no(n)),e.optional=()=>Sw(e),e.exactOptional=()=>qI(e),e.nullable=()=>kw(e),e.nullish=()=>Sw(kw(e)),e.nonoptional=n=>GI(e,n),e.array=()=>Qn(e),e.or=n=>DC([e,n]),e.and=n=>UI(e,n),e.transform=n=>Rg(e,MC(n)),e.default=n=>VI(e,n),e.prefault=n=>KI(e,n),e.catch=n=>XI(e,n),e.pipe=n=>Rg(e,n),e.readonly=()=>e6(e),e.describe=n=>{const a=e.clone();return pu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=pu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return pu.get(e);const a=e.clone();return pu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),zC=oe("_ZodString",(e,t)=>{Ry.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>kL(e,a,l);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(lL(...a)),e.includes=(...a)=>e.check(uL(...a)),e.startsWith=(...a)=>e.check(cL(...a)),e.endsWith=(...a)=>e.check(dL(...a)),e.min=(...a)=>e.check(tf(...a)),e.max=(...a)=>e.check(EC(...a)),e.length=(...a)=>e.check(NC(...a)),e.nonempty=(...a)=>e.check(tf(1,...a)),e.lowercase=a=>e.check(sL(a)),e.uppercase=a=>e.check(oL(a)),e.trim=()=>e.check(hL()),e.normalize=(...a)=>e.check(fL(...a)),e.toLowerCase=()=>e.check(mL()),e.toUpperCase=()=>e.check(pL()),e.slugify=()=>e.check(gL())}),dI=oe("ZodString",(e,t)=>{Ry.init(e,t),zC.init(e,t),e.email=n=>e.check(T5(fI,n)),e.url=n=>e.check(D5(hI,n)),e.jwt=n=>e.check(G5(_I,n)),e.emoji=n=>e.check(M5(mI,n)),e.guid=n=>e.check(gw(xw,n)),e.uuid=n=>e.check(A5(Ad,n)),e.uuidv4=n=>e.check(R5(Ad,n)),e.uuidv6=n=>e.check(z5(Ad,n)),e.uuidv7=n=>e.check(O5(Ad,n)),e.nanoid=n=>e.check(L5(pI,n)),e.guid=n=>e.check(gw(xw,n)),e.cuid=n=>e.check(I5(gI,n)),e.cuid2=n=>e.check(U5(yI,n)),e.ulid=n=>e.check(P5(vI,n)),e.base64=n=>e.check(V5(CI,n)),e.base64url=n=>e.check(Q5(EI,n)),e.xid=n=>e.check(B5(bI,n)),e.ksuid=n=>e.check($5(xI,n)),e.ipv4=n=>e.check(F5(wI,n)),e.ipv6=n=>e.check(q5(SI,n)),e.cidrv4=n=>e.check(H5(kI,n)),e.cidrv6=n=>e.check(Z5(jI,n)),e.e164=n=>e.check(K5(NI,n)),e.datetime=n=>e.check(ZL(n)),e.date=n=>e.check(QL(n)),e.time=n=>e.check(GL(n)),e.duration=n=>e.check(XL(n))});function R(e){return _5(dI,e)}const Mt=oe("ZodStringFormat",(e,t)=>{Rt.init(e,t),zC.init(e,t)}),fI=oe("ZodEmail",(e,t)=>{MM.init(e,t),Mt.init(e,t)}),xw=oe("ZodGUID",(e,t)=>{OM.init(e,t),Mt.init(e,t)}),Ad=oe("ZodUUID",(e,t)=>{DM.init(e,t),Mt.init(e,t)}),hI=oe("ZodURL",(e,t)=>{LM.init(e,t),Mt.init(e,t)}),mI=oe("ZodEmoji",(e,t)=>{IM.init(e,t),Mt.init(e,t)}),pI=oe("ZodNanoID",(e,t)=>{UM.init(e,t),Mt.init(e,t)}),gI=oe("ZodCUID",(e,t)=>{PM.init(e,t),Mt.init(e,t)}),yI=oe("ZodCUID2",(e,t)=>{BM.init(e,t),Mt.init(e,t)}),vI=oe("ZodULID",(e,t)=>{$M.init(e,t),Mt.init(e,t)}),bI=oe("ZodXID",(e,t)=>{FM.init(e,t),Mt.init(e,t)}),xI=oe("ZodKSUID",(e,t)=>{qM.init(e,t),Mt.init(e,t)}),wI=oe("ZodIPv4",(e,t)=>{KM.init(e,t),Mt.init(e,t)}),SI=oe("ZodIPv6",(e,t)=>{GM.init(e,t),Mt.init(e,t)}),kI=oe("ZodCIDRv4",(e,t)=>{YM.init(e,t),Mt.init(e,t)}),jI=oe("ZodCIDRv6",(e,t)=>{XM.init(e,t),Mt.init(e,t)}),CI=oe("ZodBase64",(e,t)=>{JM.init(e,t),Mt.init(e,t)}),EI=oe("ZodBase64URL",(e,t)=>{e5.init(e,t),Mt.init(e,t)}),NI=oe("ZodE164",(e,t)=>{t5.init(e,t),Mt.init(e,t)}),_I=oe("ZodJWT",(e,t)=>{r5.init(e,t),Mt.init(e,t)}),zy=oe("ZodNumber",(e,t)=>{wC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>jL(e,a,l),e.gt=(a,l)=>e.check(vw(a,l)),e.gte=(a,l)=>e.check(xp(a,l)),e.min=(a,l)=>e.check(xp(a,l)),e.lt=(a,l)=>e.check(yw(a,l)),e.lte=(a,l)=>e.check(bp(a,l)),e.max=(a,l)=>e.check(bp(a,l)),e.int=a=>e.check(ww(a)),e.safe=a=>e.check(ww(a)),e.positive=a=>e.check(vw(0,a)),e.nonnegative=a=>e.check(xp(0,a)),e.negative=a=>e.check(yw(0,a)),e.nonpositive=a=>e.check(bp(0,a)),e.multipleOf=(a,l)=>e.check(bw(a,l)),e.step=(a,l)=>e.check(bw(a,l)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ge(e){return eL(zy,e)}const TI=oe("ZodNumberFormat",(e,t)=>{a5.init(e,t),zy.init(e,t)});function ww(e){return nL(TI,e)}const AI=oe("ZodBoolean",(e,t)=>{i5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>CL(e,n,a)});function Wr(e){return rL(AI,e)}const RI=oe("ZodUnknown",(e,t)=>{l5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>NL()});function St(){return aL(RI)}const zI=oe("ZodNever",(e,t)=>{s5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EL(e,n,a)});function OI(e){return iL(zI,e)}const DI=oe("ZodArray",(e,t)=>{o5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>zL(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(tf(n,a)),e.nonempty=n=>e.check(tf(1,n)),e.max=(n,a)=>e.check(EC(n,a)),e.length=(n,a)=>e.check(NC(n,a)),e.unwrap=()=>e.element});function Qn(e,t){return yL(DI,e,t)}const MI=oe("ZodObject",(e,t)=>{c5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>OL(e,n,a,l),mt(e,"shape",()=>t.shape),e.keyof=()=>Ve(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:St()}),e.loose=()=>e.clone({...e._zod.def,catchall:St()}),e.strict=()=>e.clone({...e._zod.def,catchall:OI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>R4(e,n),e.safeExtend=n=>z4(e,n),e.merge=n=>O4(e,n),e.pick=n=>T4(e,n),e.omit=n=>A4(e,n),e.partial=(...n)=>D4(LC,e,n[0]),e.required=(...n)=>M4(IC,e,n[0])});function de(e,t){const n={type:"object",shape:e??{},...Re(t)};return new MI(n)}const OC=oe("ZodUnion",(e,t)=>{jC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>DL(e,n,a,l),e.options=t.options});function DC(e,t){return new OC({type:"union",options:e,...Re(t)})}const LI=oe("ZodDiscriminatedUnion",(e,t)=>{OC.init(e,t),d5.init(e,t)});function Oy(e,t,n){return new LI({type:"union",options:t,discriminator:e,...Re(n)})}const II=oe("ZodIntersection",(e,t)=>{f5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>ML(e,n,a,l)});function UI(e,t){return new II({type:"intersection",left:e,right:t})}const PI=oe("ZodRecord",(e,t)=>{h5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>LL(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Ht(e,t,n){return new PI({type:"record",keyType:e,valueType:t,...Re(n)})}const Ag=oe("ZodEnum",(e,t)=>{m5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>_L(e,a,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,l)=>{const o={};for(const c of a)if(n.has(c))o[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Ag({...t,checks:[],...Re(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const c of a)if(n.has(c))delete o[c];else throw new Error(`Key ${c} not found in enum`);return new Ag({...t,checks:[],...Re(l),entries:o})}});function Ve(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Ag({type:"enum",entries:n,...Re(t)})}const BI=oe("ZodLiteral",(e,t)=>{p5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>TL(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 ln(e,t){return new BI({type:"literal",values:Array.isArray(e)?e:[e],...Re(t)})}const $I=oe("ZodTransform",(e,t)=>{g5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>RL(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new iC(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Au(o,n.value,t));else{const c=o;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=n.value),c.inst??(c.inst=e),n.issues.push(Au(c))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function MC(e){return new $I({type:"transform",transform:e})}const LC=oe("ZodOptional",(e,t)=>{CC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>RC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function Sw(e){return new LC({type:"optional",innerType:e})}const FI=oe("ZodExactOptional",(e,t)=>{y5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>RC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function qI(e){return new FI({type:"optional",innerType:e})}const HI=oe("ZodNullable",(e,t)=>{v5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>IL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function kw(e){return new HI({type:"nullable",innerType:e})}const ZI=oe("ZodDefault",(e,t)=>{b5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>PL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VI(e,t){return new ZI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():uC(t)}})}const QI=oe("ZodPrefault",(e,t)=>{x5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>BL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function KI(e,t){return new QI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():uC(t)}})}const IC=oe("ZodNonOptional",(e,t)=>{w5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>UL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function GI(e,t){return new IC({type:"nonoptional",innerType:e,...Re(t)})}const YI=oe("ZodCatch",(e,t)=>{S5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>$L(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function XI(e,t){return new YI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JI=oe("ZodPipe",(e,t)=>{k5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>FL(e,n,a,l),e.in=t.in,e.out=t.out});function Rg(e,t){return new JI({type:"pipe",in:e,out:t})}const WI=oe("ZodReadonly",(e,t)=>{j5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>qL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function e6(e){return new WI({type:"readonly",innerType:e})}const t6=oe("ZodCustom",(e,t)=>{C5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>AL(e,n)});function n6(e,t={}){return vL(t6,e,t)}function r6(e){return bL(e)}function a6(e,t){return Rg(MC(e),t)}const wp={custom:"custom"};function Tf(e){return tL(zy,e)}const i6=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function l6(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function s6(e,t){const n=l6(e),a=new Map;for(const o of t)o.name&&a.set(o.name.toLowerCase(),o.agentId);if(a.size===0)return[];const l=new Set;for(const o of n.matchAll(i6)){const c=o[1];if(!c)continue;const f=a.get(c.toLowerCase());f&&l.add(f)}return[...l]}const o6=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,jw="/";function UC(e){return!e||typeof e!="string"||e.length>256||!o6.test(e)?"/":e}const u6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},PC=Ve(["feishu","slack","kael"]),BC=Ve(["active","inactive"]);de({platform:PC,agentId:R().min(1),credentials:Ht(R(),St()),status:BC.default("active")});de({agentId:R().min(1).optional(),credentials:Ht(R(),St()).optional(),status:BC.optional()});de({id:Ge(),platform:R(),agentId:R(),hasCredentials:Wr(),status:R(),createdAt:R(),updatedAt:R()});const c6=Ve(["code","reverse_token","oauth","manual"]);de({appId:R().min(1),appSecret:R().min(1)});de({platform:PC,externalUserId:R().min(1),agentId:R().min(1),boundVia:c6.default("manual"),displayName:R().max(200).optional()});de({id:Ge(),platform:R(),externalUserId:R(),agentId:R(),boundVia:R().nullable(),displayName:R().nullable(),createdAt:R()});de({feishuUserId:R().min(1),displayName:R().max(200).optional()});de({configId:Ge(),platform:R(),agentId:R(),appId:R(),connected:Wr(),lastActiveAt:R().nullable()});const $C=Ve(["online","offline"]),FC=Ve(["idle","working","blocked","error"]);Ve(["active","suspended","evicted"]);const d6=Ve(["active","suspended"]);de({chatId:R().min(1),state:d6});de({runtimeState:FC});de({agentId:R().min(1),runtimeType:R().max(50),runtimeVersion:R().max(50).optional()});Ve(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);de({agentId:R(),status:$C,connectedAt:R().nullable(),lastSeenAt:R(),clientId:R().nullable().optional(),runtimeType:R().nullable().optional(),runtimeVersion:R().nullable().optional(),runtimeState:FC.nullable().optional(),activeSessions:Ge().int().nullable().optional(),totalSessions:Ge().int().nullable().optional(),runtimeUpdatedAt:R().nullable().optional()});de({total:Ge().int(),running:Ge().int(),byState:de({idle:Ge().int(),working:Ge().int(),blocked:Ge().int(),error:Ge().int()}),clients:Ge().int()});const rf={CLAUDE_CODE:"claude-code",CODEX:"codex"},Af=Ve(["claude-code","codex"]),f6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Rf=Ve(["human","personal_assistant","autonomous_agent"]),Cw={PRIVATE:"private",ORGANIZATION:"organization"},Dy=Ve(["private","organization"]),h6=Ve(["admin-api","portal"]);Ve(["active","suspended"]);const zg=/^[a-z0-9][a-z0-9_-]{0,63}$/,js=64,m6=["admin","agent","first-tree","hub","me","null","system","undefined"],p6=new Set(m6);function Og(e){return p6.has(e)}de({name:R().min(1).max(64).regex(zg,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!Og(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:Rf,displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).optional(),organizationId:R().min(1).max(100).optional(),source:h6.optional(),visibility:Dy.optional(),metadata:Ht(R(),St()).optional(),managerId:R().optional(),clientId:R().min(1).max(100).optional(),runtimeProvider:Af.optional()});de({type:Rf.optional(),displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).nullable().optional(),visibility:Dy.optional(),metadata:Ht(R(),St()).optional(),managerId:R().nullable().optional(),clientId:R().min(1).max(100).nullable().optional()});de({clientId:R().min(1).max(100),runtimeProvider:Af,force:Wr().optional()});de({uuid:R(),name:R().nullable(),organizationId:R(),type:Rf,displayName:R(),delegateMention:R().nullable(),inboxId:R(),status:R(),source:R().nullable().optional(),visibility:Dy,metadata:Ht(R(),St()),managerId:R().nullable(),clientId:R().nullable(),runtimeProvider:Af,presenceStatus:$C.optional(),createdAt:R(),updatedAt:R()});de({repo:R().nullable(),branch:R().nullable()});de({type:ln("agent:pinned"),agentId:R(),name:R().nullable(),displayName:R(),agentType:Rf,runtimeProvider:Af});const g6=32e3,My=/^[a-z0-9][a-z0-9_-]{0,63}$/i,y6=/^[A-Z][A-Z0-9_]*$/,v6=de({append:R().max(g6).default("")}),b6=de({name:R().regex(My,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:ln("stdio"),command:R().min(1),args:Qn(R()).optional()}),x6=de({name:R().regex(My,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:ln("http"),url:R().url(),headers:Ht(R(),R()).optional()}),w6=de({name:R().regex(My,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:ln("sse"),url:R().url(),headers:Ht(R(),R()).optional()}),S6=Oy("transport",[b6,x6,w6]),k6=de({key:R().regex(y6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:R(),sensitive:Wr().default(!1)}),j6=de({url:R().min(1),ref:R().min(1).optional(),localPath:R().min(1).optional()}),zf=de({prompt:v6.default({append:""}),model:R().default("opus"),mcpServers:Qn(S6).default([]),env:Qn(k6).default([]),gitRepos:Qn(j6).default([])}),C6=zf.extend({kind:ln("claude-code")}),E6=zf.extend({kind:ln("codex")}),N6=Oy("kind",[C6,E6]),_6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,c)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:wp.custom,path:["mcpServers",c,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,c)=>{a.has(o.key)&&t.addIssue({code:wp.custom,path:["env",c,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,c)=>{const f=o.localPath??lf(o.url);f&&(l.has(f)&&t.addIssue({code:wp.custom,path:["gitRepos",c,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},qC=a6(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,N6).superRefine((e,t)=>{_6(e,t)}),T6=de({agentId:R(),version:Ge().int().positive(),payload:qC,updatedAt:R(),updatedBy:R()});de({expectedVersion:Ge().int().positive(),payload:zf.partial()});de({payload:zf.partial()});de({current:T6,next:qC,diff:Qn(de({path:R(),op:Ve(["add","remove","replace"]),before:St().optional(),after:St().optional()}))});const af="***";function lf(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}de({username:R().min(1),password:R().min(1)});de({accessToken:R(),refreshToken:R()});de({refreshToken:R().min(1)});de({token:R().min(1)});de({token:R(),expiresIn:Ge(),command:R()});const A6=Ve(["direct","group","thread"]);de({type:A6,topic:R().max(500).optional(),participantIds:Qn(R()).min(1),metadata:Ht(R(),St()).optional()});const HC=de({agentId:R(),role:R(),mode:R(),joinedAt:R()});HC.extend({name:R().nullable(),displayName:R(),type:R()});const R6=de({id:R(),organizationId:R(),type:R(),topic:R().nullable(),lifecyclePolicy:R().nullable().optional(),metadata:Ht(R(),St()),createdAt:R(),updatedAt:R()});R6.extend({participants:Qn(HC)});de({topic:R().trim().max(500).nullable()});de({agentId:R().min(1),mode:Ve(["full","mention_only"]).default("full")});de({agentId:R().min(1)});const z6=Ve(["connected","disconnected"]);de({id:R(),userId:R().nullable(),status:z6,sdkVersion:R().max(50).nullable(),hostname:R().max(100).nullable(),os:R().max(50).nullable(),agentCount:Ge().int().min(0),connectedAt:R().nullable(),lastSeenAt:R(),metadata:Ht(R(),St()).nullable()});const O6=de({wsInboxDeliver:Wr().default(!1)}).partial();de({clientId:R().min(1).max(100),hostname:R().max(100).optional(),os:R().max(50).optional(),sdkVersion:R().max(50).optional(),wireCapabilities:O6.optional()});de({clientId:R(),previousUserId:R().nullable(),unpinnedAgentCount:Ge().int().nonnegative()});const D6=Ve(["ok","missing","unauthenticated","error"]),M6=Ve(["api_key","oauth","auth_json","none"]),L6=de({state:D6,available:Wr(),authenticated:Wr(),sdkVersion:R().nullable().optional(),authMethod:M6,error:R().nullable().optional(),detectedAt:R()}),I6=Ht(R(),L6);de({capabilities:I6});de({limit:Tf().int().min(1).max(100).default(20),cursor:R().optional()});const U6=["image/png","image/jpeg","image/gif","image/webp"],Ly=Ve(U6);de({data:R().min(1),mimeType:Ly,filename:R().min(1),size:Ge().int().nonnegative().optional(),imageId:R().uuid().optional()});de({imageId:R().uuid(),mimeType:Ly,filename:R().min(1),size:Ge().int().nonnegative().optional()});de({type:ln("image_payload"),imageId:R().uuid(),chatId:R(),base64:R().min(1),mimeType:Ly,filename:R().min(1),size:Ge().int().nonnegative().optional()});const Iy=Ve(["hub_ui","cli","feishu","github","api"]),ZC=Ve(["text","markdown","card","reference","file","task"]);de({format:ZC.default("text"),content:St(),metadata:Ht(R(),St()).optional(),inReplyTo:R().optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Iy.optional()});de({format:ZC.default("text"),content:St(),metadata:Ht(R(),St()).optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Iy.optional()});const P6=de({id:R(),chatId:R(),senderId:R(),format:R(),content:St(),metadata:Ht(R(),St()),replyToInbox:R().nullable(),replyToChat:R().nullable(),inReplyTo:R().nullable(),source:Iy.nullable(),createdAt:R()}),B6=de({senderId:R(),chatId:R(),replyToChat:R().nullable()}).nullable(),$6=Ve(["full","mention_only"]),F6=de({id:R(),senderId:R(),format:R(),content:St(),metadata:Ht(R(),St()).default({}),createdAt:R()}),VC=P6.extend({configVersion:Ge().int().positive(),recipientMode:$6.default("full"),inReplyToSnapshot:B6.default(null),precedingMessages:Qn(F6).default([])});Ve(["pending","delivered","acked","failed"]);const q6=de({id:Ge(),inboxId:R(),messageId:R(),chatId:R().nullable(),status:R(),retryCount:Ge(),createdAt:R(),deliveredAt:R().nullable(),ackedAt:R().nullable()});q6.extend({message:VC});de({limit:Tf().int().min(1).max(50).default(10)});de({type:ln("inbox:deliver"),entryId:Ge().int().nonnegative(),inboxId:R().min(1),chatId:R().nullable(),message:VC}).passthrough();de({type:ln("inbox:ack"),entryId:Ge().int().nonnegative()});const H6=7;de({organizationId:R(),organizationName:R(),organizationDisplayName:R(),role:R(),expiresAt:R().nullable()});de({id:R(),organizationId:R(),token:R(),inviteUrl:R(),role:R(),createdAt:R(),expiresAt:R().nullable()});de({token:R().min(1)});de({}).optional();Ve(["connect","create_agent","completed"]);de({id:R(),name:R(),displayName:R(),role:Ve(["admin","member"])});de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:R().min(1).max(200)});de({organizationId:R().min(1)});de({id:R(),organizationId:R(),organizationName:R(),role:Ve(["admin","member"]),agentId:R()});const Z6={ADMIN:"admin",MEMBER:"member"},Uy=Ve(["admin","member"]),V6=de({id:R(),userId:R(),organizationId:R(),agentId:R(),role:Uy,createdAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),role:Uy.default("member")});de({role:Uy.optional(),displayName:R().min(1).max(200).optional()});V6.extend({username:R(),displayName:R(),password:R()});const Q6=Ve(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),QC=Ve(["high","medium","low"]);de({id:R(),organizationId:R(),type:Q6,severity:QC,agentId:R().nullable(),chatId:R().nullable(),message:R(),read:Wr(),createdAt:R()});de({limit:Tf().int().min(1).max(100).default(20),cursor:R().optional(),severity:QC.optional(),read:Ve(["true","false"]).transform(e=>e==="true").optional(),agentId:R().optional()});de({next:R().max(256).optional()});de({code:R().min(1),state:R().min(1)});de({githubId:R().min(1),login:R().min(1),email:R().email().optional(),displayName:R().optional(),next:R().max(256).optional()});const KC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!KC.test(e),"Name must not be a UUID format"),displayName:R().min(1).max(200),maxAgents:Ge().int().min(0).default(0),maxMessagesPerMinute:Ge().int().min(0).default(0),features:Ht(R(),St()).default({})});de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!KC.test(e),"Name must not be a UUID format").optional(),displayName:R().min(1).max(200).optional(),maxAgents:Ge().int().min(0).optional(),maxMessagesPerMinute:Ge().int().min(0).optional(),features:Ht(R(),St()).optional()});de({id:R(),name:R(),displayName:R(),maxAgents:Ge(),maxMessagesPerMinute:Ge(),features:Ht(R(),St()),createdAt:R(),updatedAt:R()});const K6=de({workingCount:Ge().int().nonnegative(),errorMask:Wr()}),G6=de({type:ln("pulse:tick"),organizationId:R(),agents:Ht(R(),Qn(K6).length(32))}),Y6=Ve(["tool_call","error","assistant_text","thinking","turn_end"]),GC=de({toolUseId:R(),name:R(),args:St(),status:Ve(["pending","ok","error"]),durationMs:Ge().int().nonnegative().optional(),resultPreview:R().max(400).optional()}),YC=de({source:Ve(["sdk","runtime","tool"]),message:R().max(2e3)}),XC=de({text:R().max(8e3)}),JC=de({}),WC=de({status:Ve(["success","error"])}),X6=Oy("kind",[de({kind:ln("tool_call"),payload:GC}),de({kind:ln("error"),payload:YC}),de({kind:ln("assistant_text"),payload:XC}),de({kind:ln("thinking"),payload:JC}),de({kind:ln("turn_end"),payload:WC})]);de({id:R(),agentId:R(),chatId:R(),seq:Ge().int().positive(),kind:Y6,payload:DC([GC,YC,XC,JC,WC]),createdAt:R()});de({agentId:R(),chatId:R(),event:X6});de({agentId:R(),chatId:R()});de({type:ln("session:reconcile"),agentId:R().min(1),chatIds:Qn(R().min(1)).max(500)});de({type:ln("session:reconcile:result"),agentId:R().min(1),staleChatIds:Qn(R().min(1))});const J6=de({organizationId:R(),agentCount:Ge(),chatCount:Ge(),messageCount:Ge()});de({totalAgents:Ge(),totalChats:Ge(),totalMessages:Ge(),byOrganization:Qn(J6)});de({key:R(),value:St(),updatedAt:R()});Ht(R(),St());const ji={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Zd={[ji.INBOX_TIMEOUT_SECONDS]:300,[ji.MAX_RETRY_COUNT]:3,[ji.POLLING_INTERVAL_SECONDS]:5,[ji.PRESENCE_CLEANUP_SECONDS]:60},Ru=Ve(["pending","assigned","working","completed","failed","cancelled"]),Ew=Ve(["agent","admin"]),W6=Ve(["assigned","status_changed","cancelled"]);de({taskId:R(),event:W6,title:R(),body:R().default(""),status:Ru,fromStatus:Ru.optional(),originRef:R().nullable().optional()});const eU=de({title:R().min(1).max(500),body:R().optional(),assigneeAgentId:R().optional(),originRef:R().max(500).optional(),metadata:Ht(R(),St()).optional()});eU.extend({organizationId:R().optional()});de({status:Ve(["working","completed","failed"]),result:R().optional()});de({assigneeAgentId:R().nullable().optional(),status:Ru.optional(),result:R().optional()});de({chatId:R().min(1)});const tU=de({id:R(),organizationId:R(),title:R(),body:R(),status:Ru,assigneeAgentId:R().nullable(),createdByType:Ew,createdById:R(),originRef:R().nullable(),result:R().nullable(),metadata:Ht(R(),St()),createdAt:R(),updatedAt:R(),cancelledAt:R().nullable(),cancelledByType:Ew.nullable(),cancelledById:R().nullable()}),nU=de({taskId:R(),chatId:R(),linkedByAgentId:R().nullable(),linkedAt:R()});tU.extend({chats:Qn(nU)});de({status:Ru.optional(),assigneeAgentId:R().optional(),originRef:R().optional(),limit:Tf().int().min(1).max(100).default(20),cursor:R().optional()});const rU=Ve(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);de({taskId:R(),signal:rU,reason:R()});const aU=Ve(["active","suspended"]);de({id:R(),username:R(),displayName:R(),avatarUrl:R().nullable(),status:aU,createdAt:R(),updatedAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),password:R().min(8).max(200)});de({displayName:R().min(1).max(200).optional(),password:R().min(8).max(200).optional()});de({type:ln("auth"),token:R().min(1)});const iU=de({wsInboxDeliver:Wr().default(!1)}).partial();de({type:ln("server:welcome"),serverCommandVersion:R().min(1),serverTimeMs:Ge().int().nonnegative(),capabilities:iU.optional()}).passthrough();const eE=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function lU(e){const t=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const n of Object.values(e))for(let a=0;a<32&&a<n.length;a++){const l=n[a],o=t[a];!l||!o||(o.workingCount+=l.workingCount,o.errorMask=o.errorMask||l.errorMask)}return t}const sU=2e3,oU=3e4;let hi=null,sf=!1,Sp=0,vu=null;const Dg=new Set;let gu=null,Cs=0;function uU(e){for(const t of Dg)try{t(e)}catch{}gu&&(e.type==="notification"?gu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(gu.invalidateQueries({queryKey:["activity"]}),gu.invalidateQueries({queryKey:["sessions"]})))}function tE(){const e=dy();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);uU(o)}catch{}},a.onopen=()=>{a===hi&&(Sp=0)},a.onclose=()=>{if(a!==hi||(hi=null,sf||Cs===0))return;Sp++;const l=Math.min(sU*2**(Sp-1),oU);vu=setTimeout(()=>{vu=null,!sf&&Cs>0&&tE()},l)}}function cU(){sf=!0,vu&&(clearTimeout(vu),vu=null),hi&&(hi.close(1e3,"unmount"),hi=null)}function nE(e){const{onMessage:t,enabled:n=!0}=e??{},a=dn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{gu=a},[a]),x.useEffect(()=>{if(!n)return;const o=c=>{var f;return(f=l.current)==null?void 0:f.call(l,c)};return Dg.add(o),Cs++,Cs===1&&(sf=!1,tE()),()=>{Dg.delete(o),Cs--,Cs===0&&cU()}},[n])}const rE=x.createContext({aggregated:eE,agents:{},receivedAtMs:null,stale:!0});function dU({children:e}){const[t,n]=x.useState({aggregated:eE,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());nE({onMessage:c=>{const f=G6.safeParse(c);f.success&&n({aggregated:lU(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const c=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(c)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return u.jsx(rE.Provider,{value:o,children:e})}function fU(){return x.useContext(rE)}function Of({title:e,subtitle:t,right:n,className:a,style:l,...o}){return u.jsxs("div",{className:Ae("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-3) var(--sp-5) var(--sp-2_5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)",...l},...o,children:[u.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),u.jsx("div",{style:{flex:1}}),n]})}function aE({className:e,style:t,...n}){return u.jsx("div",{className:Ae("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 iE({active:e,onClick:t,children:n}){return u.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 bg-transparent text-body font-medium",style:{padding:"var(--sp-1_75) var(--sp-3)",marginBottom:-1,borderBottom:`var(--hairline-bold) solid ${e?"var(--accent)":"transparent"}`,color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",transition:"color 0.12s"},onMouseEnter:a=>{e||(a.currentTarget.style.color="var(--fg)")},onMouseLeave:a=>{e||(a.currentTarget.style.color="var(--fg-3)")},children:n})}const hU={neutral:{bg:"var(--bg-sunken)",fg:"var(--fg-2)",bd:"var(--border)"},accent:{bg:"var(--accent-bg)",fg:"var(--accent-dim)",bd:"color-mix(in oklch, var(--accent) 30%, transparent)"},warn:{bg:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},error:{bg:"color-mix(in oklch, var(--state-error) 14%, transparent)",fg:"var(--state-error)",bd:"color-mix(in oklch, var(--state-error) 30%, transparent)"},outline:{bg:"transparent",fg:"var(--fg-3)",bd:"var(--border)"},idle:{bg:"color-mix(in oklch, var(--state-idle) 14%, transparent)",fg:"var(--state-idle)",bd:"color-mix(in oklch, var(--state-idle) 30%, transparent)"},working:{bg:"color-mix(in oklch, var(--state-working) 14%, transparent)",fg:"var(--state-working)",bd:"color-mix(in oklch, var(--state-working) 30%, transparent)"},blocked:{bg:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},offline:{bg:"color-mix(in oklch, var(--state-offline) 14%, transparent)",fg:"var(--state-offline)",bd:"color-mix(in oklch, var(--state-offline) 30%, transparent)"}};function kn({tone:e="neutral",className:t,style:n,...a}){const l=hU[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return u.jsx("span",{className:Ae("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 vl=x.forwardRef(({className:e,...t},n)=>u.jsx("table",{ref:n,className:Ae("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));vl.displayName="DenseTable";const bl=x.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:e,...t}));bl.displayName="DenseTableHeader";const xl=x.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:e,...t}));xl.displayName="DenseTableBody";const or=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>u.jsx("tr",{ref:o,className:Ae("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}));or.displayName="DenseTableRow";const He=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("th",{ref:a,className:Ae("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}));He.displayName="DenseTableHead";const Be=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("td",{ref:a,className:Ae("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Be.displayName="DenseTableCell";const sn=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Ae("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));sn.displayName="Panel";const Ar=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Ae("flex items-center justify-between gap-3",e),style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ar.displayName="PanelHeader";const Rr=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Ae("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Rr.displayName="PanelTitle";const ea=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Ae(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));ea.displayName="PanelBody";function Qs({children:e,right:t,className:n,style:a,...l}){return u.jsxs("div",{className:Ae("mono flex items-center justify-between uppercase text-eyebrow",n),style:{padding:"var(--sp-1_75) var(--sp-3_5)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)",...a},...l,children:[u.jsx("span",{children:e}),t]})}function Xu({className:e,style:t,...n}){return u.jsx("span",{className:Ae("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function Py(){return ke.get("/members")}function mU(e){return ke.post("/members",e)}function pU(e,t){return ke.patch(`/members/${encodeURIComponent(e)}`,t)}function gU(e){return ke.delete(`/members/${encodeURIComponent(e)}`)}function By(){const{data:e}=$e({queryKey:["members","name-map"],queryFn:Py,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.id,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function yU(){const e=fn(),t=By(),{data:n,isLoading:a,error:l}=$e({queryKey:["admin-all-agents"],queryFn:()=>VD({limit:100})});return u.jsxs("div",{children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-2_5)"},children:"Every agent in the organization — including private agents owned by other members. Use this view to troubleshoot or reassign."}),u.jsxs(sn,{children:[u.jsxs(Qs,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]}):!n||n.items.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(He,{children:"Display name"}),u.jsx(He,{children:"Agent name"}),u.jsx(He,{children:"Type"}),u.jsx(He,{children:"Visibility"}),u.jsx(He,{children:"Owner"}),u.jsx(He,{children:"Status"}),u.jsx(He,{children:"Created"})]})}),u.jsx(xl,{children:n.items.map(o=>u.jsxs(or,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[u.jsx(Be,{children:u.jsx("span",{className:"font-medium",children:o.displayName})}),u.jsx(Be,{children:o.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",o.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:o.uuid.slice(0,8)})}),u.jsx(Be,{children:u.jsx(kn,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),u.jsx(Be,{children:u.jsx(kn,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),u.jsx(Be,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),u.jsx(Be,{children:u.jsx(kn,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(o.createdAt)})]},o.uuid))})]})]})]})}const ro=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));ro.displayName="Card";const ao=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("flex flex-col space-y-1.5 p-6",e),...t}));ao.displayName="CardHeader";const Ju=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("text-subtitle leading-none",e),...t}));Ju.displayName="CardTitle";const lE=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("text-body text-muted-foreground",e),...t}));lE.displayName="CardDescription";const io=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("p-6 pt-0",e),...t}));io.displayName="CardContent";const vU=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Ae("flex items-center p-6 pt-0",e),...t}));vU.displayName="CardFooter";function bU(e){const t=new Date(e),n=Date.now(),a=t.getTime()-n;if(a<=0)return`expired ${t.toLocaleDateString()}`;const l=Math.ceil(a/(1440*60*1e3));return`expires ${l===1?"in less than a day":`in ${l} days`} · ${t.toLocaleDateString()}`}function xU(){const{organizationId:e}=qt(),[t,n]=x.useState(null),[a,l]=x.useState(null),[o,c]=x.useState(!1),[f,m]=x.useState(!1);x.useEffect(()=>{e&&(async()=>{try{const y=await ke.get(`/admin/organizations/${e}/invitations`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){c(!0),l(null);try{const y=await ke.post(`/admin/organizations/${e}/invitations/rotate`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to rotate invite link")}finally{c(!1)}}};return u.jsxs(ro,{children:[u.jsxs(ao,{children:[u.jsx(Ju,{children:"Invite link"}),u.jsxs(lE,{children:["Anyone with this link can join your team as a member. Links expire after ",H6," days; rotating revokes the old link instantly and resets the timer."]})]}),u.jsxs(io,{className:"space-y-3",children:[a&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),u.jsx(he,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),u.jsx(he,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),u.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${bU(t.expiresAt)}`:" · no expiry"]})]}):u.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}var wU="Label",sE=x.forwardRef((e,t)=>u.jsx(Oa.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())}}));sE.displayName=wU;var SU=sE;const st=x.forwardRef(({className:e,...t},n)=>u.jsx(SU,{ref:n,className:Ae("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));st.displayName="Label";const oE=Object.values(Z6);function kU(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 jU(){const e=dn(),{memberId:t}=qt(),[n,a]=x.useState(!1),[l,o]=x.useState({username:"",displayName:"",role:"member"}),[c,f]=x.useState(null),[m,h]=x.useState(null),{data:y,isLoading:g,error:b}=$e({queryKey:["members"],queryFn:Py}),w=wt({mutationFn:()=>mU({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:N=>{e.invalidateQueries({queryKey:["members"]}),f(N.password)}}),k=wt({mutationFn:gU,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(N){N.preventDefault(),w.mutate()}function C(N){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(N)}return u.jsxs(u.Fragment,{children:[u.jsxs(sn,{children:[u.jsxs(Qs,{right:u.jsxs($t,{open:n,onOpenChange:N=>N?a(!0):j(),children:[u.jsx(qD,{asChild:!0,children:u.jsxs(he,{size:"xs",className:"normal-case tracking-normal",children:[u.jsx(Jr,{className:"h-3 w-3"}),"Add member"]})}),u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:c?"Member Created":"Create Member"})}),c?u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),u.jsxs("div",{className:"flex items-center gap-2 rounded-md p-3",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("code",{className:"flex-1 text-body mono",children:c}),u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(c),title:"Copy password",children:u.jsx(vf,{className:"h-4 w-4"})})]}),u.jsx(tn,{children:u.jsx(he,{onClick:j,children:"Done"})})]}):u.jsxs("form",{onSubmit:E,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"member-username",children:"Username"}),u.jsx(jt,{id:"member-username",type:"text",value:l.username,onChange:N=>o({...l,username:N.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"member-name",children:"Display Name"}),u.jsx(jt,{id:"member-name",value:l.displayName,onChange:N=>o({...l,displayName:N.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"member-role",children:"Role"}),u.jsx("select",{id:"member-role",value:l.role,onChange:N=>o({...l,role:N.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:oE.map(N=>u.jsx("option",{value:N,children:N},N))})]}),w.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:w.error.message}),u.jsx(tn,{children:u.jsx(he,{type:"submit",disabled:w.isPending,children:w.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(y==null?void 0:y.length)??0]}),g?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",b instanceof Error?b.message:"Unknown error"]}):(y==null?void 0:y.length)===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(He,{style:{width:30}}),u.jsx(He,{children:"Username"}),u.jsx(He,{children:"Name"}),u.jsx(He,{children:"Role"}),u.jsx(He,{children:"Created"}),u.jsx(He,{style:{width:1}})]})}),u.jsx(xl,{children:y==null?void 0:y.map(N=>{const z=t===N.id;return u.jsxs(or,{children:[u.jsx(Be,{children:u.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:z?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:z?"var(--accent-dim)":"var(--fg-2)"},children:kU(N.displayName,N.username)})}),u.jsxs(Be,{children:[u.jsx("span",{className:"mono font-medium",children:N.username}),z&&u.jsx(Xu,{style:{marginLeft:6},children:"you"})]}),u.jsx(Be,{style:{color:"var(--fg-2)"},children:N.displayName}),u.jsx(Be,{children:u.jsx(kn,{tone:N.role==="admin"?"accent":"neutral",children:N.role})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(N.createdAt)}),u.jsx(Be,{style:{whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-0.5 justify-end",children:[u.jsx(he,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:N.id,username:N.username,displayName:N.displayName,role:N.role}),title:"Edit",children:u.jsx(Qu,{className:"h-3.5 w-3.5"})}),u.jsx(he,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>C(N.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})]})})]},N.id)})})]})]}),u.jsx(CU,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function CU({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,c]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),c(e.role),m(null))},[e]);const h=wt({mutationFn:async()=>{if(!e)throw new Error("No target");const b={};return a.trim()&&a!==e.displayName&&(b.displayName=a.trim()),o!==e.role&&(b.role=o),Object.keys(b).length===0?e:pU(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function y(b){b.preventDefault(),h.mutate()}const g=e!==null;return u.jsx($t,{open:g,onOpenChange:b=>b?void 0:t(),children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:"Edit Member"})}),e&&u.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Username"}),u.jsx(jt,{value:e.username,disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"edit-member-display",children:"Display Name"}),u.jsx(jt,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"edit-member-role",children:"Role"}),u.jsx("select",{id:"edit-member-role",value:o,onChange:b=>c(b.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:oE.map(b=>u.jsx("option",{value:b,children:b},b))}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),u.jsx(he,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function EU(){return ke.get("/admin/system/config")}function NU(e){return ke.patch("/admin/system/config",e)}function _U(e){return ke.get(`/admin/organizations/${encodeURIComponent(e)}`)}function TU(e,t){return ke.patch(`/admin/organizations/${encodeURIComponent(e)}`,t)}function AU(){return ke.post("/me/organizations/leave")}function RU(){const{organizationId:e}=qt(),t=dn(),n=$e({queryKey:["organization",e],queryFn:()=>e?_U(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=x.useState(""),[o,c]=x.useState(""),[f,m]=x.useState(!1);x.useEffect(()=>{n.data&&(l(n.data.displayName),c(n.data.name))},[n.data]);const h=wt({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const g={},b=a.trim(),w=o.trim();return b&&b!==n.data.displayName&&(g.displayName=b),w&&w!==n.data.name&&(g.name=w),Object.keys(g).length===0?Promise.resolve(n.data):TU(e,g)},onSuccess:g=>{t.setQueryData(["organization",e],g),t.invalidateQueries({queryKey:["me-organizations"]}),m(!0),setTimeout(()=>m(!1),2e3)}}),y=g=>{g.preventDefault(),h.mutate()};return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsx(Rr,{children:"Team identity"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[f&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsxs(he,{type:"submit",form:"team-identity-form",size:"xs",disabled:h.isPending||!n.data,children:[u.jsx(cr,{className:"h-3 w-3"}),h.isPending?"Saving…":"Save"]})]})]}),u.jsx(ea,{children:n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):u.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[u.jsx(Nw,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:a,onChange:l}),u.jsx(Nw,{label:"URL slug",hint:"Lowercase letters, digits, hyphens. Used in invite URLs.",value:o,onChange:g=>c(g.toLowerCase()),mono:!0,pattern:"[a-z0-9][a-z0-9-]*"}),h.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h.error.message})]})})]})}function Nw({label:e,hint:t,value:n,onChange:a,mono:l,pattern:o}){return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),u.jsx("input",{value:n,onChange:c=>a(c.target.value),pattern:o,className:`w-full outline-none text-body ${l?"mono":""}`,style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]})}const uE=[{key:ji.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:ji.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:ji.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:ji.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],_w=uE.map(e=>e.key);function zU(){const e=dn(),{data:t,isLoading:n}=$e({queryKey:["system-config"],queryFn:EU}),[a,l]=x.useState({}),[o,c]=x.useState(!1);x.useEffect(()=>{if(!t)return;const y={};for(const g of _w){const b=t[g]??Zd[g]??"";y[g]=String(b)}l(y)},[t]);const f=wt({mutationFn:()=>{const y={};for(const[g,b]of Object.entries(a)){const w=b.trim();if(w==="")y[g]=Zd[g]??0;else{const k=Number(w);y[g]=Number.isNaN(k)?w:k}}return NU(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),c(!0),setTimeout(()=>c(!1),2e3)}});function m(){const y={};for(const g of _w)y[g]=String(Zd[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return u.jsxs("div",{className:"space-y-4",children:[u.jsx(RU,{}),u.jsx("form",{onSubmit:h,children:u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsx(Rr,{children:"System configuration"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsx(he,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),u.jsxs(he,{type:"submit",size:"xs",disabled:f.isPending,children:[u.jsx(cr,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),u.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?u.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):uE.map(y=>u.jsx(OU,{field:y,value:a[y.key]??"",onChange:g=>l({...a,[y.key]:g})},y.key)),f.error instanceof Error&&u.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})]})}function OU({field:e,value:t,onChange:n}){const a=String(Zd[e.key]??"—");return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),u.jsxs(Xu,{style:{marginTop:4,display:"block"},children:["default"," ",u.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx("input",{value:t,onChange:l=>n(l.target.value),className:"w-full outline-none mono text-body",style:{padding:`var(--sp-1_25) ${e.unit?56:10}px var(--sp-1_25) var(--sp-2_5)`,background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}}),e.unit&&u.jsx("span",{className:"mono text-caption",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)",pointerEvents:"none"},children:e.unit})]})]})}const Tw=[{key:"members",label:"Members"},{key:"invite",label:"Invite link"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function DU(){const{role:e}=qt(),t=Mn(),n=fn();if(e===null)return u.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return u.jsx(pf,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=Tw.some(c=>c.key===a)?a:"members",o=c=>{n({hash:c},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(Of,{title:"Admin",subtitle:"Organization-wide controls"}),u.jsx(aE,{children:Tw.map(c=>u.jsx(iE,{active:l===c.key,onClick:()=>o(c.key),children:c.label},c.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&u.jsx(jU,{}),l==="invite"&&u.jsx(xU,{}),l==="all-agents"&&u.jsx(yU,{}),l==="settings"&&u.jsx(zU,{})]})]})}function MU(e){return ke.get(`/admin/agents/${e}/config`)}function LU(e,t){return ke.patch(`/admin/agents/${e}/config`,t)}function IU(e,t){return ke.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function UU(e){return ke.get(`/admin/agents/${e}/client-status`)}function PU({className:e,style:t,...n}){return u.jsx("div",{className:Ae("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function BU({onClick:e,children:t}){return u.jsx("button",{type:"button",onClick:e,className:"bg-transparent border-0 p-0 cursor-pointer",style:{color:"var(--fg-3)",textDecoration:"none",font:"inherit"},onMouseEnter:n=>{n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--fg-3)"},children:t})}function $U(){return u.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function FU({children:e,mono:t}){return u.jsx("span",{className:Ae("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function Xr({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?u.jsxs("span",{className:Ae("shrink-0",n),style:a,role:"img","aria-label":"working",children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?u.jsx("span",{className:Ae("shrink-0",n),style:{...a,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:u.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?u.jsx("span",{className:Ae("shrink-0",n),style:{...a,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?u.jsx("span",{className:Ae("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:Ae("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function qU(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Ks({state:e,className:t}){const n=e!==null&&qU(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return u.jsxs("span",{className:Ae("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[u.jsx(Xr,{state:n,size:7}),n]})}function Rd({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function HU({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?u.jsx("div",{className:"sticky z-20 flex items-center justify-between gap-3 backdrop-blur",style:{top:0,padding:"var(--sp-1_75) var(--sp-5)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[u.jsxs("span",{children:["Runs on ",u.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),u.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function ZU(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),c=t.displayName||t.name||t.uuid;return u.jsxs("section",{id:"ad-danger",style:{background:"color-mix(in oklch, var(--state-error) 6%, var(--bg-raised))",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[u.jsx(gy,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),u.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),u.jsxs("div",{children:[t.status==="active"?u.jsx(kp,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(he,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):u.jsx(kp,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(he,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(kp,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(he,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[u.jsx(Hs,{className:"h-3 w-3"}),"Delete"]})})]}),u.jsx(VU,{open:l,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),u.jsx(QU,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function kp(e){return u.jsxs("div",{className:"flex items-start justify-between gap-4 text-body",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid color-mix(in oklch, var(--state-error) 14%, transparent)"},children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),u.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),u.jsx("div",{children:e.action})]})}function VU({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsxs(Ft,{children:['Suspend "',n,'"?']})}),u.jsx("div",{className:"space-y-3",children:u.jsx("p",{className:"text-body",style:{color:"var(--fg-2)"},children:"Runtime binds and HTTP calls will be refused while the agent is suspended. Active sessions end on their next message. You can reactivate later from this same page."})}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(he,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function QU({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,c]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return u.jsx($t,{open:e,onOpenChange:m=>{t(m),m||c("")},children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsxs(Ft,{children:['Delete "',n,'"?']})}),u.jsxs("form",{onSubmit:f,className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",u.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),u.jsx(jt,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(he,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const KU={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 $y({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const c=KU[e],f=e==="deleted";return u.jsxs("div",{className:Ae("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[u.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),c.label&&u.jsx("span",{className:Ae("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",c.tone),children:c.label}),!o&&(f?u.jsxs(he,{size:"sm",variant:"ghost",onClick:a,children:[u.jsx(kz,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsxs(he,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[u.jsx(Qu,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Edit"})]}),u.jsxs(he,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[u.jsx(Hs,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function GU(e){const[t,n]=x.useState(null),[a,l]=x.useState(()=>new Set),o=f=>l(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h}),c=e.items.filter(f=>f.status!=="deleted").length;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["Environment variables (",c,")"]}),!e.disabled&&u.jsxs(he,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Jr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(ea,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(f=>{const m=f.value.sensitive,h=f.value.value===af,y=m&&!h&&!!f.value.value,g=a.has(f.key);let b;return m?y&&g?b=f.value.value:b="••••••":b=f.value.value||u.jsx("em",{children:"(empty)"}),u.jsxs($y,{status:f.status,onEdit:()=>n({mode:"edit",key:f.key,initial:f.value}),onDelete:()=>e.onDelete(f.key),onUndo:()=>e.onUndoDelete(f.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono font-medium",children:f.value.key}),u.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&u.jsx(Uk,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&u.jsx("button",{type:"button",onClick:()=>y&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:y?g?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":g?"Hide value":"Reveal value",disabled:!y,style:{padding:0,opacity:y?1:.4},children:g?u.jsx(qR,{className:"h-3.5 w-3.5"}):u.jsx(ZR,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&u.jsx(YU,{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 YU({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.key)??""),[f,m]=x.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=x.useState((n==null?void 0:n.sensitive)??!1),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),y((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function w(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=af),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:n?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"env-key",children:"Key"}),u.jsx(jt,{id:"env-key",value:o,onChange:k=>c(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&u.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"env-value",children:"Value"}),u.jsx(jt,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),u.jsxs("label",{className:"flex items-center gap-2 text-body",children:[u.jsx("input",{type:"checkbox",checked:h,onChange:k=>y(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(he,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function XU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["Git repositories (",a,")"]}),!e.disabled&&u.jsxs(he,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Jr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(ea,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??lf(l.value.url);return u.jsxs($y,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&u.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),u.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&u.jsx(JU,{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 JU({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.url)??""),[f,m]=x.useState((n==null?void 0:n.ref)??""),[h,y]=x.useState((n==null?void 0:n.localPath)??""),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function w(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||lf(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 u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:n?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"git-url",children:"URL"}),u.jsx(jt,{id:"git-url",value:o,onChange:k=>c(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(jt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(jt,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:lf(o)||"repo-name",className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(he,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function cE({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:c,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return u.jsx("span",{className:Ae("mono text-label",o),style:{color:"var(--fg-4)",...c},title:f,children:l});const y=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,b=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?u.jsxs("span",{className:Ae("inline-flex flex-col leading-tight",o),style:{gap:1,...c},title:y??void 0,children:[h&&u.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):u.jsxs("span",{className:Ae("inline-flex items-baseline gap-1.5",o),style:c,title:y??void 0,children:[h&&u.jsx("span",{style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function WU({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=Cy(),o=By(),c=e.metadata,f=c==null?void 0:c.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(b=>typeof b=="string"):[],y=e.managerId?o(e.managerId):null,g=e.delegateMention?l(e.delegateMention):null;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsx(Rr,{children:"Profile"}),e.status==="active"&&u.jsxs(he,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[u.jsx(Qu,{className:"h-3 w-3"})," Edit"]})]}),u.jsxs(ea,{className:"text-body space-y-1",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&u.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsxs("span",{className:"text-muted-foreground",children:["delegate ",u.jsx(cE,{name:g.name,displayName:g.displayName})]})]})]}),u.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsxs("span",{children:["owner ",u.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-foreground",children:m})]}),u.jsxs("span",{children:["type ",u.jsx(kn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),u.jsxs("span",{children:["visibility"," ",u.jsx(kn,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&u.jsxs("span",{children:["domains"," ",u.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>u.jsx(kn,{tone:"outline",children:b},b))})]})]})]}),u.jsx(eP,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function eP({agent:e,open:t,onOpenChange:n,onSave:a}){var L;const{memberId:l,role:o}=qt(),[c,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[y,g]=x.useState(e.visibility),[b,w]=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,N=$e({queryKey:["agents-for-delegate"],queryFn:async()=>(await Yu({limit:100})).items.filter(O=>O.type==="personal_assistant"&&O.status==="active"),enabled:t&&E});async function z(D){D.preventDefault(),j(null);const O=c.trim();if(!O){j("Display name is required.");return}w(!0);try{const M={displayName:O,delegateMention:m||null};y!==e.visibility&&(M.visibility=y),await a(M),n(!1)}catch(M){j(M instanceof Error?M.message:String(M))}finally{w(!1)}}return u.jsx($t,{open:t,onOpenChange:n,children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:z,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Agent name"}),u.jsx(jt,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"id-display",children:"Display Name"}),u.jsx(jt,{id:"id-display",value:c,onChange:D=>f(D.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"id-visibility",children:"Visibility"}),u.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:[u.jsx("option",{value:Cw.PRIVATE,children:"Private — only the manager"}),u.jsx("option",{value:Cw.ORGANIZATION,children:"Organization — all members"})]}),u.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&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.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:[u.jsx("option",{value:"",children:"None"}),(L=N.data)==null?void 0:L.map(D=>u.jsx("option",{value:D.uuid,children:D.displayName?`${D.displayName} (@${D.name??D.uuid})`:D.name?`@${D.name}`:D.uuid},D.uuid))]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&u.jsx("p",{className:"text-body text-destructive",children:k}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),u.jsx(he,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function tP(e){return e==="working"?"accent":e==="error"?"error":"outline"}function nP(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["MCP servers (",a,")"]}),!e.disabled&&u.jsxs(he,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Jr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(ea,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>{const o=l.status==="deleted"||!e.toolHealth?"unknown":e.toolHealth(l.value.name);return u.jsxs($y,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[u.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),u.jsx("span",{className:"font-medium font-mono",children:l.value.name}),u.jsx(kn,{tone:tP(o),children:o}),u.jsx("span",{className:"text-caption text-muted-foreground truncate",children:rP(l.value)})]},l.key)})}),t&&u.jsx(aP,{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 rP(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 aP({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=x.useState((n==null?void 0:n.name)??""),[h,y]=x.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,b]=x.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[w,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((n==null?void 0:n.transport)==="stdio"?n.command:""),b((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),E(null))},[e,n]);function C(N){if(N.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 z;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const L=g.trim().split(/\s+/).filter(D=>D.length>0);z={name:f,transport:"stdio",command:h.trim(),...L.length?{args:L}:{}}}else{const L=w.trim();try{new URL(L)}catch{E("URL is not valid.");return}z={name:f,transport:o,url:L}}l(z)}return u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:n?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:C,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:o,onChange:N=>c(N.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-name",children:"Name"}),u.jsx(jt,{id:"mcp-name",value:f,onChange:N=>m(N.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-command",children:"Command"}),u.jsx(jt,{id:"mcp-command",value:h,onChange:N=>y(N.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(jt,{id:"mcp-args",value:g,onChange:N=>b(N.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"mcp-url",children:"URL"}),u.jsx(jt,{id:"mcp-url",value:w,onChange:N=>k(N.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&u.jsx("p",{className:"text-body text-destructive",children:j}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(he,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const iP=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],lP=[{value:"gpt-5.5",label:"gpt-5.5",hint:"latest"},{value:"gpt-5.4",label:"gpt-5.4"},{value:"gpt-5.4-mini",label:"gpt-5.4-mini",hint:"fastest"},{value:"gpt-5.3-codex",label:"gpt-5.3-codex",hint:"coding-specialized"},{value:"gpt-5.2",label:"gpt-5.2"}],sP={"claude-code":iP,codex:lP},oP={"claude-code":"Choose which Claude model powers this agent. Aliases (opus / sonnet / haiku) follow the CLI's latest-in-family mapping and may shift across releases. Applies to new sessions immediately; active sessions switch on their next message. Unset falls back to the operator's local ~/.claude/settings.json model preference, then the CLI default.",codex:"Pick a Codex model. Slugs come from the Codex CLI bundled with @openai/codex-sdk; ChatGPT-account auth currently only accepts gpt-5.5, while API-key auth accepts the wider set. Applies to new sessions immediately; active sessions switch on their next message. Unset lets the codex CLI choose a model that matches the user's auth mode."},uP={value:"",label:"(unset — inherits local)"};function cP({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const c=e!==t,f=sP[o],m=x.useMemo(()=>{const h=[uP,...f];return e!==""&&!f.some(y=>y.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return u.jsxs(sn,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["Model",c&&u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})]}),c&&u.jsx(he,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),u.jsxs(ea,{className:"space-y-2",children:[u.jsx(dP,{items:m,value:e,onChange:n,disabled:l}),u.jsx("p",{className:"text-caption text-muted-foreground",children:oP[o]})]})]})}function dP({items:e,value:t,onChange:n,disabled:a}){const[l,o]=x.useState(!1),[c,f]=x.useState(null),m=x.useRef(null),h=x.useRef(null),y=e.find(b=>b.value===t)??e[0],g=x.useCallback(()=>{const b=m.current;if(!b)return;const w=b.getBoundingClientRect();f({top:w.bottom+4,left:w.left,width:w.width})},[]);return x.useLayoutEffect(()=>{l&&g()},[l,g]),x.useEffect(()=>{if(!l)return;const b=j=>{var C,N;const E=j.target;(C=m.current)!=null&&C.contains(E)||(N=h.current)!=null&&N.contains(E)||o(!1)},w=j=>{var E;j.key==="Escape"&&(o(!1),(E=m.current)==null||E.focus())},k=()=>g();return document.addEventListener("pointerdown",b),document.addEventListener("keydown",w),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",w),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[l,g]),u.jsxs("div",{className:"max-w-md",children:[u.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(b=>!b),className:"mono flex h-9 w-full items-center justify-between rounded-[var(--radius-input)] border border-input bg-transparent pl-3 pr-2 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 hover:border-ring transition-colors cursor-pointer","aria-haspopup":"listbox","aria-expanded":l,children:[u.jsx("span",{className:"truncate",style:{color:(y==null?void 0:y.value)===""?"var(--fg-3)":void 0},children:(y==null?void 0:y.label)??t}),u.jsx(Lk,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&c&&xy.createPortal(u.jsx("div",{ref:h,className:"fixed z-50 overflow-hidden rounded-[var(--radius-input)] py-1",style:{top:c.top,left:c.left,width:c.width,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",boxShadow:"var(--shadow-md)",maxHeight:280,overflowY:"auto"},children:e.map(b=>{const w=b.value===t;return u.jsxs("button",{type:"button",onClick:()=>{n(b.value),o(!1)},className:"mono flex w-full items-center gap-2 cursor-pointer px-3 py-1.5 text-body text-left hover:bg-accent/40 transition-colors focus-visible:outline-none focus-visible:bg-accent/40",style:{background:w?"var(--bg-hover)":void 0,color:b.value===""?"var(--fg-3)":void 0},children:[u.jsx(cr,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:w?"visible":"hidden",color:"var(--state-idle)"}}),u.jsx("span",{className:"flex-1 truncate",children:b.label}),b.hint&&u.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:b.hint})]},b.value||"__unset")})}),document.body)]})}function fP(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const hP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pP={};function Aw(e,t){return(pP.jsx?mP:hP).test(e)}const gP=/[ \t\n\f\r]/g;function yP(e){return typeof e=="object"?e.type==="text"?Rw(e.value):!1:Rw(e)}function Rw(e){return e.replace(gP,"")===""}class Wu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Wu.prototype.normal={};Wu.prototype.property={};Wu.prototype.space=void 0;function dE(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Wu(n,a,t)}function Mg(e){return e.toLowerCase()}class Yn{constructor(t,n){this.attribute=n,this.property=t}}Yn.prototype.attribute="";Yn.prototype.booleanish=!1;Yn.prototype.boolean=!1;Yn.prototype.commaOrSpaceSeparated=!1;Yn.prototype.commaSeparated=!1;Yn.prototype.defined=!1;Yn.prototype.mustUseProperty=!1;Yn.prototype.number=!1;Yn.prototype.overloadedBoolean=!1;Yn.prototype.property="";Yn.prototype.spaceSeparated=!1;Yn.prototype.space=void 0;let vP=0;const Ke=Nl(),Wt=Nl(),Lg=Nl(),pe=Nl(),Et=Nl(),_s=Nl(),ir=Nl();function Nl(){return 2**++vP}const Ig=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:Wt,commaOrSpaceSeparated:ir,commaSeparated:_s,number:pe,overloadedBoolean:Lg,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),jp=Object.keys(Ig);class Fy extends Yn{constructor(t,n,a,l){let o=-1;if(super(t,n),zw(this,"space",l),typeof a=="number")for(;++o<jp.length;){const c=jp[o];zw(this,jp[o],(a&Ig[c])===Ig[c])}}}Fy.prototype.defined=!0;function zw(e,t,n){n&&(e[t]=n)}function lo(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new Fy(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Mg(a)]=a,n[Mg(o.attribute)]=a}return new Wu(t,n,e.space)}const fE=lo({properties:{ariaActiveDescendant:null,ariaAtomic:Wt,ariaAutoComplete:null,ariaBusy:Wt,ariaChecked:Wt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:Wt,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:Wt,ariaFlowTo:Et,ariaGrabbed:Wt,ariaHasPopup:null,ariaHidden:Wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:pe,ariaLive:null,ariaModal:Wt,ariaMultiLine:Wt,ariaMultiSelectable:Wt,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Wt,ariaReadOnly:Wt,ariaRelevant:null,ariaRequired:Wt,ariaRoleDescription:Et,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Wt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function hE(e,t){return t in e?e[t]:t}function mE(e,t){return hE(e,t.toLowerCase())}const bP=lo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_s,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:Et,autoFocus:Ke,autoPlay:Ke,blocking:Et,capture:null,charSet:null,checked:Ke,cite:null,className:Et,cols:pe,colSpan:null,content:null,contentEditable:Wt,controls:Ke,controlsList:Et,coords:pe|_s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:Lg,draggable:Wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:Et,height:pe,hidden:Lg,high:pe,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:Et,itemRef:Et,itemScope:Ke,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,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:Ke,optimum:pe,pattern:null,ping:Et,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:Et,required:Ke,reversed:Ke,rows:pe,rowSpan:pe,sandbox:Et,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:Wt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Wt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ke,disableRemotePlayback:Ke,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:mE}),xP=lo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ir,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_s,g2:_s,glyphName:_s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:ir,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ir,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ir,rev:ir,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ir,requiredFeatures:ir,requiredFonts:ir,requiredFormats:ir,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:ir,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ir,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ir,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hE}),pE=lo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gE=lo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mE}),yE=lo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wP={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"},SP=/[A-Z]/g,Ow=/-[a-z]/g,kP=/^data[-\w.:]+$/i;function jP(e,t){const n=Mg(t);let a=t,l=Yn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Ow,EP);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Ow.test(o)){let c=o.replace(SP,CP);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=Fy}return new l(a,t)}function CP(e){return"-"+e.toLowerCase()}function EP(e){return e.charAt(1).toUpperCase()}const NP=dE([fE,bP,pE,gE,yE],"html"),qy=dE([fE,xP,pE,gE,yE],"svg");function _P(e){return e.join(" ").trim()}var gs={},Cp,Dw;function TP(){if(Dw)return Cp;Dw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
358
|
-
`,h="/",y="*",g="",b="comment",w="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var N=1,z=1;function L(le){var ne=le.match(t);ne&&(N+=ne.length);var Z=le.lastIndexOf(m);z=~Z?le.length-Z:z+le.length}function D(){var le={line:N,column:z};return function(ne){return ne.position=new O(le),Y(),ne}}function O(le){this.start=le,this.end={line:N,column:z},this.source=C.source}O.prototype.content=E;function M(le){var ne=new Error(C.source+":"+N+":"+z+": "+le);if(ne.reason=le,ne.filename=C.source,ne.line=N,ne.column=z,ne.source=E,!C.silent)throw ne}function U(le){var ne=le.exec(E);if(ne){var Z=ne[0];return L(Z),E=E.slice(Z.length),ne}}function Y(){U(n)}function F(le){var ne;for(le=le||[];ne=J();)ne!==!1&&le.push(ne);return le}function J(){var le=D();if(!(h!=E.charAt(0)||y!=E.charAt(1))){for(var ne=2;g!=E.charAt(ne)&&(y!=E.charAt(ne)||h!=E.charAt(ne+1));)++ne;if(ne+=2,g===E.charAt(ne-1))return M("End of comment missing");var Z=E.slice(2,ne-2);return z+=2,L(Z),E=E.slice(ne),z+=2,le({type:b,comment:Z})}}function ee(){var le=D(),ne=U(a);if(ne){if(J(),!U(l))return M("property missing ':'");var Z=U(o),te=le({type:w,property:j(ne[0].replace(e,g)),value:Z?j(Z[0].replace(e,g)):g});return U(c),te}}function we(){var le=[];F(le);for(var ne;ne=ee();)ne!==!1&&(le.push(ne),F(le));return le}return Y(),we()}function j(E){return E?E.replace(f,g):g}return Cp=k,Cp}var Mw;function AP(){if(Mw)return gs;Mw=1;var e=gs&&gs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(gs,"__esModule",{value:!0}),gs.default=n;const t=e(TP());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof l=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:y}=m;f?l(h,y,m):y&&(o=o||{},o[h]=y)}),o}return gs}var uu={},Lw;function RP(){if(Lw)return uu;Lw=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},m=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,c))};return uu.camelCase=m,uu}var cu,Iw;function zP(){if(Iw)return cu;Iw=1;var e=cu&&cu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(AP()),n=RP();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(c[(0,n.camelCase)(f,o)]=m)}),c}return a.default=a,cu=a,cu}var OP=zP();const DP=ff(OP),vE=bE("end"),Hy=bE("start");function bE(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 MP(e){const t=Hy(e),n=vE(e);if(t&&n)return{start:t,end:n}}function bu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Uw(e.position):"start"in e||"end"in e?Uw(e):"line"in e||"column"in e?Ug(e):""}function Ug(e){return Pw(e&&e.line)+":"+Pw(e&&e.column)}function Uw(e){return Ug(e&&e.start)+"-"+Ug(e&&e.end)}function Pw(e){return e&&typeof e=="number"?e:1}class An extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=bu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}An.prototype.file="";An.prototype.name="";An.prototype.reason="";An.prototype.message="";An.prototype.stack="";An.prototype.column=void 0;An.prototype.line=void 0;An.prototype.ancestors=void 0;An.prototype.cause=void 0;An.prototype.fatal=void 0;An.prototype.place=void 0;An.prototype.ruleId=void 0;An.prototype.source=void 0;const Zy={}.hasOwnProperty,LP=new Map,IP=/[A-Z]/g,UP=new Set(["table","tbody","thead","tfoot","tr"]),PP=new Set(["td","th"]),xE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function BP(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=KP(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=QP(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"?qy:NP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=wE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function wE(e,t,n){if(t.type==="element")return $P(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return FP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return HP(e,t,n);if(t.type==="mdxjsEsm")return qP(e,t);if(t.type==="root")return ZP(e,t,n);if(t.type==="text")return VP(e,t)}function $P(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=qy,e.schema=l),e.ancestors.push(t);const o=kE(e,t.tagName,!1),c=GP(e,t);let f=Qy(e,t);return UP.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!yP(m):!0})),SE(e,c,o,t),Vy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function FP(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}zu(e,t.position)}function qP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zu(e,t.position)}function HP(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=qy,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:kE(e,t.name,!0),c=YP(e,t),f=Qy(e,t);return SE(e,c,o,t),Vy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function ZP(e,t,n){const a={};return Vy(a,Qy(e,t)),e.create(t,e.Fragment,a,n)}function VP(e,t){return t.value}function SE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Vy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function QP(e,t,n){return a;function a(l,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function KP(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),m=Hy(a);return t(l,o,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function GP(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Zy.call(t.properties,l)){const o=XP(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&PP.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function YP(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else zu(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else zu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function Qy(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:LP;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;c=m+"-"+h,l.set(m,h+1)}}const f=wE(e,o,c);f!==void 0&&n.push(f)}return n}function XP(e,t,n){const a=jP(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?fP(n):_P(n)),a.property==="style"){let l=typeof n=="object"?n:JP(e,String(n));return e.stylePropertyNameCase==="css"&&(l=WP(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?wP[a.property]||a.property:a.attribute,n]}}function JP(e,t){try{return DP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new An("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=xE+"#cannot-parse-style-attribute",l}}function kE(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const f=Aw(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=Aw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Zy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);zu(e)}function zu(e,t){const n=new An("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=xE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function WP(e){const t={};let n;for(n in e)Zy.call(e,n)&&(t[e9(n)]=e[n]);return t}function e9(e){let t=e.replace(IP,t9);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function t9(e){return"-"+e.toLowerCase()}const Ep={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"]},n9={};function Ky(e,t){const n=n9,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return jE(e,a,l)}function jE(e,t,n){if(r9(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 Bw(e.children,t,n)}return Array.isArray(e)?Bw(e,t,n):""}function Bw(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=jE(e[l],t,n);return a.join("")}function r9(e){return!!(e&&typeof e=="object")}const $w=document.createElement("i");function Gy(e){const t="&"+e+";";$w.innerHTML=t;const n=$w.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ur(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function Er(e,t){return e.length>0?(ur(e,e.length,0,t),e):t}const Fw={}.hasOwnProperty;function CE(e){const t={};let n=-1;for(;++n<e.length;)a9(t,e[n]);return t}function a9(e,t){let n;for(n in t){const l=(Fw.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){Fw.call(l,c)||(l[c]=[]);const f=o[c];i9(l[c],Array.isArray(f)?f:f?[f]:[])}}}function i9(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);ur(e,0,0,a)}function EE(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 Ir(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dn=Mi(/[A-Za-z]/),Tn=Mi(/[\dA-Za-z]/),l9=Mi(/[#-'*+\--9=?A-Z^-~]/);function of(e){return e!==null&&(e<32||e===127)}const Pg=Mi(/\d/),s9=Mi(/[\dA-Fa-f]/),o9=Mi(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function Ct(e){return e!==null&&(e<0||e===32)}function tt(e){return e===-2||e===-1||e===32}const Df=Mi(new RegExp("\\p{P}|\\p{S}","u")),wl=Mi(/\s/);function Mi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function so(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&Tn(e.charCodeAt(n+1))&&Tn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function ut(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return tt(m)?(e.enter(n),f(m)):t(m)}function f(m){return tt(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const u9={tokenize:c9};function c9(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"),ut(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Oe(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const d9={tokenize:f9},qw={tokenize:h9};function f9(e){const t=this,n=[];let a=0,l,o,c;return f;function f(z){if(a<n.length){const L=n[a];return t.containerState=L[1],e.attempt(L[0].continuation,m,h)(z)}return h(z)}function m(z){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&N();const L=t.events.length;let D=L,O;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){O=t.events[D][1].end;break}C(a);let M=L;for(;M<t.events.length;)t.events[M][1].end={...O},M++;return ur(t.events,D+1,0,t.events.slice(L)),t.events.length=M,h(z)}return f(z)}function h(z){if(a===n.length){if(!l)return b(z);if(l.currentConstruct&&l.currentConstruct.concrete)return k(z);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qw,y,g)(z)}function y(z){return l&&N(),C(a),b(z)}function g(z){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,k(z)}function b(z){return t.containerState={},e.attempt(qw,w,k)(z)}function w(z){return a++,n.push([t.currentConstruct,t.containerState]),b(z)}function k(z){if(z===null){l&&N(),C(0),e.consume(z);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(z)}function j(z){if(z===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(z);return}return Oe(z)?(e.consume(z),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(z),j)}function E(z,L){const D=t.sliceStream(z);if(L&&D.push(null),z.previous=o,o&&(o.next=z),o=z,l.defineSkip(z.start),l.write(D),t.parser.lazy[z.start.line]){let O=l.events.length;for(;O--;)if(l.events[O][1].start.offset<c&&(!l.events[O][1].end||l.events[O][1].end.offset>c))return;const M=t.events.length;let U=M,Y,F;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(Y){F=t.events[U][1].end;break}Y=!0}for(C(a),O=M;O<t.events.length;)t.events[O][1].end={...F},O++;ur(t.events,U+1,0,t.events.slice(M)),t.events.length=O}}function C(z){let L=n.length;for(;L-- >z;){const D=n[L];t.containerState=D[1],D[0].exit.call(t,e)}n.length=z}function N(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function h9(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gs(e){if(e===null||Ct(e)||wl(e))return 1;if(Df(e))return 2}function Mf(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 Bg={name:"attention",resolveAll:m9,tokenize:p9};function m9(e,t){let n=-1,a,l,o,c,f,m,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},b={...e[n][1].start};Hw(g,-m),Hw(b,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=Er(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=Er(h,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=Er(h,Mf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=Er(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=Er(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,ur(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 p9(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Gs(a);let o;return c;function c(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),y=Gs(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 Hw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const g9={name:"autolink",tokenize:y9};function y9(e,t,n){let a=0;return l;function l(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(w){return Dn(w)?(e.consume(w),c):w===64?n(w):h(w)}function c(w){return w===43||w===45||w===46||Tn(w)?(a=1,f(w)):h(w)}function f(w){return w===58?(e.consume(w),a=0,m):(w===43||w===45||w===46||Tn(w))&&a++<32?(e.consume(w),f):(a=0,h(w))}function m(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||of(w)?n(w):(e.consume(w),m)}function h(w){return w===64?(e.consume(w),y):l9(w)?(e.consume(w),h):n(w)}function y(w){return Tn(w)?g(w):n(w)}function g(w){return w===46?(e.consume(w),a=0,y):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):b(w)}function b(w){if((w===45||Tn(w))&&a++<63){const k=w===45?b:g;return e.consume(w),k}return n(w)}}const ec={partial:!0,tokenize:v9};function v9(e,t,n){return a;function a(o){return tt(o)?ut(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Oe(o)?t(o):n(o)}}const NE={continuation:{tokenize:x9},exit:w9,name:"blockQuote",tokenize:b9};function b9(e,t,n){const a=this;return l;function l(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return tt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function x9(e,t,n){const a=this;return l;function l(c){return tt(c)?ut(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(NE,t,n)(c)}}function w9(e){e.exit("blockQuote")}const _E={name:"characterEscape",tokenize:S9};function S9(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 o9(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const TE={name:"characterReference",tokenize:k9};function k9(e,t,n){const a=this;let l=0,o,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=Tn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=s9,y):(e.enter("characterReferenceValue"),o=7,c=Pg,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return c===Tn&&!Gy(a.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&l++<o?(e.consume(g),y):n(g)}}const Zw={partial:!0,tokenize:C9},Vw={concrete:!0,name:"codeFenced",tokenize:j9};function j9(e,t,n){const a=this,l={partial:!0,tokenize:D};let o=0,c=0,f;return m;function m(O){return h(O)}function h(O){const M=a.events[a.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(O)}function y(O){return O===f?(c++,e.consume(O),y):c<3?n(O):(e.exit("codeFencedFenceSequence"),tt(O)?ut(e,g,"whitespace")(O):g(O))}function g(O){return O===null||Oe(O)?(e.exit("codeFencedFence"),a.interrupt?t(O):e.check(Zw,j,L)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||Oe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(O)):tt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,w,"whitespace")(O)):O===96&&O===f?n(O):(e.consume(O),b)}function w(O){return O===null||Oe(O)?g(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||Oe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(O)):O===96&&O===f?n(O):(e.consume(O),k)}function j(O){return e.attempt(l,L,E)(O)}function E(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),C}function C(O){return o>0&&tt(O)?ut(e,N,"linePrefix",o+1)(O):N(O)}function N(O){return O===null||Oe(O)?e.check(Zw,j,L)(O):(e.enter("codeFlowValue"),z(O))}function z(O){return O===null||Oe(O)?(e.exit("codeFlowValue"),N(O)):(e.consume(O),z)}function L(O){return e.exit("codeFenced"),t(O)}function D(O,M,U){let Y=0;return F;function F(ne){return O.enter("lineEnding"),O.consume(ne),O.exit("lineEnding"),J}function J(ne){return O.enter("codeFencedFence"),tt(ne)?ut(O,ee,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):ee(ne)}function ee(ne){return ne===f?(O.enter("codeFencedFenceSequence"),we(ne)):U(ne)}function we(ne){return ne===f?(Y++,O.consume(ne),we):Y>=c?(O.exit("codeFencedFenceSequence"),tt(ne)?ut(O,le,"whitespace")(ne):le(ne)):U(ne)}function le(ne){return ne===null||Oe(ne)?(O.exit("codeFencedFence"),M(ne)):U(ne)}}}function C9(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const Np={name:"codeIndented",tokenize:N9},E9={partial:!0,tokenize:_9};function N9(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),ut(e,o,"linePrefix",5)(h)}function o(h){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):Oe(h)?e.attempt(E9,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Oe(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function _9(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):Oe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):ut(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Oe(c)?l(c):n(c)}}const T9={name:"codeText",previous:R9,resolve:A9,tokenize:z9};function A9(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 R9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function z9(e,t,n){let a=0,l,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):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 O9{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&&du(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),du(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),du(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);du(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);du(this.left,n.reverse())}}}function du(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 AE(e){const t={};let n=-1,a,l,o,c,f,m,h;const y=new O9(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,D9(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(a),y.splice(l,n-l+1,f))}}return ur(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function D9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],h={};let y,g,b=-1,w=n,k=0,j=0;const E=[j];for(;w;){for(;e.get(++l)[1]!==w;);o.push(l),w._tokenizer||(y=a.sliceStream(w),w.next||y.push(null),g&&c.defineSkip(w.start),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=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),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(c.events=[],w?(w._tokenizer=void 0,w.previous=void 0):E.pop(),b=E.length;b--;){const C=f.slice(E[b],E[b+1]),N=o.pop();m.push([N,N+C.length-1]),e.splice(N,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 M9={resolve:I9,tokenize:U9},L9={partial:!0,tokenize:P9};function I9(e){return AE(e),e}function U9(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(L9,c,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function P9(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ut(e,o,"linePrefix")}function o(c){if(c===null||Oe(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function RE(e,t,n,a,l,o,c,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||of(C)?n(C):(e.enter(a),e.enter(c),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"}),w(C))}function w(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:w)}function k(C){return C===60||C===62||C===92?(e.consume(C),w):w(C)}function j(C){return!y&&(C===null||C===41||Ct(C))?(e.exit("chunkString"),e.exit(f),e.exit(c),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||of(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 zE(e,t,n,a,l,o){const c=this;let f=0,m;return h;function h(w){return e.enter(a),e.enter(l),e.consume(w),e.exit(l),e.enter(o),y}function y(w){return f>999||w===null||w===91||w===93&&!m||w===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(w):w===93?(e.exit(o),e.enter(l),e.consume(w),e.exit(l),e.exit(a),t):Oe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||Oe(w)||f++>999?(e.exit("chunkString"),y(w)):(e.consume(w),m||(m=!tt(w)),w===92?b:g)}function b(w){return w===91||w===92||w===93?(e.consume(w),f++,g):g(w)}}function OE(e,t,n,a,l,o){let c;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),c=b===40?41:b,m):n(b)}function m(b){return b===c?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===c?(e.exit(o),m(c)):b===null?n(b):Oe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ut(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===c||b===null||Oe(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===c||b===92?(e.consume(b),y):y(b)}}function xu(e,t){let n;return a;function a(l){return Oe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):tt(l)?ut(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const B9={name:"definition",tokenize:F9},$9={partial:!0,tokenize:q9};function F9(e,t,n){const a=this;let l;return o;function o(w){return e.enter("definition"),c(w)}function c(w){return zE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function f(w){return l=Ir(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),m):n(w)}function m(w){return Ct(w)?xu(e,h)(w):h(w)}function h(w){return RE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function y(w){return e.attempt($9,g,g)(w)}function g(w){return tt(w)?ut(e,b,"whitespace")(w):b(w)}function b(w){return w===null||Oe(w)?(e.exit("definition"),a.parser.defined.push(l),t(w)):n(w)}}function q9(e,t,n){return a;function a(f){return Ct(f)?xu(e,l)(f):n(f)}function l(f){return OE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return tt(f)?ut(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Oe(f)?t(f):n(f)}}const H9={name:"hardBreakEscape",tokenize:Z9};function Z9(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 V9={name:"headingAtx",resolve:Q9,tokenize:K9};function Q9(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"},ur(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function K9(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&a++<6?(e.consume(y),c):y===null||Ct(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)):tt(y)?ut(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||Ct(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const G9=["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"],Qw=["pre","script","style","textarea"],Y9={concrete:!0,name:"htmlFlow",resolveTo:W9,tokenize:e8},X9={partial:!0,tokenize:n8},J9={partial:!0,tokenize:t8};function W9(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 e8(e,t,n){const a=this;let l,o,c,f,m;return h;function h(A){return y(A)}function y(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),g}function g(A){return A===33?(e.consume(A),b):A===47?(e.consume(A),o=!0,j):A===63?(e.consume(A),l=3,a.interrupt?t:_):Dn(A)?(e.consume(A),c=String.fromCharCode(A),E):n(A)}function b(A){return A===45?(e.consume(A),l=2,w):A===91?(e.consume(A),l=5,f=0,k):Dn(A)?(e.consume(A),l=4,a.interrupt?t:_):n(A)}function w(A){return A===45?(e.consume(A),a.interrupt?t:_):n(A)}function k(A){const q="CDATA[";return A===q.charCodeAt(f++)?(e.consume(A),f===q.length?a.interrupt?t:ee:k):n(A)}function j(A){return Dn(A)?(e.consume(A),c=String.fromCharCode(A),E):n(A)}function E(A){if(A===null||A===47||A===62||Ct(A)){const q=A===47,G=c.toLowerCase();return!q&&!o&&Qw.includes(G)?(l=1,a.interrupt?t(A):ee(A)):G9.includes(c.toLowerCase())?(l=6,q?(e.consume(A),C):a.interrupt?t(A):ee(A)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(A):o?N(A):z(A))}return A===45||Tn(A)?(e.consume(A),c+=String.fromCharCode(A),E):n(A)}function C(A){return A===62?(e.consume(A),a.interrupt?t:ee):n(A)}function N(A){return tt(A)?(e.consume(A),N):F(A)}function z(A){return A===47?(e.consume(A),F):A===58||A===95||Dn(A)?(e.consume(A),L):tt(A)?(e.consume(A),z):F(A)}function L(A){return A===45||A===46||A===58||A===95||Tn(A)?(e.consume(A),L):D(A)}function D(A){return A===61?(e.consume(A),O):tt(A)?(e.consume(A),D):z(A)}function O(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),m=A,M):tt(A)?(e.consume(A),O):U(A)}function M(A){return A===m?(e.consume(A),m=null,Y):A===null||Oe(A)?n(A):(e.consume(A),M)}function U(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Ct(A)?D(A):(e.consume(A),U)}function Y(A){return A===47||A===62||tt(A)?z(A):n(A)}function F(A){return A===62?(e.consume(A),J):n(A)}function J(A){return A===null||Oe(A)?ee(A):tt(A)?(e.consume(A),J):n(A)}function ee(A){return A===45&&l===2?(e.consume(A),Z):A===60&&l===1?(e.consume(A),te):A===62&&l===4?(e.consume(A),P):A===63&&l===3?(e.consume(A),_):A===93&&l===5?(e.consume(A),ve):Oe(A)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(X9,B,we)(A)):A===null||Oe(A)?(e.exit("htmlFlowData"),we(A)):(e.consume(A),ee)}function we(A){return e.check(J9,le,B)(A)}function le(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),ne}function ne(A){return A===null||Oe(A)?we(A):(e.enter("htmlFlowData"),ee(A))}function Z(A){return A===45?(e.consume(A),_):ee(A)}function te(A){return A===47?(e.consume(A),c="",ie):ee(A)}function ie(A){if(A===62){const q=c.toLowerCase();return Qw.includes(q)?(e.consume(A),P):ee(A)}return Dn(A)&&c.length<8?(e.consume(A),c+=String.fromCharCode(A),ie):ee(A)}function ve(A){return A===93?(e.consume(A),_):ee(A)}function _(A){return A===62?(e.consume(A),P):A===45&&l===2?(e.consume(A),_):ee(A)}function P(A){return A===null||Oe(A)?(e.exit("htmlFlowData"),B(A)):(e.consume(A),P)}function B(A){return e.exit("htmlFlow"),t(A)}}function t8(e,t,n){const a=this;return l;function l(c){return Oe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function n8(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(ec,t,n)}}const r8={name:"htmlText",tokenize:a8};function a8(e,t,n){const a=this;let l,o,c;return f;function f(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),m}function m(_){return _===33?(e.consume(_),h):_===47?(e.consume(_),D):_===63?(e.consume(_),z):Dn(_)?(e.consume(_),U):n(_)}function h(_){return _===45?(e.consume(_),y):_===91?(e.consume(_),o=0,k):Dn(_)?(e.consume(_),N):n(_)}function y(_){return _===45?(e.consume(_),w):n(_)}function g(_){return _===null?n(_):_===45?(e.consume(_),b):Oe(_)?(c=g,te(_)):(e.consume(_),g)}function b(_){return _===45?(e.consume(_),w):g(_)}function w(_){return _===62?Z(_):_===45?b(_):g(_)}function k(_){const P="CDATA[";return _===P.charCodeAt(o++)?(e.consume(_),o===P.length?j:k):n(_)}function j(_){return _===null?n(_):_===93?(e.consume(_),E):Oe(_)?(c=j,te(_)):(e.consume(_),j)}function E(_){return _===93?(e.consume(_),C):j(_)}function C(_){return _===62?Z(_):_===93?(e.consume(_),C):j(_)}function N(_){return _===null||_===62?Z(_):Oe(_)?(c=N,te(_)):(e.consume(_),N)}function z(_){return _===null?n(_):_===63?(e.consume(_),L):Oe(_)?(c=z,te(_)):(e.consume(_),z)}function L(_){return _===62?Z(_):z(_)}function D(_){return Dn(_)?(e.consume(_),O):n(_)}function O(_){return _===45||Tn(_)?(e.consume(_),O):M(_)}function M(_){return Oe(_)?(c=M,te(_)):tt(_)?(e.consume(_),M):Z(_)}function U(_){return _===45||Tn(_)?(e.consume(_),U):_===47||_===62||Ct(_)?Y(_):n(_)}function Y(_){return _===47?(e.consume(_),Z):_===58||_===95||Dn(_)?(e.consume(_),F):Oe(_)?(c=Y,te(_)):tt(_)?(e.consume(_),Y):Z(_)}function F(_){return _===45||_===46||_===58||_===95||Tn(_)?(e.consume(_),F):J(_)}function J(_){return _===61?(e.consume(_),ee):Oe(_)?(c=J,te(_)):tt(_)?(e.consume(_),J):Y(_)}function ee(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,we):Oe(_)?(c=ee,te(_)):tt(_)?(e.consume(_),ee):(e.consume(_),le)}function we(_){return _===l?(e.consume(_),l=void 0,ne):_===null?n(_):Oe(_)?(c=we,te(_)):(e.consume(_),we)}function le(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Ct(_)?Y(_):(e.consume(_),le)}function ne(_){return _===47||_===62||Ct(_)?Y(_):n(_)}function Z(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function te(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ie}function ie(_){return tt(_)?ut(e,ve,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):ve(_)}function ve(_){return e.enter("htmlTextData"),c(_)}}const Yy={name:"labelEnd",resolveAll:o8,resolveTo:u8,tokenize:c8},i8={tokenize:d8},l8={tokenize:f8},s8={tokenize:h8};function o8(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&&ur(e,0,e.length,n),e}function u8(e,t){let n=e.length,a=0,l,o,c,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=Er(f,e.slice(o+1,o+a+3)),f=Er(f,[["enter",y,t]]),f=Er(f,Mf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=Er(f,[["exit",y,t],e[c-2],e[c-1],["exit",h,t]]),f=Er(f,e.slice(c+1)),f=Er(f,[["exit",m,t]]),ur(e,o,e.length,f),e}function c8(e,t,n){const a=this;let l=a.events.length,o,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(b){return o?o._inactive?g(b):(c=a.parser.defined.includes(Ir(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(i8,y,c?y:g)(b):b===91?e.attempt(l8,y,c?h:g)(b):c?y(b):g(b)}function h(b){return e.attempt(s8,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function d8(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 Ct(g)?xu(e,o)(g):o(g)}function o(g){return g===41?y(g):RE(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return Ct(g)?xu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?OE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return Ct(g)?xu(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 f8(e,t,n){const a=this;return l;function l(f){return zE.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Ir(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function h8(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 m8={name:"labelStartImage",resolveAll:Yy.resolveAll,tokenize:p8};function p8(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const g8={name:"labelStartLink",resolveAll:Yy.resolveAll,tokenize:y8};function y8(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const _p={name:"lineEnding",tokenize:v8};function v8(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const Vd={name:"thematicBreak",tokenize:b8};function b8(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||Oe(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),tt(h)?ut(e,f,"whitespace")(h):f(h))}}const Hn={continuation:{tokenize:k8},exit:C8,name:"list",tokenize:S8},x8={partial:!0,tokenize:E8},w8={partial:!0,tokenize:j8};function S8(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(w){const k=a.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||w===a.containerState.marker:Pg(w)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Vd,n,h)(w):h(w);if(!a.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(w)}return n(w)}function m(w){return Pg(w)&&++c<10?(e.consume(w),m):(!a.interrupt||c<2)&&(a.containerState.marker?w===a.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||w,e.check(ec,a.interrupt?n:y,e.attempt(x8,b,g))}function y(w){return a.containerState.initialBlankLine=!0,o++,b(w)}function g(w){return tt(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),b):n(w)}function b(w){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function k8(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(ec,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ut(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!tt(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(w8,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,ut(e,e.attempt(Hn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function j8(e,t,n){const a=this;return ut(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function C8(e){e.exit(this.containerState.type)}function E8(e,t,n){const a=this;return ut(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!tt(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Kw={name:"setextUnderline",resolveTo:N8,tokenize:_8};function N8(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function _8(e,t,n){const a=this;let l;return o;function o(h){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),l=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),tt(h)?ut(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Oe(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const T8={tokenize:A8};function A8(e){const t=this,n=e.attempt(ec,a,e.attempt(this.parser.constructs.flowInitial,l,ut(e,e.attempt(this.parser.constructs.flow,l,e.attempt(M9,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 R8={resolveAll:ME()},z8=DE("string"),O8=DE("text");function DE(e){return{resolveAll:ME(e==="text"?D8:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,f);return c;function c(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),m}function m(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),m)}function h(y){if(y===null)return!0;const g=l[y];let b=-1;if(g)for(;++b<g.length;){const w=g[b];if(!w.previous||w.previous.call(a,a.previous))return!0}return!1}}}function ME(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 D8(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,c=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const M8={42:Hn,43:Hn,45:Hn,48:Hn,49:Hn,50:Hn,51:Hn,52:Hn,53:Hn,54:Hn,55:Hn,56:Hn,57:Hn,62:NE},L8={91:B9},I8={[-2]:Np,[-1]:Np,32:Np},U8={35:V9,42:Vd,45:[Kw,Vd],60:Y9,61:Kw,95:Vd,96:Vw,126:Vw},P8={38:TE,92:_E},B8={[-5]:_p,[-4]:_p,[-3]:_p,33:m8,38:TE,42:Bg,60:[g9,r8],91:g8,92:[H9,_E],93:Yy,95:Bg,96:T9},$8={null:[Bg,R8]},F8={null:[42,95]},q8={null:[]},H8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:F8,contentInitial:L8,disable:q8,document:M8,flow:U8,flowInitial:I8,insideSpan:$8,string:P8,text:B8},Symbol.toStringTag,{value:"Module"}));function Z8(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let c=[],f=[];const m={attempt:M(D),check:M(O),consume:N,enter:z,exit:L,interrupt:M(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:w,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(J){return c=Er(c,J),E(),c[c.length-1]!==null?[]:(U(t,0),h.events=Mf(o,h.events,h),h.events)}function b(J,ee){return Q8(w(J),ee)}function w(J){return V8(c,J)}function k(){const{_bufferIndex:J,_index:ee,line:we,column:le,offset:ne}=a;return{_bufferIndex:J,_index:ee,line:we,column:le,offset:ne}}function j(J){l[J.line]=J.column,F()}function E(){let J;for(;a._index<c.length;){const ee=c[a._index];if(typeof ee=="string")for(J=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===J&&a._bufferIndex<ee.length;)C(ee.charCodeAt(a._bufferIndex));else C(ee)}}function C(J){y=y(J)}function N(J){Oe(J)?(a.line++,a.column=1,a.offset+=J===-3?2:1,F()):J!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=J}function z(J,ee){const we=ee||{};return we.type=J,we.start=k(),h.events.push(["enter",we,h]),f.push(we),we}function L(J){const ee=f.pop();return ee.end=k(),h.events.push(["exit",ee,h]),ee}function D(J,ee){U(J,ee.from)}function O(J,ee){ee.restore()}function M(J,ee){return we;function we(le,ne,Z){let te,ie,ve,_;return Array.isArray(le)?B(le):"tokenize"in le?B([le]):P(le);function P(ce){return be;function be(xe){const me=xe!==null&&ce[xe],Xe=xe!==null&&ce.null,Le=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Xe)?Xe:Xe?[Xe]:[]];return B(Le)(xe)}}function B(ce){return te=ce,ie=0,ce.length===0?Z:A(ce[ie])}function A(ce){return be;function be(xe){return _=Y(),ve=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?G():ce.tokenize.call(ee?Object.assign(Object.create(h),ee):h,m,q,G)(xe)}}function q(ce){return J(ve,_),ne}function G(ce){return _.restore(),++ie<te.length?A(te[ie]):Z}}}function U(J,ee){J.resolveAll&&!o.includes(J)&&o.push(J),J.resolve&&ur(h.events,ee,h.events.length-ee,J.resolve(h.events.slice(ee),h)),J.resolveTo&&(h.events=J.resolveTo(h.events,h))}function Y(){const J=k(),ee=h.previous,we=h.currentConstruct,le=h.events.length,ne=Array.from(f);return{from:le,restore:Z};function Z(){a=J,h.previous=ee,h.currentConstruct=we,h.events.length=le,f=ne,F()}}function F(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function V8(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function Q8(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
|
|
359
|
-
`;break}case-3:{c=`\r
|
|
360
|
-
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function K8(e){const a={constructs:CE([H8,...(e||{}).extensions||[]]),content:l(u9),defined:[],document:l(d9),flow:l(T8),lazy:{},string:l(z8),text:l(O8)};return a;function l(o){return c;function c(f){return Z8(a,o,f)}}}function G8(e){for(;!AE(e););return e}const Gw=/[\0\t\n\r]/g;function Y8(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const m=[];let h,y,g,b,w;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(Gw.lastIndex=g,h=Gw.exec(o),b=h&&h.index!==void 0?h.index:o.length,w=o.charCodeAt(b),!h){t=o.slice(g);break}if(w===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),w){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 X8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function J8(e){return e.replace(X8,W8)}function W8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return EE(n.slice(o?2:1),o?16:10)}return Gy(n)||e}const LE={}.hasOwnProperty;function eB(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),tB(n)(G8(K8(n).document().write(Y8()(e,t,!0))))}function tB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ma),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:o(Pe),blockQuote:o(Xe),characterEscape:Y,characterReference:Y,codeFenced:o(Le),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Le,c),codeText:o(re,c),codeTextData:Y,data:Y,codeFlowValue:Y,definition:o(Ee),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Ie),hardBreakEscape:o(Lt),hardBreakTrailing:o(Lt),htmlFlow:o(hn,c),htmlFlowData:Y,htmlText:o(hn,c),htmlTextData:Y,image:o(_l),label:c,link:o(Ma),listItem:o(na),listItemValue:b,listOrdered:o(La,g),listUnordered:o(La),paragraph:o(oo),reference:A,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Pe),strong:o(uo),thematicBreak:o(co)},exit:{atxHeading:m(),atxHeadingSequence:D,autolink:m(),autolinkEmail:me,autolinkProtocol:xe,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:G,characterReferenceMarkerNumeric:G,characterReferenceValue:ce,characterReference:be,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:m(C),codeText:m(ne),codeTextData:F,data:F,definition:m(),definitionDestinationString:L,definitionLabelString:N,definitionTitleString:z,emphasis:m(),hardBreakEscape:m(ee),hardBreakTrailing:m(ee),htmlFlow:m(we),htmlFlowData:F,htmlText:m(le),htmlTextData:F,image:m(te),label:ve,labelText:ie,lineEnding:J,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:q,resourceDestinationString:_,resourceTitleString:P,resource:B,setextHeading:m(U),setextHeadingLineSequence:M,setextHeadingText:O,strong:m(),thematicBreak:m()}};IE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(se){let ye={type:"root",children:[]};const Ue={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:y,data:n},Fe=[];let at=-1;for(;++at<se.length;)if(se[at][1].type==="listOrdered"||se[at][1].type==="listUnordered")if(se[at][0]==="enter")Fe.push(at);else{const pn=Fe.pop();at=l(se,pn,at)}for(at=-1;++at<se.length;){const pn=t[se[at][0]];LE.call(pn,se[at][1].type)&&pn[se[at][1].type].call(Object.assign({sliceSerialize:se[at][2].sliceSerialize},Ue),se[at][1])}if(Ue.tokenStack.length>0){const pn=Ue.tokenStack[Ue.tokenStack.length-1];(pn[1]||Yw).call(Ue,void 0,pn[0])}for(ye.position={start:ci(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:ci(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)ye=t.transforms[at](ye)||ye;return ye}function l(se,ye,Ue){let Fe=ye-1,at=-1,pn=!1,fr,nn,Zt,gn;for(;++Fe<=Ue;){const ht=se[Fe];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?at++:at--,gn=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(fr&&!gn&&!at&&!Zt&&(Zt=Fe),gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gn=void 0}if(!at&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||at===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(fr){let zr=Fe;for(nn=void 0;zr--;){const Ln=se[zr];if(Ln[1].type==="lineEnding"||Ln[1].type==="lineEndingBlank"){if(Ln[0]==="exit")continue;nn&&(se[nn][1].type="lineEndingBlank",pn=!0),Ln[1].type="lineEnding",nn=zr}else if(!(Ln[1].type==="linePrefix"||Ln[1].type==="blockQuotePrefix"||Ln[1].type==="blockQuotePrefixWhitespace"||Ln[1].type==="blockQuoteMarker"||Ln[1].type==="listItemIndent"))break}Zt&&(!nn||Zt<nn)&&(fr._spread=!0),fr.end=Object.assign({},nn?se[nn][1].start:ht[1].end),se.splice(nn||Fe,0,["exit",fr,ht[2]]),Fe++,Ue++}if(ht[1].type==="listItemPrefix"){const zr={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};fr=zr,se.splice(Fe,0,["enter",zr,ht[2]]),Fe++,Ue++,Zt=void 0,gn=!0}}}return se[ye][1]._spread=pn,Ue}function o(se,ye){return Ue;function Ue(Fe){f.call(this,se(Fe),Fe),ye&&ye.call(this,Fe)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(se,ye,Ue){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([ye,Ue||void 0]),se.position={start:ci(ye.start),end:void 0}}function m(se){return ye;function ye(Ue){se&&se.call(this,Ue),h.call(this,Ue)}}function h(se,ye){const Ue=this.stack.pop(),Fe=this.tokenStack.pop();if(Fe)Fe[0].type!==se.type&&(ye?ye.call(this,se,Fe[0]):(Fe[1]||Yw).call(this,se,Fe[0]));else throw new Error("Cannot close `"+se.type+"` ("+bu({start:se.start,end:se.end})+"): it’s not open");Ue.position.end=ci(se.end)}function y(){return Ky(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(se){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function w(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=se}function k(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=se}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/(\r?\n|\r)$/g,"")}function N(se){const ye=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ye,Ue.identifier=Ir(this.sliceSerialize(se)).toLowerCase()}function z(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function L(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function D(se){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Ue=this.sliceSerialize(se).length;ye.depth=Ue}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function M(se){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(se){const Ue=this.stack[this.stack.length-1].children;let Fe=Ue[Ue.length-1];(!Fe||Fe.type!=="text")&&(Fe=mn(),Fe.position={start:ci(se.start),end:void 0},Ue.push(Fe)),this.stack.push(Fe)}function F(se){const ye=this.stack.pop();ye.value+=this.sliceSerialize(se),ye.position.end=ci(se.end)}function J(se){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ue=ye.children[ye.children.length-1];Ue.position.end=ci(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(Y.call(this,se),F.call(this,se))}function ee(){this.data.atHardBreak=!0}function we(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function le(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function ne(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function Z(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function te(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function ie(se){const ye=this.sliceSerialize(se),Ue=this.stack[this.stack.length-2];Ue.label=J8(ye),Ue.identifier=Ir(ye).toLowerCase()}function ve(){const se=this.stack[this.stack.length-1],ye=this.resume(),Ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ue.type==="link"){const Fe=se.children;Ue.children=Fe}else Ue.alt=ye}function _(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function P(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function B(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function q(se){const ye=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ye,Ue.identifier=Ir(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function G(se){this.data.characterReferenceType=se.type}function ce(se){const ye=this.sliceSerialize(se),Ue=this.data.characterReferenceType;let Fe;Ue?(Fe=EE(ye,Ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Fe=Gy(ye);const at=this.stack[this.stack.length-1];at.value+=Fe}function be(se){const ye=this.stack.pop();ye.position.end=ci(se.end)}function xe(se){F.call(this,se);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(se)}function me(se){F.call(this,se);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(se)}function Xe(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function re(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function Pe(){return{type:"heading",depth:0,children:[]}}function Lt(){return{type:"break"}}function hn(){return{type:"html",value:""}}function _l(){return{type:"image",title:null,url:"",alt:null}}function Ma(){return{type:"link",title:null,url:"",children:[]}}function La(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function na(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function oo(){return{type:"paragraph",children:[]}}function uo(){return{type:"strong",children:[]}}function mn(){return{type:"text",value:""}}function co(){return{type:"thematicBreak"}}}function ci(e){return{line:e.line,column:e.column,offset:e.offset}}function IE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?IE(e,a):nB(e,a)}}function nB(e,t){let n;for(n in t)if(LE.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 Yw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bu({start:t.start,end:t.end})+") is still open")}function rB(e){const t=this;t.parser=n;function n(a){return eB(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function aB(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 iB(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
361
|
-
`}]}function lB(e,t){const n=t.value?t.value+`
|
|
362
|
-
`:"",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 sB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=so(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,f+=1,e.footnoteCounts.set(a,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function cB(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 dB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function UE(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function fB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return UE(e,t);const l={src:so(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function hB(e,t){const n={src:so(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function mB(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 pB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return UE(e,t);const l={href:so(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function gB(e,t){const n={href:so(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function yB(e,t,n){const a=e.all(t),l=n?vB(n):PE(t),o={},c=[];if(typeof t.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const y=a[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
|
|
363
|
-
`}),y.type==="element"&&y.tagName==="p"&&!l?c.push(...y.children):c.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
364
|
-
`});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function vB(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=PE(n[a])}return t}function PE(e){const t=e.spread;return t??e.children.length>1}function bB(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const c=a[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function xB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function SB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kB(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),l.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Hy(t.children[1]),m=vE(t.children[t.children.length-1]);f&&m&&(c.position={start:f,end:m}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function jB(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,f=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],b={},w=c?c[m]:void 0;w&&(b.align=w);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 CB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xw=9,Jw=32;function EB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(Ww(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(Ww(t.slice(l),l>0,!1)),o.join("")}function Ww(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===Xw||o===Jw;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===Xw||o===Jw;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function NB(e,t){const n={type:"text",value:EB(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 TB={blockquote:aB,break:iB,code:lB,delete:sB,emphasis:oB,footnoteReference:uB,heading:cB,html:dB,imageReference:fB,image:hB,inlineCode:mB,linkReference:pB,link:gB,listItem:yB,list:bB,paragraph:xB,root:wB,strong:SB,table:kB,tableCell:CB,tableRow:jB,text:NB,thematicBreak:_B,toml:zd,yaml:zd,definition:zd,footnoteDefinition:zd};function zd(){}const BE=-1,Lf=0,wu=1,uf=2,Xy=3,Jy=4,Wy=5,ev=6,$E=7,FE=8,eS=typeof self=="object"?self:globalThis,AB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case Lf:case BE:return n(c,l);case wu:{const f=n([],l);for(const m of c)f.push(a(m));return f}case uf:{const f=n({},l);for(const[m,h]of c)f[a(m)]=a(h);return f}case Xy:return n(new Date(c),l);case Jy:{const{source:f,flags:m}=c;return n(new RegExp(f,m),l)}case Wy:{const f=n(new Map,l);for(const[m,h]of c)f.set(a(m),a(h));return f}case ev:{const f=n(new Set,l);for(const m of c)f.add(a(m));return f}case $E:{const{name:f,message:m}=c;return n(new eS[f](m),l)}case FE:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return n(new DataView(f),c)}}return n(new eS[o](c),l)};return a},tS=e=>AB(new Map,e)(0),ys="",{toString:RB}={},{keys:zB}=Object,fu=e=>{const t=typeof e;if(t!=="object"||!e)return[Lf,t];const n=RB.call(e).slice(8,-1);switch(n){case"Array":return[wu,ys];case"Object":return[uf,ys];case"Date":return[Xy,ys];case"RegExp":return[Jy,ys];case"Map":return[Wy,ys];case"Set":return[ev,ys];case"DataView":return[wu,n]}return n.includes("Array")?[wu,n]:n.includes("Error")?[$E,n]:[uf,n]},Od=([e,t])=>e===Lf&&(t==="function"||t==="symbol"),OB=(e,t,n,a)=>{const l=(c,f)=>{const m=a.push(c)-1;return n.set(f,m),m},o=c=>{if(n.has(c))return n.get(c);let[f,m]=fu(c);switch(f){case Lf:{let y=c;switch(m){case"bigint":f=FE,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([BE],c)}return l([f,y],c)}case wu:{if(m){let b=c;return m==="DataView"?b=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(c)),l([m,[...b]],c)}const y=[],g=l([f,y],c);for(const b of c)y.push(o(b));return g}case uf:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const y=[],g=l([f,y],c);for(const b of zB(c))(e||!Od(fu(c[b])))&&y.push([o(b),o(c[b])]);return g}case Xy:return l([f,c.toISOString()],c);case Jy:{const{source:y,flags:g}=c;return l([f,{source:y,flags:g}],c)}case Wy:{const y=[],g=l([f,y],c);for(const[b,w]of c)(e||!(Od(fu(b))||Od(fu(w))))&&y.push([o(b),o(w)]);return g}case ev:{const y=[],g=l([f,y],c);for(const b of c)(e||!Od(fu(b)))&&y.push(o(b));return g}}const{message:h}=c;return l([f,{name:m,message:h}],c)};return o},nS=(e,{json:t,lossy:n}={})=>{const a=[];return OB(!(t||n),!!t,new Map,a)(e),a},cf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?tS(nS(e,t)):structuredClone(e):(e,t)=>tS(nS(e,t));function DB(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 MB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function LB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||DB,a=e.options.footnoteBackLabel||MB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const y=e.all(h),g=String(h.identifier).toUpperCase(),b=so(g.toLowerCase());let w=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++w<=j;){k.length>0&&k.push({type:"text",value:" "});let N=typeof n=="string"?n:n(m,w);typeof N=="string"&&(N={type:"text",value:N}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,w),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const N=E.children[E.children.length-1];N&&N.type==="text"?N.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:{...cf(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
365
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
366
|
-
`}]}}const If=(function(e){if(e==null)return BB;if(typeof e=="function")return Uf(e);if(typeof e=="object")return Array.isArray(e)?IB(e):UB(e);if(typeof e=="string")return PB(e);throw new Error("Expected function, string, or object as test")});function IB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=If(e[n]);return Uf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function UB(e){const t=e;return Uf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function PB(e){return Uf(t);function t(n){return n&&n.type===e}}function Uf(e){return t;function t(n,a,l){return!!($B(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function BB(){return!0}function $B(e){return e!==null&&typeof e=="object"&&"type"in e}const qE=[],FB=!0,$g=!1,qB="skip";function HE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=If(l),c=a?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return b;function b(){let w=qE,k,j,E;if((!t||o(m,h,y[y.length-1]||void 0))&&(w=HB(n(m,y)),w[0]===$g))return w;if("children"in m&&m.children){const C=m;if(C.children&&w[0]!==qB)for(j=(a?C.children.length:-1)+c,E=y.concat(C);j>-1&&j<C.children.length;){const N=C.children[j];if(k=f(N,j,E)(),k[0]===$g)return k;j=typeof k[1]=="number"?k[1]:j+c}}return w}}}function HB(e){return Array.isArray(e)?e:typeof e=="number"?[FB,e]:e==null?qE:[e]}function tv(e,t,n,a){let l,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,l=n):(o=t,c=n,l=a),HE(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return c(m,g,y)}}const Fg={}.hasOwnProperty,ZB={};function VB(e,t){const n=t||ZB,a=new Map,l=new Map,o=new Map,c={...TB,...n.handlers},f={all:h,applyData:KB,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:QB,wrap:YB};return tv(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,w=f.handlers[b];if(Fg.call(f.handlers,b)&&w)return w(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...E}=y,C=cf(E);return C.children=f.all(y),C}return cf(y)}return(f.options.unknownHandler||GB)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let w=-1;for(;++w<b.length;){const k=f.one(b[w],y);if(k){if(w&&b[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=rS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=rS(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function QB(e,t){e.position&&(t.position=MP(e))}function KB(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,cf(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function GB(e,t){const n=t.data||{},a="value"in t&&!(Fg.call(n,"hProperties")||Fg.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 YB(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
367
|
-
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
368
|
-
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
369
|
-
`}),n}function rS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function aS(e,t){const n=VB(e,t),a=n.one(e,void 0),l=LB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
370
|
-
`},l),o}function XB(e,t){return e&&"run"in e?async function(n,a){const l=aS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return aS(n,{file:a,...e||t})}}function iS(e){if(e)throw e}var Tp,lS;function JB(){if(lS)return Tp;lS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},c=function(h,y){n&&y.name==="__proto__"?n(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(a)return a(h,y).value}else return;return h[y]};return Tp=function m(){var h,y,g,b,w,k,j=arguments[0],E=1,C=arguments.length,N=!1;for(typeof j=="boolean"&&(N=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&&(N&&b&&(o(b)||(w=l(b)))?(w?(w=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},c(j,{name:y,newValue:m(N,k,b)})):typeof b<"u"&&c(j,{name:y,newValue:b}));return j},Tp}var WB=JB();const Ap=ff(WB);function qg(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 e$(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){c(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?t$(y,f)(...h):c(null,...h)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function t$(e,t){let n;return a;function a(...c){const f=e.length>c.length;let m;f&&c.push(l);try{m=e.apply(this,c)}catch(h){const y=h;if(f&&n)throw y;return l(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(c,...f){n||(n=!0,t(c,...f))}function o(c){l(null,c)}}const Hr={basename:n$,dirname:r$,extname:a$,join:i$,sep:"/"};function n$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');tc(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function r$(e){if(tc(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 a$(e){tc(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function i$(...e){let t=-1,n;for(;++t<e.length;)tc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":l$(n)}function l$(e){tc(e);const t=e.codePointAt(0)===47;let n=s$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function s$(e,t){let n="",a=0,l=-1,o=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else f===46&&o>-1?o++:o=-1}return n}function tc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const o$={cwd:u$};function u$(){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 c$(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 d$(e)}function d$(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 Rp=["history","path","basename","stem","extname","dirname"];class ZE{constructor(t){let n;t?Hg(t)?n={path:t}:typeof t=="string"||f$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":o$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Rp.length;){const o=Rp[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)Rp.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Hr.basename(this.path):void 0}set basename(t){Op(t,"basename"),zp(t,"basename"),this.path=Hr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Hr.dirname(this.path):void 0}set dirname(t){sS(this.basename,"dirname"),this.path=Hr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Hr.extname(this.path):void 0}set extname(t){if(zp(t,"extname"),sS(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=Hr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Hg(t)&&(t=c$(t)),Op(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Hr.basename(this.path,this.extname):void 0}set stem(t){Op(t,"stem"),zp(t,"stem"),this.path=Hr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new An(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function zp(e,t){if(e&&e.includes(Hr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Hr.sep+"`")}function Op(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function f$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const h$=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),m$={}.hasOwnProperty;class nv extends h${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=e$()}copy(){const t=new nv;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Ap(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Lp("data",this.frozen),this.namespace[t]=n,this):m$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Lp("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=Dd(t),a=this.parser||this.Parser;return Dp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Dp("process",this.parser||this.Parser),Mp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const f=Dd(t),m=a.parse(f);a.run(m,f,function(y,g,b){if(y||!g||!b)return h(y);const w=g,k=a.stringify(w,b);y$(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?c(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),Dp("processSync",this.parser||this.Parser),Mp("processSync",this.compiler||this.Compiler),this.process(t,l),uS("processSync","process",n),a;function l(o,c){n=!0,iS(o),a=c}}run(t,n,a){oS(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,f){const m=Dd(n);l.run(t,m,h);function h(y,g,b){const w=g||t;y?f(y):c?c(w):a(void 0,w,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),uS("runSync","run",a),l;function o(c,f){iS(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=Dd(n),l=this.compiler||this.Compiler;return Mp("stringify",l),oS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Lp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;m(y,g)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(l.settings=Ap(!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[w,...k]=y;const j=a[b][1];qg(j)&&qg(w)&&(w=Ap(!0,j,w)),a[b]=[h,w,...k]}}}}const p$=new nv().freeze();function Dp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Mp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lp(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 oS(e){if(!qg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function uS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dd(e){return g$(e)?e:new ZE(e)}function g$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function y$(e){return typeof e=="string"||v$(e)}function v$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const b$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",cS=[],dS={allowDangerousHtml:!0},x$=/^(https?|ircs?|mailto|xmpp)$/i,w$=[{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 S$(e){const t=k$(e),n=j$(e);return C$(t.runSync(t.parse(n),n),e)}function k$(e){const t=e.rehypePlugins||cS,n=e.remarkPlugins||cS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dS}:dS;return p$().use(rB).use(n).use(XB,a).use(t)}function j$(e){const t=e.children||"",n=new ZE;return typeof t=="string"&&(n.value=t),n}function C$(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||E$;for(const y of w$)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+b$+y.id,void 0);return tv(e,h),BP(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return c?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let w;for(w in Ep)if(Object.hasOwn(Ep,w)&&Object.hasOwn(y.properties,w)){const k=y.properties[w],j=Ep[w];(j===null||j.includes(y.tagName))&&(y.properties[w]=m(String(k||""),w,y))}}if(y.type==="element"){let w=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!w&&a&&typeof g=="number"&&(w=!a(y,g,b)),w&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function E$(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||x$.test(e.slice(0,t))?e:""}function N$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function VE(e,t,n){const l=If((n||{}).ignore||[]),o=_$(t);let c=-1;for(;++c<o.length;)HE(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const w=y[g],k=b?b.children:void 0;if(l(w,k?k.indexOf(w):void 0,b))return;b=w}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[c][0],w=o[c][1];let k=0;const E=g.children.indexOf(h);let C=!1,N=[];b.lastIndex=0;let z=b.exec(h.value);for(;z;){const L=z.index,D={index:z.index,input:z.input,stack:[...y,h]};let O=w(...z,D);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?b.lastIndex=L+1:(k!==L&&N.push({type:"text",value:h.value.slice(k,L)}),Array.isArray(O)?N.push(...O):O&&N.push(O),k=L+z[0].length,C=!0),!b.global)break;z=b.exec(h.value)}return C?(k<h.value.length&&N.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...N)):N=[h],E+N.length}}function _$(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([T$(l[0]),A$(l[1])])}return t}function T$(e){return typeof e=="string"?new RegExp(N$(e),"g"):e}function A$(e){return typeof e=="function"?e:function(){return e}}function R$(e){VE(e,[/\r?\n|\r/g,z$])}function z$(){return{type:"break"}}function O$(){return function(e){R$(e)}}function fS(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 Ip="phrasing",Up=["autolink","link","image","label"];function D$(){return{transforms:[$$],enter:{literalAutolink:L$,literalAutolinkEmail:Pp,literalAutolinkHttp:Pp,literalAutolinkWww:Pp},exit:{literalAutolink:B$,literalAutolinkEmail:P$,literalAutolinkHttp:I$,literalAutolinkWww:U$}}}function M$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ip,notInConstruct:Up},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ip,notInConstruct:Up},{character:":",before:"[ps]",after:"\\/",inConstruct:Ip,notInConstruct:Up}]}}function L$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Pp(e){this.config.enter.autolinkProtocol.call(this,e)}function I$(e){this.config.exit.autolinkProtocol.call(this,e)}function U$(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 P$(e){this.config.exit.autolinkEmail.call(this,e)}function B$(e){this.exit(e)}function $$(e){VE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,F$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),q$]],{ignore:["link","linkReference"]})}function F$(e,t,n,a,l){let o="";if(!QE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!H$(n)))return!1;const c=Z$(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function q$(e,t,n,a){return!QE(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function H$(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 Z$(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=fS(e,"(");let o=fS(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 QE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||wl(n)||Df(n))&&(!t||n!==47)}KE.peek=eF;function V$(){this.buffer()}function Q$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function K$(){this.buffer()}function G$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Y$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ir(this.sliceSerialize(e)).toLowerCase(),n.label=t}function X$(e){this.exit(e)}function J$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ir(this.sliceSerialize(e)).toLowerCase(),n.label=t}function W$(e){this.exit(e)}function eF(){return"["}function KE(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),c(),o+=l.move("]"),o}function tF(){return{enter:{gfmFootnoteCallString:V$,gfmFootnoteCall:Q$,gfmFootnoteDefinitionLabelString:K$,gfmFootnoteDefinition:G$},exit:{gfmFootnoteCallString:Y$,gfmFootnoteCall:X$,gfmFootnoteDefinitionLabelString:J$,gfmFootnoteDefinition:W$}}}function nF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:KE},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const f=o.createTracker(c);let m=f.move("[^");const h=o.enter("footnoteDefinition"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),y(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
371
|
-
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?GE:rF))),h(),m}}function rF(e,t,n){return t===0?e:GE(e,t,n)}function GE(e,t,n){return(n?"":" ")+e}const aF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];YE.peek=uF;function iF(){return{canContainEols:["delete"],enter:{strikethrough:sF},exit:{strikethrough:oF}}}function lF(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:aF}],handlers:{delete:YE}}}function sF(e){this.enter({type:"delete",children:[]},e)}function oF(e){this.exit(e)}function YE(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function uF(){return"~"}function cF(e){return e.length}function dF(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||cF,o=[],c=[],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 N=fF(e[y][C]);if(n.alignDelimiters!==!1){const z=l(N);E[C]=z,(m[C]===void 0||z>m[C])&&(m[C]=z)}j.push(N)}c[y]=j,f[y]=E}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=hS(a[g]);else{const j=hS(a);for(;++g<h;)o[g]=j}g=-1;const b=[],w=[];for(;++g<h;){const j=o[g];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let N=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-C.length);const z=E+"-".repeat(N)+C;n.alignDelimiters!==!1&&(N=E.length+N+C.length,N>m[g]&&(m[g]=N),w[g]=N),b[g]=z}c.splice(1,0,b),f.splice(1,0,w),y=-1;const k=[];for(;++y<c.length;){const j=c[y],E=f[y];g=-1;const C=[];for(;++g<h;){const N=j[g]||"";let z="",L="";if(n.alignDelimiters!==!1){const D=m[g]-(E[g]||0),O=o[g];O===114?z=" ".repeat(D):O===99?D%2?(z=" ".repeat(D/2+.5),L=" ".repeat(D/2-.5)):(z=" ".repeat(D/2),L=z):L=" ".repeat(D)}n.delimiterStart!==!1&&!g&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||g)&&C.push(" "),n.alignDelimiters!==!1&&C.push(z),C.push(N),n.alignDelimiters!==!1&&C.push(L),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(`
|
|
372
|
-
`)}function fF(e){return e==null?"":String(e)}function hS(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 hF(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),mF);return l(),c}function mF(e,t,n){return">"+(n?"":" ")+e}function pF(e,t){return mS(e,t.inConstruct,!0)&&!mS(e,t.notInConstruct,!1)}function mS(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 pS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
373
|
-
`&&pF(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
374
|
-
`}function gF(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>c&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function yF(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 vF(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 bF(e,t,n,a){const l=vF(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(yF(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,xF);return g(),b}const f=n.createTracker(a),m=l.repeat(Math.max(gF(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${c}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
|
|
375
|
-
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
|
|
376
|
-
`),o&&(y+=f.move(o+`
|
|
377
|
-
`)),y+=f.move(m),h(),y}function xF(e,t,n){return(n?"":" ")+e}function rv(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 wF(e,t,n,a){const l=rv(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("definition");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
378
|
-
`,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),c(),h}function SF(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ou(e){return"&#x"+e.toString(16).toUpperCase()+";"}function df(e,t,n){const a=Gs(e),l=Gs(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}}XE.peek=kF;function XE(e,t,n,a){const l=SF(n),o=n.enter("emphasis"),c=n.createTracker(a),f=c.move(l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=df(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Ou(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=df(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+Ou(g));const w=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function kF(e,t,n){return n.options.emphasis||"*"}function jF(e,t){let n=!1;return tv(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,$g}),!!((!e.depth||e.depth<3)&&Ky(e)&&(t.options.setext||n))}function CF(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(jF(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
379
|
-
`,after:`
|
|
380
|
-
`});return g(),y(),b+`
|
|
381
|
-
`+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
382
|
-
`))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
383
|
-
`,...o.current()});return/^[\t ]/.test(h)&&(h=Ou(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),f(),h}JE.peek=EF;function JE(e){return e.value||""}function EF(){return"<"}WE.peek=NF;function WE(e,t,n,a){const l=rv(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),c(),h}function NF(){return"!"}eN.peek=_F;function eN(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function _F(){return"!"}tN.peek=TF;function tN(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],f=n.compilePattern(c);let m;if(c.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return l+a+l}function TF(){return"`"}function nN(e,t){const n=Ky(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))}rN.peek=AF;function rN(e,t,n,a){const l=rv(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,m;if(nN(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=c.move(" "+l),h+=c.move(n.safe(e.title,{before:h,after:l,...c.current()})),h+=c.move(l),m()),h+=c.move(")"),f(),h}function AF(e,t,n){return nN(e,n)?"<":"["}aN.peek=RF;function aN(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function RF(){return"["}function av(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 zF(e){const t=av(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 OF(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 iN(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 DF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?OF(n):av(n);const f=e.ordered?c==="."?")":".":zF(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),iN(n)===c&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=f),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,l(),h}function MF(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 LF(e,t,n,a){const l=MF(n);let o=n.bulletCurrent||av(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(c-o.length)),f.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,b,w){return b?(w?"":" ".repeat(c))+g:(w?o:o+" ".repeat(c-o.length))+g}}function IF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const UF=If(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function PF(e,t,n,a){return(e.children.some(function(c){return UF(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function BF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lN.peek=$F;function lN(e,t,n,a){const l=BF(n),o=n.enter("strong"),c=n.createTracker(a),f=c.move(l+l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=df(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Ou(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=df(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+Ou(g));const w=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function $F(e,t,n){return n.options.strong||"*"}function FF(e,t,n,a){return n.safe(e.value,a)}function qF(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 HF(e,t,n){const a=(iN(n)+(n.options.ruleSpaces?" ":"")).repeat(qF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const sN={blockquote:hF,break:pS,code:bF,definition:wF,emphasis:XE,hardBreak:pS,heading:CF,html:JE,image:WE,imageReference:eN,inlineCode:tN,link:rN,linkReference:aN,list:DF,listItem:LF,paragraph:IF,root:PF,strong:lN,text:FF,thematicBreak:HF};function ZF(){return{enter:{table:VF,tableData:gS,tableHeader:gS,tableRow:KF},exit:{codeText:GF,table:QF,tableData:Bp,tableHeader:Bp,tableRow:Bp}}}function VF(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 QF(e){this.exit(e),this.data.inTable=void 0}function KF(e){this.enter({type:"tableRow",children:[]},e)}function Bp(e){this.exit(e)}function gS(e){this.enter({type:"tableCell",children:[]},e)}function GF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,YF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function YF(e,t){return t==="|"?t:e}function XF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
384
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:c,tableCell:m,tableRow:f}};function c(w,k,j,E){return h(y(w,j,E),w.align)}function f(w,k,j,E){const C=g(w,j,E),N=h([C]);return N.slice(0,N.indexOf(`
|
|
385
|
-
`))}function m(w,k,j,E){const C=j.enter("tableCell"),N=j.enter("phrasing"),z=j.containerPhrasing(w,{...E,before:o,after:o});return N(),C(),z}function h(w,k){return dF(w,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(w,k,j){const E=w.children;let C=-1;const N=[],z=k.enter("table");for(;++C<E.length;)N[C]=g(E[C],k,j);return z(),N}function g(w,k,j){const E=w.children;let C=-1;const N=[],z=k.enter("tableRow");for(;++C<E.length;)N[C]=m(E[C],w,k,j);return z(),N}function b(w,k,j){let E=sN.inlineCode(w,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function JF(){return{exit:{taskListCheckValueChecked:yS,taskListCheckValueUnchecked:yS,paragraph:eq}}}function WF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:tq}}}function yS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function eq(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){c=f;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function tq(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(c);let m=sN.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+c}}function nq(){return[D$(),tF(),iF(),ZF(),JF()]}function rq(e){return{extensions:[M$(),nF(e),lF(),XF(e),WF()]}}const aq={tokenize:cq,partial:!0},oN={tokenize:dq,partial:!0},uN={tokenize:fq,partial:!0},cN={tokenize:hq,partial:!0},iq={tokenize:mq,partial:!0},dN={name:"wwwAutolink",tokenize:oq,previous:hN},fN={name:"protocolAutolink",tokenize:uq,previous:mN},Da={name:"emailAutolink",tokenize:sq,previous:pN},ta={};function lq(){return{text:ta}}let al=48;for(;al<123;)ta[al]=Da,al++,al===58?al=65:al===91&&(al=97);ta[43]=Da;ta[45]=Da;ta[46]=Da;ta[95]=Da;ta[72]=[Da,fN];ta[104]=[Da,fN];ta[87]=[Da,dN];ta[119]=[Da,dN];function sq(e,t,n){const a=this;let l,o;return c;function c(g){return!Zg(g)||!pN.call(a,a.previous)||iv(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Zg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(iq,y,h)(g):g===45||g===95||Tn(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&&Dn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function oq(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!hN.call(a,a.previous)||iv(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(aq,e.attempt(oN,e.attempt(uN,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function uq(e,t,n){const a=this;let l="",o=!1;return c;function c(g){return(g===72||g===104)&&mN.call(a,a.previous)&&!iv(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(Dn(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(g),m}return n(g)}function m(g){return g===47?(e.consume(g),o?h:(o=!0,m)):n(g)}function h(g){return g===null||of(g)||Ct(g)||wl(g)||Df(g)?n(g):e.attempt(oN,e.attempt(uN,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function cq(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function dq(e,t,n){let a,l,o;return c;function c(h){return h===46||h===95?e.check(cN,m,f)(h):h===null||Ct(h)||wl(h)||h!==45&&Df(h)?m(h):(o=!0,e.consume(h),c)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),c}function m(h){return l||a||!o?n(h):t(h)}}function fq(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(cN,t,o)(c):c===null||Ct(c)||wl(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function hq(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||Ct(f)||wl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||Ct(f)||wl(f)?t(f):a(f)}function o(f){return Dn(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):Dn(f)?(e.consume(f),c):n(f)}}function mq(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return Tn(o)?n(o):t(o)}}function hN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ct(e)}function mN(e){return!Dn(e)}function pN(e){return!(e===47||Zg(e))}function Zg(e){return e===43||e===45||e===46||e===95||Tn(e)}function iv(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 pq={tokenize:kq,partial:!0};function gq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xq,continuation:{tokenize:wq},exit:Sq}},text:{91:{name:"gfmFootnoteCall",tokenize:bq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yq,resolveTo:vq}}}}function yq(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!c||!c._balanced)return n(m);const h=Ir(a.sliceSerialize({start:c.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function vq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function bq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!c||g===null||g===91||Ct(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Ir(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Ct(g)||(c=!0),o++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function xq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):n(k)}function y(k){if(c>999||k===93&&!f||k===null||k===91||Ct(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Ir(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Ct(k)||(f=!0),c++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),c++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),ut(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function wq(e,t,n){return e.check(ec,t,e.attempt(pq,t,n))}function Sq(e){e.exit("gfmFootnoteDefinition")}function kq(e,t,n){const a=this;return ut(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function jq(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},b=[["enter",y,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",g,f]],w=f.parser.constructs.insideSpan.null;w&&ur(b,b.length,0,Mf(w,c.slice(h+1,m),f)),ur(b,b.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",y,f]]),ur(c,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,f,m){const h=this.previous,y=this.events;let g=0;return b;function b(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(c.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const j=Gs(h);if(k===126)return g>1?m(k):(c.consume(k),g++,w);if(g<2&&!n)return m(k);const E=c.exit("strikethroughSequenceTemporary"),C=Gs(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class Cq{constructor(){this.map=[]}add(t,n,a){Eq(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function Eq(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 Nq(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 _q(){return{flow:{null:{name:"table",tokenize:Tq,resolveAll:Aq}}}}function Tq(e,t,n){const a=this;let l=0,o=0,c;return f;function f(F){let J=a.events.length-1;for(;J>-1;){const le=a.events[J][1].type;if(le==="lineEnding"||le==="linePrefix")J--;else break}const ee=J>-1?a.events[J][1].type:null,we=ee==="tableHead"||ee==="tableRow"?O:m;return we===O&&a.parser.lazy[a.now().line]?n(F):we(F)}function m(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(c=!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"),w):n(F):tt(F)?ut(e,y,"whitespace")(F):(o+=1,c&&(c=!1,l+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g(F)))}function g(F){return F===null||F===124||Ct(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 w(F){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(F):(e.enter("tableDelimiterRow"),c=!1,tt(F)?ut(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?(c=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),j):D(F)}function j(F){return tt(F)?ut(e,E,"whitespace")(F):E(F)}function E(F){return F===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),C):F===45?(o+=1,C(F)):F===null||Oe(F)?L(F):D(F)}function C(F){return F===45?(e.enter("tableDelimiterFiller"),N(F)):D(F)}function N(F){return F===45?(e.consume(F),N):F===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),z):(e.exit("tableDelimiterFiller"),z(F))}function z(F){return tt(F)?ut(e,L,"whitespace")(F):L(F)}function L(F){return F===124?k(F):F===null||Oe(F)?!c||l!==o?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function O(F){return e.enter("tableRow"),M(F)}function M(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),M):F===null||Oe(F)?(e.exit("tableRow"),t(F)):tt(F)?ut(e,M,"whitespace")(F):(e.enter("data"),U(F))}function U(F){return F===null||F===124||Ct(F)?(e.exit("data"),M(F)):(e.consume(F),F===92?Y:U)}function Y(F){return F===92||F===124?(e.consume(F),U):U(F)}}function Aq(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,y,g;const b=new Cq;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(vS(b,t,m,h,y),y=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",y,t]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=Md(b,t,o,l,void 0,g),o=[0,0,0,0]),c[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=Md(b,t,o,l,void 0,g)),o=c,c=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],g=Md(b,t,o,l,n,g)):c[1]!==0&&(g=Md(b,t,c,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&vS(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=Nq(t.events,n))}return e}function Md(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ws(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ws(t.events,n[1]);if(o={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ws(t.events,n[2]),y=ws(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const b=t.events[n[2]],w=t.events[n[3]];if(b[1].end=Object.assign({},w[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return l!==void 0&&(o.end=Object.assign({},ws(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function vS(e,t,n,a,l){const o=[],c=ws(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function ws(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const Rq={name:"tasklistCheck",tokenize:Oq};function zq(){return{text:{91:Rq}}}function Oq(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 Ct(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return Oe(m)?t(m):tt(m)?e.check({tokenize:Dq},t,n)(m):n(m)}}function Dq(e,t,n){return ut(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function Mq(e){return CE([lq(),gq(),jq(e),_q(),zq()])}const Lq={};function Iq(e){const t=this,n=e||Lq,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(Mq(n)),o.push(nq()),c.push(rq(n))}function gN({children:e,className:t}){return u.jsx("div",{className:Ae("prose prose-sm max-w-none leading-[1.55] text-[color:inherit]","prose-headings:text-current prose-p:text-current prose-li:text-current prose-strong:text-current prose-em:text-current prose-blockquote:text-current","prose-p:my-2 prose-headings:mt-3 prose-headings:mb-1.5 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 prose-pre:my-2 prose-blockquote:my-2 prose-hr:my-3","prose-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:u.jsx(S$,{remarkPlugins:[Iq,O$],children:e})})}function Uq({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,c]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),u.jsxs(sn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Ar,{children:[u.jsxs(Rr,{children:["System prompt append",m&&u.jsx(Pq,{})]}),!o&&!l&&u.jsxs(he,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[u.jsx(Qu,{className:"h-3 w-3"})," Edit"]})]}),u.jsx(ea,{children:o?u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),c(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(he,{size:"xs",variant:"ghost",onClick:()=>{a(),c(!1)},disabled:!m,children:"Revert"}),u.jsx(he,{size:"xs",onClick:()=>c(!1),children:"Done"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):u.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?u.jsx(gN,{children:e}):u.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function Pq(){return u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})}const yN={"claude-code":"Claude Code",codex:"Codex"},Bq=[rf.CLAUDE_CODE,rf.CODEX];function $q({open:e,onOpenChange:t,agent:n}){const a=dn(),l=n.clientId,o=n.runtimeProvider,[c,f]=x.useState(l),[m,h]=x.useState(o),[y,g]=x.useState(!1),w=$e({queryKey:["clients-rebind"],queryFn:Ra,enabled:e}).data??[],k=CT({queries:w.map(U=>({queryKey:["client-capabilities",U.id],queryFn:()=>by(U.id),enabled:e}))}),j=x.useMemo(()=>{const U=new Map;return k.forEach((Y,F)=>{const J=w[F];if(!J)return;const ee=Y.data;ee!=null&&ee.capabilities&&U.set(J.id,ee.capabilities)}),U},[k,w]);x.useEffect(()=>{e||(f(l),h(o),g(!1))},[e,l,o]);const E=c?j.get(c)??null:null,C=(E==null?void 0:E[m])??null,N=!C||C.state==="missing"||C.state==="error",z=!!c&&(c!==l||m!==o)&&(!N||y),L=m!==o,D=c!==l,O=wt({mutationFn:()=>{if(!c)throw new Error("clientId required");return GD(n.uuid,{clientId:c,runtimeProvider:m,force:N&&y?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),M=O.error instanceof Vu||O.error instanceof Error?O.error.message:null;return u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{className:"max-w-lg",children:[u.jsx(Kt,{children:u.jsx(Ft,{children:"Re-bind agent"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["Currently:"," ",u.jsx("span",{className:"mono",children:qq(l,w,o)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Computer"}),u.jsx("select",{value:c??"",onChange:U=>f(U.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:w.map(U=>u.jsx("option",{value:U.id,children:Fq(U)},U.id))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Runtime"}),u.jsx("div",{className:"space-y-2",children:Bq.map(U=>{const Y=(E==null?void 0:E[U])??null,F=!!Y&&Y.state!=="missing",J=m===U;return u.jsxs("label",{className:J?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":F?"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30":"flex items-start gap-3 rounded-md border border-border p-3 opacity-60",children:[u.jsx("input",{type:"radio",name:"rebind-runtime",checked:J,onChange:()=>h(U),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:yN[U]}),u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:Zq(Y,U)})]})]},U)})})]}),(D||L)&&u.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-caption space-y-1",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:"Heads up:"})," active sessions on the previous computer are suspended at re-bind. Chat history is preserved."]}),L&&u.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),N&&u.jsxs("label",{className:"flex items-start gap-2 text-caption",style:{color:"var(--fg-2)"},children:[u.jsx("input",{type:"checkbox",checked:y,onChange:U=>g(U.target.checked),className:"mt-0.5"}),u.jsx("span",{children:"Override capability check — pick this if the destination computer is offline or the SDK was just installed and capabilities haven't refreshed yet."})]}),M&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:M})]}),u.jsxs(tn,{children:[u.jsx(he,{variant:"outline",onClick:()=>t(!1),disabled:O.isPending,children:"Cancel"}),u.jsx(he,{onClick:()=>O.mutate(),disabled:!z||O.isPending,children:O.isPending?"Re-binding…":"Re-bind"})]})]})})}function Fq(e){return`${e.hostname??e.id} · ${e.status}`}function qq(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${yN[n]}`}const Hq={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function Zq(e,t){if(!e)return"Not reported on this computer.";switch(e.state){case"ok":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, authenticated.`;case"unauthenticated":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, not authenticated. ${Hq[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const Vq={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function Qq(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return u.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 backdrop-blur",style:{padding:"var(--sp-3) var(--sp-6)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderTop:"var(--hairline) solid var(--border)"},children:u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx(Xr,{state:"blocked",size:8}),u.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),u.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>u.jsx("button",{type:"button",onClick:()=>e.onJumpTo(n),className:"text-caption transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",cursor:"pointer"},children:Vq[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&u.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[u.jsx(cr,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),u.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&u.jsx(he,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(he,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),u.jsx(he,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(XR,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function Su(e){return`agent-cfg-${e}`}function hu({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:c}){return u.jsxs("section",{id:e,className:Ae("space-y-3",o),...c,children:[u.jsxs("div",{className:"flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),u.jsx("div",{className:"space-y-3",children:l})]})}function Kq(){return u.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const Gq={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Re-bind via the agent's settings to switch computer or runtime."},codex:{name:"Codex",caption:"OpenAI's Codex CLI runtime. Re-bind via the agent's settings to switch computer or runtime."}};function Yq(e){const t=Gq[e.runtimeProvider];return u.jsxs("div",{className:"space-y-3",children:[u.jsx(Xq,{name:t.name,caption:t.caption,locked:!0}),u.jsx(Jq,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function Xq({name:e,caption:t,locked:n}){return u.jsxs(sn,{children:[u.jsx(Ar,{children:u.jsxs(Rr,{children:["Where it runs",n&&u.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(Uk,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),u.jsxs(ea,{className:"space-y-1 text-body",children:[u.jsxs("div",{className:"inline-flex items-center gap-2",children:[u.jsx(Pk,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),u.jsx("span",{className:"font-medium",children:e})]}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function Jq(e){const t=!!e.computerLabel;return u.jsxs(sn,{children:[u.jsxs(Ar,{children:[u.jsx(Rr,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&u.jsxs(he,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[u.jsx(xg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&u.jsxs(he,{size:"xs",variant:"outline",onClick:e.onRebind,children:[u.jsx(xg,{className:"h-3 w-3"}),"Re-bind"]})]}),u.jsx(ea,{className:"text-body",children:t?u.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"No computer bound. A computer claims this agent on its first WebSocket connect, or you can pick one manually via the button above."})})]})}function Wq(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 e7(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function t7(e,t){return JSON.stringify(e)===JSON.stringify(t)}function $p(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function bS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:t7(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Fp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],c=new Set(o.map(h=>h.key)),f=e7(n,c),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:bS(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:bS(f)}}),remove:a=>t(l=>{const c=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:c}}),undo:a=>t(l=>{const c=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:c}})}}function n7(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:$p(e.payload.mcpServers,"mcp"),env:$p(e.payload.env,"env"),git:$p(e.payload.gitRepos,"git")}}function r7(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(n7(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",c=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const z=[],L=U=>U.reduce((Y,F)=>F.status==="unchanged"?Y:Y+1,0),D=L(a.mcp),O=L(a.env),M=L(a.git);return c&&z.push("prompt"),f&&z.push("model"),D>0&&z.push("mcp"),O>0&&z.push("env"),M>0&&z.push("git"),{anyDirty:z.length>0,dirtySections:z,counts:{prompt:c?1:0,model:f?1:0,mcp:D,env:O,git:M}}},[a,c,f]),h=x.useCallback(z=>{n(L=>L&&z(L))},[]),y=x.useCallback(z=>h(L=>({...L,promptAppend:z})),[h]),g=x.useCallback(()=>h(z=>({...z,promptAppend:l})),[h,l]),b=x.useCallback(z=>h(L=>({...L,model:z})),[h]),w=x.useCallback(()=>h(z=>({...z,model:o})),[h,o]),k=x.useMemo(()=>Fp("mcp",h),[h]),j=x.useMemo(()=>Fp("env",h),[h]),E=x.useMemo(()=>Fp("git",h),[h]),C=x.useCallback(()=>{n(null)},[]),N=x.useCallback(()=>{if(!t||!e)return{};const z={};c&&(z.prompt={append:t.promptAppend}),f&&(z.model=t.model);const L=m.counts.mcp>0,D=m.counts.env>0,O=m.counts.git>0;return L&&(z.mcpServers=t.mcp.filter(M=>M.status!=="deleted").map(M=>M.value)),D&&(z.env=t.env.filter(M=>M.status!=="deleted").map(M=>{const U=M.value;return U.sensitive&&U.value===af?{key:U.key,value:af,sensitive:!0}:U})),O&&(z.gitRepos=t.git.filter(M=>M.status!=="deleted").map(M=>M.value)),z},[t,e,c,f,m]);return{draft:a,summary:m,promptDirty:c,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:w,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:N}}const Nn={overview:"ad-overview",setup:"ad-setup",prompt:Su("prompt"),tools:Su("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function a7(e){const t=[{key:"overview",label:"Profile",anchor:Nn.overview}];return e||t.push({key:"setup",label:"Setup",anchor:Nn.setup},{key:"prompt",label:"Prompt",anchor:Nn.prompt},{key:"tools",label:"Tools",anchor:Nn.tools},{key:"advanced",label:"Advanced",anchor:Nn.advanced}),t.push({key:"danger",label:"Danger zone",anchor:Nn.danger,divider:!0,danger:!0}),t}function i7(){var gn,ht,zr,Ln,nc,Li,Ii,Ui,Pr,Pi,Ia,rc;const t=Sk().uuid??"",n=fn(),a=dn(),l=$e({queryKey:["agent",t],queryFn:()=>nC(t),enabled:!!t}),o=$e({queryKey:["agent-config",t],queryFn:()=>MU(t),enabled:!!t&&((gn=l.data)==null?void 0:gn.type)!=="human"}),c=$e({queryKey:["agent-client-status",t],queryFn:()=>UU(t),enabled:!!t&&((ht=l.data)==null?void 0:ht.type)!=="human"}),f=$e({queryKey:["agent-sessions-active",t],queryFn:()=>eo(t,{state:"active"}),enabled:!!t&&((zr=l.data)==null?void 0:zr.type)!=="human"}),m=$e({queryKey:["clients"],queryFn:Ra,enabled:!!t&&((Ln=l.data)==null?void 0:Ln.type)!=="human",refetchInterval:3e4}),h=r7(o.data),[y,g]=x.useState(null),[b,w]=x.useState(null),[k,j]=x.useState(!1),E=wt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const Se=h.buildPayloadPatch();return LU(t,{expectedVersion:o.data.version,payload:Se})},onSuccess:Se=>{a.setQueryData(["agent-config",t],Se),g(null),w(null),j(!0)},onError:Se=>{if(j(!1),Se instanceof Vu&&Se.status===409){w("Someone else saved a newer version while you were editing."),g(null);return}g(Se instanceof Error?Se.message:String(Se))}});x.useEffect(()=>{if(!k)return;const Se=setTimeout(()=>j(!1),2500);return()=>clearTimeout(Se)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const C=x.useCallback(()=>{w(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),N=x.useCallback(Se=>{const Je=document.getElementById(Se);Je&&Je.scrollIntoView({behavior:"smooth",block:"start"})},[]),z=wt({mutationFn:Se=>W1(t,Se),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),L=wt({mutationFn:()=>XD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),D=wt({mutationFn:()=>JD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),O=wt({mutationFn:()=>YD(t),onSuccess:()=>n("/agents")}),M=wt({mutationFn:()=>WD(t)}),[U,Y]=x.useState(!1),[F,J]=x.useState(""),[ee,we]=x.useState(null),[le,ne]=x.useState(!1),Z=$e({queryKey:["clients"],queryFn:Ra,enabled:U}),te=wt({mutationFn:Se=>W1(t,{clientId:Se}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),Y(!1),J(""),we(null)},onError:Se=>we(Se instanceof Error?Se.message:String(Se))}),[ie,ve]=x.useState(!1),[_,P]=x.useState(null),B=wt({mutationFn:()=>IU(t,h.buildPayloadPatch()),onSuccess:Se=>{const Je=Se.diff.length?Se.diff.map(yn=>`${yn.op} ${yn.path}`).join(`
|
|
386
|
-
`):"(no changes)";P(Je)},onError:Se=>P(`Dry run failed: ${Se instanceof Error?Se.message:String(Se)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const Se=Je=>{Je.preventDefault(),Je.returnValue=""};return window.addEventListener("beforeunload",Se),()=>window.removeEventListener("beforeunload",Se)},[h.summary.anyDirty]);const A=((nc=l.data)==null?void 0:nc.type)==="human",q=x.useMemo(()=>a7(A),[A]),G=x.useRef(null),[ce,be]=x.useState(!1);x.useEffect(()=>{if(A)return;const Se=G.current;if(!Se||typeof IntersectionObserver>"u")return;const Je=new IntersectionObserver(yn=>{const ra=yn[0];ra&&be(!ra.isIntersecting&&ra.boundingClientRect.top<0)},{threshold:0});return Je.observe(Se),()=>Je.disconnect()},[A]);const[xe,me]=x.useState(Nn.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const Se=[];for(const Je of q){const yn=document.getElementById(Je.anchor);if(!yn)continue;const ra=new IntersectionObserver(fo=>{for(const ac of fo)ac.isIntersecting&&me(Je.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});ra.observe(yn),Se.push(ra)}return()=>{for(const Je of Se)Je.disconnect()}},[q]);const Xe=x.useMemo(()=>{const Se=new Set;for(const Je of h.summary.dirtySections)Je==="prompt"&&Se.add(Nn.prompt),Je==="model"&&Se.add(Nn.setup),Je==="mcp"&&Se.add(Nn.tools),(Je==="env"||Je==="git")&&Se.add(Nn.advanced);return Se},[h.summary.dirtySections]);if(l.isLoading)return u.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:u.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return u.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const Le=l.data;if(!Le)return u.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const re=Le.type==="human",Ee=c.data,Ie=((Li=f.data)==null?void 0:Li.length)??0,Pe=!re&&!(Ee!=null&&Ee.clientId),Lt=!re&&Ee?!Ee.online&&!!Ee.clientId:!1,hn=Le,_l=hn.runtimeState??null,Ma=hn.runtimeType??null,La=hn.totalSessions??null,na=Le.uuid.slice(0,8),oo=Wq({activeSessions:Ie,isUnclaimed:Pe,isOffline:Lt}),uo=h.draft.mcp.filter(Se=>Se.status!=="deleted"),mn=h.draft.env.filter(Se=>Se.status!=="deleted"),co=h.draft.git.filter(Se=>Se.status!=="deleted"),se=Se=>new Set(uo.filter(Je=>Je.key!==Se).map(Je=>Je.value.name.toLowerCase())),ye=Se=>new Set(mn.filter(Je=>Je.key!==Se).map(Je=>Je.value.key)),Ue=Se=>new Set(co.filter(Je=>Je.key!==Se).map(Je=>{const{value:yn}=Je;return yn.localPath?yn.localPath:((yn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Fe={sessions:La??"—",active:Ie,runtime:Ma??(re?"human":"—"),model:((Ui=(Ii=o.data)==null?void 0:Ii.payload.model)==null?void 0:Ui.trim())||"—"},at=(Ee==null?void 0:Ee.clientId)??null,pn=at?((Pr=m.data)==null?void 0:Pr.find(Se=>Se.id===at))??null:null,fr=at?(pn==null?void 0:pn.hostname)??at:null,nn=Le.runtimeProvider??"claude-code",Zt=nn==="codex"?"Codex":"Claude Code";return u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:220,borderRight:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",padding:"var(--sp-3) 0"},children:[u.jsx(Xu,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),q.map(Se=>u.jsxs("div",{children:[Se.divider&&u.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),u.jsx(l7,{label:Se.label,active:xe===Se.anchor,danger:Se.danger??!1,dirty:Xe.has(Se.anchor),onClick:()=>N(Se.anchor)})]},Se.key))]}),u.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[u.jsxs(PU,{style:{marginBottom:"var(--sp-2)"},children:[u.jsx(BU,{onClick:()=>n("/agents"),children:"Agents"}),u.jsx($U,{}),u.jsx(FU,{mono:!0,children:Le.name??na})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"inline-flex items-center justify-center",style:{width:36,height:36,borderRadius:"var(--radius-panel)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:u.jsx(to,{width:18,height:20,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-title",title:`agt_${na}`,children:Le.displayName}),u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",Le.name??na]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[u.jsx(kn,{tone:Le.type==="autonomous_agent"?"accent":"neutral",children:Le.type}),Le.visibility&&u.jsx(kn,{tone:Le.visibility==="organization"?"accent":"outline",children:Le.visibility}),(Ee==null?void 0:Ee.offlineSince)&&u.jsxs("span",{className:"mono",children:["offline since ",Ni(Ee.offlineSince)]})]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(Ks,{state:_l}),u.jsxs(he,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${Le.uuid}`),children:[u.jsx(py,{className:"h-3 w-3"})," Open chat"]}),!re&&Le.status==="active"&&u.jsxs(he,{variant:"outline",size:"xs",onClick:()=>{M.reset(),M.mutate()},disabled:M.isPending,children:[u.jsx(Pk,{className:"h-3 w-3"}),M.isPending?"Testing…":"Test"]})]})]}),u.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[u.jsx(Rd,{label:"sessions",value:Fe.sessions}),u.jsx(Rd,{label:"active",value:Fe.active,accent:typeof Fe.active=="number"&&Fe.active>0?"var(--accent)":void 0}),u.jsx(Rd,{label:"runtime",value:Fe.runtime}),u.jsx(Rd,{label:"model",value:Fe.model})]})]}),u.jsx("div",{ref:G,"aria-hidden":!0,style:{height:0}}),!re&&u.jsx(HU,{runtimeLabel:Zt,computerLabel:fr,visible:ce}),u.jsxs("div",{className:"mx-auto",style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)",maxWidth:960,display:"flex",flexDirection:"column",gap:20},children:[(M.data||M.error)&&u.jsx(f7,{result:M.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>M.reset()}),u.jsx(hu,{anchorId:Nn.overview,title:"Profile",right:u.jsxs(he,{variant:"outline",size:"xs",onClick:()=>n(`/settings?agent=${Le.uuid}`),title:"Manage platform bindings in Settings",children:[u.jsx(xg,{className:"h-3 w-3"}),"Manage bindings"]}),children:u.jsx(WU,{agent:Le,onSave:async Se=>{await z.mutateAsync(Se)}})}),!re&&u.jsxs(u.Fragment,{children:[u.jsxs(hu,{anchorId:Nn.setup,title:"Setup",caption:((Pi=o.data)==null?void 0:Pi.version)!=null?u.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&u.jsxs(u.Fragment,{children:[" · ",u.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&u.jsx(Yq,{runtimeProvider:nn,computerLabel:fr,canBindComputer:Pe&&Le.status==="active",bindComputerPending:te.isPending,onBindComputer:()=>Y(!0),onRebind:Le.clientId?()=>ne(!0):void 0,modelSlot:u.jsx(cP,{value:h.draft.model,baseline:((Ia=o.data)==null?void 0:Ia.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:Le.status!=="active",provider:nn})})]}),u.jsx(hu,{anchorId:Nn.prompt,title:"Prompt",children:o.data?u.jsx(Uq,{value:h.draft.promptAppend,baseline:((rc=o.data)==null?void 0:rc.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:Le.status!=="active"}):null}),u.jsx(hu,{anchorId:Nn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?u.jsx(nP,{items:h.draft.mcp,otherNames:se,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:Le.status!=="active"}):null}),u.jsx(hu,{anchorId:Nn.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{id:Su("env"),children:u.jsx(GU,{items:h.draft.env,otherKeys:ye,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:Le.status!=="active"})}),u.jsx("div",{id:Su("git"),children:u.jsx(XU,{items:h.draft.git,otherPaths:Ue,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:Le.status!=="active"})}),_&&u.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:"var(--sp-2)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:_}),h.summary.anyDirty&&u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:u.jsx("button",{type:"button",onClick:()=>B.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:B.isPending,children:B.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),u.jsx(Kq,{}),u.jsx(ZU,{agent:Le,suspendPending:L.isPending,reactivatePending:D.isPending,deletePending:O.isPending,onSuspend:()=>L.mutate(),onReactivate:()=>D.mutate(),onDelete:()=>O.mutate()})]}),!re&&u.jsx(Qq,{summary:h.summary,saveHint:oo,conflictMessage:b,errorMessage:y,saving:E.isPending,justSaved:k,onSave:()=>E.mutate(),onDiscard:()=>{h.summary.anyDirty&&ve(!0)},onReloadRemote:C,onJumpTo:Se=>N(Su(Se))})]}),u.jsx(s7,{open:ie,onOpenChange:ve,title:"Discard unsaved changes?",description:"Your edits to Prompt / Model / Tools / Advanced will be reverted to the last saved baseline.",confirmLabel:"Discard changes",destructive:!0,onConfirm:()=>{h.resetAll(),g(null),w(null),ve(!1)}}),u.jsx($t,{open:U,onOpenChange:Se=>{Y(Se),Se||(J(""),we(null),te.reset())},children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:"Bind computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick a computer you own to pin this agent to. The bind is one-shot — once set, moving the agent requires deleting and re-creating it on the target computer."}),Z.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):Z.error?u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",Z.error instanceof Error?Z.error.message:"Unknown"]}):u.jsx(o7,{clients:Z.data??[],selected:F,onSelect:J}),ee&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:ee})]}),u.jsxs(tn,{children:[u.jsx(he,{variant:"outline",onClick:()=>Y(!1),children:"Cancel"}),u.jsx(he,{disabled:!F||te.isPending,onClick:()=>{we(null),te.mutate(F)},children:te.isPending?"Binding…":"Bind"})]})]})}),u.jsx($q,{open:le,onOpenChange:ne,agent:Le})]})}function l7({label:e,active:t,danger:n,dirty:a,onClick:l}){return u.jsx("button",{type:"button",onClick:l,className:Ae("block w-full text-left bg-transparent text-body transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t?"":"hover:bg-accent"),style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",border:"none",borderLeft:`var(--hairline-bold) solid ${t?"var(--accent)":"transparent"}`,background:t?"var(--bg-active)":"transparent",color:t?"var(--fg)":"var(--fg-3)",fontWeight:t?500:400},children:u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"flex-1 truncate",children:e}),a&&u.jsx("span",{role:"img","aria-label":"unsaved changes",style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-blocked)",flexShrink:0}}),n&&!a&&u.jsx("span",{"aria-hidden":!0,style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-error)",flexShrink:0}})]})})}function s7(e){return u.jsx($t,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(he,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function o7({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?u.jsxs("div",{className:"text-body",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:"var(--sp-2_5) var(--sp-3)",color:"var(--fg-3)"},children:["No connected computers available. Run"," ",u.jsx("code",{className:"mono text-label",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):u.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",margin:0,padding:0,listStyle:"none"},children:a.map(l=>{const o=l.id===t,c=l.status==="online"||l.status==="active";return u.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Ae("w-full text-left flex items-center gap-3"),style:{padding:"var(--sp-2) var(--sp-3)",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[u.jsx("span",{className:Ae("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:c?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),u.jsxs("span",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),u.jsxs("span",{className:"block mono truncate text-caption",style:{color:"var(--fg-4)"},children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const u7={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},c7={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},d7={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function f7({result:e,onDismiss:t}){const n=c7[e.status],a=d7[e.status],l=e.connection;return u.jsx("div",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderLeft:`var(--sp-0_75) solid ${n}`,borderRadius:"var(--radius-panel)",padding:"var(--sp-3) var(--sp-3_5)"},children:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(kn,{tone:a,children:u7[e.status]}),e.responseTime!=null&&u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[u.jsx("div",{children:l.runtimeState&&u.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?u.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):u.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&u.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&u.jsx("p",{className:"mono whitespace-pre-wrap text-label",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:8,maxHeight:160,overflow:"auto"},children:e.responseContent})]}),u.jsx(he,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function h7(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function m7({agent:e,open:t,onClose:n,onBound:a}){var g;const[l,o]=x.useState(!1),c=$e({queryKey:["connect-token",e.uuid],queryFn:()=>nj(),enabled:t,staleTime:6e4}),f=$e({queryKey:["agent-poll",e.uuid],queryFn:()=>nC(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});x.useEffect(()=>{const b=f.data;b!=null&&b.clientId&&a(b)},[f.data,a]);const m=((g=c.data)==null?void 0:g.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${h7(e.name)} --agent-id ${e.uuid} && `+m:m;function y(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return u.jsx($t,{open:t,onOpenChange:b=>!b&&n(),children:u.jsxs(zt,{className:"max-w-lg",children:[u.jsx(Kt,{children:u.jsx(Ft,{children:"Last step — connect your computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[u.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),u.jsx(he,{variant:"outline",size:"icon",className:"shrink-0",onClick:y,disabled:!h,children:l?u.jsx(cr,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):u.jsx(vf,{className:"h-4 w-4"})})]}),u.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[u.jsx(Xr,{state:"working",size:8}),u.jsx("span",{children:"Waiting for your computer to connect…"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),u.jsx(tn,{children:u.jsx(he,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}function Vg(e){return e.normalize("NFKD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,js)}const qp=200;function p7(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 g7(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,js)}function y7(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 v7({open:e,onOpenChange:t,onCreated:n}){const a=dn(),{refreshMe:l,organizationId:o}=qt(),[c,f]=x.useState(""),[m,h]=x.useState(""),[y,g]=x.useState(!1),[b,w]=x.useState("claude-code"),[k,j]=x.useState("form"),[E,C]=x.useState([]),[N,z]=x.useState(null),[L,D]=x.useState(!1),[O,M]=x.useState({}),[U,Y]=x.useState({status:"idle"});x.useEffect(()=>{e&&(f(""),h(""),g(!1),w("claude-code"),j("form"),C([]),z(null),D(!1),M({}),Y({status:"idle"}))},[e]),x.useEffect(()=>{y||h(Vg(c))},[c,y]);const F=x.useRef(0);x.useEffect(()=>{if(!e||!m){Y({status:"idle"});return}if(!zg.test(m)){Y({status:"bad",reason:"invalid"});return}if(Og(m)){Y({status:"bad",reason:"reserved"});return}const _=++F.current;Y({status:"checking"});const P=window.setTimeout(()=>{KD(m).then(B=>{_===F.current&&(B.available?Y({status:"ok"}):Y({status:"bad",reason:B.reason}))}).catch(()=>{_===F.current&&Y({status:"idle"})})},300);return()=>window.clearTimeout(P)},[m,e]);const J=wt({mutationFn:async _=>{const P=c.trim()||m.trim()||"Untitled assistant";return QD({name:m||void 0,type:"personal_assistant",displayName:P,clientId:_.clientId,runtimeProvider:b,...o?{organizationId:o}:{}})},onSuccess:_=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),l(),n(_,b)}}),ee=x.useMemo(()=>{const _=J.error;if(!_)return{};if(_ instanceof Vu){const P=p7(_.issues);return Object.keys(P).length>0?P:_.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:_.message}}return _ instanceof Error?{_root:_.message}:{}},[J.error]),we=U.status==="bad"?y7(U.reason):void 0,le={...we?{name:we}:{},...ee,...O};function ne(){const _={};return m?m.length>js?_.name=`Agent name must be at most ${js} characters (got ${m.length}).`:zg.test(m)?Og(m)&&(_.name="That agent name is reserved — pick a different one."):_.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":c.trim().length>0&&(_.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),c.length>qp&&(_.displayName=`Display name must be at most ${qp} characters (got ${c.length}).`),_}async function Z(_){var B,A;_.preventDefault();const P=ne();if(M(P),!(Object.keys(P).length>0)&&U.status!=="bad"){D(!0);try{const G=(await Ra()).filter(be=>be.status==="connected");if(G.length===0){J.mutate({clientId:void 0});return}if(G.length===1){J.mutate({clientId:(B=G[0])==null?void 0:B.id});return}const ce=[...G].sort((be,xe)=>xe.lastSeenAt.localeCompare(be.lastSeenAt));C(ce),z(((A=ce[0])==null?void 0:A.id)??null),j("pick-computer")}catch{J.mutate({clientId:void 0})}finally{D(!1)}}}function te(){N&&J.mutate({clientId:N})}const ie=U.status==="bad",ve=c.trim().length>0&&!ie&&!J.isPending&&!L;return k==="pick-computer"?u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{className:"max-w-lg",children:[u.jsx(Kt,{children:u.jsx(Ft,{children:"Choose a computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",u.jsx("span",{className:"font-medium",children:c||m})," ","should run:"]}),u.jsx("div",{className:"space-y-2",children:E.map(_=>{const P=N===_.id;return u.jsxs("label",{className:P?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"target-computer",checked:P,onChange:()=>z(_.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body font-medium truncate",children:_.hostname??_.id}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:[_.os??"unknown OS"," · last seen ",new Date(_.lastSeenAt).toLocaleString()]})]})]},_.id)})}),le.clientId&&u.jsx("p",{className:"text-body text-destructive",children:le.clientId}),le._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:le._root})]}),u.jsxs(tn,{children:[u.jsx(he,{variant:"outline",onClick:()=>j("form"),disabled:J.isPending,children:"Back"}),u.jsx(he,{onClick:te,disabled:!N||J.isPending,children:J.isPending?"Creating…":"Create"})]})]})}):u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{className:"max-w-lg",children:[u.jsx(Kt,{children:u.jsx(Ft,{children:"New Agent"})}),u.jsxs("form",{onSubmit:Z,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"new-agent-display-name",children:"Display name"}),u.jsx(jt,{id:"new-agent-display-name",value:c,onChange:_=>{f(_.target.value),O.displayName&&M(P=>({...P,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:qp,"aria-invalid":le.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),u.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"How teammates see this agent in chats and lists. Can be changed anytime."}),le.displayName&&u.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:le.displayName})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"new-agent-name",children:"Agent name"}),u.jsxs("div",{className:"flex items-stretch",children:[u.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center px-2 font-mono text-body text-muted-foreground border border-r-0 border-input rounded-l-[var(--radius-input)] bg-muted/40",children:"@"}),u.jsx(jt,{id:"new-agent-name",value:m,onChange:_=>{const P=g7(_.target.value);h(P),g(!0),O.name&&M(B=>({...B,name:void 0}))},onBlur:_=>{const P=Vg(_.target.value);P!==m&&h(P)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:js,"aria-invalid":le.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),u.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Used in @mentions and CLI commands. Lowercase letters, digits, hyphens (-), and underscores (_). Up to"," ",js," characters. Permanent after creation."]}),m&&!le.name&&U.status!=="idle"&&u.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:U.status==="ok"?"var(--state-idle)":U.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[U.status==="checking"&&"Checking availability…",U.status==="ok"&&"Available."]}),le.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:le.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:b==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:b==="claude-code",onChange:()=>w("claude-code"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),u.jsx("div",{className:"text-caption text-muted-foreground",children:"Anthropic's Claude Code on the bound computer. (default)"})]})]}),u.jsxs("label",{className:b==="codex"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:b==="codex",onChange:()=>w("codex"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Codex"}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:["OpenAI Codex CLI on the bound computer. Run ",u.jsx("code",{children:"codex login"})," on the host once."]})]})]})]})]}),le._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:le._root}),u.jsx(tn,{children:u.jsx(he,{type:"submit",disabled:!ve,children:L?"Checking computers…":J.isPending?"Creating…":"Create"})})]})]})})}function yu({active:e,count:t,warn:n,className:a,children:l,style:o,...c}){return u.jsxs("button",{type:"button",className:Ae("mono inline-flex items-center gap-1 text-caption leading-[1.6]",a),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...c,children:[l,t!==void 0&&u.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const b7=Object.values(f6);function xS(e){return[...e].sort((t,n)=>{const a=(t.displayName||t.name||"").toLowerCase(),l=(n.displayName||n.name||"").toLowerCase();return a.localeCompare(l)})}function x7(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null}}function vs(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 w7(){const e=fn(),{memberId:t}=qt(),[n,a]=x.useState(),[l,o]=x.useState(""),[c,f]=x.useState(!1),[m,h]=x.useState(null),[y,g]=x.useState("all"),[b,w]=x.useState(""),k=Cl(),j=Cy(),E=By(),{data:C,isLoading:N,error:z}=$e({queryKey:["agents",n,l],queryFn:()=>Yu({limit:100,cursor:n,type:l||void 0})}),{data:L}=$e({queryKey:["activity"],queryFn:Ku,refetchInterval:1e4}),D=x.useMemo(()=>{const ie=new Map;for(const ve of(L==null?void 0:L.agents)??[])ie.set(ve.agentId,ve);return ie},[L==null?void 0:L.agents]),{myAgents:O,teamAgents:M}=x.useMemo(()=>{if(!(C!=null&&C.items))return{myAgents:[],teamAgents:[]};const ie=[],ve=[];for(const _ of C.items)t&&_.managerId===t?ie.push(_):ve.push(_);return{myAgents:xS(ie),teamAgents:xS(ve)}},[C,t]),U=(C==null?void 0:C.items.length)??0,Y=O.length,F=M.length,J=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(ie=>{var ve;return((ve=D.get(ie.uuid))==null?void 0:ve.runtimeState)==="working"}).length,[C==null?void 0:C.items,D]),ee=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(ie=>{var _;const ve=(_=D.get(ie.uuid))==null?void 0:_.runtimeState;return ve==="blocked"||ve==="error"}).length,[C==null?void 0:C.items,D]);function we(ie){var _;const ve=(_=D.get(ie.uuid))==null?void 0:_.runtimeState;return y==="mine"?t!=null&&ie.managerId===t:y==="running"?ve==="working":y==="attn"?ve==="blocked"||ve==="error":!0}function le(ie){if(!b.trim())return!0;const ve=b.toLowerCase(),_=ie.delegateMention?k(ie.delegateMention):"",P=E(ie.managerId);return(ie.name??"").toLowerCase().includes(ve)||ie.displayName.toLowerCase().includes(ve)||_.toLowerCase().includes(ve)||P.toLowerCase().includes(ve)}const ne=O.filter(ie=>we(ie)&&le(ie)),Z=M.filter(ie=>we(ie)&&le(ie));function te(ie,ve){if(f(!1),ie.clientId){e(`/?a=${ie.uuid}`);return}if(ve==="claude-code"||ve==="codex"){h(ie);return}e(`/?a=${ie.uuid}`)}return u.jsxs("div",{className:"-m-6",children:[u.jsx(Of,{title:"Agents",subtitle:U>0?u.jsxs(u.Fragment,{children:[U," total · ",Y," mine · ",F," team"]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(he,{size:"xs",onClick:()=>f(!0),children:[u.jsx(Jr,{className:"h-3 w-3"}),"New agent"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsxs("div",{className:"flex items-center gap-2.5 mb-3.5",style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("div",{className:"relative",style:{width:240},children:[u.jsx(bf,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),u.jsx("input",{value:b,onChange:ie=>w(ie.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2_5) var(--sp-1_25) var(--sp-7)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx(yu,{active:y==="all",count:U,onClick:()=>g("all"),children:"all"}),u.jsx(yu,{active:y==="mine",count:Y,onClick:()=>g("mine"),children:"mine"}),u.jsx(yu,{active:y==="running",count:J,onClick:()=>g("running"),children:"running"}),u.jsx(yu,{active:y==="attn",count:ee,warn:!0,onClick:()=>g("attn"),children:"attn"})]}),u.jsx("div",{style:{flex:1}}),u.jsxs("select",{value:l,onChange:ie=>{o(ie.target.value),a(void 0)},className:"outline-none text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"},children:[u.jsx("option",{value:"",children:"all types"}),b7.map(ie=>u.jsx("option",{value:ie,children:ie},ie))]})]}),N?u.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):z?u.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",z instanceof Error?z.message:"Unknown error"]}):u.jsxs(u.Fragment,{children:[u.jsx(wS,{title:`My agents · ${ne.length}`,agents:ne,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!1,emptyLabel:O.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:u.jsx(SS,{items:[{state:"working",count:vs(O,D,"working")},{state:"blocked",count:vs(O,D,"blocked")},{state:"error",count:vs(O,D,"error")}]}),className:"mb-4"}),M.length>0&&u.jsx(wS,{title:`Team agents · ${Z.length}`,agents:Z,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!0,emptyLabel:"No agents match the current filter",breakdown:u.jsx(SS,{items:[{state:"working",count:vs(M,D,"working")},{state:"blocked",count:vs(M,D,"blocked")},{state:"error",count:vs(M,D,"error")}]})})]}),(C==null?void 0:C.nextCursor)&&u.jsx("div",{className:"flex justify-end mt-4",children:u.jsx(he,{variant:"outline",size:"xs",onClick:()=>a(C.nextCursor??void 0),children:"Next page"})})]}),u.jsx(v7,{open:c,onOpenChange:f,onCreated:te}),m&&u.jsx(m7,{agent:m,open:m!==null,onClose:()=>{const ie=m.uuid;h(null),e(`/?a=${ie}`)},onBound:ie=>{h(null),e(`/?a=${ie.uuid}`)}})]})}function wS({title:e,agents:t,runtimeMap:n,resolveAgentIdentity:a,resolveMemberName:l,navigate:o,emptyLabel:c,breakdown:f,className:m,showOwner:h}){return u.jsxs(sn,{className:m,children:[u.jsx(Qs,{right:f,children:e}),t.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:c}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(He,{children:"Display name"}),u.jsx(He,{children:"Agent name"}),u.jsx(He,{children:"Type"}),u.jsx(He,{children:"Delegate"}),h&&u.jsx(He,{children:"Owner"}),u.jsx(He,{children:"Runtime"}),u.jsx(He,{children:"Status"}),u.jsx(He,{children:"Created"})]})}),u.jsx(xl,{children:t.map(y=>u.jsx(S7,{agent:y,runtime:x7(y,n),resolveAgentIdentity:a,resolveMemberName:l,navigate:o,showOwner:h},y.uuid))})]})]})}function SS({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:u.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>u.jsxs("span",{className:"inline-flex items-center",children:[a>0&&u.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),u.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[u.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function S7({agent:e,runtime:t,resolveAgentIdentity:n,resolveMemberName:a,navigate:l,showOwner:o}){const{runtimeState:c}=t,f=c==="idle"||c==="working"||c==="blocked"||c==="error"||c==="offline",m=e.delegateMention?n(e.delegateMention):null;return u.jsxs(or,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[u.jsx(Be,{children:u.jsx("span",{className:"font-medium",children:e.displayName})}),u.jsx(Be,{children:e.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",e.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Be,{children:u.jsx(kn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),u.jsx(Be,{children:e.delegateMention?u.jsx(cE,{name:(m==null?void 0:m.name)??null,displayName:(m==null?void 0:m.displayName)??null,tone:"accent"}):u.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),o&&u.jsx(Be,{className:"text-label",style:{color:"var(--fg-2)"},children:a(e.managerId)}),u.jsx(Be,{children:c&&f?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(Xr,{state:c,size:7}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:c})]}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Be,{children:u.jsx(kn,{tone:e.status==="active"?"accent":"outline",children:e.status})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(e.createdAt)})]})}function k7(){const{data:e}=$e({queryKey:["members","user-name-map"],queryFn:Py,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}const j7=1500;function C7({command:e,expiresInSeconds:t,phase:n,copyLabel:a={idle:"Copy",done:"Copied"},waitingText:l="Waiting for your computer to connect…",successContent:o,errorContent:c,caption:f="Single-use · regenerates the previous one.",copyButtonPlacement:m="right"}){const[h,y]=x.useState(!1),g=async()=>{e&&(await navigator.clipboard.writeText(e),y(!0),setTimeout(()=>y(!1),j7))},b=t!==void 0?Math.max(1,Math.round(t/60)):null,w=u.jsx("pre",{className:"mono text-label",style:{margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",minWidth:0,flex:m==="right"?1:void 0},title:e??"",children:e?u.jsxs(u.Fragment,{children:[e,b!==null&&u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",b,"m"]})]}):"Generating token…"}),k=u.jsxs(he,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:!e,style:{alignSelf:"flex-start"},children:[h?u.jsx(cr,{className:"h-3.5 w-3.5"}):u.jsx(vf,{className:"h-3.5 w-3.5"}),h?a.done:a.idle]});return u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[m==="right"?u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[w,k]}):u.jsxs(u.Fragment,{children:[w,k]}),f&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:f}),n==="waiting"&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-blocked) 35%, var(--fg))"},children:[u.jsx(E7,{}),l]}),n==="success"&&o&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-idle) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-idle) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-idle) 45%, var(--fg))"},children:[u.jsx(cr,{className:"h-3.5 w-3.5",style:{flexShrink:0}}),u.jsx("span",{style:{minWidth:0},children:o})]}),n==="error"&&c&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:c})]})}function E7(){return u.jsx("span",{"aria-hidden":"true",style:{width:12,height:12,flexShrink:0,borderRadius:"50%",border:"var(--hairline-bold) solid color-mix(in oklch, var(--state-blocked) 30%, transparent)",borderTopColor:"var(--state-blocked)",animation:"spin 0.85s linear infinite"}})}const N7=3e3,_7=1200;function T7({open:e,onOpenChange:t}){const n=dn(),{user:a}=qt(),[l,o]=x.useState("loading"),[c,f]=x.useState(null),[m,h]=x.useState(null),[y,g]=x.useState(null),b=x.useRef(new Set);return x.useEffect(()=>{if(!e){o("loading"),f(null),h(null),g(null),b.current=new Set;return}let w=!1;const k=(n.getQueryData(["clients"])??[]).map(j=>j.id);return b.current=new Set(k),(async()=>{try{const j=await nj();if(w)return;f(j),o("waiting")}catch(j){if(w)return;h(j instanceof Error?j.message:"Failed to generate connect token"),o("error")}})(),()=>{w=!0}},[e,n]),x.useEffect(()=>{if(!e||l!=="waiting"||!a)return;const k=setInterval(async()=>{try{const j=await n.fetchQuery({queryKey:["clients"],queryFn:Ra}),E=b.current,C=j.find(N=>!E.has(N.id)&&N.status==="connected"&&N.userId===a.id);C&&(g(C.hostname??null),o("success"))}catch{}},N7);return()=>clearInterval(k)},[e,l,n,a]),x.useEffect(()=>{if(l!=="success")return;const w=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},_7);return()=>clearTimeout(w)},[l,t,n]),u.jsx($t,{open:e,onOpenChange:t,children:u.jsxs(zt,{children:[u.jsxs(Kt,{children:[u.jsx(Ft,{children:"Connect a new computer"}),u.jsx(jf,{children:"Run this command on the machine you want to pair with this Hub."})]}),u.jsx(C7,{command:(c==null?void 0:c.command)??null,expiresInSeconds:c==null?void 0:c.expiresIn,phase:l,successContent:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold",children:y??"Computer"})," connected. Closing…"]}),errorContent:m}),u.jsx("div",{className:"flex justify-end",style:{gap:"var(--sp-2)"},children:u.jsx(he,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function A7(){const e=dn(),t=Cl(),n=k7(),{role:a}=qt(),l=a==="admin",[o,c]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(null),[w,k]=x.useState(!1),{data:j}=$e({queryKey:["clients"],queryFn:Ra,refetchInterval:1e4}),{data:E}=$e({queryKey:["activity"],queryFn:Ku,refetchInterval:1e4}),C=wt({mutationFn:w3,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),N=wt({mutationFn:x3,onSuccess:()=>{y(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:M=>{M instanceof Vu?b(M.message):b(M instanceof Error?M.message:String(M))}}),z=x.useMemo(()=>{const M=new Map;for(const U of(E==null?void 0:E.agents)??[]){if(!U.clientId)continue;const Y=M.get(U.clientId)??[];Y.push(U),M.set(U.clientId,Y)}return M},[E==null?void 0:E.agents]),L=M=>z.get(M)??[],D=(j??[]).filter(M=>M.status==="connected").length,O=(j??[]).reduce((M,U)=>M+U.agentCount,0);return u.jsxs("div",{className:"-m-6",children:[u.jsx(Of,{title:"Computers",subtitle:j&&j.length>0?u.jsxs(u.Fragment,{children:[j.length," total · ",D," connected · ",O," agents bound"]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(he,{size:"xs",onClick:()=>k(!0),children:[u.jsx(Jr,{className:"h-3 w-3"}),"New Connection"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsx(T7,{open:w,onOpenChange:k}),h&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),L(h.id).length>0&&u.jsxs("div",{className:"mb-3 p-2 rounded",style:{background:"color-mix(in oklch, var(--state-blocked) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[u.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),u.jsx("ul",{className:"text-body space-y-0.5",children:L(h.id).map(M=>u.jsx("li",{className:"font-medium",children:t(M.agentId)},M.agentId))})]}),g&&u.jsx("div",{className:"mb-3 p-2 rounded text-body",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:g}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(he,{variant:"outline",size:"sm",onClick:()=>{y(null),b(null)},children:"Cancel"}),u.jsx(he,{variant:"destructive",size:"sm",onClick:()=>N.mutate(h.id),disabled:N.isPending,children:N.isPending?"Retiring…":"Retire"})]})]})}),f&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:L(f.id).length===0?u.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):L(f.id).map(M=>u.jsxs("li",{className:"text-body flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:t(M.agentId)}),u.jsx(Ks,{state:M.runtimeState})]},M.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(he,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),u.jsx(he,{variant:"destructive",size:"sm",onClick:()=>C.mutate(f.id),disabled:C.isPending,children:C.isPending?"Disconnecting…":"Disconnect"})]})]})}),!j||j.length===0?u.jsx(sn,{children:u.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers. Use the button above to generate a connect command."})}):u.jsxs(sn,{children:[u.jsxs(Qs,{right:u.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",j.length]}),u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(He,{style:{width:16}}),u.jsx(He,{children:"Hostname"}),l&&u.jsx(He,{children:"Owner"}),u.jsx(He,{children:"OS"}),u.jsx(He,{children:"SDK"}),u.jsx(He,{children:"Agents"}),u.jsx(He,{children:"Connected"}),u.jsx(He,{children:"Status"}),u.jsx(He,{})]})}),u.jsx(xl,{children:j.map(M=>{const U=o===M.id,Y=L(M.id);return u.jsx(L7,{client:M,boundAgents:Y,isExpanded:U,agentName:t,showOwner:l,ownerName:n,onToggle:()=>c(U?null:M.id),onDisconnect:()=>m(M),onRetire:()=>{b(null),y(M)}},M.id)})})]})]})]})]})}const R7={"claude-code":"Claude Code",codex:"Codex"},z7=[rf.CLAUDE_CODE,rf.CODEX],kS={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},O7={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function D7({clientId:e,enabled:t}){const{data:n,isLoading:a}=$e({queryKey:["client-capabilities",e],queryFn:()=>by(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return u.jsxs(u.Fragment,{children:[u.jsx(Xu,{style:{display:"block",marginBottom:6},children:"Runtimes"}),a&&!l?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l&&Object.keys(l).length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Capabilities not yet reported. Reconnect this computer to refresh."}):u.jsx("div",{className:"flex flex-col gap-1",children:z7.map(o=>u.jsx(M7,{provider:o,entry:l?l[o]??null:null},o))})]})}function M7({provider:e,entry:t}){const n=R7[e];if(!t)return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",kS[e]]})]});switch(t.state){case"ok":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-idle)"},children:["✓ ",t.sdkVersion?`v${t.sdkVersion} · `:"","authenticated (",t.authMethod,")"]})]});case"unauthenticated":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",O7[e]]})]});case"missing":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",kS[e]]})]});case"error":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function L7({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:c,onDisconnect:f,onRetire:m}){const h=l?9:8,y=e.status==="connected"?"idle":"offline";return u.jsxs(u.Fragment,{children:[u.jsxs(or,{interactive:!0,selected:n,onClick:c,children:[u.jsx(Be,{style:{width:16},children:u.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?u.jsx(Lk,{className:"h-3.5 w-3.5"}):u.jsx(BR,{className:"h-3.5 w-3.5"})})}),u.jsx(Be,{className:"font-medium",children:e.hostname??"—"}),l&&u.jsx(Be,{style:{color:"var(--fg-2)"},children:o(e.userId)}),u.jsx(Be,{style:{color:"var(--fg-3)"},children:e.os??"—"}),u.jsx(Be,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),u.jsx(Be,{children:u.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?Ni(e.connectedAt):"—"}),u.jsx(Be,{children:u.jsx(Ks,{state:y})}),u.jsx(Be,{style:{width:1,whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-1 justify-end",children:[u.jsxs(he,{variant:"ghost",size:"xs",className:"text-label",onClick:g=>{g.stopPropagation(),f()},children:[u.jsx(Cz,{className:"h-3 w-3"})," Disconnect"]}),u.jsxs(he,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:g=>{g.stopPropagation(),m()},children:[u.jsx(Hs,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&u.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[u.jsx(Be,{}),u.jsxs(Be,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[u.jsx(D7,{clientId:e.id,enabled:n}),u.jsxs(Xu,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):u.jsx("div",{className:"flex flex-col gap-1",children:t.map(g=>u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(g.agentId)}),u.jsx(Ks,{state:g.runtimeState}),g.activeSessions!==null&&u.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[g.activeSessions," / ",g.totalSessions??0," sessions"]})]},g.agentId))})]})]})]})}function I7(){const{token:e}=Sk(),t=fn(),{isAuthenticated:n,adoptTokens:a}=qt(),[l,o]=x.useState(null),[c,f]=x.useState(null),[m,h]=x.useState(!1),[y,g]=x.useState(null);if(x.useEffect(()=>{e&&(async()=>{try{const E=await fetch(`/api/v1/invite/${encodeURIComponent(e)}/preview`);if(!E.ok){f("This invitation is no longer valid");return}o(await E.json())}catch{f("Network error while loading invitation")}})()},[e]),x.useEffect(()=>{n&&(async()=>{try{const E=await ke.get("/me/organizations"),C=await ke.get("/me"),N=E.find(z=>z.id===C.member.organizationId);g((N==null?void 0:N.displayName)??null)}catch{}})()},[n]),!e)return u.jsx(jS,{message:"Bad invitation URL"});if(c)return u.jsx(jS,{message:"This invitation is no longer valid"});if(!l)return u.jsx(U7,{});const b=async()=>{h(!0);try{const E=await ke.post("/me/organizations/join",{token:e});await a(E.tokens),Ok("invite"),t("/",{replace:!0})}catch(E){f(E instanceof Error?E.message:"Failed to join team")}finally{h(!1)}},w=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,k=n&&y&&y!==l.organizationDisplayName,j=P7(l.expiresAt);return u.jsx(lv,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsx(ao,{className:"text-center",children:u.jsxs(Ju,{className:"text-title",children:["You're invited to join",u.jsx("br",{}),l.organizationDisplayName]})}),u.jsxs(io,{className:"space-y-4",children:[k&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md p-3 text-label",style:{background:"var(--bg-sunken)",color:"var(--fg-2)"},children:[u.jsx(gy,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsxs("span",{children:["You'll switch from ",u.jsx("span",{className:"font-medium",children:y})," to"," ",u.jsx("span",{className:"font-medium",children:l.organizationDisplayName}),"."]})]}),n?u.jsx(he,{className:"w-full",disabled:m,onClick:b,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):u.jsx(he,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:w,children:[u.jsx(Ik,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),j&&u.jsx("p",{className:"text-center text-label",style:{color:j.urgent?"var(--destructive)":"var(--fg-3)"},children:j.text}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]})]})]})})}function lv({children:e}){return u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Zu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(my,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:e})]})}function U7(){return u.jsx(lv,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mx-auto h-5 w-2/3 rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto mt-2 h-5 w-1/2 rounded-md",style:{background:"var(--bg-sunken)"}})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx("div",{className:"h-9 w-full rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto h-3 w-1/3 rounded-md",style:{background:"var(--bg-sunken)"}})]})]})})}function jS({message:e}){return u.jsx(lv,{children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:u.jsx(gy,{className:"h-6 w-6"})}),u.jsx(Ju,{className:"text-title",children:e})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx("p",{className:"text-center text-body text-muted-foreground",children:"It may have expired or been revoked. Ask the team admin for a fresh link."}),u.jsx(he,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs(Zu,{to:"/",children:[u.jsx(my,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function P7(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const n=t-Date.now();if(n<=0)return null;const a=Math.floor(n/6e4),l=Math.floor(a/60),o=Math.floor(l/24);return o>7?null:o>=1?{text:`Expires in ${o} ${o===1?"day":"days"}`,urgent:!1}:l>=1?{text:`Expires in ${l} ${l===1?"hour":"hours"}`,urgent:!0}:{text:`Expires in ${Math.max(1,a)} ${a===1?"minute":"minutes"}`,urgent:!0}}function B7(e){if(typeof e!="object"||e===null||!("from"in e))return null;const t=e.from;if(typeof t!="object"||t===null||!("pathname"in t)||typeof t.pathname!="string"||t.pathname==="/login")return null;const n="search"in t&&typeof t.search=="string"?t.search:"",a="hash"in t&&typeof t.hash=="string"?t.hash:"",l=`${t.pathname}${n}${a}`,o=UC(l);return o===jw&&l!==jw?null:o}function $7(){const{isAuthenticated:e}=qt(),t=Mn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=B7(t.state)??"/",l=a==="/"?"/api/v1/auth/github/start":`/api/v1/auth/github/start?next=${encodeURIComponent(a)}`,o="/api/v1/auth/github/dev-callback?githubId=1&login=devuser&displayName=Dev+User";return e?u.jsx(pf,{to:a,replace:!0}):u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Zu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(my,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:u.jsxs(ro,{className:"w-full max-w-sm",children:[u.jsxs(ao,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:u.jsx(to,{width:28,height:32})}),u.jsxs(Ju,{className:"text-title",children:["First Tree ",u.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),u.jsxs(io,{className:"space-y-4",children:[u.jsx(he,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:l,children:[u.jsx(Ik,{className:"h-4 w-4"}),"Continue with GitHub"]})}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]}),n&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[u.jsx("span",{className:"relative z-10 bg-card px-2",children:"localhost only"}),u.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),u.jsx(he,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs("a",{href:o,children:[u.jsx(Az,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function F7(){const e=fn(),{adoptTokens:t}=qt(),[n,a]=x.useState(null);return x.useEffect(()=>{const l=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,o=new URLSearchParams(l),c=o.get("access"),f=o.get("refresh"),m=UC(o.get("next")),h=o.get("joinPath");if(!c||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&Ok(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:c,refreshToken:f}),e(m,{replace:!0})))()},[t,e]),u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}function q7(){return ke.get("/admin/adapter-mappings")}function H7(e){return ke.post("/admin/adapter-mappings",e)}function Z7(e){return ke.delete(`/admin/adapter-mappings/${e}`)}function V7(){return ke.get("/admin/adapters/status")}function Q7(){return ke.get("/admin/adapters")}function K7(e){return ke.post("/admin/adapters",e)}function G7(e,t){return ke.patch(`/admin/adapters/${e}`,t)}function Y7(e){return ke.delete(`/admin/adapters/${e}`)}const X7=Object.values(u6),CS={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function ES(e){const[t,n]=x.useState(CS),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...CS,platform:e.initialPlatform??"feishu",status:e.initialStatus??"active"}),l(""))},[e.open,e.initialPlatform,e.initialStatus]);function o(f){if(f.preventDefault(),l(""),e.kind==="user"){if(!t.externalUserId)return;e.onSubmit({kind:"user-create",draft:{platform:t.platform,externalUserId:t.externalUserId,displayName:t.displayName||null}});return}if(t.platform==="feishu"){if(!e.editingId&&(!t.feishuAppId||!t.feishuAppSecret)){l("App ID and App Secret are required");return}}else if(t.platform==="kael"){if(!e.editingId&&(!t.kaelUserId||!t.kaelProjectId)){l("User ID and Project ID are required");return}}else{const h=t.credentialsJson.trim();if(!e.editingId&&!h){l("Credentials are required");return}if(h)try{JSON.parse(h)}catch{l("Invalid JSON");return}}const m=J7(t);if(!e.editingId&&!m){l("Credentials are required");return}if(e.editingId)e.onSubmit({kind:"bot-update",status:t.status,...m?{credentials:m}:{}});else{if(!m)return;e.onSubmit({kind:"bot-create",draft:{platform:t.platform,status:t.status,credentials:m}})}}const c=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return u.jsx($t,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:c})}),u.jsxs("form",{onSubmit:o,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"binding-platform",children:"Platform"}),u.jsx("select",{id:"binding-platform",value:t.platform,onChange:f=>n({...t,platform:f.target.value}),disabled:!!e.editingId,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:X7.map(f=>u.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"binding-ext-id",children:"External user ID"}),u.jsx(jt,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"binding-name",children:"Display name (optional)"}),u.jsx(jt,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):u.jsxs(u.Fragment,{children:[t.platform==="feishu"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(jt,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),u.jsx(jt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(jt,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(jt,{id:"kael-project-id",value:t.kaelProjectId,onChange:f=>n({...t,kaelProjectId:f.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!e.editingId&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs(st,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),u.jsx("textarea",{id:"binding-creds",value:t.credentialsJson,onChange:f=>n({...t,credentialsJson:f.target.value}),rows:4,className:"flex w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),a&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(st,{htmlFor:"binding-status",children:"Status"}),u.jsxs("select",{id:"binding-status",value:t.status,onChange:f=>n({...t,status:f.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"active",children:"active"}),u.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(he,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function J7(e){if(e.platform==="feishu")return!e.feishuAppId&&!e.feishuAppSecret||!e.feishuAppId||!e.feishuAppSecret?null:{app_id:e.feishuAppId,app_secret:e.feishuAppSecret};if(e.platform==="kael")return!e.kaelUserId&&!e.kaelProjectId||!e.kaelUserId||!e.kaelProjectId?null:{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId};const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function W7(){var A;const e=fn(),t=dn(),[n,a]=yf(),l=n.get("agent"),o=Cl(),c=$e({queryKey:["adapters"],queryFn:Q7}),f=$e({queryKey:["adapter-mappings"],queryFn:q7}),m=$e({queryKey:["adapter-statuses"],queryFn:V7,refetchInterval:15e3}),y=((A=$e({queryKey:["agents","name-map"],queryFn:()=>Yu({limit:100}),staleTime:3e4}).data)==null?void 0:A.items)??[],g=x.useMemo(()=>{const q=new Map;for(const G of m.data??[])q.set(G.configId,G);return q},[m.data]),b=x.useMemo(()=>{const q=c.data??[];return l?q.filter(G=>G.agentId===l):q},[c.data,l]),w=x.useMemo(()=>{const q=f.data??[];return l?q.filter(G=>G.agentId===l):q},[f.data,l]),k=b.reduce((q,G)=>{var ce;return q+((ce=g.get(G.id))!=null&&ce.connected?1:0)},0),j=b.length-k,E=c.isLoading||f.isLoading,[C,N]=x.useState(null),[z,L]=x.useState(""),[D,O]=x.useState(null),[M,U]=x.useState(null),[Y,F]=x.useState(null),[J,ee]=x.useState(null),we=wt({mutationFn:q=>K7({platform:q.platform,agentId:q.agentId,credentials:q.credentials,status:q.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),le=wt({mutationFn:q=>{const G={status:q.status};return q.credentials&&(G.credentials=q.credentials),G7(q.id,G)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),ne=wt({mutationFn:Y7,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),Z=wt({mutationFn:q=>H7({platform:q.platform,externalUserId:q.externalUserId,agentId:q.agentId,boundVia:"manual",displayName:q.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),U(null)}}),te=wt({mutationFn:Z7,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function ie(q){if(l){q==="bot"?O({agentId:l,editingId:null}):U({agentId:l});return}L(""),N({kind:q})}function ve(){!C||!z||(C.kind==="bot"?O({agentId:z,editingId:null}):U({agentId:z}),N(null))}function _(q){if(D){if(q.kind==="bot-create")we.mutate({agentId:D.agentId,platform:q.draft.platform,status:q.draft.status,credentials:q.draft.credentials});else if(q.kind==="bot-update"){if(!D.editingId)return;le.mutate({id:D.editingId,status:q.status,credentials:q.credentials})}}}function P(q){!M||q.kind!=="user-create"||Z.mutate({agentId:M.agentId,platform:q.draft.platform,externalUserId:q.draft.externalUserId,displayName:q.draft.displayName})}const B=l?y.find(q=>q.uuid===l):null;return u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Manage how external platforms (Feishu, Slack, Kael) reach your agents. Bot bindings hold encrypted credentials; user bindings map an external user to a human agent in this organization."}),l&&u.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[u.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),u.jsxs("span",{className:"inline-flex items-center gap-1.5 mono text-caption",style:{padding:"var(--sp-0_5) var(--sp-2)",borderRadius:"var(--radius-chip)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border)"},children:[(B==null?void 0:B.displayName)??l,u.jsx("button",{type:"button",onClick:()=>{const q=new URLSearchParams(n);q.delete("agent"),a(q,{replace:!0})},"aria-label":"Clear filter",className:"inline-flex items-center justify-center hover:bg-accent rounded-full",style:{width:14,height:14,border:"none",background:"transparent",cursor:"pointer"},children:u.jsx(Gd,{className:"h-3 w-3"})})]})]}),u.jsxs(sn,{className:"mb-3.5",children:[u.jsxs(Qs,{right:u.jsxs("span",{className:"inline-flex items-center gap-2",children:[u.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[u.jsx(Xr,{state:"idle",size:6})," ",k," online"]}),u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(Xr,{state:"offline",size:6})," ",j," offline"]})]}),u.jsxs(he,{size:"xs",variant:"outline",onClick:()=>ie("bot"),children:[u.jsx(Jr,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),E?u.jsx(Ld,{children:"Loading…"}):b.length?u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(He,{children:"Agent"}),u.jsx(He,{children:"Platform"}),u.jsx(He,{children:"Status"}),u.jsx(He,{children:"Connection"}),u.jsx(He,{children:"Created"}),u.jsx(He,{style:{width:96,textAlign:"right"}})]})}),u.jsx(xl,{children:b.map(q=>{var ce;const G=((ce=g.get(q.id))==null?void 0:ce.connected)??!1;return u.jsxs(or,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[u.jsx(Be,{children:u.jsx("span",{className:"mono font-medium",children:o(q.agentId)})}),u.jsx(Be,{children:u.jsx(kn,{children:q.platform})}),u.jsx(Be,{children:u.jsx(kn,{tone:q.status==="active"?"accent":"outline",children:q.status})}),u.jsx(Be,{children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[u.jsx(Xr,{state:G?"idle":"offline",size:7}),u.jsx("span",{style:{color:"var(--fg-3)"},children:G?"Online":"Offline"})]})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(q.createdAt)}),u.jsxs(Be,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:be=>be.stopPropagation(),children:[u.jsx(he,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>O({agentId:q.agentId,editingId:q.id,initialPlatform:eH(q.platform),initialStatus:tH(q.status)}),children:"Edit"}),u.jsx(he,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>F(q.id),disabled:ne.isPending,title:"Delete",children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})]})]},q.id)})})]}):u.jsx(Ld,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),u.jsxs(sn,{children:[u.jsxs(Qs,{right:u.jsxs(he,{size:"xs",variant:"outline",onClick:()=>ie("user"),children:[u.jsx(Jr,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",w.length]}),E?u.jsx(Ld,{children:"Loading…"}):w.length?u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(or,{children:[u.jsx(He,{children:"Agent"}),u.jsx(He,{children:"Platform"}),u.jsx(He,{children:"External user ID"}),u.jsx(He,{children:"Display name"}),u.jsx(He,{children:"Bound via"}),u.jsx(He,{children:"Created"}),u.jsx(He,{style:{width:32}})]})}),u.jsx(xl,{children:w.map(q=>u.jsxs(or,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[u.jsx(Be,{children:u.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(q.agentId)})}),u.jsx(Be,{children:u.jsx(kn,{children:q.platform})}),u.jsx(Be,{children:u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:q.externalUserId})}),u.jsx(Be,{style:{color:"var(--fg-2)"},children:q.displayName??"—"}),u.jsx(Be,{children:u.jsx(kn,{tone:"outline",children:q.boundVia??"—"})}),u.jsx(Be,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ni(q.createdAt)}),u.jsx(Be,{onClick:G=>G.stopPropagation(),children:u.jsx(he,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>ee(q.id),disabled:te.isPending,title:"Delete",children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})})]},q.id))})]}):u.jsx(Ld,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),u.jsx(nH,{open:C!=null,kind:(C==null?void 0:C.kind)??"bot",agents:y,agentId:z,onAgentChange:L,onCancel:()=>N(null),onConfirm:ve}),u.jsx(ES,{open:D!=null,kind:"bot",editingId:(D==null?void 0:D.editingId)??null,initialPlatform:D==null?void 0:D.initialPlatform,initialStatus:D==null?void 0:D.initialStatus,agentLabel:D?o(D.agentId):"",pending:we.isPending||le.isPending,errorMessage:(we.error??le.error)instanceof Error?(we.error??le.error).message:null,onOpenChange:q=>{q||(O(null),we.reset(),le.reset())},onSubmit:_}),u.jsx(ES,{open:M!=null,kind:"user",editingId:null,agentLabel:M?o(M.agentId):"",pending:Z.isPending,errorMessage:Z.error instanceof Error?Z.error.message:null,onOpenChange:q=>{q||(U(null),Z.reset())},onSubmit:P}),u.jsx(NS,{open:Y!=null,onOpenChange:q=>!q&&F(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:ne.isPending,onConfirm:()=>{Y!=null&&(ne.mutate(Y),F(null))}}),u.jsx(NS,{open:J!=null,onOpenChange:q=>!q&&ee(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:te.isPending,onConfirm:()=>{J!=null&&(te.mutate(J),ee(null))}})]})}function eH(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function tH(e){return e==="inactive"?"inactive":"active"}function Ld({children:e}){return u.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function nH(e){const t=e.kind==="user"?e.agents.filter(n=>n.type==="human"&&n.status==="active"):e.agents.filter(n=>n.type!=="human"&&n.status==="active");return u.jsx($t,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),u.jsxs("select",{value:e.agentId,onChange:n=>e.onAgentChange(n.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>u.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),u.jsxs(tn,{children:[u.jsx(he,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),u.jsx(he,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function NS(e){return u.jsx($t,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(he,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function rH(){const{organizationId:e,selectOrganization:t,logout:n}=qt(),[a,l]=x.useState([]),[o,c]=x.useState(!1),[f,m]=x.useState(!1),[h,y]=x.useState(null);x.useEffect(()=>{(async()=>{try{const k=await ke.get("/me/organizations");l(k)}catch{}})()},[]);const g=a.find(k=>k.id===e),b=(g==null?void 0:g.displayName)??"this team",w=async()=>{m(!0),y(null);try{await AU();const j=(await ke.get("/me/organizations").catch(()=>[])).find(E=>E.id!==e);j?await t(j.id):n()}catch(k){y(k instanceof Error?k.message:"Failed to leave team"),m(!1)}};return u.jsxs(u.Fragment,{children:[u.jsxs(sn,{children:[u.jsx(Ar,{children:u.jsx(Rr,{children:"Membership"})}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-4) var(--sp-4)"},children:[u.jsxs("div",{className:"text-body",style:{color:"var(--fg)"},children:["You're a member of ",u.jsx("span",{className:"font-medium",children:b}),"."]}),u.jsx("div",{className:"text-label text-muted-foreground",style:{marginTop:4},children:"Leaving removes your access immediately. Your agents stay in the team for history; you can re-join later if an admin shares an invite link."}),u.jsx("div",{style:{marginTop:"var(--sp-3)"},children:u.jsx(he,{variant:"destructive",size:"sm",onClick:()=>c(!0),disabled:f,children:f?"Leaving…":"Leave team"})}),h&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h})]})]}),u.jsx($t,{open:o,onOpenChange:k=>!f&&c(k),children:u.jsxs(zt,{children:[u.jsxs(Kt,{children:[u.jsxs(Ft,{children:["Leave ",b,"?"]}),u.jsx(jf,{children:"You'll lose access to this team's agents and chats. Your historical messages stay, but you won't be able to read or send new ones until an admin re-invites you."})]}),u.jsxs(tn,{children:[u.jsx(he,{variant:"outline",size:"sm",onClick:()=>c(!1),disabled:f,children:"Cancel"}),u.jsx(he,{variant:"destructive",size:"sm",onClick:()=>void w(),disabled:f,children:f?"Leaving…":"Leave team"})]})]})})]})}const _S=[{key:"bindings",label:"Bindings"},{key:"membership",label:"Membership"}];function aH(){const e=Mn(),t=fn(),n=e.hash.replace("#",""),a=_S.some(o=>o.key===n)?n:"bindings",l=o=>{t({hash:o},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(Of,{title:"Settings",subtitle:"Per-member controls"}),u.jsx(aE,{children:_S.map(o=>u.jsx(iE,{active:a===o.key,onClick:()=>l(o.key),children:o.label},o.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[a==="bindings"&&u.jsx(W7,{}),a==="membership"&&u.jsx(rH,{})]})]})}function iH(e){return ke.get(`/admin/chats/${encodeURIComponent(e)}`)}function lH(e,t){return ke.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function TS(e,t){return ke.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function sH(e,t){return ke.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function oH(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 vN(e){return ke.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function uH(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit)),t!=null&&t.cursor&&n.set("cursor",t.cursor);const a=n.toString();return ke.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const cH="first-tree-hub-images",dH=1,Ys="images";let Id=null;function bN(){return Id||(Id=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(cH,dH);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Ys)||n.createObjectStore(Ys,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Id)}async function fH(e){const t=await bN();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Ys,"readwrite"),o=l.objectStore(Ys),c={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(c),l.oncomplete=()=>n(),l.onerror=()=>a(l.error??new Error("Image storage write failed")),l.onabort=()=>a(l.error??new Error("Image storage write aborted"))})}async function hH(e){const t=await bN();return t?new Promise(n=>{const o=t.transaction(Ys,"readonly").objectStore(Ys).get(e);o.onsuccess=()=>{const c=o.result;if(!c){n(null);return}n({base64:c.base64,mimeType:c.mimeType})},o.onerror=()=>n(null)}):null}function mH(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 pH(e,t){if(!t)return[...e].sort((a,l)=>(a.displayName??a.name??"").localeCompare(l.displayName??l.name??"")).slice(0,8);const n=[];for(const a of e){const l=(a.name??"").toLowerCase(),o=(a.displayName??"").toLowerCase();let c=1/0;l.startsWith(t)?c=0:o.startsWith(t)?c=1:o.includes(t)&&(c=2),c!==1/0&&n.push({c:a,score:c})}return n.sort((a,l)=>a.score-l.score||(a.c.displayName??"").localeCompare(l.c.displayName??"")),n.slice(0,8).map(a=>a.c)}function gH(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),c=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${c}${m}`,y=l.length+c.length+(f?1:0);return{text:h,cursor:y}}function yH({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,c]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:mH(e,t),[e,t,l]),y=x.useMemo(()=>h?pH(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{c(0)},[g]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,w=h!==null&&y.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(C){if(!h)return;const N=gH(e,h,t,C);N&&a(N)}return{trigger:w?h:null,results:w?y:[],highlightIndex:o,handleKey:C=>{if(!w||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),c(N=>y.length===0?0:(N+1)%y.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),c(N=>y.length===0?0:(N-1+y.length)%y.length),!0;if(C.key==="Enter"||C.key==="Tab"){const N=y[o]??y[0];return N?(C.preventDefault(),j(N),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function vH({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:l}){const o=x.useRef(null);return x.useEffect(()=>{var m;const f=(m=o.current)==null?void 0:m.querySelector(`[data-mention-index="${n}"]`);f==null||f.scrollIntoView({block:"nearest"})},[n]),!e||t.length===0||!l.current?null:u.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:Ae("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,right:0,background:"var(--bg-raised)",borderColor:"var(--border)"},children:t.map((f,m)=>{const h=m===n;return u.jsxs("button",{type:"button",role:"option","aria-selected":h,"data-mention-index":m,onMouseDown:y=>{y.preventDefault(),a(f)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:h?"var(--accent-dim)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer"},children:[u.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&u.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function xN(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function bH(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=AS(l.payload);if(!o)continue;const c=a.get(o)??-1;l.seq>c&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=AS(l.payload);return o?a.get(o)===l.seq:!0})}function AS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Pf(e){const t=new Date(e),n=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),a=l=>{var o;return((o=n.find(c=>c.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function wN(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 xH(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function RS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function wH({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function SH({agentId:e,chatId:t,session:n}){const a=dn(),[,l]=yf(),[o,c]=x.useState(!1),[f,m]=x.useState(null),h=rj(e,t),y=Xd(e),g=E=>{a.setQueryData(h,C=>C&&{...C,state:E}),a.setQueryData(y,C=>C&&C.map(N=>N.chatId===t?{...N,state:E}:N))},b=wt({mutationFn:()=>E3(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,N)=>{N!=null&&N.previousSession&&a.setQueryData(h,N.previousSession),N!=null&&N.previousList&&a.setQueryData(y,N.previousList)},onSuccess:E=>{g(E.state)}}),w=wt({mutationFn:()=>N3(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,N=>N&&N.filter(z=>z.chatId!==t)),{previousSession:E,previousList:C}},onError:(E,C,N)=>{N!=null&&N.previousSession&&a.setQueryData(h,N.previousSession),N!=null&&N.previousList&&a.setQueryData(y,N.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,C,N)=>{if(E.state!=="evicted"){N!=null&&N.previousList&&a.setQueryData(y,N.previousList),g(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),c(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",background:"var(--bg-sunken)"},children:[k&&u.jsxs("button",{type:"button",onClick:()=>b.mutate(),disabled:b.isPending,className:"inline-flex items-center transition-colors text-label",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--fg-2)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="var(--bg-hover)",onMouseLeave:E=>E.currentTarget.style.background="transparent",children:[u.jsx(sz,{className:"h-3 w-3"})," Suspend",u.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&u.jsxs("button",{type:"button",onClick:()=>{m(null),c(!0)},disabled:w.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:[u.jsx(yz,{className:"h-3 w-3"})," Terminate"]})]}),u.jsx(kH,{open:o,onOpenChange:E=>{w.isPending||c(E),E||m(null)},session:n,chatId:t,error:f,pending:w.isPending,onConfirm:()=>w.mutate()})]})}function kH(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:c,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return u.jsx($t,{open:t,onOpenChange:n,children:u.jsxs(zt,{children:[u.jsx(Kt,{children:u.jsx(Ft,{children:"Terminate session?"})}),u.jsxs("form",{onSubmit:m,className:"space-y-4",children:[u.jsx("p",{className:"text-body text-muted-foreground",children:"Ending this session is permanent. It is removed from the workspace and cannot be resumed. Chat history is preserved; a new message will start a fresh session."}),u.jsxs("div",{className:"mono text-label",style:{padding:"var(--sp-2) var(--sp-2_5)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",display:"grid",gap:4},children:[u.jsxs("span",{children:["chat: ",u.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&u.jsxs("span",{children:["last activity: ",wN(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&u.jsxs("span",{children:["messages: ",a.messageCount]})]}),c&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:c}),u.jsxs(tn,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),u.jsx(he,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function jH({event:e}){const t=S3(e.payload);if(!t)return null;const n=t.status==="error",a=t.status==="pending",l=n?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":a?"using":"used";return u.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[a?u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:l,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):u.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),u.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?RS(t.args):void 0,children:[u.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",u.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?u.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",RS(t.args),")"]}):null,t.durationMs!==void 0&&!a?u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",xH(t.durationMs)]}):null]})]})}function CH({event:e,agentNameFn:t,agentId:n}){const a=j3(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[u.jsx(SN,{name:l,isSelf:!1}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Pf(e.createdAt)}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function EH({event:e}){return u.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),u.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Pf(e.createdAt)})]})}function NH({event:e}){const t=k3(e.payload),n=Pf(e.createdAt);return u.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2_5)",borderLeft:"var(--hairline-bold) solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 var(--radius-input) var(--radius-input) 0"},children:[u.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),u.jsx("div",{className:"text-label",style:{marginTop:2,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function SN({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return u.jsx("div",{className:"mono text-eyebrow font-bold",style:{width:20,height:20,borderRadius:"var(--radius-input)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"var(--hairline) solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?n:u.jsx(to,{width:9,height:10,style:{color:"var(--accent)"}})})}function _H({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[u.jsx(SN,{name:a,isSelf:l}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Pf(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(wH,{msg:e,myAgentId:t})})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&TH(e.content)?u.jsx("img",{src:`data:${e.content.mimeType};base64,${e.content.data}`,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):e.format==="file"&&AH(e.content)?u.jsx(RH,{content:e.content}):e.format==="text"?u.jsx(gN,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):u.jsx("pre",{className:"mono text-label",style:{background:"var(--bg-sunken)",padding:8,borderRadius:"var(--radius-input)",overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function TH(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 AH(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 RH({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return hH(e.imageId).then(l=>{a||n(l?{kind:"hit",src:`data:${l.mimeType};base64,${l.base64}`}:{kind:"miss"})}),()=>{a=!0}},[e.imageId]),t.kind==="hit"?u.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?u.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):u.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function zH({agentId:e,chatId:t}){var Le;const n=dn(),a=Cl(),l=Cy(),{agentId:o}=qt(),[c,f]=x.useState(""),[m,h]=x.useState(0),[y,g]=x.useState([]),[b,w]=x.useState(!1),[k,j]=x.useState(null),E=x.useRef(null),C=x.useRef(null),N=x.useRef(null),z=x.useRef(!1),L=x.useRef(new Set);x.useEffect(()=>{z.current=!1},[t]);const{data:D}=$e({queryKey:["chat-messages",t],queryFn:()=>uH(t,{limit:50}),refetchInterval:5e3}),{data:O}=$e({queryKey:["session-events",e,t],queryFn:()=>C3(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:M}=$e({queryKey:rj(e,t),queryFn:()=>eo(e).then(re=>re.find(Ee=>Ee.chatId===t)??null),refetchInterval:5e3}),{data:U}=$e({queryKey:["chat-detail",t],queryFn:()=>iH(t),enabled:!!t}),Y=wt({mutationFn:re=>TS(t,re),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Xd(e)})}}),F=x.useCallback(re=>{const Ie=re.filter(hn=>hn.type.startsWith("image/"));if(Ie.length===0)return;const Pe=Ie.find(hn=>hn.size>5242880);if(Pe){j(`Image too large (${(Pe.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const Lt=Ie.map(hn=>({id:crypto.randomUUID(),file:hn,previewUrl:URL.createObjectURL(hn)}));g(hn=>[...hn,...Lt]),j(null)},[]),J=x.useCallback(re=>{g(Ee=>{const Ie=Ee.find(Pe=>Pe.id===re);return Ie&&URL.revokeObjectURL(Ie.previewUrl),Ee.filter(Pe=>Pe.id!==re)})},[]),ee=async()=>{const re=c.trim(),Ee=y;if(!(!re&&Ee.length===0)&&!b&&!(G&&ce.length===0)){if(Ee.length>0){w(!0),j(null);try{for(const Ie of Ee){const Pe=await oH(Ie.file),Lt=crypto.randomUUID();await fH({imageId:Lt,base64:Pe,mimeType:Ie.file.type}),await sH(t,{data:Pe,mimeType:Ie.file.type,filename:Ie.file.name,size:Ie.file.size,imageId:Lt}),URL.revokeObjectURL(Ie.previewUrl)}g([]),re&&await TS(t,re),f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Xd(e)})}catch(Ie){j(Ie instanceof Error?Ie.message:"Failed to send image")}finally{w(!1)}return}Y.mutate(re)}},[we,le]=x.useState(!1),[ne,Z]=x.useState(""),te=x.useRef(null);x.useEffect(()=>{var re;we&&((re=te.current)==null||re.focus())},[we]);const ie=wt({mutationFn:re=>lH(t,re),onSuccess:()=>{le(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),ve=()=>{const re=ne.trim();ie.mutate(re.length>0?re:null)},_=x.useMemo(()=>{const re=(D==null?void 0:D.items)??[],Ee=bH((O==null?void 0:O.items)??[]),Ie=[...re.map(Pe=>({kind:"message",at:Pe.createdAt,key:`m-${Pe.id}`,data:Pe})),...Ee.map(Pe=>({kind:"event",at:Pe.createdAt,key:`e-${Pe.id}`,data:Pe}))];return Ie.sort((Pe,Lt)=>Pe.at.localeCompare(Lt.at)),Ie},[D,O]),P=_.length;x.useEffect(()=>{var re;P>0&&((re=N.current)==null||re.scrollIntoView({behavior:"smooth"}))},[P]);const B=U!=null&&U.participants?U.participants.map(re=>{const Ee=a(re.agentId);return`@${Ee.length>20?`${Ee.slice(0,17)}…`:Ee}`}).join(" "):`@${a(e)}`,A=a(e),q=x.useMemo(()=>{var Ie;const re=((Ie=U==null?void 0:U.participants)==null?void 0:Ie.map(Pe=>Pe.agentId))??[e],Ee=[];for(const Pe of re){if(Pe===o)continue;const Lt=l(Pe);!Lt||!Lt.name||Ee.push({agentId:Pe,name:Lt.name,displayName:Lt.displayName})}return Ee},[U==null?void 0:U.participants,e,l,o]),G=x.useMemo(()=>{if(!U)return!1;if(U.type==="group")return!0;const re=U.participants.some(Ee=>Ee.agentId===o);return U.type==="direct"&&!re&&U.participants.length>=2},[U,o]);x.useEffect(()=>{if(L.current.has(t)||!D||!O||!U||_.length>0||c.length>0||G||A===e)return;const re=`Hi ${A}! What can you help with?`;f(re),h(re.length),L.current.add(t),requestAnimationFrame(()=>{const Ee=C.current;Ee&&(Ee.focus(),Ee.setSelectionRange(re.length,re.length))})},[t,e,D,O,U,_.length,c.length,A,G]);const ce=x.useMemo(()=>{if(!G)return[];const re=q.map(Ee=>({agentId:Ee.agentId,name:Ee.name}));return s6(c,re)},[c,q,G]),be=yH({value:c,cursor:m,candidates:q,disabled:Y.isPending||b,onSelect:re=>{f(re.text),h(re.cursor),requestAnimationFrame(()=>{const Ee=C.current;Ee&&(Ee.focus(),Ee.setSelectionRange(re.cursor,re.cursor))})}}),xe=(M==null?void 0:M.runtimeState)??"idle",me=xN((M==null?void 0:M.runtimeState)??null,e?"connected":null),Xe=(M==null?void 0:M.messageCount)??((Le=D==null?void 0:D.items)==null?void 0:Le.length)??0;return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx(Xr,{state:me,size:8}),we?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:te,value:ne,onChange:re=>Z(re.target.value),onKeyDown:re=>{re.key==="Enter"?(re.preventDefault(),ve()):re.key==="Escape"&&(re.preventDefault(),le(!1))},disabled:ie.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none text-subtitle",style:{flex:1,minWidth:0,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),u.jsx("button",{type:"button",onClick:ve,disabled:ie.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:u.jsx(cr,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>le(!1),disabled:ie.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:u.jsx(Gd,{className:"h-3.5 w-3.5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(U==null?void 0:U.topic)||(M==null?void 0:M.summary)||`Chat · ${t.slice(0,8)}`}),u.jsx("button",{type:"button",onClick:()=>{Z((U==null?void 0:U.topic)??""),le(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:re=>re.currentTarget.style.color="var(--fg-2)",onMouseLeave:re=>re.currentTarget.style.color="var(--fg-4)",children:u.jsx(Qu,{className:"h-3 w-3"})})]}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)",padding:"var(--hairline) var(--sp-1_25)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)"},children:t})]}),u.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[u.jsx("span",{className:"mono",children:B}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["started ",wN((M==null?void 0:M.startedAt)??null)]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[Xe," msgs"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["runtime"," ",u.jsx("span",{className:"mono",style:{color:me==="error"?"var(--state-error)":"var(--fg-2)"},children:xe})]})]})]}),u.jsx(SH,{agentId:e,chatId:t,session:M??null})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[P===0&&u.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[u.jsx(py,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),u.jsx("div",{className:"flex flex-col",style:{gap:4},children:_.map(re=>{if(re.kind==="event"){const Ee=re.data;switch(Ee.kind){case"tool_call":return u.jsx(jH,{event:Ee},re.key);case"assistant_text":return u.jsx(CH,{event:Ee,agentId:e,agentNameFn:a},re.key);case"thinking":return u.jsx(EH,{event:Ee},re.key);case"error":return u.jsx(NH,{event:Ee},re.key);default:return null}}return u.jsx(_H,{msg:re.data,myAgentId:o,agentNameFn:a},re.key)})}),u.jsx("div",{ref:N})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:re=>re.preventDefault(),onDrop:re=>{re.preventDefault(),F(Array.from(re.dataTransfer.files))},children:[y.length>0&&u.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:y.map(re=>u.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[u.jsx("img",{src:re.previewUrl,alt:re.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),u.jsx("button",{type:"button",onClick:()=>J(re.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"var(--color-overlay-scrim)",border:"none",color:"var(--bg-raised)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:u.jsx(Gd,{className:"h-2 w-2"})})]},re.id))}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(vH,{trigger:be.trigger,results:be.results,highlightIndex:be.highlightIndex,anchorRef:C,onPick:be.pick}),u.jsx("textarea",{ref:C,value:c,onChange:re=>{f(re.target.value),h(re.target.selectionStart??re.target.value.length)},onSelect:re=>{h(re.currentTarget.selectionStart??c.length)},onFocus:()=>{G&&(z.current||c.length>0||q.length===0||(z.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const re=C.current;re&&re.setSelectionRange(1,1)})))},onPaste:re=>{const Ee=Array.from(re.clipboardData.files);Ee.length>0&&(re.preventDefault(),F(Ee))},placeholder:G?"Type @ to pick a recipient, then your message":`Message @${A} · / for commands · @ to mention`,rows:2,onKeyDown:re=>{be.handleKey(re)||re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),ee())},disabled:Y.isPending||b,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2_25) var(--sp-3) var(--sp-7_5)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}})]}),u.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[u.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[u.jsx("button",{type:"button",onClick:()=>{var re;return(re=E.current)==null?void 0:re.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:u.jsx(iz,{className:"h-3.5 w-3.5"})}),u.jsx("input",{ref:E,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:re=>{re.target.files&&(F(Array.from(re.target.files)),re.target.value="")}}),u.jsx("span",{children:"/suspend"}),u.jsx("span",{children:"/resume"}),u.jsx("span",{children:"/branch"}),u.jsx("span",{children:"/promote"})]}),u.jsxs("span",{className:"flex items-center",style:{gap:8},children:[b&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),u.jsxs("span",{children:[u.jsx("span",{className:"kbd",children:"⏎"})," send ",u.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),u.jsxs("button",{type:"button",onClick:ee,disabled:Y.isPending||b||!c.trim()&&y.length===0||G&&ce.length===0,title:G&&ce.length===0?"Pick at least one recipient with @ before sending in a group chat":void 0,className:Ae("inline-flex items-center transition-colors text-label font-semibold",(Y.isPending||b||!c.trim()&&y.length===0||G&&ce.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"var(--hairline) solid var(--accent)",borderRadius:"var(--radius-input)"},children:[u.jsx(hz,{className:"h-3 w-3"})," Send"]})]})]})]}),(Y.isError||k)&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(Y.error instanceof Error?Y.error.message:"Failed to send")})]})]})}function OH(){return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(to,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),u.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}const DH=3e4,MH=1e3,LH=3e3;function IH(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function UH(){var be;const{refreshMe:e,organizationId:t,memberId:n}=qt(),a=fn(),l=fR(t,n),o=mR(l),c=o!=null&&o.connectToken&&o.connectTokenExpiresAt&&o.connectTokenExpiresAt>Date.now()?o.connectToken:null,f=c?(o==null?void 0:o.connectTokenExpiresAt)??null:null,[m,h]=x.useState(()=>(o==null?void 0:o.displayName)??""),[y,g]=x.useState(()=>(o==null?void 0:o.selectedRuntime)??null),[b,w]=x.useState(null),[k,j]=x.useState(null),[E,C]=x.useState(null),[N,z]=x.useState(()=>c),[L,D]=x.useState(()=>f),[O,M]=x.useState([]),[U,Y]=x.useState("form"),[F,J]=x.useState(null),[ee]=x.useState(()=>cR()),we=x.useRef(null),le=x.useRef(null),ne=x.useRef(null),Z=x.useRef(0);x.useEffect(()=>()=>{le.current&&(le.current.cancelled=!0)},[]),x.useEffect(()=>{pR(l,{displayName:m,selectedRuntime:y,connectToken:N,connectTokenExpiresAt:L})},[l,m,y,N,L]),x.useEffect(()=>{(async()=>{try{const xe=await ke.get("/me/organizations");M(xe)}catch{}})()},[]),x.useEffect(()=>{if(U!=="form")return;let xe=!1;const me=async()=>{const Le=++Z.current;try{const re=await Ra();if(xe||Le!==Z.current)return;const Ie=re.filter(Pe=>Pe.status==="connected").sort((Pe,Lt)=>Lt.lastSeenAt.localeCompare(Pe.lastSeenAt))[0]??null;if(w(Pe=>(Pe==null?void 0:Pe.id)===(Ie==null?void 0:Ie.id)?Pe:Ie),Ie){ne.current!==Ie.id&&(ne.current=null,C(null),j(null));try{const Pe=await by(Ie.id);if(xe||Le!==Z.current)return;ne.current=Ie.id,C(Ie.id),j(Pe.capabilities)}catch{}}else ne.current=null,C(null),j(null)}catch{}};me();const Xe=setInterval(me,LH);return()=>{xe=!0,clearInterval(Xe)}},[U]),x.useEffect(()=>{if(b)return;if(N&&L&&L>Date.now()){const me=Math.max(L-Date.now(),0),Xe=window.setTimeout(()=>{z(null),D(null)},me);return()=>window.clearTimeout(Xe)}N&&(z(null),D(null));let xe=!1;return(async()=>{try{const me=await ke.post("/connect-tokens",{});xe||(z(me.token),D(Date.now()+me.expiresIn*1e3))}catch(me){xe||J(me instanceof Error?me.message:"Failed to generate connect token")}})(),()=>{xe=!0}},[b,N,L]);const te=b&&E===b.id?k:null;x.useEffect(()=>{g(xe=>{if(!te)return xe;const me=Object.entries(te).filter(([,Xe])=>Xe.state==="ok").map(([Xe])=>Xe);return xe&&me.includes(xe)?xe:me[0]??null})},[te]);const ie=te?Object.entries(te).filter(([,xe])=>xe.state==="ok").map(([xe])=>xe):[],ve=((be=O.find(xe=>xe.id===t))==null?void 0:be.displayName)??"",_=m.trim(),P=_||"your agent",B=N?`npm install -g @agent-team-foundation/first-tree-hub
|
|
387
|
-
first-tree-hub connect ${N}`:null,A=x.useCallback(async xe=>{le.current&&(le.current.cancelled=!0);const me={cancelled:!1};le.current=me;const Xe=Date.now();for(;!me.cancelled;){let Le=!1;try{const re=await ke.get(`/admin/agents/${encodeURIComponent(xe)}/client-status`);if(me.cancelled)return;Le=re.online===!0}catch{if(me.cancelled)return}if(Le){try{const re=await vN(xe);if(me.cancelled||(gR(l),await e(),me.cancelled))return;a(`/?a=${encodeURIComponent(xe)}&c=${encodeURIComponent(re.id)}`,{replace:!0})}catch(re){if(me.cancelled)return;J(re instanceof Error?re.message:"Failed to open chat"),Y("timeout")}return}if(Date.now()-Xe>DH){me.cancelled||Y("timeout");return}await new Promise(re=>setTimeout(re,MH))}},[l,e,a]),q=!!(_&&b&&y&&ie.includes(y)&&U==="form"),G=x.useCallback(async()=>{if(!b||!y||!_)return;J(null),Y("creating");const xe=Vg(_);let me;try{me=(await ke.post("/admin/agents",{type:"personal_assistant",displayName:_,...xe?{name:xe}:{},clientId:b.id,runtimeProvider:y,...t?{organizationId:t}:{}})).uuid,we.current=me}catch(Xe){J(Xe instanceof Error?Xe.message:"Failed to create agent"),Y("form");return}await A(me)},[_,b,y,A,t]),ce=x.useCallback(async()=>{const xe=we.current;xe&&(J(null),Y("creating"),await A(xe))},[A]);return u.jsx("div",{className:"flex-1 overflow-auto",style:{display:"flex",justifyContent:"center",padding:"clamp(var(--sp-16), 12vh, var(--sp-45)) var(--sp-4) var(--sp-12)"},children:u.jsxs("div",{style:{width:"100%",maxWidth:560},children:[U==="form"&&u.jsx(PH,{joinPath:ee,teamName:ve,displayName:m,setDisplayName:h,trimmedName:_,connectedClient:b,cliCommand:B,okRuntimes:ie,selectedRuntime:y,setSelectedRuntime:g,capabilitiesLoaded:te!==null,error:F,canCreate:q,onCreate:G}),U==="creating"&&u.jsx(VH,{nameOrFallback:P}),U==="timeout"&&u.jsx(QH,{nameOrFallback:P,hostname:(b==null?void 0:b.hostname)??null,error:F,onRetry:ce})]})})}function PH({joinPath:e,teamName:t,displayName:n,setDisplayName:a,trimmedName:l,connectedClient:o,cliCommand:c,okRuntimes:f,selectedRuntime:m,setSelectedRuntime:h,capabilitiesLoaded:y,error:g,canCreate:b,onCreate:w}){const k=x.useRef(null),E=e==="invite"&&t?`Welcome — you've joined ${t}`:"Welcome to First Tree Hub",C=l?o?m?"Ready to create.":"Next: choose a runtime.":"Next: connect the computer where they'll work.":"Next: name your agent.";return x.useEffect(()=>{var N;l||(N=k.current)==null||N.focus()},[l]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex flex-col items-start",style:{gap:"var(--sp-4)",paddingTop:0},children:[u.jsxs("p",{className:"text-label",style:{margin:0,color:"var(--fg-3)",maxWidth:420},children:[u.jsx("span",{style:{color:"var(--fg-2)"},children:E}),u.jsx("span",{style:{color:"var(--fg-4)"},children:" · "}),"Where agents and humans work as one team."]}),u.jsx("h1",{className:"text-title font-semibold",style:{margin:0,color:"var(--fg)"},children:"Let's create your first agent."})]}),u.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[u.jsx(BH,{}),u.jsx(zS,{number:"01",state:l?"complete":"active",children:u.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)",flexWrap:"wrap"},children:[u.jsx("label",{htmlFor:"onboarding-name",className:"text-body font-normal",style:{color:"var(--fg-2)",whiteSpace:"nowrap"},children:"What should we call this agent?"}),u.jsx("input",{ref:k,id:"onboarding-name","aria-label":"Agent display name",value:n,onChange:N=>a(N.target.value),placeholder:"e.g. Code Reviewer",maxLength:200,className:"onboarding-name-input text-body font-medium",style:{flex:"0 1 28ch",minWidth:"22ch",maxWidth:"30ch",padding:"var(--sp-0_5) 0",background:"transparent",border:0,borderBottom:"var(--hairline) solid var(--border-faint)",borderRadius:0,boxShadow:"none",color:"var(--fg)",outline:"none",caretColor:"var(--accent)",transition:"border-color 160ms ease, color 160ms ease"},onFocus:N=>{N.currentTarget.style.borderBottomColor="var(--accent)"},onBlur:N=>{N.currentTarget.style.borderBottomColor="var(--border-faint)"}})]})}),u.jsx(zS,{number:"02",state:b?"complete":l?"active":"idle",children:u.jsxs("div",{style:{animation:l?"subtle-fade 200ms ease-out":void 0},children:[u.jsxs("h2",{className:"text-subtitle font-semibold",style:{color:l?"var(--fg)":"var(--fg-4)",fontWeight:l?600:500},children:["Where will ",l||"this agent"," run?"]}),l?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:o?`This computer will run ${l} and keep it connected to Hub.`:"This agent needs a computer to do its work. Connect the one it should use."}),!o&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",marginTop:"var(--sp-2)"},children:"Open Terminal on that computer and run this command."}),o?u.jsx(qH,{hostname:o.hostname??o.id}):u.jsxs(u.Fragment,{children:[u.jsx($H,{command:c}),u.jsx(FH,{})]}),o&&u.jsx(HH,{runtimes:f,selected:m,onSelect:h,capabilitiesLoaded:y})]}):null]})})]}),g&&u.jsx("div",{className:"text-body",style:{marginTop:"var(--sp-4)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:g}),l&&u.jsxs("div",{style:{marginTop:b?"var(--sp-4)":"var(--sp-5)",marginLeft:"calc(var(--sp-5) + var(--sp-3))",animation:"subtle-fade 180ms ease-out"},children:[!b&&u.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-4)"},children:C}),b&&u.jsxs(he,{type:"button",size:"default",style:{marginTop:0,border:"var(--hairline) solid color-mix(in oklch, var(--accent) 32%, transparent)",background:"var(--accent)",boxShadow:"var(--shadow-md)",color:"var(--primary-foreground, var(--color-primary-foreground))",opacity:1,transform:"translateZ(0)",transition:"box-shadow 160ms ease, transform 160ms ease"},onClick:w,onMouseEnter:N=>{N.currentTarget.style.transform="scale(1.01)",N.currentTarget.style.boxShadow="var(--shadow-md)"},onMouseLeave:N=>{N.currentTarget.style.transform="scale(1)",N.currentTarget.style.boxShadow="var(--shadow-md)"},children:[u.jsxs("span",{children:["Create ",l]}),u.jsx(zR,{className:"h-4 w-4"})]}),u.jsx("p",{className:"text-caption",style:{margin:b?"var(--sp-2) 0 0":"var(--sp-0_5) 0 0",color:"var(--fg-4)"},children:"You can customize this agent after setup."})]})]})}function BH(){return u.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"var(--sp-5)",bottom:"var(--sp-5)",left:"calc(var(--sp-2_5) - var(--hairline))",width:"var(--hairline)",background:"color-mix(in oklch, var(--border-faint) 56%, transparent)"}})}function zS({number:e,state:t,children:n}){const a=t==="active",l=t==="complete";return u.jsxs("section",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:"var(--sp-3)",marginTop:e==="01"?0:"var(--sp-5)",position:"relative"},children:[u.jsx("div",{className:"mono text-caption flex items-center justify-center",style:{width:"var(--sp-5)",height:"var(--sp-5)",borderRadius:999,background:a||l?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:a||l?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",color:a||l?"var(--accent)":"var(--fg-4)",zIndex:1},children:l?u.jsx(cr,{className:"h-3 w-3"}):e}),u.jsx("div",{style:{minHeight:"var(--sp-6)",paddingBottom:"var(--sp-1)"},children:n})]})}function $H({command:e}){const[t,n]=x.useState(!1),l=(e?e.split(`
|
|
388
|
-
`):[]).find(m=>m.startsWith("first-tree-hub"))??"",o="first-tree-hub connect ",c=l.startsWith(o)?`${o}${l.slice(o.length,o.length+22)}…`:l.length>52?`${l.slice(0,52)}…`:l,f=async()=>{e&&(await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500))};return u.jsx("div",{style:{marginTop:"var(--sp-2)"},children:u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[u.jsx("pre",{className:"mono text-label",title:l,style:{flex:1,minHeight:38,margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--bg-sunken) 42%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--border-faint) 58%, transparent)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:c||"Generating token…"}),u.jsxs(he,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:!e,style:{alignSelf:"stretch",background:"color-mix(in oklch, var(--bg-raised) 48%, transparent)",borderColor:"color-mix(in oklch, var(--border) 58%, transparent)",boxShadow:"none",height:"auto",minHeight:38},children:[t?u.jsx(cr,{className:"h-3.5 w-3.5"}):u.jsx(vf,{className:"h-3.5 w-3.5"}),t?"Copied":"Copy"]})]})})}function FH(){return u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",color:"color-mix(in oklch, var(--accent) 24%, var(--fg-3))"},children:[u.jsx(ZH,{}),u.jsx("span",{children:"Waiting for your computer…"})]})}function qH({hostname:e}){return u.jsxs("div",{className:"inline-flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",padding:"var(--sp-1_5) var(--sp-2_5)",borderRadius:999,background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"color-mix(in oklch, var(--accent) 26%, var(--fg))",animation:"onboarding-pop 260ms cubic-bezier(0.2, 0.9, 0.2, 1.15)"},children:[u.jsx(cr,{className:"h-3.5 w-3.5"}),u.jsxs("span",{children:[u.jsx("span",{className:"mono font-semibold",children:e})," connected"]})]})}function HH({runtimes:e,selected:t,onSelect:n,capabilitiesLoaded:a}){return e.length===0?u.jsx("p",{className:"text-label",style:{marginTop:"var(--sp-3)",color:"var(--fg-3)"},children:a?"No runtime ready on this computer. Install Claude Code or Codex, then check back.":"Detecting installed runtimes…"}):u.jsxs("div",{style:{marginTop:"var(--sp-3)"},children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Powered by"}),u.jsxs("fieldset",{className:"flex",style:{gap:"var(--sp-4)",flexWrap:"wrap",margin:0,padding:0,border:0},children:[u.jsx("legend",{className:"sr-only",children:"Runtime provider"}),e.map((l,o)=>{const c=t===l;return u.jsxs("label",{className:"onboarding-runtime-option inline-flex items-center text-body",style:{gap:"var(--sp-1_5)",padding:"var(--sp-1) 0",cursor:"pointer",color:c?"color-mix(in oklch, var(--accent) 30%, var(--fg))":"var(--fg)",fontWeight:c?600:400,animation:`onboarding-rise 220ms ease-out ${o*80}ms both`,transition:"color 160ms ease, opacity 160ms ease, transform 160ms ease"},children:[u.jsx("input",{type:"radio",name:"onboarding-runtime",value:l,checked:c,onChange:()=>n(l),className:"sr-only"}),u.jsx("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center",style:{width:14,height:14,borderRadius:"50%",border:c?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-strong)",background:c?"color-mix(in oklch, var(--accent) 8%, transparent)":"transparent",boxShadow:c?"0 0 0 var(--sp-0_5) color-mix(in oklch, var(--accent) 10%, transparent)":"none",transition:"border-color 160ms ease, background 160ms ease, box-shadow 160ms ease"},children:c&&u.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)"}})}),IH(l)]},l)})]})]})}function ZH(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",display:"inline-block",width:8,height:8,flexShrink:0},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--accent)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--accent)",animation:"ring-pulse 1.8s infinite",opacity:.55}})]})}function VH({nameOrFallback:e}){return u.jsxs("div",{className:"flex flex-col items-center text-center",style:{paddingTop:"var(--sp-12)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:["Creating ",e,"…"]}),u.jsx(KH,{}),u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Usually takes ~10 seconds"})]})}function QH({nameOrFallback:e,hostname:t,error:n,onRetry:a}){const l=t??"your computer";return u.jsxs("div",{className:"flex flex-col",style:{paddingTop:"var(--sp-8)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:[e," is taking longer than expected."]}),n?u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 10%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 25%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:n}):u.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)"},children:[u.jsx("p",{children:"This usually means:"}),u.jsxs("ul",{style:{paddingLeft:"var(--sp-4)",listStyle:"disc",marginTop:"var(--sp-1_5)"},children:[u.jsxs("li",{children:["The runtime can't start on ",l," (missing API key, etc.)"]}),u.jsxs("li",{children:["The connection to ",l," dropped"]})]}),u.jsxs("p",{style:{marginTop:"var(--sp-2)"},children:["Fix it on ",l,", then click ",u.jsx("span",{className:"font-semibold",children:"Try again"}),"."]})]}),u.jsx("div",{className:"flex",style:{gap:"var(--sp-2)"},children:u.jsx(he,{onClick:a,children:"Try again"})})]})}function KH(){return u.jsxs("span",{className:"flex items-center",style:{gap:6},children:[u.jsx(Hp,{delayMs:0}),u.jsx(Hp,{delayMs:160}),u.jsx(Hp,{delayMs:320})]})}function Hp({delayMs:e}){return u.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",animationDelay:`${e}ms`,display:"inline-block"}})}function GH({selectedAgentId:e,selectedChatId:t}){const{wizardStep:n}=qt();return t&&e?u.jsx(zH,{agentId:e,chatId:t}):n!==null&&n!=="completed"?u.jsx(UH,{}):u.jsx(OH,{})}function kN(){const{data:e}=$e({queryKey:["clients"],queryFn:Ra,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 Qg({children:e}){return u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function jN({children:e}){return u.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Gr({label:e,children:t}){return u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{color:"var(--fg-3)"},children:e}),u.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function OS(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 DS(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 Zp({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[u.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function YH({notifications:e,agentId:t}){const[,n]=yf(),a=dn(),l=wt({mutationFn:o=>rC(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return u.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>u.jsx(aC,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function CN({agentId:e}){var h;const t=Cl(),{resolve:n}=kN(),{data:a}=$e({queryKey:["activity"],queryFn:Ku,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(y=>y.agentId===e),o=n(l==null?void 0:l.clientId),{data:c}=$e({queryKey:["notifications","agent",e],queryFn:()=>Ng({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:u.jsx(to,{width:14,height:16,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),u.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),u.jsx(Ks,{state:m})]}),u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[u.jsx(Zp,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),u.jsx(Zp,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),u.jsx(Zp,{label:"uptime",value:DS((o==null?void 0:o.connectedAt)??null)})]})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx(Qg,{children:"Computer · runtime"}),u.jsxs(jN,{children:[u.jsx(Gr,{label:"host",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),u.jsx(Gr,{label:"os",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),u.jsx(Gr,{label:"runtime",children:u.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),u.jsx(Gr,{label:"sdk",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),u.jsx(Gr,{label:"connected",children:u.jsx("span",{className:"mono text-label",children:DS((o==null?void 0:o.connectedAt)??null)})})]})]}),u.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[u.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),u.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[u.jsx(Qg,{children:"Notifications"}),!(c!=null&&c.items)||c.items.length===0?u.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):u.jsx(YH,{notifications:c.items,agentId:e})]})]})}function XH({agentId:e,chatId:t}){const{data:n}=$e({queryKey:["session",e,t],queryFn:()=>eo(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return u.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx(Qg,{children:"Session"}),u.jsxs(jN,{children:[u.jsx(Gr,{label:"state",children:u.jsx(Ks,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),u.jsx(Gr,{label:"chat",children:u.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),u.jsx(Gr,{label:"started",children:OS((n==null?void 0:n.startedAt)??null)}),u.jsx(Gr,{label:"last",children:OS((n==null?void 0:n.lastActivityAt)??null)}),u.jsx(Gr,{label:"messages",children:u.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),u.jsx(CN,{agentId:e})]})}function JH({selectedAgentId:e,selectedChatId:t}){return t&&e?u.jsx(XH,{agentId:e,chatId:t}):e?u.jsx(CN,{agentId:e}):null}const WH=32;function eZ({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return u.jsx("div",{className:Ae("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:WH}).map((l,o)=>{const c=e[o]??{workingCount:0,errorMask:!1},f=c.workingCount===0?.08:c.workingCount/a,m=.25+f*.7,h=c.errorMask?"var(--state-error)":"var(--accent)";return u.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const tZ={error:0,blocked:1,working:2,idle:3};function nZ(e,t){return t?e?tZ[e]??4:4:5}function rZ(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function aZ({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=Cl(),{resolve:o}=kN(),c=fU(),[f,m]=x.useState(""),[h,y]=x.useState("all"),{data:g}=$e({queryKey:["activity"],queryFn:Ku,refetchInterval:1e4}),{data:b}=$e({queryKey:e?Xd(e):["agent-sessions",null],queryFn:()=>e?eo(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),w=wt({mutationFn:D=>vN(D),onSuccess:(D,O)=>{a(O,D.id)}}),{humans:k,agents:j,totalAll:E}=x.useMemo(()=>{const D=(g==null?void 0:g.agents)??[],O=f.trim().toLowerCase(),M=D.filter(J=>{var le;if(!rZ(J,h))return!1;if(!O)return!0;const ee=l(J.agentId).toLowerCase(),we=J.clientId?(((le=o(J.clientId))==null?void 0:le.hostname)??"").toLowerCase():"";return ee.includes(O)||we.includes(O)||J.agentId.toLowerCase().includes(O)}),U=J=>nZ(J.runtimeState,J.clientId),Y=[],F=[];for(const J of M)(J.type==="human"?Y:F).push(J);return Y.sort((J,ee)=>U(J)-U(ee)),F.sort((J,ee)=>U(J)-U(ee)),{humans:Y,agents:F,totalAll:D.length}},[g,f,h,l,o]),C=x.useMemo(()=>{const D=(g==null?void 0:g.agents)??[];return{working:D.filter(O=>O.runtimeState==="working").length,blocked:D.filter(O=>O.runtimeState==="blocked").length,error:D.filter(O=>O.runtimeState==="error").length}},[g]),N=[{value:"all",label:"all",count:E},{value:"active",label:"active",count:C.working},{value:"attn",label:"attn",count:C.blocked+C.error,warn:C.blocked+C.error>0}],z=D=>{var J;const O=e===D.agentId,M=xN(D.runtimeState,D.clientId),U=D.clientId?((J=o(D.clientId))==null?void 0:J.hostname)??D.clientId.slice(0,8):null,Y=D.activeSessions??0,F=D.totalSessions??0;return u.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("button",{type:"button",onClick:()=>n(O?null:D.agentId),className:Ae("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"var(--sp-3_5) 1fr auto",columnGap:8,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-3)",background:O?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${O?"var(--accent)":"transparent"}`},children:[u.jsx(Xr,{state:M,size:8}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(D.agentId)}),D.type==="human"&&u.jsx("span",{className:"mono uppercase text-eyebrow",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),u.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:M==="offline"?"disconnected":U||"—"})]}),u.jsx("div",{className:"flex flex-col items-end gap-0.5",children:F>0&&u.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[Y,u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",F]})]})})]}),O&&u.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!b||b.length===0)&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-4)"},children:"No sessions yet"}),b==null?void 0:b.filter(ee=>ee.state!=="evicted").map(ee=>{const we=ee.state==="active"?"working":"idle";return u.jsxs("button",{type:"button",onClick:()=>a(D.agentId,ee.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===ee.chatId?"var(--bg-hover)":"transparent",color:ee.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:le=>{t!==ee.chatId&&(le.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:le=>{t!==ee.chatId&&(le.currentTarget.style.background="transparent")},children:[u.jsx(Xr,{state:we,size:6}),u.jsx("span",{className:"truncate text-body",style:{color:ee.topic||ee.summary?"var(--fg-2)":"var(--fg-4)"},children:ee.topic||ee.summary||`Chat · ${ee.chatId.slice(0,8)}`})]},ee.chatId)}),u.jsxs("button",{type:"button",onClick:()=>w.mutate(D.agentId),disabled:w.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:ee=>{ee.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:ee=>{ee.currentTarget.style.background="transparent"},children:[u.jsx(Jr,{className:"h-3 w-3"}),"New chat"]})]})]},D.agentId)},L=k.length+j.length;return u.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("div",{style:{marginBottom:8},children:u.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[E," members"]})}),u.jsxs("div",{className:"relative",children:[u.jsx(bf,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),u.jsx("input",{value:f,onChange:D=>m(D.target.value),placeholder:"Filter…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2) var(--sp-1_25) var(--sp-6_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),u.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:N.map(D=>u.jsx(yu,{active:h===D.value,count:D.count,warn:D.warn,onClick:()=>y(D.value),children:D.label},D.value))})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[u.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[u.jsx(iZ,{}),"5m"]}),u.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:c.stale?"stale":"live"})]}),u.jsx(eZ,{aggregated:c.aggregated,stale:c.stale}),u.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[u.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[C.working," working"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[C.blocked," blocked"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[C.error," error"]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[L===0&&u.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:f||h!=="all"?"No matches":u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{margin:0},children:"No agents"}),u.jsx("p",{className:"text-label",style:{margin:"var(--sp-1) 0 0",color:"var(--fg-4)"},children:"Your first agent will appear here."})]})}),j.length>0&&u.jsxs("div",{children:[u.jsx(MS,{label:"Agents",count:j.length}),j.map(z)]}),k.length>0&&u.jsxs("div",{children:[u.jsx(MS,{label:"Humans",count:k.length}),k.map(z)]})]})]})}function MS({label:e,count:t}){return u.jsxs("div",{className:"mono uppercase sticky top-0 z-10 text-eyebrow",style:{padding:"var(--sp-1_25) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[e," · ",t]})}function iZ(){return u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[u.jsx("title",{children:"pulse"}),u.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function lZ(){const[e,t]=yf(),n=e.get("a"),a=e.get("c");nE();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:c}=$e({queryKey:["agent-sessions",n],queryFn:()=>n?eo(n):Promise.resolve([]),enabled:!!n&&!a});return x.useEffect(()=>{if(!n||a||!c||c.length===0)return;const f=[...c].filter(m=>m.state!=="evicted").sort((m,h)=>(h.lastActivityAt??"").localeCompare(m.lastActivityAt??""))[0];f&&t({a:n,c:f.chatId},{replace:!0})},[n,a,c,t]),u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(aZ,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),u.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:u.jsx(GH,{selectedAgentId:n,selectedChatId:a})}),n&&u.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:u.jsx(JH,{selectedAgentId:n,selectedChatId:a})})]})}const sZ=new xT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function oZ(){return u.jsx(wT,{client:sZ,children:u.jsx(vR,{children:u.jsx(YA,{children:u.jsxs(CA,{children:[u.jsx(ar,{path:"/login",element:u.jsx($7,{})}),u.jsx(ar,{path:"/signup",element:u.jsx(pf,{to:"/login",replace:!0})}),u.jsx(ar,{path:"/auth/github/complete",element:u.jsx(F7,{})}),u.jsx(ar,{path:"/invite/:token",element:u.jsx(I7,{})}),u.jsx(ar,{element:u.jsx(jR,{}),children:u.jsxs(ar,{element:u.jsx(dU,{children:u.jsx(S4,{})}),children:[u.jsx(ar,{index:!0,element:u.jsx(lZ,{})}),u.jsx(ar,{path:"agents",element:u.jsx(w7,{})}),u.jsx(ar,{path:"agents/:uuid",element:u.jsx(i7,{})}),u.jsx(ar,{path:"clients",element:u.jsx(A7,{})}),u.jsx(ar,{path:"settings",element:u.jsx(aH,{})}),u.jsx(ar,{path:"admin",element:u.jsx(DU,{})})]})})]})})})})}const EN=document.getElementById("root");if(!EN)throw new Error("Root element not found");K2.createRoot(EN).render(u.jsx(x.StrictMode,{children:u.jsx(oZ,{})}));export{zR as A,to as F,Zu as L,ot as c,u as j,x as r};
|