@agent-team-foundation/first-tree-hub 0.12.6 → 0.12.7
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/cli/index.mjs +4 -4
- package/dist/{client-GOgUQxVe-Dqk9oZf9.mjs → client-93HZWg84-MIPzQD9A.mjs} +2 -2
- package/dist/{client-B89AKi3Q-DAyGdQSq.mjs → client-h5l7mi0m-OEX7MOBg.mjs} +4 -3
- package/dist/{dist-xP6NpdMp.mjs → dist-CTkhS6p5.mjs} +7 -2
- package/dist/{feishu-CsfadBKa.mjs → feishu-DJm0EaZP.mjs} +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{invitation-C299fxkP-DFBBuUcj.mjs → invitation-C299fxkP-jQiGR5fl.mjs} +1 -1
- package/dist/{saas-connect-RCN8zL5e.mjs → saas-connect-CY2NxeKx.mjs} +122 -25
- package/dist/web/assets/index-BKbK8BhK.css +1 -0
- package/dist/web/assets/index-BNM-YSSu.js +421 -0
- package/dist/web/assets/index-JGwkYWtM.js +11 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-BHNq2Nl1.js +0 -16
- package/dist/web/assets/index-BaLvRwAX.js +0 -416
- package/dist/web/assets/index-BdW7weV1.css +0 -1
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
var gS=e=>{throw TypeError(e)};var Zp=(e,t,n)=>t.has(e)||gS("Cannot "+n);var U=(e,t,n)=>(Zp(e,t,"read from private field"),n?n.call(e):t.get(e)),_e=(e,t,n)=>t.has(e)?gS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ke=(e,t,n,a)=>(Zp(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Ge=(e,t,n)=>(Zp(e,t,"access private method"),n);var rf=(e,t,n,a)=>({set _(s){ke(e,t,s,n)},get _(){return U(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 s in a)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(a,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>a[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)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(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function nh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gp={exports:{}},Tu={};/**
|
|
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 yS;function B2(){if(yS)return Tu;yS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,o){var c=null;if(o!==void 0&&(c=""+o),s.key!==void 0&&(c=""+s.key),"key"in s){o={};for(var d in s)d!=="key"&&(o[d]=s[d])}else o=s;return s=o.ref,{$$typeof:e,type:a,key:c,ref:s!==void 0?s:null,props:o}}return Tu.Fragment=t,Tu.jsx=n,Tu.jsxs=n,Tu}var vS;function $2(){return vS||(vS=1,Gp.exports=B2()),Gp.exports}var l=$2(),Vp={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 bS;function F2(){if(bS)return Qe;bS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function w(P){return P===null||typeof P!="object"?null:(P=x&&P[x]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,C={};function E(P,$,T){this.props=P,this.context=$,this.refs=C,this.updater=T||S}E.prototype.isReactComponent={},E.prototype.setState=function(P,$){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,$,"setState")},E.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=E.prototype;function R(P,$,T){this.props=P,this.context=$,this.refs=C,this.updater=T||S}var z=R.prototype=new N;z.constructor=R,k(z,E.prototype),z.isPureReactComponent=!0;var L=Array.isArray;function O(){}var B={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function V(P,$,T){var G=T.ref;return{$$typeof:e,type:P,key:$,ref:G!==void 0?G:null,props:T}}function D(P,$){return V(P.type,$,P.props)}function K(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function ae(P){var $={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(T){return $[T]})}var be=/\/+/g;function W(P,$){return typeof P=="object"&&P!==null&&P.key!=null?ae(""+P.key):$.toString(36)}function X(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($){P.status==="pending"&&(P.status="fulfilled",P.value=$)},function($){P.status==="pending"&&(P.status="rejected",P.reason=$)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function Z(P,$,T,G,q){var re=typeof P;(re==="undefined"||re==="boolean")&&(P=null);var xe=!1;if(P===null)xe=!0;else switch(re){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(P.$$typeof){case e:case t:xe=!0;break;case p:return xe=P._init,Z(xe(P._payload),$,T,G,q)}}if(xe)return q=q(P),xe=G===""?"."+W(P,0):G,L(q)?(T="",xe!=null&&(T=xe.replace(be,"$&/")+"/"),Z(q,$,T,"",function(Ie){return Ie})):q!=null&&(K(q)&&(q=D(q,T+(q.key==null||P&&P.key===q.key?"":(""+q.key).replace(be,"$&/")+"/")+xe)),$.push(q)),1;xe=0;var we=G===""?".":G+":";if(L(P))for(var me=0;me<P.length;me++)G=P[me],re=we+W(G,me),xe+=Z(G,$,T,re,q);else if(me=w(P),typeof me=="function")for(P=me.call(P),me=0;!(G=P.next()).done;)G=G.value,re=we+W(G,me++),xe+=Z(G,$,T,re,q);else if(re==="object"){if(typeof P.then=="function")return Z(X(P),$,T,G,q);throw $=String(P),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return xe}function te(P,$,T){if(P==null)return P;var G=[],q=0;return Z(P,G,"","",function(re){return $.call(T,re,q++)}),G}function je(P){if(P._status===-1){var $=P._result;$=$(),$.then(function(T){(P._status===0||P._status===-1)&&(P._status=1,P._result=T)},function(T){(P._status===0||P._status===-1)&&(P._status=2,P._result=T)}),P._status===-1&&(P._status=0,P._result=$)}if(P._status===1)return P._result.default;throw P._result}var Ae=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=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($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},M={map:te,forEach:function(P,$,T){te(P,function(){$.apply(this,arguments)},T)},count:function(P){var $=0;return te(P,function(){$++}),$},toArray:function(P){return te(P,function($){return $})||[]},only:function(P){if(!K(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Qe.Activity=g,Qe.Children=M,Qe.Component=E,Qe.Fragment=n,Qe.Profiler=s,Qe.PureComponent=R,Qe.StrictMode=a,Qe.Suspense=m,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(P){return B.H.useMemoCache(P)}},Qe.cache=function(P){return function(){return P.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(P,$,T){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var G=k({},P.props),q=P.key;if($!=null)for(re in $.key!==void 0&&(q=""+$.key),$)!I.call($,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&$.ref===void 0||(G[re]=$[re]);var re=arguments.length-2;if(re===1)G.children=T;else if(1<re){for(var xe=Array(re),we=0;we<re;we++)xe[we]=arguments[we+2];G.children=xe}return V(P.type,q,G)},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,$,T){var G,q={},re=null;if($!=null)for(G in $.key!==void 0&&(re=""+$.key),$)I.call($,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(q[G]=$[G]);var xe=arguments.length-2;if(xe===1)q.children=T;else if(1<xe){for(var we=Array(xe),me=0;me<xe;me++)we[me]=arguments[me+2];q.children=we}if(P&&P.defaultProps)for(G in xe=P.defaultProps,xe)q[G]===void 0&&(q[G]=xe[G]);return V(P,re,q)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(P){return{$$typeof:d,render:P}},Qe.isValidElement=K,Qe.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:je}},Qe.memo=function(P,$){return{$$typeof:h,type:P,compare:$===void 0?null:$}},Qe.startTransition=function(P){var $=B.T,T={};B.T=T;try{var G=P(),q=B.S;q!==null&&q(T,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(O,Ae)}catch(re){Ae(re)}finally{$!==null&&T.types!==null&&($.types=T.types),B.T=$}},Qe.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Qe.use=function(P){return B.H.use(P)},Qe.useActionState=function(P,$,T){return B.H.useActionState(P,$,T)},Qe.useCallback=function(P,$){return B.H.useCallback(P,$)},Qe.useContext=function(P){return B.H.useContext(P)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(P,$){return B.H.useDeferredValue(P,$)},Qe.useEffect=function(P,$){return B.H.useEffect(P,$)},Qe.useEffectEvent=function(P){return B.H.useEffectEvent(P)},Qe.useId=function(){return B.H.useId()},Qe.useImperativeHandle=function(P,$,T){return B.H.useImperativeHandle(P,$,T)},Qe.useInsertionEffect=function(P,$){return B.H.useInsertionEffect(P,$)},Qe.useLayoutEffect=function(P,$){return B.H.useLayoutEffect(P,$)},Qe.useMemo=function(P,$){return B.H.useMemo(P,$)},Qe.useOptimistic=function(P,$){return B.H.useOptimistic(P,$)},Qe.useReducer=function(P,$,T){return B.H.useReducer(P,$,T)},Qe.useRef=function(P){return B.H.useRef(P)},Qe.useState=function(P){return B.H.useState(P)},Qe.useSyncExternalStore=function(P,$,T){return B.H.useSyncExternalStore(P,$,T)},Qe.useTransition=function(){return B.H.useTransition()},Qe.version="19.2.4",Qe}var xS;function rv(){return xS||(xS=1,Vp.exports=F2()),Vp.exports}var b=rv();const H2=nh(b),av=U2({__proto__:null,default:H2},[b]);var Qp={exports:{}},Au={},Kp={exports:{}},Yp={};/**
|
|
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 wS;function q2(){return wS||(wS=1,(function(e){function t(Z,te){var je=Z.length;Z.push(te);e:for(;0<je;){var Ae=je-1>>>1,M=Z[Ae];if(0<s(M,te))Z[Ae]=te,Z[je]=M,je=Ae;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],je=Z.pop();if(je!==te){Z[0]=je;e:for(var Ae=0,M=Z.length,P=M>>>1;Ae<P;){var $=2*(Ae+1)-1,T=Z[$],G=$+1,q=Z[G];if(0>s(T,je))G<M&&0>s(q,T)?(Z[Ae]=q,Z[G]=je,Ae=G):(Z[Ae]=T,Z[$]=je,Ae=$);else if(G<M&&0>s(q,je))Z[Ae]=q,Z[G]=je,Ae=G;else break e}}return te}function s(Z,te){var je=Z.sortIndex-te.sortIndex;return je!==0?je: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,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],h=[],p=1,g=null,x=3,w=!1,S=!1,k=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function z(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 L(Z){if(k=!1,z(Z),!S)if(n(m)!==null)S=!0,O||(O=!0,ae());else{var te=n(h);te!==null&&X(L,te.startTime-Z)}}var O=!1,B=-1,I=5,V=-1;function D(){return C?!0:!(e.unstable_now()-V<I)}function K(){if(C=!1,O){var Z=e.unstable_now();V=Z;var te=!0;try{e:{S=!1,k&&(k=!1,N(B),B=-1),w=!0;var je=x;try{t:{for(z(Z),g=n(m);g!==null&&!(g.expirationTime>Z&&D());){var Ae=g.callback;if(typeof Ae=="function"){g.callback=null,x=g.priorityLevel;var M=Ae(g.expirationTime<=Z);if(Z=e.unstable_now(),typeof M=="function"){g.callback=M,z(Z),te=!0;break t}g===n(m)&&a(m),z(Z)}else a(m);g=n(m)}if(g!==null)te=!0;else{var P=n(h);P!==null&&X(L,P.startTime-Z),te=!1}}break e}finally{g=null,x=je,w=!1}te=void 0}}finally{te?ae():O=!1}}}var ae;if(typeof R=="function")ae=function(){R(K)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,W=be.port2;be.port1.onmessage=K,ae=function(){W.postMessage(null)}}else ae=function(){E(K,0)};function X(Z,te){B=E(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"):I=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(Z){switch(x){case 1:case 2:case 3:var te=3;break;default:te=x}var je=x;x=te;try{return Z()}finally{x=je}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(Z,te){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var je=x;x=Z;try{return te()}finally{x=je}},e.unstable_scheduleCallback=function(Z,te,je){var Ae=e.unstable_now();switch(typeof je=="object"&&je!==null?(je=je.delay,je=typeof je=="number"&&0<je?Ae+je:Ae):je=Ae,Z){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=je+M,Z={id:p++,callback:te,priorityLevel:Z,startTime:je,expirationTime:M,sortIndex:-1},je>Ae?(Z.sortIndex=je,t(h,Z),n(m)===null&&Z===n(h)&&(k?(N(B),B=-1):k=!0,X(L,je-Ae))):(Z.sortIndex=M,t(m,Z),S||w||(S=!0,O||(O=!0,ae()))),Z},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(Z){var te=x;return function(){var je=x;x=te;try{return Z.apply(this,arguments)}finally{x=je}}}})(Yp)),Yp}var SS;function Z2(){return SS||(SS=1,Kp.exports=q2()),Kp.exports}var Xp={exports:{}},Qn={};/**
|
|
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 kS;function G2(){if(kS)return Qn;kS=1;var e=rv();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}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},s=Symbol.for("react.portal");function o(m,h,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:m,containerInfo:h,implementation:p}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Qn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Qn.createPortal=function(m,h){var p=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,p)},Qn.flushSync=function(m){var h=c.T,p=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=p,a.d.f()}},Qn.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))},Qn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Qn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var p=h.as,g=d(p,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:w}):p==="script"&&a.d.X(m,{crossOrigin:g,integrity:x,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Qn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=d(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:p,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)},Qn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,g=d(p,h.crossOrigin);a.d.L(m,p,{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})}},Qn.preloadModule=function(m,h){if(typeof m=="string")if(h){var p=d(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},Qn.requestFormReset=function(m){a.d.r(m)},Qn.unstable_batchedUpdates=function(m,h){return m(h)},Qn.useFormState=function(m,h,p){return c.H.useFormState(m,h,p)},Qn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Qn.version="19.2.4",Qn}var jS;function wj(){if(jS)return Xp.exports;jS=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(),Xp.exports=G2(),Xp.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 CS;function V2(){if(CS)return Au;CS=1;var e=Z2(),t=rv(),n=wj();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}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 s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,u=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(u=i.return),r=i.return;while(r)}return i.tag===3?u: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 d(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 u=r,f=i;;){var y=u.return;if(y===null)break;var v=y.alternate;if(v===null){if(f=y.return,f!==null){u=f;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===u)return m(y),r;if(v===f)return m(y),i;v=v.sibling}throw Error(a(188))}if(u.return!==f.return)u=y,f=v;else{for(var j=!1,A=y.child;A;){if(A===u){j=!0,u=y,f=v;break}if(A===f){j=!0,f=y,u=v;break}A=A.sibling}if(!j){for(A=v.child;A;){if(A===u){j=!0,u=v,f=y;break}if(A===f){j=!0,f=v,u=y;break}A=A.sibling}if(!j)throw Error(a(189))}}if(u.alternate!==f)throw Error(a(190))}if(u.tag!==3)throw Error(a(188));return u.stateNode.current===u?r:i}function p(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=p(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),R=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function ae(r){return r===null||typeof r!="object"?null:(r=K&&r[K]||r["@@iterator"],typeof r=="function"?r:null)}var be=Symbol.for("react.client.reference");function W(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===be?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case k:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case O:return"SuspenseList";case V:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case R:return r.displayName||"Context";case N:return(r._context.displayName||"Context")+".Consumer";case z:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case B:return i=r.displayName||null,i!==null?i:W(r.type)||"Memo";case I:i=r._payload,r=r._init;try{return W(r(i))}catch{}}return null}var X=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,je={pending:!1,data:null,method:null,action:null},Ae=[],M=-1;function P(r){return{current:r}}function $(r){0>M||(r.current=Ae[M],Ae[M]=null,M--)}function T(r,i){M++,Ae[M]=r.current,r.current=i}var G=P(null),q=P(null),re=P(null),xe=P(null);function we(r,i){switch(T(re,i),T(q,r),T(G,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Uw(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Uw(i),r=Bw(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}$(G),T(G,r)}function me(){$(G),$(q),$(re)}function Ie(r){r.memoizedState!==null&&T(xe,r);var i=G.current,u=Bw(i,r.type);i!==u&&(T(q,r),T(G,u))}function Ue(r){q.current===r&&($(G),$(q)),xe.current===r&&($(xe),Cu._currentValue=je)}var ft,ut;function ie(r){if(ft===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);ft=i&&i[1]||"",ut=-1<u.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+ft+r+ut}var le=!1;function ve(r,i){if(!r||le)return"";le=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(oe){var ne=oe}Reflect.construct(r,[],he)}else{try{he.call()}catch(oe){ne=oe}r.call(he.prototype)}}else{try{throw Error()}catch(oe){ne=oe}(he=r())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(oe){if(oe&&ne&&typeof oe.stack=="string")return[oe.stack,ne.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=f.DetermineComponentFrameRoot(),j=v[0],A=v[1];if(j&&A){var H=j.split(`
|
|
44
|
+
`),ee=A.split(`
|
|
45
|
+
`);for(y=f=0;f<H.length&&!H[f].includes("DetermineComponentFrameRoot");)f++;for(;y<ee.length&&!ee[y].includes("DetermineComponentFrameRoot");)y++;if(f===H.length||y===ee.length)for(f=H.length-1,y=ee.length-1;1<=f&&0<=y&&H[f]!==ee[y];)y--;for(;1<=f&&0<=y;f--,y--)if(H[f]!==ee[y]){if(f!==1||y!==1)do if(f--,y--,0>y||H[f]!==ee[y]){var ce=`
|
|
46
|
+
`+H[f].replace(" at new "," at ");return r.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",r.displayName)),ce}while(1<=f&&0<=y);break}}}finally{le=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?ie(u):""}function Re(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 ve(r.type,!1);case 11:return ve(r.type.render,!1);case 1:return ve(r.type,!0);case 31:return ie("Activity");default:return""}}function St(r){try{var i="",u=null;do i+=Re(r,u),u=r,r=r.return;while(r);return i}catch(f){return`
|
|
47
|
+
Error generating stack: `+f.message+`
|
|
48
|
+
`+f.stack}}var Ft=Object.prototype.hasOwnProperty,Pn=e.unstable_scheduleCallback,hr=e.unstable_cancelCallback,pi=e.unstable_shouldYield,gi=e.unstable_requestPaint,un=e.unstable_now,da=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,$e=e.unstable_NormalPriority,Ve=e.unstable_LowPriority,at=e.unstable_IdlePriority,cn=e.log,tr=e.unstable_setDisableYieldValue,Ht=null,Lt=null;function At(r){if(typeof cn=="function"&&tr(r),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(Ht,r)}catch{}}var it=Math.clz32?Math.clz32:il,nr=Math.log,zn=Math.LN2;function il(r){return r>>>=0,r===0?32:31-(nr(r)/zn|0)|0}var fa=256,ha=262144,Ma=4194304;function Vn(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 Da(r,i,u){var f=r.pendingLanes;if(f===0)return 0;var y=0,v=r.suspendedLanes,j=r.pingedLanes;r=r.warmLanes;var A=f&134217727;return A!==0?(f=A&~v,f!==0?y=Vn(f):(j&=A,j!==0?y=Vn(j):u||(u=A&~r,u!==0&&(y=Vn(u))))):(A=f&~v,A!==0?y=Vn(A):j!==0?y=Vn(j):u||(u=f&~r,u!==0&&(y=Vn(u)))),y===0?0:i!==0&&i!==y&&(i&v)===0&&(v=y&-y,u=i&-i,v>=u||v===32&&(u&4194048)!==0)?i:y}function Sa(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function qt(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 Ce(){var r=Ma;return Ma<<=1,(Ma&62914560)===0&&(Ma=4194304),r}function tt(r){for(var i=[],u=0;31>u;u++)i.push(r);return i}function pn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Ar(r,i,u,f,y,v){var j=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var A=r.entanglements,H=r.expirationTimes,ee=r.hiddenUpdates;for(u=j&~u;0<u;){var ce=31-it(u),he=1<<ce;A[ce]=0,H[ce]=-1;var ne=ee[ce];if(ne!==null)for(ee[ce]=null,ce=0;ce<ne.length;ce++){var oe=ne[ce];oe!==null&&(oe.lane&=-536870913)}u&=~he}f!==0&&yi(r,f,0),v!==0&&y===0&&r.tag!==0&&(r.suspendedLanes|=v&~(j&~i))}function yi(r,i,u){r.pendingLanes|=i,r.suspendedLanes&=~i;var f=31-it(i);r.entangledLanes|=i,r.entanglements[f]=r.entanglements[f]|1073741824|u&261930}function ys(r,i){var u=r.entangledLanes|=i;for(r=r.entanglements;u;){var f=31-it(u),y=1<<f;y&i|r[f]&i&&(r[f]|=i),u&=~y}}function Fc(r,i){var u=i&-i;return u=(u&42)!==0?1:rr(u),(u&(r.suspendedLanes|i))!==0?0:u}function rr(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 ma(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Lo(){var r=te.p;return r!==0?r:(r=window.event,r===void 0?32:uS(r.type))}function Po(r,i){var u=te.p;try{return te.p=r,i()}finally{te.p=u}}var Hr=Math.random().toString(36).slice(2),dn="__reactFiber$"+Hr,Zt="__reactProps$"+Hr,Ia="__reactContainer$"+Hr,sl="__reactEvents$"+Hr,Lh="__reactListeners$"+Hr,Hc="__reactHandles$"+Hr,Uo="__reactResources$"+Hr,vi="__reactMarker$"+Hr;function Pe(r){delete r[dn],delete r[Zt],delete r[sl],delete r[Lh],delete r[Hc]}function F(r){var i=r[dn];if(i)return i;for(var u=r.parentNode;u;){if(i=u[Ia]||u[dn]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(r=Vw(r);r!==null;){if(u=r[dn])return u;r=Vw(r)}return i}r=u,u=r.parentNode}return null}function pe(r){if(r=r[dn]||r[Ia]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Ne(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function wt(r){var i=r[Uo];return i||(i=r[Uo]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ht(r){r[vi]=!0}var Xt=new Set,Un={};function gn(r,i){Mn(r,i),Mn(r+"Capture",i)}function Mn(r,i){for(Un[r]=i,r=0;r<i.length;r++)Xt.add(i[r])}var Bo=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]*$"),fn={},$o={};function qc(r){return Ft.call($o,r)?!0:Ft.call(fn,r)?!1:Bo.test(r)?$o[r]=!0:(fn[r]=!0,!1)}function Zc(r,i,u){if(qc(i))if(u===null)r.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+u)}}function Gc(r,i,u){if(u===null)r.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+u)}}function La(r,i,u,f){if(f===null)r.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(i,u,""+f)}}function qr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Rb(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function OT(r,i,u){var f=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var y=f.get,v=f.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return y.call(this)},set:function(j){u=""+j,v.call(this,j)}}),Object.defineProperty(r,i,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(j){u=""+j},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Ph(r){if(!r._valueTracker){var i=Rb(r)?"checked":"value";r._valueTracker=OT(r,i,""+r[i])}}function Ob(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var u=i.getValue(),f="";return r&&(f=Rb(r)?r.checked?"true":"false":r.value),r=f,r!==u?(i.setValue(r),!0):!1}function Vc(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 zT=/[\n"\\]/g;function Zr(r){return r.replace(zT,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Uh(r,i,u,f,y,v,j,A){r.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?r.type=j:r.removeAttribute("type"),i!=null?j==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+qr(i)):r.value!==""+qr(i)&&(r.value=""+qr(i)):j!=="submit"&&j!=="reset"||r.removeAttribute("value"),i!=null?Bh(r,j,qr(i)):u!=null?Bh(r,j,qr(u)):f!=null&&r.removeAttribute("value"),y==null&&v!=null&&(r.defaultChecked=!!v),y!=null&&(r.checked=y&&typeof y!="function"&&typeof y!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.name=""+qr(A):r.removeAttribute("name")}function zb(r,i,u,f,y,v,j,A){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){Ph(r);return}u=u!=null?""+qr(u):"",i=i!=null?""+qr(i):u,A||i===r.value||(r.value=i),r.defaultValue=i}f=f??y,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=A?r.checked:!!f,r.defaultChecked=!!f,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(r.name=j),Ph(r)}function Bh(r,i,u){i==="number"&&Vc(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function ll(r,i,u,f){if(r=r.options,i){i={};for(var y=0;y<u.length;y++)i["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=i.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&f&&(r[u].defaultSelected=!0)}else{for(u=""+qr(u),i=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,f&&(r[y].defaultSelected=!0);return}i!==null||r[y].disabled||(i=r[y])}i!==null&&(i.selected=!0)}}function Mb(r,i,u){if(i!=null&&(i=""+qr(i),i!==r.value&&(r.value=i),u==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=u!=null?""+qr(u):""}function Db(r,i,u,f){if(i==null){if(f!=null){if(u!=null)throw Error(a(92));if(X(f)){if(1<f.length)throw Error(a(93));f=f[0]}u=f}u==null&&(u=""),i=u}u=qr(i),r.defaultValue=u,f=r.textContent,f===u&&f!==""&&f!==null&&(r.value=f),Ph(r)}function ol(r,i){if(i){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=i;return}}r.textContent=i}var MT=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 Ib(r,i,u){var f=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":f?r.setProperty(i,u):typeof u!="number"||u===0||MT.has(i)?i==="float"?r.cssFloat=u:r[i]=(""+u).trim():r[i]=u+"px"}function Lb(r,i,u){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?r.setProperty(f,""):f==="float"?r.cssFloat="":r[f]="");for(var y in i)f=i[y],i.hasOwnProperty(y)&&u[y]!==f&&Ib(r,y,f)}else for(var v in i)i.hasOwnProperty(v)&&Ib(r,v,i[v])}function $h(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 DT=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"]]),IT=/^[\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 Qc(r){return IT.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Pa(){}var Fh=null;function Hh(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ul=null,cl=null;function Pb(r){var i=pe(r);if(i&&(r=i.stateNode)){var u=r[Zt]||null;e:switch(r=i.stateNode,i.type){case"input":if(Uh(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Zr(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var f=u[i];if(f!==r&&f.form===r.form){var y=f[Zt]||null;if(!y)throw Error(a(90));Uh(f,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(i=0;i<u.length;i++)f=u[i],f.form===r.form&&Ob(f)}break e;case"textarea":Mb(r,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&ll(r,!!u.multiple,i,!1)}}}var qh=!1;function Ub(r,i,u){if(qh)return r(i,u);qh=!0;try{var f=r(i);return f}finally{if(qh=!1,(ul!==null||cl!==null)&&(Dd(),ul&&(i=ul,r=cl,cl=ul=null,Pb(i),r)))for(i=0;i<r.length;i++)Pb(r[i])}}function Fo(r,i){var u=r.stateNode;if(u===null)return null;var f=u[Zt]||null;if(f===null)return null;u=f[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":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(a(231,i,typeof u));return u}var Ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zh=!1;if(Ua)try{var Ho={};Object.defineProperty(Ho,"passive",{get:function(){Zh=!0}}),window.addEventListener("test",Ho,Ho),window.removeEventListener("test",Ho,Ho)}catch{Zh=!1}var bi=null,Gh=null,Kc=null;function Bb(){if(Kc)return Kc;var r,i=Gh,u=i.length,f,y="value"in bi?bi.value:bi.textContent,v=y.length;for(r=0;r<u&&i[r]===y[r];r++);var j=u-r;for(f=1;f<=j&&i[u-f]===y[v-f];f++);return Kc=y.slice(r,1<f?1-f:void 0)}function Yc(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 Xc(){return!0}function $b(){return!1}function mr(r){function i(u,f,y,v,j){this._reactName=u,this._targetInst=y,this.type=f,this.nativeEvent=v,this.target=j,this.currentTarget=null;for(var A in r)r.hasOwnProperty(A)&&(u=r[A],this[A]=u?u(v):v[A]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Xc:$b,this.isPropagationStopped=$b,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Xc)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Xc)},persist:function(){},isPersistent:Xc}),i}var vs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wc=mr(vs),qo=g({},vs,{view:0,detail:0}),LT=mr(qo),Vh,Qh,Zo,Jc=g({},qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yh,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!==Zo&&(Zo&&r.type==="mousemove"?(Vh=r.screenX-Zo.screenX,Qh=r.screenY-Zo.screenY):Qh=Vh=0,Zo=r),Vh)},movementY:function(r){return"movementY"in r?r.movementY:Qh}}),Fb=mr(Jc),PT=g({},Jc,{dataTransfer:0}),UT=mr(PT),BT=g({},qo,{relatedTarget:0}),Kh=mr(BT),$T=g({},vs,{animationName:0,elapsedTime:0,pseudoElement:0}),FT=mr($T),HT=g({},vs,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),qT=mr(HT),ZT=g({},vs,{data:0}),Hb=mr(ZT),GT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VT={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"},QT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KT(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=QT[r])?!!i[r]:!1}function Yh(){return KT}var YT=g({},qo,{key:function(r){if(r.key){var i=GT[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Yc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?VT[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yh,charCode:function(r){return r.type==="keypress"?Yc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Yc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),XT=mr(YT),WT=g({},Jc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qb=mr(WT),JT=g({},qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yh}),eA=mr(JT),tA=g({},vs,{propertyName:0,elapsedTime:0,pseudoElement:0}),nA=mr(tA),rA=g({},Jc,{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}),aA=mr(rA),iA=g({},vs,{newState:0,oldState:0}),sA=mr(iA),lA=[9,13,27,32],Xh=Ua&&"CompositionEvent"in window,Go=null;Ua&&"documentMode"in document&&(Go=document.documentMode);var oA=Ua&&"TextEvent"in window&&!Go,Zb=Ua&&(!Xh||Go&&8<Go&&11>=Go),Gb=" ",Vb=!1;function Qb(r,i){switch(r){case"keyup":return lA.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kb(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var dl=!1;function uA(r,i){switch(r){case"compositionend":return Kb(i);case"keypress":return i.which!==32?null:(Vb=!0,Gb);case"textInput":return r=i.data,r===Gb&&Vb?null:r;default:return null}}function cA(r,i){if(dl)return r==="compositionend"||!Xh&&Qb(r,i)?(r=Bb(),Kc=Gh=bi=null,dl=!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 Zb&&i.locale!=="ko"?null:i.data;default:return null}}var dA={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 Yb(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!dA[r.type]:i==="textarea"}function Xb(r,i,u,f){ul?cl?cl.push(f):cl=[f]:ul=f,i=Fd(i,"onChange"),0<i.length&&(u=new Wc("onChange","change",null,u,f),r.push({event:u,listeners:i}))}var Vo=null,Qo=null;function fA(r){zw(r,0)}function ed(r){var i=Ne(r);if(Ob(i))return r}function Wb(r,i){if(r==="change")return i}var Jb=!1;if(Ua){var Wh;if(Ua){var Jh="oninput"in document;if(!Jh){var ex=document.createElement("div");ex.setAttribute("oninput","return;"),Jh=typeof ex.oninput=="function"}Wh=Jh}else Wh=!1;Jb=Wh&&(!document.documentMode||9<document.documentMode)}function tx(){Vo&&(Vo.detachEvent("onpropertychange",nx),Qo=Vo=null)}function nx(r){if(r.propertyName==="value"&&ed(Qo)){var i=[];Xb(i,Qo,r,Hh(r)),Ub(fA,i)}}function hA(r,i,u){r==="focusin"?(tx(),Vo=i,Qo=u,Vo.attachEvent("onpropertychange",nx)):r==="focusout"&&tx()}function mA(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ed(Qo)}function pA(r,i){if(r==="click")return ed(i)}function gA(r,i){if(r==="input"||r==="change")return ed(i)}function yA(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Rr=typeof Object.is=="function"?Object.is:yA;function Ko(r,i){if(Rr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var u=Object.keys(r),f=Object.keys(i);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var y=u[f];if(!Ft.call(i,y)||!Rr(r[y],i[y]))return!1}return!0}function rx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function ax(r,i){var u=rx(r);r=0;for(var f;u;){if(u.nodeType===3){if(f=r+u.textContent.length,r<=i&&f>=i)return{node:u,offset:i-r};r=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=rx(u)}}function ix(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?ix(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function sx(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Vc(r.document);i instanceof r.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)r=i.contentWindow;else break;i=Vc(r.document)}return i}function em(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 vA=Ua&&"documentMode"in document&&11>=document.documentMode,fl=null,tm=null,Yo=null,nm=!1;function lx(r,i,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;nm||fl==null||fl!==Vc(f)||(f=fl,"selectionStart"in f&&em(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Yo&&Ko(Yo,f)||(Yo=f,f=Fd(tm,"onSelect"),0<f.length&&(i=new Wc("onSelect","select",null,i,u),r.push({event:i,listeners:f}),i.target=fl)))}function bs(r,i){var u={};return u[r.toLowerCase()]=i.toLowerCase(),u["Webkit"+r]="webkit"+i,u["Moz"+r]="moz"+i,u}var hl={animationend:bs("Animation","AnimationEnd"),animationiteration:bs("Animation","AnimationIteration"),animationstart:bs("Animation","AnimationStart"),transitionrun:bs("Transition","TransitionRun"),transitionstart:bs("Transition","TransitionStart"),transitioncancel:bs("Transition","TransitionCancel"),transitionend:bs("Transition","TransitionEnd")},rm={},ox={};Ua&&(ox=document.createElement("div").style,"AnimationEvent"in window||(delete hl.animationend.animation,delete hl.animationiteration.animation,delete hl.animationstart.animation),"TransitionEvent"in window||delete hl.transitionend.transition);function xs(r){if(rm[r])return rm[r];if(!hl[r])return r;var i=hl[r],u;for(u in i)if(i.hasOwnProperty(u)&&u in ox)return rm[r]=i[u];return r}var ux=xs("animationend"),cx=xs("animationiteration"),dx=xs("animationstart"),bA=xs("transitionrun"),xA=xs("transitionstart"),wA=xs("transitioncancel"),fx=xs("transitionend"),hx=new Map,am="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(" ");am.push("scrollEnd");function pa(r,i){hx.set(r,i),gn(i,[r])}var td=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)},Gr=[],ml=0,im=0;function nd(){for(var r=ml,i=im=ml=0;i<r;){var u=Gr[i];Gr[i++]=null;var f=Gr[i];Gr[i++]=null;var y=Gr[i];Gr[i++]=null;var v=Gr[i];if(Gr[i++]=null,f!==null&&y!==null){var j=f.pending;j===null?y.next=y:(y.next=j.next,j.next=y),f.pending=y}v!==0&&mx(u,y,v)}}function rd(r,i,u,f){Gr[ml++]=r,Gr[ml++]=i,Gr[ml++]=u,Gr[ml++]=f,im|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function sm(r,i,u,f){return rd(r,i,u,f),ad(r)}function ws(r,i){return rd(r,null,null,i),ad(r)}function mx(r,i,u){r.lanes|=u;var f=r.alternate;f!==null&&(f.lanes|=u);for(var y=!1,v=r.return;v!==null;)v.childLanes|=u,f=v.alternate,f!==null&&(f.childLanes|=u),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(y=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,y&&i!==null&&(y=31-it(u),r=v.hiddenUpdates,f=r[y],f===null?r[y]=[i]:f.push(i),i.lane=u|536870912),v):null}function ad(r){if(50<vu)throw vu=0,pp=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var pl={};function SA(r,i,u,f){this.tag=r,this.key=u,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=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Or(r,i,u,f){return new SA(r,i,u,f)}function lm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ba(r,i){var u=r.alternate;return u===null?(u=Or(r.tag,i,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=i,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,i=r.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function px(r,i){r.flags&=65011714;var u=r.alternate;return u===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=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,i=u.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function id(r,i,u,f,y,v){var j=0;if(f=r,typeof r=="function")lm(r)&&(j=1);else if(typeof r=="string")j=N2(r,u,G.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case V:return r=Or(31,u,i,y),r.elementType=V,r.lanes=v,r;case k:return Ss(u.children,y,v,i);case C:j=8,y|=24;break;case E:return r=Or(12,u,i,y|2),r.elementType=E,r.lanes=v,r;case L:return r=Or(13,u,i,y),r.elementType=L,r.lanes=v,r;case O:return r=Or(19,u,i,y),r.elementType=O,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case R:j=10;break e;case N:j=9;break e;case z:j=11;break e;case B:j=14;break e;case I:j=16,f=null;break e}j=29,u=Error(a(130,r===null?"null":typeof r,"")),f=null}return i=Or(j,u,i,y),i.elementType=r,i.type=f,i.lanes=v,i}function Ss(r,i,u,f){return r=Or(7,r,f,i),r.lanes=u,r}function om(r,i,u){return r=Or(6,r,null,i),r.lanes=u,r}function gx(r){var i=Or(18,null,null,0);return i.stateNode=r,i}function um(r,i,u){return i=Or(4,r.children!==null?r.children:[],r.key,i),i.lanes=u,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var yx=new WeakMap;function Vr(r,i){if(typeof r=="object"&&r!==null){var u=yx.get(r);return u!==void 0?u:(i={value:r,source:i,stack:St(i)},yx.set(r,i),i)}return{value:r,source:i,stack:St(i)}}var gl=[],yl=0,sd=null,Xo=0,Qr=[],Kr=0,xi=null,ka=1,ja="";function $a(r,i){gl[yl++]=Xo,gl[yl++]=sd,sd=r,Xo=i}function vx(r,i,u){Qr[Kr++]=ka,Qr[Kr++]=ja,Qr[Kr++]=xi,xi=r;var f=ka;r=ja;var y=32-it(f)-1;f&=~(1<<y),u+=1;var v=32-it(i)+y;if(30<v){var j=y-y%5;v=(f&(1<<j)-1).toString(32),f>>=j,y-=j,ka=1<<32-it(i)+y|u<<y|f,ja=v+r}else ka=1<<v|u<<y|f,ja=r}function cm(r){r.return!==null&&($a(r,1),vx(r,1,0))}function dm(r){for(;r===sd;)sd=gl[--yl],gl[yl]=null,Xo=gl[--yl],gl[yl]=null;for(;r===xi;)xi=Qr[--Kr],Qr[Kr]=null,ja=Qr[--Kr],Qr[Kr]=null,ka=Qr[--Kr],Qr[Kr]=null}function bx(r,i){Qr[Kr++]=ka,Qr[Kr++]=ja,Qr[Kr++]=xi,ka=i.id,ja=i.overflow,xi=r}var Bn=null,Bt=null,mt=!1,wi=null,Yr=!1,fm=Error(a(519));function Si(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wo(Vr(i,r)),fm}function xx(r){var i=r.stateNode,u=r.type,f=r.memoizedProps;switch(i[dn]=r,i[Zt]=f,u){case"dialog":lt("cancel",i),lt("close",i);break;case"iframe":case"object":case"embed":lt("load",i);break;case"video":case"audio":for(u=0;u<xu.length;u++)lt(xu[u],i);break;case"source":lt("error",i);break;case"img":case"image":case"link":lt("error",i),lt("load",i);break;case"details":lt("toggle",i);break;case"input":lt("invalid",i),zb(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":lt("invalid",i);break;case"textarea":lt("invalid",i),Db(i,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||f.suppressHydrationWarning===!0||Lw(i.textContent,u)?(f.popover!=null&&(lt("beforetoggle",i),lt("toggle",i)),f.onScroll!=null&<("scroll",i),f.onScrollEnd!=null&<("scrollend",i),f.onClick!=null&&(i.onclick=Pa),i=!0):i=!1,i||Si(r,!0)}function wx(r){for(Bn=r.return;Bn;)switch(Bn.tag){case 5:case 31:case 13:Yr=!1;return;case 27:case 3:Yr=!0;return;default:Bn=Bn.return}}function vl(r){if(r!==Bn)return!1;if(!mt)return wx(r),mt=!0,!1;var i=r.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||Ap(r.type,r.memoizedProps)),u=!u),u&&Bt&&Si(r),wx(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Bt=Gw(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Bt=Gw(r)}else i===27?(i=Bt,Ii(r.type)?(r=Dp,Dp=null,Bt=r):Bt=i):Bt=Bn?Wr(r.stateNode.nextSibling):null;return!0}function ks(){Bt=Bn=null,mt=!1}function hm(){var r=wi;return r!==null&&(vr===null?vr=r:vr.push.apply(vr,r),wi=null),r}function Wo(r){wi===null?wi=[r]:wi.push(r)}var mm=P(null),js=null,Fa=null;function ki(r,i,u){T(mm,i._currentValue),i._currentValue=u}function Ha(r){r._currentValue=mm.current,$(mm)}function pm(r,i,u){for(;r!==null;){var f=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),r===u)break;r=r.return}}function gm(r,i,u,f){var y=r.child;for(y!==null&&(y.return=r);y!==null;){var v=y.dependencies;if(v!==null){var j=y.child;v=v.firstContext;e:for(;v!==null;){var A=v;v=y;for(var H=0;H<i.length;H++)if(A.context===i[H]){v.lanes|=u,A=v.alternate,A!==null&&(A.lanes|=u),pm(v.return,u,r),f||(j=null);break e}v=A.next}}else if(y.tag===18){if(j=y.return,j===null)throw Error(a(341));j.lanes|=u,v=j.alternate,v!==null&&(v.lanes|=u),pm(j,u,r),j=null}else j=y.child;if(j!==null)j.return=y;else for(j=y;j!==null;){if(j===r){j=null;break}if(y=j.sibling,y!==null){y.return=j.return,j=y;break}j=j.return}y=j}}function bl(r,i,u,f){r=null;for(var y=i,v=!1;y!==null;){if(!v){if((y.flags&524288)!==0)v=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var j=y.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var A=y.type;Rr(y.pendingProps.value,j.value)||(r!==null?r.push(A):r=[A])}}else if(y===xe.current){if(j=y.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(r!==null?r.push(Cu):r=[Cu])}y=y.return}r!==null&&gm(i,r,u,f),i.flags|=262144}function ld(r){for(r=r.firstContext;r!==null;){if(!Rr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Cs(r){js=r,Fa=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function $n(r){return Sx(js,r)}function od(r,i){return js===null&&Cs(r),Sx(r,i)}function Sx(r,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},Fa===null){if(r===null)throw Error(a(308));Fa=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Fa=Fa.next=i;return u}var kA=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(u,f){r.push(f)}};this.abort=function(){i.aborted=!0,r.forEach(function(u){return u()})}},jA=e.unstable_scheduleCallback,CA=e.unstable_NormalPriority,yn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ym(){return{controller:new kA,data:new Map,refCount:0}}function Jo(r){r.refCount--,r.refCount===0&&jA(CA,function(){r.controller.abort()})}var eu=null,vm=0,xl=0,wl=null;function EA(r,i){if(eu===null){var u=eu=[];vm=0,xl=wp(),wl={status:"pending",value:void 0,then:function(f){u.push(f)}}}return vm++,i.then(kx,kx),i}function kx(){if(--vm===0&&eu!==null){wl!==null&&(wl.status="fulfilled");var r=eu;eu=null,xl=0,wl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function NA(r,i){var u=[],f={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return r.then(function(){f.status="fulfilled",f.value=i;for(var y=0;y<u.length;y++)(0,u[y])(i)},function(y){for(f.status="rejected",f.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),f}var jx=Z.S;Z.S=function(r,i){lw=un(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&EA(r,i),jx!==null&&jx(r,i)};var Es=P(null);function bm(){var r=Es.current;return r!==null?r:Mt.pooledCache}function ud(r,i){i===null?T(Es,Es.current):T(Es,i.pool)}function Cx(){var r=bm();return r===null?null:{parent:yn._currentValue,pool:r}}var Sl=Error(a(460)),xm=Error(a(474)),cd=Error(a(542)),dd={then:function(){}};function Ex(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Nx(r,i,u){switch(u=r[u],u===void 0?r.push(i):u!==i&&(i.then(Pa,Pa),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Tx(r),r;default:if(typeof i.status=="string")i.then(Pa,Pa);else{if(r=Mt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(f){if(i.status==="pending"){var y=i;y.status="fulfilled",y.value=f}},function(f){if(i.status==="pending"){var y=i;y.status="rejected",y.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Tx(r),r}throw _s=i,Sl}}function Ns(r){try{var i=r._init;return i(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(_s=u,Sl):u}}var _s=null;function _x(){if(_s===null)throw Error(a(459));var r=_s;return _s=null,r}function Tx(r){if(r===Sl||r===cd)throw Error(a(483))}var kl=null,tu=0;function fd(r){var i=tu;return tu+=1,kl===null&&(kl=[]),Nx(kl,r,i)}function nu(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function hd(r,i){throw i.$$typeof===x?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function Ax(r){function i(Y,Q){if(r){var J=Y.deletions;J===null?(Y.deletions=[Q],Y.flags|=16):J.push(Q)}}function u(Y,Q){if(!r)return null;for(;Q!==null;)i(Y,Q),Q=Q.sibling;return null}function f(Y){for(var Q=new Map;Y!==null;)Y.key!==null?Q.set(Y.key,Y):Q.set(Y.index,Y),Y=Y.sibling;return Q}function y(Y,Q){return Y=Ba(Y,Q),Y.index=0,Y.sibling=null,Y}function v(Y,Q,J){return Y.index=J,r?(J=Y.alternate,J!==null?(J=J.index,J<Q?(Y.flags|=67108866,Q):J):(Y.flags|=67108866,Q)):(Y.flags|=1048576,Q)}function j(Y){return r&&Y.alternate===null&&(Y.flags|=67108866),Y}function A(Y,Q,J,fe){return Q===null||Q.tag!==6?(Q=om(J,Y.mode,fe),Q.return=Y,Q):(Q=y(Q,J),Q.return=Y,Q)}function H(Y,Q,J,fe){var Be=J.type;return Be===k?ce(Y,Q,J.props.children,fe,J.key):Q!==null&&(Q.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===I&&Ns(Be)===Q.type)?(Q=y(Q,J.props),nu(Q,J),Q.return=Y,Q):(Q=id(J.type,J.key,J.props,null,Y.mode,fe),nu(Q,J),Q.return=Y,Q)}function ee(Y,Q,J,fe){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==J.containerInfo||Q.stateNode.implementation!==J.implementation?(Q=um(J,Y.mode,fe),Q.return=Y,Q):(Q=y(Q,J.children||[]),Q.return=Y,Q)}function ce(Y,Q,J,fe,Be){return Q===null||Q.tag!==7?(Q=Ss(J,Y.mode,fe,Be),Q.return=Y,Q):(Q=y(Q,J),Q.return=Y,Q)}function he(Y,Q,J){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=om(""+Q,Y.mode,J),Q.return=Y,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:return J=id(Q.type,Q.key,Q.props,null,Y.mode,J),nu(J,Q),J.return=Y,J;case S:return Q=um(Q,Y.mode,J),Q.return=Y,Q;case I:return Q=Ns(Q),he(Y,Q,J)}if(X(Q)||ae(Q))return Q=Ss(Q,Y.mode,J,null),Q.return=Y,Q;if(typeof Q.then=="function")return he(Y,fd(Q),J);if(Q.$$typeof===R)return he(Y,od(Y,Q),J);hd(Y,Q)}return null}function ne(Y,Q,J,fe){var Be=Q!==null?Q.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Be!==null?null:A(Y,Q,""+J,fe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case w:return J.key===Be?H(Y,Q,J,fe):null;case S:return J.key===Be?ee(Y,Q,J,fe):null;case I:return J=Ns(J),ne(Y,Q,J,fe)}if(X(J)||ae(J))return Be!==null?null:ce(Y,Q,J,fe,null);if(typeof J.then=="function")return ne(Y,Q,fd(J),fe);if(J.$$typeof===R)return ne(Y,Q,od(Y,J),fe);hd(Y,J)}return null}function oe(Y,Q,J,fe,Be){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return Y=Y.get(J)||null,A(Q,Y,""+fe,Be);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case w:return Y=Y.get(fe.key===null?J:fe.key)||null,H(Q,Y,fe,Be);case S:return Y=Y.get(fe.key===null?J:fe.key)||null,ee(Q,Y,fe,Be);case I:return fe=Ns(fe),oe(Y,Q,J,fe,Be)}if(X(fe)||ae(fe))return Y=Y.get(J)||null,ce(Q,Y,fe,Be,null);if(typeof fe.then=="function")return oe(Y,Q,J,fd(fe),Be);if(fe.$$typeof===R)return oe(Y,Q,J,od(Q,fe),Be);hd(Q,fe)}return null}function Te(Y,Q,J,fe){for(var Be=null,kt=null,De=Q,Xe=Q=0,dt=null;De!==null&&Xe<J.length;Xe++){De.index>Xe?(dt=De,De=null):dt=De.sibling;var jt=ne(Y,De,J[Xe],fe);if(jt===null){De===null&&(De=dt);break}r&&De&&jt.alternate===null&&i(Y,De),Q=v(jt,Q,Xe),kt===null?Be=jt:kt.sibling=jt,kt=jt,De=dt}if(Xe===J.length)return u(Y,De),mt&&$a(Y,Xe),Be;if(De===null){for(;Xe<J.length;Xe++)De=he(Y,J[Xe],fe),De!==null&&(Q=v(De,Q,Xe),kt===null?Be=De:kt.sibling=De,kt=De);return mt&&$a(Y,Xe),Be}for(De=f(De);Xe<J.length;Xe++)dt=oe(De,Y,Xe,J[Xe],fe),dt!==null&&(r&&dt.alternate!==null&&De.delete(dt.key===null?Xe:dt.key),Q=v(dt,Q,Xe),kt===null?Be=dt:kt.sibling=dt,kt=dt);return r&&De.forEach(function($i){return i(Y,$i)}),mt&&$a(Y,Xe),Be}function Ze(Y,Q,J,fe){if(J==null)throw Error(a(151));for(var Be=null,kt=null,De=Q,Xe=Q=0,dt=null,jt=J.next();De!==null&&!jt.done;Xe++,jt=J.next()){De.index>Xe?(dt=De,De=null):dt=De.sibling;var $i=ne(Y,De,jt.value,fe);if($i===null){De===null&&(De=dt);break}r&&De&&$i.alternate===null&&i(Y,De),Q=v($i,Q,Xe),kt===null?Be=$i:kt.sibling=$i,kt=$i,De=dt}if(jt.done)return u(Y,De),mt&&$a(Y,Xe),Be;if(De===null){for(;!jt.done;Xe++,jt=J.next())jt=he(Y,jt.value,fe),jt!==null&&(Q=v(jt,Q,Xe),kt===null?Be=jt:kt.sibling=jt,kt=jt);return mt&&$a(Y,Xe),Be}for(De=f(De);!jt.done;Xe++,jt=J.next())jt=oe(De,Y,Xe,jt.value,fe),jt!==null&&(r&&jt.alternate!==null&&De.delete(jt.key===null?Xe:jt.key),Q=v(jt,Q,Xe),kt===null?Be=jt:kt.sibling=jt,kt=jt);return r&&De.forEach(function(P2){return i(Y,P2)}),mt&&$a(Y,Xe),Be}function zt(Y,Q,J,fe){if(typeof J=="object"&&J!==null&&J.type===k&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case w:e:{for(var Be=J.key;Q!==null;){if(Q.key===Be){if(Be=J.type,Be===k){if(Q.tag===7){u(Y,Q.sibling),fe=y(Q,J.props.children),fe.return=Y,Y=fe;break e}}else if(Q.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===I&&Ns(Be)===Q.type){u(Y,Q.sibling),fe=y(Q,J.props),nu(fe,J),fe.return=Y,Y=fe;break e}u(Y,Q);break}else i(Y,Q);Q=Q.sibling}J.type===k?(fe=Ss(J.props.children,Y.mode,fe,J.key),fe.return=Y,Y=fe):(fe=id(J.type,J.key,J.props,null,Y.mode,fe),nu(fe,J),fe.return=Y,Y=fe)}return j(Y);case S:e:{for(Be=J.key;Q!==null;){if(Q.key===Be)if(Q.tag===4&&Q.stateNode.containerInfo===J.containerInfo&&Q.stateNode.implementation===J.implementation){u(Y,Q.sibling),fe=y(Q,J.children||[]),fe.return=Y,Y=fe;break e}else{u(Y,Q);break}else i(Y,Q);Q=Q.sibling}fe=um(J,Y.mode,fe),fe.return=Y,Y=fe}return j(Y);case I:return J=Ns(J),zt(Y,Q,J,fe)}if(X(J))return Te(Y,Q,J,fe);if(ae(J)){if(Be=ae(J),typeof Be!="function")throw Error(a(150));return J=Be.call(J),Ze(Y,Q,J,fe)}if(typeof J.then=="function")return zt(Y,Q,fd(J),fe);if(J.$$typeof===R)return zt(Y,Q,od(Y,J),fe);hd(Y,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,Q!==null&&Q.tag===6?(u(Y,Q.sibling),fe=y(Q,J),fe.return=Y,Y=fe):(u(Y,Q),fe=om(J,Y.mode,fe),fe.return=Y,Y=fe),j(Y)):u(Y,Q)}return function(Y,Q,J,fe){try{tu=0;var Be=zt(Y,Q,J,fe);return kl=null,Be}catch(De){if(De===Sl||De===cd)throw De;var kt=Or(29,De,null,Y.mode);return kt.lanes=fe,kt.return=Y,kt}finally{}}}var Ts=Ax(!0),Rx=Ax(!1),ji=!1;function wm(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sm(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 Ci(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ei(r,i,u){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(Ct&2)!==0){var y=f.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),f.pending=i,i=ad(r),mx(r,null,u),i}return rd(r,f,i,u),ad(r)}function ru(r,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var f=i.lanes;f&=r.pendingLanes,u|=f,i.lanes=u,ys(r,u)}}function km(r,i){var u=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var y=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var j={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?y=v=j:v=v.next=j,u=u.next}while(u!==null);v===null?y=v=i:v=v.next=i}else y=v=i;u={baseState:f.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:f.shared,callbacks:f.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=i:r.next=i,u.lastBaseUpdate=i}var jm=!1;function au(){if(jm){var r=wl;if(r!==null)throw r}}function iu(r,i,u,f){jm=!1;var y=r.updateQueue;ji=!1;var v=y.firstBaseUpdate,j=y.lastBaseUpdate,A=y.shared.pending;if(A!==null){y.shared.pending=null;var H=A,ee=H.next;H.next=null,j===null?v=ee:j.next=ee,j=H;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,A=ce.lastBaseUpdate,A!==j&&(A===null?ce.firstBaseUpdate=ee:A.next=ee,ce.lastBaseUpdate=H))}if(v!==null){var he=y.baseState;j=0,ce=ee=H=null,A=v;do{var ne=A.lane&-536870913,oe=ne!==A.lane;if(oe?(ct&ne)===ne:(f&ne)===ne){ne!==0&&ne===xl&&(jm=!0),ce!==null&&(ce=ce.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Te=r,Ze=A;ne=i;var zt=u;switch(Ze.tag){case 1:if(Te=Ze.payload,typeof Te=="function"){he=Te.call(zt,he,ne);break e}he=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ze.payload,ne=typeof Te=="function"?Te.call(zt,he,ne):Te,ne==null)break e;he=g({},he,ne);break e;case 2:ji=!0}}ne=A.callback,ne!==null&&(r.flags|=64,oe&&(r.flags|=8192),oe=y.callbacks,oe===null?y.callbacks=[ne]:oe.push(ne))}else oe={lane:ne,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ce===null?(ee=ce=oe,H=he):ce=ce.next=oe,j|=ne;if(A=A.next,A===null){if(A=y.shared.pending,A===null)break;oe=A,A=oe.next,oe.next=null,y.lastBaseUpdate=oe,y.shared.pending=null}}while(!0);ce===null&&(H=he),y.baseState=H,y.firstBaseUpdate=ee,y.lastBaseUpdate=ce,v===null&&(y.shared.lanes=0),Ri|=j,r.lanes=j,r.memoizedState=he}}function Ox(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function zx(r,i){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)Ox(u[r],i)}var jl=P(null),md=P(0);function Mx(r,i){r=Wa,T(md,r),T(jl,i),Wa=r|i.baseLanes}function Cm(){T(md,Wa),T(jl,jl.current)}function Em(){Wa=md.current,$(jl),$(md)}var zr=P(null),Xr=null;function Ni(r){var i=r.alternate;T(hn,hn.current&1),T(zr,r),Xr===null&&(i===null||jl.current!==null||i.memoizedState!==null)&&(Xr=r)}function Nm(r){T(hn,hn.current),T(zr,r),Xr===null&&(Xr=r)}function Dx(r){r.tag===22?(T(hn,hn.current),T(zr,r),Xr===null&&(Xr=r)):_i()}function _i(){T(hn,hn.current),T(zr,zr.current)}function Mr(r){$(zr),Xr===r&&(Xr=null),$(hn)}var hn=P(0);function pd(r){for(var i=r;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||zp(u)||Mp(u)))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 qa=0,Ye=null,Rt=null,vn=null,gd=!1,Cl=!1,As=!1,yd=0,su=0,El=null,_A=0;function tn(){throw Error(a(321))}function _m(r,i){if(i===null)return!1;for(var u=0;u<i.length&&u<r.length;u++)if(!Rr(r[u],i[u]))return!1;return!0}function Tm(r,i,u,f,y,v){return qa=v,Ye=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?v0:qm,As=!1,v=u(f,y),As=!1,Cl&&(v=Lx(i,u,f,y)),Ix(r),v}function Ix(r){Z.H=uu;var i=Rt!==null&&Rt.next!==null;if(qa=0,vn=Rt=Ye=null,gd=!1,su=0,El=null,i)throw Error(a(300));r===null||bn||(r=r.dependencies,r!==null&&ld(r)&&(bn=!0))}function Lx(r,i,u,f){Ye=r;var y=0;do{if(Cl&&(El=null),su=0,Cl=!1,25<=y)throw Error(a(301));if(y+=1,vn=Rt=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=b0,v=i(u,f)}while(Cl);return v}function TA(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?lu(i):i,r=r.useState()[0],(Rt!==null?Rt.memoizedState:null)!==r&&(Ye.flags|=1024),i}function Am(){var r=yd!==0;return yd=0,r}function Rm(r,i,u){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~u}function Om(r){if(gd){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}gd=!1}qa=0,vn=Rt=Ye=null,Cl=!1,su=yd=0,El=null}function ar(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vn===null?Ye.memoizedState=vn=r:vn=vn.next=r,vn}function mn(){if(Rt===null){var r=Ye.alternate;r=r!==null?r.memoizedState:null}else r=Rt.next;var i=vn===null?Ye.memoizedState:vn.next;if(i!==null)vn=i,Rt=r;else{if(r===null)throw Ye.alternate===null?Error(a(467)):Error(a(310));Rt=r,r={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},vn===null?Ye.memoizedState=vn=r:vn=vn.next=r}return vn}function vd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lu(r){var i=su;return su+=1,El===null&&(El=[]),r=Nx(El,r,i),i=Ye,(vn===null?i.memoizedState:vn.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?v0:qm),r}function bd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return lu(r);if(r.$$typeof===R)return $n(r)}throw Error(a(438,String(r)))}function zm(r){var i=null,u=Ye.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var f=Ye.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(y){return y.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=vd(),Ye.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(r),f=0;f<r;f++)u[f]=D;return i.index++,u}function Za(r,i){return typeof i=="function"?i(r):i}function xd(r){var i=mn();return Mm(i,Rt,r)}function Mm(r,i,u){var f=r.queue;if(f===null)throw Error(a(311));f.lastRenderedReducer=u;var y=r.baseQueue,v=f.pending;if(v!==null){if(y!==null){var j=y.next;y.next=v.next,v.next=j}i.baseQueue=y=v,f.pending=null}if(v=r.baseState,y===null)r.memoizedState=v;else{i=y.next;var A=j=null,H=null,ee=i,ce=!1;do{var he=ee.lane&-536870913;if(he!==ee.lane?(ct&he)===he:(qa&he)===he){var ne=ee.revertLane;if(ne===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),he===xl&&(ce=!0);else if((qa&ne)===ne){ee=ee.next,ne===xl&&(ce=!0);continue}else he={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(A=H=he,j=v):H=H.next=he,Ye.lanes|=ne,Ri|=ne;he=ee.action,As&&u(v,he),v=ee.hasEagerState?ee.eagerState:u(v,he)}else ne={lane:he,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(A=H=ne,j=v):H=H.next=ne,Ye.lanes|=he,Ri|=he;ee=ee.next}while(ee!==null&&ee!==i);if(H===null?j=v:H.next=A,!Rr(v,r.memoizedState)&&(bn=!0,ce&&(u=wl,u!==null)))throw u;r.memoizedState=v,r.baseState=j,r.baseQueue=H,f.lastRenderedState=v}return y===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function Dm(r){var i=mn(),u=i.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=r;var f=u.dispatch,y=u.pending,v=i.memoizedState;if(y!==null){u.pending=null;var j=y=y.next;do v=r(v,j.action),j=j.next;while(j!==y);Rr(v,i.memoizedState)||(bn=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),u.lastRenderedState=v}return[v,f]}function Px(r,i,u){var f=Ye,y=mn(),v=mt;if(v){if(u===void 0)throw Error(a(407));u=u()}else u=i();var j=!Rr((Rt||y).memoizedState,u);if(j&&(y.memoizedState=u,bn=!0),y=y.queue,Pm($x.bind(null,f,y,r),[r]),y.getSnapshot!==i||j||vn!==null&&vn.memoizedState.tag&1){if(f.flags|=2048,Nl(9,{destroy:void 0},Bx.bind(null,f,y,u,i),null),Mt===null)throw Error(a(349));v||(qa&127)!==0||Ux(f,i,u)}return u}function Ux(r,i,u){r.flags|=16384,r={getSnapshot:i,value:u},i=Ye.updateQueue,i===null?(i=vd(),Ye.updateQueue=i,i.stores=[r]):(u=i.stores,u===null?i.stores=[r]:u.push(r))}function Bx(r,i,u,f){i.value=u,i.getSnapshot=f,Fx(i)&&Hx(r)}function $x(r,i,u){return u(function(){Fx(i)&&Hx(r)})}function Fx(r){var i=r.getSnapshot;r=r.value;try{var u=i();return!Rr(r,u)}catch{return!0}}function Hx(r){var i=ws(r,2);i!==null&&br(i,r,2)}function Im(r){var i=ar();if(typeof r=="function"){var u=r;if(r=u(),As){At(!0);try{u()}finally{At(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:r},i}function qx(r,i,u,f){return r.baseState=u,Mm(r,Rt,typeof f=="function"?f:Za)}function AA(r,i,u,f,y){if(kd(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:y,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){v.listeners.push(j)}};Z.T!==null?u(!0):v.isTransition=!1,f(v),u=i.pending,u===null?(v.next=i.pending=v,Zx(i,v)):(v.next=u.next,i.pending=u.next=v)}}function Zx(r,i){var u=i.action,f=i.payload,y=r.state;if(i.isTransition){var v=Z.T,j={};Z.T=j;try{var A=u(y,f),H=Z.S;H!==null&&H(j,A),Gx(r,i,A)}catch(ee){Lm(r,i,ee)}finally{v!==null&&j.types!==null&&(v.types=j.types),Z.T=v}}else try{v=u(y,f),Gx(r,i,v)}catch(ee){Lm(r,i,ee)}}function Gx(r,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){Vx(r,i,f)},function(f){return Lm(r,i,f)}):Vx(r,i,u)}function Vx(r,i,u){i.status="fulfilled",i.value=u,Qx(i),r.state=u,i=r.pending,i!==null&&(u=i.next,u===i?r.pending=null:(u=u.next,i.next=u,Zx(r,u)))}function Lm(r,i,u){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=u,Qx(i),i=i.next;while(i!==f)}r.action=null}function Qx(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Kx(r,i){return i}function Yx(r,i){if(mt){var u=Mt.formState;if(u!==null){e:{var f=Ye;if(mt){if(Bt){t:{for(var y=Bt,v=Yr;y.nodeType!==8;){if(!v){y=null;break t}if(y=Wr(y.nextSibling),y===null){y=null;break t}}v=y.data,y=v==="F!"||v==="F"?y:null}if(y){Bt=Wr(y.nextSibling),f=y.data==="F!";break e}}Si(f)}f=!1}f&&(i=u[0])}}return u=ar(),u.memoizedState=u.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kx,lastRenderedState:i},u.queue=f,u=p0.bind(null,Ye,f),f.dispatch=u,f=Im(!1),v=Hm.bind(null,Ye,!1,f.queue),f=ar(),y={state:i,dispatch:null,action:r,pending:null},f.queue=y,u=AA.bind(null,Ye,y,v,u),y.dispatch=u,f.memoizedState=r,[i,u,!1]}function Xx(r){var i=mn();return Wx(i,Rt,r)}function Wx(r,i,u){if(i=Mm(r,i,Kx)[0],r=xd(Za)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=lu(i)}catch(j){throw j===Sl?cd:j}else f=i;i=mn();var y=i.queue,v=y.dispatch;return u!==i.memoizedState&&(Ye.flags|=2048,Nl(9,{destroy:void 0},RA.bind(null,y,u),null)),[f,v,r]}function RA(r,i){r.action=i}function Jx(r){var i=mn(),u=Rt;if(u!==null)return Wx(i,u,r);mn(),i=i.memoizedState,u=mn();var f=u.queue.dispatch;return u.memoizedState=r,[i,f,!1]}function Nl(r,i,u,f){return r={tag:r,create:u,deps:f,inst:i,next:null},i=Ye.updateQueue,i===null&&(i=vd(),Ye.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=r.next=r:(f=u.next,u.next=r,r.next=f,i.lastEffect=r),r}function e0(){return mn().memoizedState}function wd(r,i,u,f){var y=ar();Ye.flags|=r,y.memoizedState=Nl(1|i,{destroy:void 0},u,f===void 0?null:f)}function Sd(r,i,u,f){var y=mn();f=f===void 0?null:f;var v=y.memoizedState.inst;Rt!==null&&f!==null&&_m(f,Rt.memoizedState.deps)?y.memoizedState=Nl(i,v,u,f):(Ye.flags|=r,y.memoizedState=Nl(1|i,v,u,f))}function t0(r,i){wd(8390656,8,r,i)}function Pm(r,i){Sd(2048,8,r,i)}function OA(r){Ye.flags|=4;var i=Ye.updateQueue;if(i===null)i=vd(),Ye.updateQueue=i,i.events=[r];else{var u=i.events;u===null?i.events=[r]:u.push(r)}}function n0(r){var i=mn().memoizedState;return OA({ref:i,nextImpl:r}),function(){if((Ct&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function r0(r,i){return Sd(4,2,r,i)}function a0(r,i){return Sd(4,4,r,i)}function i0(r,i){if(typeof i=="function"){r=r();var u=i(r);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function s0(r,i,u){u=u!=null?u.concat([r]):null,Sd(4,4,i0.bind(null,i,r),u)}function Um(){}function l0(r,i){var u=mn();i=i===void 0?null:i;var f=u.memoizedState;return i!==null&&_m(i,f[1])?f[0]:(u.memoizedState=[r,i],r)}function o0(r,i){var u=mn();i=i===void 0?null:i;var f=u.memoizedState;if(i!==null&&_m(i,f[1]))return f[0];if(f=r(),As){At(!0);try{r()}finally{At(!1)}}return u.memoizedState=[f,i],f}function Bm(r,i,u){return u===void 0||(qa&1073741824)!==0&&(ct&261930)===0?r.memoizedState=i:(r.memoizedState=u,r=uw(),Ye.lanes|=r,Ri|=r,u)}function u0(r,i,u,f){return Rr(u,i)?u:jl.current!==null?(r=Bm(r,u,f),Rr(r,i)||(bn=!0),r):(qa&42)===0||(qa&1073741824)!==0&&(ct&261930)===0?(bn=!0,r.memoizedState=u):(r=uw(),Ye.lanes|=r,Ri|=r,i)}function c0(r,i,u,f,y){var v=te.p;te.p=v!==0&&8>v?v:8;var j=Z.T,A={};Z.T=A,Hm(r,!1,i,u);try{var H=y(),ee=Z.S;if(ee!==null&&ee(A,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var ce=NA(H,f);ou(r,i,ce,Lr(r))}else ou(r,i,f,Lr(r))}catch(he){ou(r,i,{then:function(){},status:"rejected",reason:he},Lr())}finally{te.p=v,j!==null&&A.types!==null&&(j.types=A.types),Z.T=j}}function zA(){}function $m(r,i,u,f){if(r.tag!==5)throw Error(a(476));var y=d0(r).queue;c0(r,y,i,je,u===null?zA:function(){return f0(r),u(f)})}function d0(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:je,baseState:je,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:je},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:u},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function f0(r){var i=d0(r);i.next===null&&(i=r.alternate.memoizedState),ou(r,i.next.queue,{},Lr())}function Fm(){return $n(Cu)}function h0(){return mn().memoizedState}function m0(){return mn().memoizedState}function MA(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var u=Lr();r=Ci(u);var f=Ei(i,r,u);f!==null&&(br(f,i,u),ru(f,i,u)),i={cache:ym()},r.payload=i;return}i=i.return}}function DA(r,i,u){var f=Lr();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},kd(r)?g0(i,u):(u=sm(r,i,u,f),u!==null&&(br(u,r,f),y0(u,i,f)))}function p0(r,i,u){var f=Lr();ou(r,i,u,f)}function ou(r,i,u,f){var y={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(kd(r))g0(i,y);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var j=i.lastRenderedState,A=v(j,u);if(y.hasEagerState=!0,y.eagerState=A,Rr(A,j))return rd(r,i,y,0),Mt===null&&nd(),!1}catch{}finally{}if(u=sm(r,i,y,f),u!==null)return br(u,r,f),y0(u,i,f),!0}return!1}function Hm(r,i,u,f){if(f={lane:2,revertLane:wp(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},kd(r)){if(i)throw Error(a(479))}else i=sm(r,u,f,2),i!==null&&br(i,r,2)}function kd(r){var i=r.alternate;return r===Ye||i!==null&&i===Ye}function g0(r,i){Cl=gd=!0;var u=r.pending;u===null?i.next=i:(i.next=u.next,u.next=i),r.pending=i}function y0(r,i,u){if((u&4194048)!==0){var f=i.lanes;f&=r.pendingLanes,u|=f,i.lanes=u,ys(r,u)}}var uu={readContext:$n,use:bd,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useLayoutEffect:tn,useInsertionEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useSyncExternalStore:tn,useId:tn,useHostTransitionStatus:tn,useFormState:tn,useActionState:tn,useOptimistic:tn,useMemoCache:tn,useCacheRefresh:tn};uu.useEffectEvent=tn;var v0={readContext:$n,use:bd,useCallback:function(r,i){return ar().memoizedState=[r,i===void 0?null:i],r},useContext:$n,useEffect:t0,useImperativeHandle:function(r,i,u){u=u!=null?u.concat([r]):null,wd(4194308,4,i0.bind(null,i,r),u)},useLayoutEffect:function(r,i){return wd(4194308,4,r,i)},useInsertionEffect:function(r,i){wd(4,2,r,i)},useMemo:function(r,i){var u=ar();i=i===void 0?null:i;var f=r();if(As){At(!0);try{r()}finally{At(!1)}}return u.memoizedState=[f,i],f},useReducer:function(r,i,u){var f=ar();if(u!==void 0){var y=u(i);if(As){At(!0);try{u(i)}finally{At(!1)}}}else y=i;return f.memoizedState=f.baseState=y,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:y},f.queue=r,r=r.dispatch=DA.bind(null,Ye,r),[f.memoizedState,r]},useRef:function(r){var i=ar();return r={current:r},i.memoizedState=r},useState:function(r){r=Im(r);var i=r.queue,u=p0.bind(null,Ye,i);return i.dispatch=u,[r.memoizedState,u]},useDebugValue:Um,useDeferredValue:function(r,i){var u=ar();return Bm(u,r,i)},useTransition:function(){var r=Im(!1);return r=c0.bind(null,Ye,r.queue,!0,!1),ar().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,u){var f=Ye,y=ar();if(mt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),Mt===null)throw Error(a(349));(ct&127)!==0||Ux(f,i,u)}y.memoizedState=u;var v={value:u,getSnapshot:i};return y.queue=v,t0($x.bind(null,f,v,r),[r]),f.flags|=2048,Nl(9,{destroy:void 0},Bx.bind(null,f,v,u,i),null),u},useId:function(){var r=ar(),i=Mt.identifierPrefix;if(mt){var u=ja,f=ka;u=(f&~(1<<32-it(f)-1)).toString(32)+u,i="_"+i+"R_"+u,u=yd++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=_A++,i="_"+i+"r_"+u.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Fm,useFormState:Yx,useActionState:Yx,useOptimistic:function(r){var i=ar();i.memoizedState=i.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=Hm.bind(null,Ye,!0,u),u.dispatch=i,[r,i]},useMemoCache:zm,useCacheRefresh:function(){return ar().memoizedState=MA.bind(null,Ye)},useEffectEvent:function(r){var i=ar(),u={impl:r};return i.memoizedState=u,function(){if((Ct&2)!==0)throw Error(a(440));return u.impl.apply(void 0,arguments)}}},qm={readContext:$n,use:bd,useCallback:l0,useContext:$n,useEffect:Pm,useImperativeHandle:s0,useInsertionEffect:r0,useLayoutEffect:a0,useMemo:o0,useReducer:xd,useRef:e0,useState:function(){return xd(Za)},useDebugValue:Um,useDeferredValue:function(r,i){var u=mn();return u0(u,Rt.memoizedState,r,i)},useTransition:function(){var r=xd(Za)[0],i=mn().memoizedState;return[typeof r=="boolean"?r:lu(r),i]},useSyncExternalStore:Px,useId:h0,useHostTransitionStatus:Fm,useFormState:Xx,useActionState:Xx,useOptimistic:function(r,i){var u=mn();return qx(u,Rt,r,i)},useMemoCache:zm,useCacheRefresh:m0};qm.useEffectEvent=n0;var b0={readContext:$n,use:bd,useCallback:l0,useContext:$n,useEffect:Pm,useImperativeHandle:s0,useInsertionEffect:r0,useLayoutEffect:a0,useMemo:o0,useReducer:Dm,useRef:e0,useState:function(){return Dm(Za)},useDebugValue:Um,useDeferredValue:function(r,i){var u=mn();return Rt===null?Bm(u,r,i):u0(u,Rt.memoizedState,r,i)},useTransition:function(){var r=Dm(Za)[0],i=mn().memoizedState;return[typeof r=="boolean"?r:lu(r),i]},useSyncExternalStore:Px,useId:h0,useHostTransitionStatus:Fm,useFormState:Jx,useActionState:Jx,useOptimistic:function(r,i){var u=mn();return Rt!==null?qx(u,Rt,r,i):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:zm,useCacheRefresh:m0};b0.useEffectEvent=n0;function Zm(r,i,u,f){i=r.memoizedState,u=u(f,i),u=u==null?i:g({},i,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Gm={enqueueSetState:function(r,i,u){r=r._reactInternals;var f=Lr(),y=Ci(f);y.payload=i,u!=null&&(y.callback=u),i=Ei(r,y,f),i!==null&&(br(i,r,f),ru(i,r,f))},enqueueReplaceState:function(r,i,u){r=r._reactInternals;var f=Lr(),y=Ci(f);y.tag=1,y.payload=i,u!=null&&(y.callback=u),i=Ei(r,y,f),i!==null&&(br(i,r,f),ru(i,r,f))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var u=Lr(),f=Ci(u);f.tag=2,i!=null&&(f.callback=i),i=Ei(r,f,u),i!==null&&(br(i,r,u),ru(i,r,u))}};function x0(r,i,u,f,y,v,j){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,v,j):i.prototype&&i.prototype.isPureReactComponent?!Ko(u,f)||!Ko(y,v):!0}function w0(r,i,u,f){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,f),i.state!==r&&Gm.enqueueReplaceState(i,i.state,null)}function Rs(r,i){var u=i;if("ref"in i){u={};for(var f in i)f!=="ref"&&(u[f]=i[f])}if(r=r.defaultProps){u===i&&(u=g({},u));for(var y in r)u[y]===void 0&&(u[y]=r[y])}return u}function S0(r){td(r)}function k0(r){console.error(r)}function j0(r){td(r)}function jd(r,i){try{var u=r.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function C0(r,i,u){try{var f=r.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Vm(r,i,u){return u=Ci(u),u.tag=3,u.payload={element:null},u.callback=function(){jd(r,i)},u}function E0(r){return r=Ci(r),r.tag=3,r}function N0(r,i,u,f){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var v=f.value;r.payload=function(){return y(v)},r.callback=function(){C0(i,u,f)}}var j=u.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(r.callback=function(){C0(i,u,f),typeof y!="function"&&(Oi===null?Oi=new Set([this]):Oi.add(this));var A=f.stack;this.componentDidCatch(f.value,{componentStack:A!==null?A:""})})}function IA(r,i,u,f,y){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=u.alternate,i!==null&&bl(i,u,y,!0),u=zr.current,u!==null){switch(u.tag){case 31:case 13:return Xr===null?Id():u.alternate===null&&nn===0&&(nn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,f===dd?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([f]):i.add(f),vp(r,f,y)),!1;case 22:return u.flags|=65536,f===dd?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([f]):u.add(f)),vp(r,f,y)),!1}throw Error(a(435,u.tag))}return vp(r,f,y),Id(),!1}if(mt)return i=zr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=y,f!==fm&&(r=Error(a(422),{cause:f}),Wo(Vr(r,u)))):(f!==fm&&(i=Error(a(423),{cause:f}),Wo(Vr(i,u))),r=r.current.alternate,r.flags|=65536,y&=-y,r.lanes|=y,f=Vr(f,u),y=Vm(r.stateNode,f,y),km(r,y),nn!==4&&(nn=2)),!1;var v=Error(a(520),{cause:f});if(v=Vr(v,u),yu===null?yu=[v]:yu.push(v),nn!==4&&(nn=2),i===null)return!0;f=Vr(f,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,r=y&-y,u.lanes|=r,r=Vm(u.stateNode,f,r),km(u,r),!1;case 1:if(i=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Oi===null||!Oi.has(v))))return u.flags|=65536,y&=-y,u.lanes|=y,y=E0(y),N0(y,r,u,f),km(u,y),!1}u=u.return}while(u!==null);return!1}var Qm=Error(a(461)),bn=!1;function Fn(r,i,u,f){i.child=r===null?Rx(i,null,u,f):Ts(i,r.child,u,f)}function _0(r,i,u,f,y){u=u.render;var v=i.ref;if("ref"in f){var j={};for(var A in f)A!=="ref"&&(j[A]=f[A])}else j=f;return Cs(i),f=Tm(r,i,u,j,v,y),A=Am(),r!==null&&!bn?(Rm(r,i,y),Ga(r,i,y)):(mt&&A&&cm(i),i.flags|=1,Fn(r,i,f,y),i.child)}function T0(r,i,u,f,y){if(r===null){var v=u.type;return typeof v=="function"&&!lm(v)&&v.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=v,A0(r,i,v,f,y)):(r=id(u.type,null,f,i,i.mode,y),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!np(r,y)){var j=v.memoizedProps;if(u=u.compare,u=u!==null?u:Ko,u(j,f)&&r.ref===i.ref)return Ga(r,i,y)}return i.flags|=1,r=Ba(v,f),r.ref=i.ref,r.return=i,i.child=r}function A0(r,i,u,f,y){if(r!==null){var v=r.memoizedProps;if(Ko(v,f)&&r.ref===i.ref)if(bn=!1,i.pendingProps=f=v,np(r,y))(r.flags&131072)!==0&&(bn=!0);else return i.lanes=r.lanes,Ga(r,i,y)}return Km(r,i,u,f,y)}function R0(r,i,u,f){var y=f.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|u:u,r!==null){for(f=i.child=r.child,y=0;f!==null;)y=y|f.lanes|f.childLanes,f=f.sibling;f=y&~v}else f=0,i.child=null;return O0(r,i,v,u,f)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&ud(i,v!==null?v.cachePool:null),v!==null?Mx(i,v):Cm(),Dx(i);else return f=i.lanes=536870912,O0(r,i,v!==null?v.baseLanes|u:u,u,f)}else v!==null?(ud(i,v.cachePool),Mx(i,v),_i(),i.memoizedState=null):(r!==null&&ud(i,null),Cm(),_i());return Fn(r,i,y,u),i.child}function cu(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function O0(r,i,u,f,y){var v=bm();return v=v===null?null:{parent:yn._currentValue,pool:v},i.memoizedState={baseLanes:u,cachePool:v},r!==null&&ud(i,null),Cm(),Dx(i),r!==null&&bl(r,i,f,!0),i.childLanes=y,null}function Cd(r,i){return i=Nd({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function z0(r,i,u){return Ts(i,r.child,null,u),r=Cd(i,i.pendingProps),r.flags|=2,Mr(i),i.memoizedState=null,r}function LA(r,i,u){var f=i.pendingProps,y=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(mt){if(f.mode==="hidden")return r=Cd(i,f),i.lanes=536870912,cu(null,r);if(Nm(i),(r=Bt)?(r=Zw(r,Yr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:xi!==null?{id:ka,overflow:ja}:null,retryLane:536870912,hydrationErrors:null},u=gx(r),u.return=i,i.child=u,Bn=i,Bt=null)):r=null,r===null)throw Si(i);return i.lanes=536870912,null}return Cd(i,f)}var v=r.memoizedState;if(v!==null){var j=v.dehydrated;if(Nm(i),y)if(i.flags&256)i.flags&=-257,i=z0(r,i,u);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(bn||bl(r,i,u,!1),y=(u&r.childLanes)!==0,bn||y){if(f=Mt,f!==null&&(j=Fc(f,u),j!==0&&j!==v.retryLane))throw v.retryLane=j,ws(r,j),br(f,r,j),Qm;Id(),i=z0(r,i,u)}else r=v.treeContext,Bt=Wr(j.nextSibling),Bn=i,mt=!0,wi=null,Yr=!1,r!==null&&bx(i,r),i=Cd(i,f),i.flags|=4096;return i}return r=Ba(r.child,{mode:f.mode,children:f.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Ed(r,i){var u=i.ref;if(u===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(a(284));(r===null||r.ref!==u)&&(i.flags|=4194816)}}function Km(r,i,u,f,y){return Cs(i),u=Tm(r,i,u,f,void 0,y),f=Am(),r!==null&&!bn?(Rm(r,i,y),Ga(r,i,y)):(mt&&f&&cm(i),i.flags|=1,Fn(r,i,u,y),i.child)}function M0(r,i,u,f,y,v){return Cs(i),i.updateQueue=null,u=Lx(i,f,u,y),Ix(r),f=Am(),r!==null&&!bn?(Rm(r,i,v),Ga(r,i,v)):(mt&&f&&cm(i),i.flags|=1,Fn(r,i,u,v),i.child)}function D0(r,i,u,f,y){if(Cs(i),i.stateNode===null){var v=pl,j=u.contextType;typeof j=="object"&&j!==null&&(v=$n(j)),v=new u(f,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Gm,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=f,v.state=i.memoizedState,v.refs={},wm(i),j=u.contextType,v.context=typeof j=="object"&&j!==null?$n(j):pl,v.state=i.memoizedState,j=u.getDerivedStateFromProps,typeof j=="function"&&(Zm(i,u,j,f),v.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(j=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),j!==v.state&&Gm.enqueueReplaceState(v,v.state,null),iu(i,f,v,y),au(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(r===null){v=i.stateNode;var A=i.memoizedProps,H=Rs(u,A);v.props=H;var ee=v.context,ce=u.contextType;j=pl,typeof ce=="object"&&ce!==null&&(j=$n(ce));var he=u.getDerivedStateFromProps;ce=typeof he=="function"||typeof v.getSnapshotBeforeUpdate=="function",A=i.pendingProps!==A,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(A||ee!==j)&&w0(i,v,f,j),ji=!1;var ne=i.memoizedState;v.state=ne,iu(i,f,v,y),au(),ee=i.memoizedState,A||ne!==ee||ji?(typeof he=="function"&&(Zm(i,u,he,f),ee=i.memoizedState),(H=ji||x0(i,u,H,f,ne,ee,j))?(ce||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=f,i.memoizedState=ee),v.props=f,v.state=ee,v.context=j,f=H):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{v=i.stateNode,Sm(r,i),j=i.memoizedProps,ce=Rs(u,j),v.props=ce,he=i.pendingProps,ne=v.context,ee=u.contextType,H=pl,typeof ee=="object"&&ee!==null&&(H=$n(ee)),A=u.getDerivedStateFromProps,(ee=typeof A=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(j!==he||ne!==H)&&w0(i,v,f,H),ji=!1,ne=i.memoizedState,v.state=ne,iu(i,f,v,y),au();var oe=i.memoizedState;j!==he||ne!==oe||ji||r!==null&&r.dependencies!==null&&ld(r.dependencies)?(typeof A=="function"&&(Zm(i,u,A,f),oe=i.memoizedState),(ce=ji||x0(i,u,ce,f,ne,oe,H)||r!==null&&r.dependencies!==null&&ld(r.dependencies))?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(f,oe,H),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(f,oe,H)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||j===r.memoizedProps&&ne===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&ne===r.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=oe),v.props=f,v.state=oe,v.context=H,f=ce):(typeof v.componentDidUpdate!="function"||j===r.memoizedProps&&ne===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&ne===r.memoizedState||(i.flags|=1024),f=!1)}return v=f,Ed(r,i),f=(i.flags&128)!==0,v||f?(v=i.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&f?(i.child=Ts(i,r.child,null,y),i.child=Ts(i,null,u,y)):Fn(r,i,u,y),i.memoizedState=v.state,r=i.child):r=Ga(r,i,y),r}function I0(r,i,u,f){return ks(),i.flags|=256,Fn(r,i,u,f),i.child}var Ym={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xm(r){return{baseLanes:r,cachePool:Cx()}}function Wm(r,i,u){return r=r!==null?r.childLanes&~u:0,i&&(r|=Ir),r}function L0(r,i,u){var f=i.pendingProps,y=!1,v=(i.flags&128)!==0,j;if((j=v)||(j=r!==null&&r.memoizedState===null?!1:(hn.current&2)!==0),j&&(y=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,r===null){if(mt){if(y?Ni(i):_i(),(r=Bt)?(r=Zw(r,Yr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:xi!==null?{id:ka,overflow:ja}:null,retryLane:536870912,hydrationErrors:null},u=gx(r),u.return=i,i.child=u,Bn=i,Bt=null)):r=null,r===null)throw Si(i);return Mp(r)?i.lanes=32:i.lanes=536870912,null}var A=f.children;return f=f.fallback,y?(_i(),y=i.mode,A=Nd({mode:"hidden",children:A},y),f=Ss(f,y,u,null),A.return=i,f.return=i,A.sibling=f,i.child=A,f=i.child,f.memoizedState=Xm(u),f.childLanes=Wm(r,j,u),i.memoizedState=Ym,cu(null,f)):(Ni(i),Jm(i,A))}var H=r.memoizedState;if(H!==null&&(A=H.dehydrated,A!==null)){if(v)i.flags&256?(Ni(i),i.flags&=-257,i=ep(r,i,u)):i.memoizedState!==null?(_i(),i.child=r.child,i.flags|=128,i=null):(_i(),A=f.fallback,y=i.mode,f=Nd({mode:"visible",children:f.children},y),A=Ss(A,y,u,null),A.flags|=2,f.return=i,A.return=i,f.sibling=A,i.child=f,Ts(i,r.child,null,u),f=i.child,f.memoizedState=Xm(u),f.childLanes=Wm(r,j,u),i.memoizedState=Ym,i=cu(null,f));else if(Ni(i),Mp(A)){if(j=A.nextSibling&&A.nextSibling.dataset,j)var ee=j.dgst;j=ee,f=Error(a(419)),f.stack="",f.digest=j,Wo({value:f,source:null,stack:null}),i=ep(r,i,u)}else if(bn||bl(r,i,u,!1),j=(u&r.childLanes)!==0,bn||j){if(j=Mt,j!==null&&(f=Fc(j,u),f!==0&&f!==H.retryLane))throw H.retryLane=f,ws(r,f),br(j,r,f),Qm;zp(A)||Id(),i=ep(r,i,u)}else zp(A)?(i.flags|=192,i.child=r.child,i=null):(r=H.treeContext,Bt=Wr(A.nextSibling),Bn=i,mt=!0,wi=null,Yr=!1,r!==null&&bx(i,r),i=Jm(i,f.children),i.flags|=4096);return i}return y?(_i(),A=f.fallback,y=i.mode,H=r.child,ee=H.sibling,f=Ba(H,{mode:"hidden",children:f.children}),f.subtreeFlags=H.subtreeFlags&65011712,ee!==null?A=Ba(ee,A):(A=Ss(A,y,u,null),A.flags|=2),A.return=i,f.return=i,f.sibling=A,i.child=f,cu(null,f),f=i.child,A=r.child.memoizedState,A===null?A=Xm(u):(y=A.cachePool,y!==null?(H=yn._currentValue,y=y.parent!==H?{parent:H,pool:H}:y):y=Cx(),A={baseLanes:A.baseLanes|u,cachePool:y}),f.memoizedState=A,f.childLanes=Wm(r,j,u),i.memoizedState=Ym,cu(r.child,f)):(Ni(i),u=r.child,r=u.sibling,u=Ba(u,{mode:"visible",children:f.children}),u.return=i,u.sibling=null,r!==null&&(j=i.deletions,j===null?(i.deletions=[r],i.flags|=16):j.push(r)),i.child=u,i.memoizedState=null,u)}function Jm(r,i){return i=Nd({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Nd(r,i){return r=Or(22,r,null,i),r.lanes=0,r}function ep(r,i,u){return Ts(i,r.child,null,u),r=Jm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function P0(r,i,u){r.lanes|=i;var f=r.alternate;f!==null&&(f.lanes|=i),pm(r.return,i,u)}function tp(r,i,u,f,y,v){var j=r.memoizedState;j===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:y,treeForkCount:v}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=f,j.tail=u,j.tailMode=y,j.treeForkCount=v)}function U0(r,i,u){var f=i.pendingProps,y=f.revealOrder,v=f.tail;f=f.children;var j=hn.current,A=(j&2)!==0;if(A?(j=j&1|2,i.flags|=128):j&=1,T(hn,j),Fn(r,i,f,u),f=mt?Xo:0,!A&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&P0(r,u,i);else if(r.tag===19)P0(r,u,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(y){case"forwards":for(u=i.child,y=null;u!==null;)r=u.alternate,r!==null&&pd(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=i.child,i.child=null):(y=u.sibling,u.sibling=null),tp(i,!1,y,u,v,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=i.child,i.child=null;y!==null;){if(r=y.alternate,r!==null&&pd(r)===null){i.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}tp(i,!0,u,null,v,f);break;case"together":tp(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function Ga(r,i,u){if(r!==null&&(i.dependencies=r.dependencies),Ri|=i.lanes,(u&i.childLanes)===0)if(r!==null){if(bl(r,i,u,!1),(u&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,u=Ba(r,r.pendingProps),i.child=u,u.return=i;r.sibling!==null;)r=r.sibling,u=u.sibling=Ba(r,r.pendingProps),u.return=i;u.sibling=null}return i.child}function np(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&ld(r)))}function PA(r,i,u){switch(i.tag){case 3:we(i,i.stateNode.containerInfo),ki(i,yn,r.memoizedState.cache),ks();break;case 27:case 5:Ie(i);break;case 4:we(i,i.stateNode.containerInfo);break;case 10:ki(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Nm(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(Ni(i),i.flags|=128,null):(u&i.child.childLanes)!==0?L0(r,i,u):(Ni(i),r=Ga(r,i,u),r!==null?r.sibling:null);Ni(i);break;case 19:var y=(r.flags&128)!==0;if(f=(u&i.childLanes)!==0,f||(bl(r,i,u,!1),f=(u&i.childLanes)!==0),y){if(f)return U0(r,i,u);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),T(hn,hn.current),f)break;return null;case 22:return i.lanes=0,R0(r,i,u,i.pendingProps);case 24:ki(i,yn,r.memoizedState.cache)}return Ga(r,i,u)}function B0(r,i,u){if(r!==null)if(r.memoizedProps!==i.pendingProps)bn=!0;else{if(!np(r,u)&&(i.flags&128)===0)return bn=!1,PA(r,i,u);bn=(r.flags&131072)!==0}else bn=!1,mt&&(i.flags&1048576)!==0&&vx(i,Xo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var f=i.pendingProps;if(r=Ns(i.elementType),i.type=r,typeof r=="function")lm(r)?(f=Rs(r,f),i.tag=1,i=D0(null,i,r,f,u)):(i.tag=0,i=Km(null,i,r,f,u));else{if(r!=null){var y=r.$$typeof;if(y===z){i.tag=11,i=_0(null,i,r,f,u);break e}else if(y===B){i.tag=14,i=T0(null,i,r,f,u);break e}}throw i=W(r)||r,Error(a(306,i,""))}}return i;case 0:return Km(r,i,i.type,i.pendingProps,u);case 1:return f=i.type,y=Rs(f,i.pendingProps),D0(r,i,f,y,u);case 3:e:{if(we(i,i.stateNode.containerInfo),r===null)throw Error(a(387));f=i.pendingProps;var v=i.memoizedState;y=v.element,Sm(r,i),iu(i,f,null,u);var j=i.memoizedState;if(f=j.cache,ki(i,yn,f),f!==v.cache&&gm(i,[yn],u,!0),au(),f=j.element,v.isDehydrated)if(v={element:f,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=I0(r,i,f,u);break e}else if(f!==y){y=Vr(Error(a(424)),i),Wo(y),i=I0(r,i,f,u);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(Bt=Wr(r.firstChild),Bn=i,mt=!0,wi=null,Yr=!0,u=Rx(i,null,f,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ks(),f===y){i=Ga(r,i,u);break e}Fn(r,i,f,u)}i=i.child}return i;case 26:return Ed(r,i),r===null?(u=Xw(i.type,null,i.pendingProps,null))?i.memoizedState=u:mt||(u=i.type,r=i.pendingProps,f=Hd(re.current).createElement(u),f[dn]=i,f[Zt]=r,Hn(f,u,r),ht(f),i.stateNode=f):i.memoizedState=Xw(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Ie(i),r===null&&mt&&(f=i.stateNode=Qw(i.type,i.pendingProps,re.current),Bn=i,Yr=!0,y=Bt,Ii(i.type)?(Dp=y,Bt=Wr(f.firstChild)):Bt=y),Fn(r,i,i.pendingProps.children,u),Ed(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&mt&&((y=f=Bt)&&(f=m2(f,i.type,i.pendingProps,Yr),f!==null?(i.stateNode=f,Bn=i,Bt=Wr(f.firstChild),Yr=!1,y=!0):y=!1),y||Si(i)),Ie(i),y=i.type,v=i.pendingProps,j=r!==null?r.memoizedProps:null,f=v.children,Ap(y,v)?f=null:j!==null&&Ap(y,j)&&(i.flags|=32),i.memoizedState!==null&&(y=Tm(r,i,TA,null,null,u),Cu._currentValue=y),Ed(r,i),Fn(r,i,f,u),i.child;case 6:return r===null&&mt&&((r=u=Bt)&&(u=p2(u,i.pendingProps,Yr),u!==null?(i.stateNode=u,Bn=i,Bt=null,r=!0):r=!1),r||Si(i)),null;case 13:return L0(r,i,u);case 4:return we(i,i.stateNode.containerInfo),f=i.pendingProps,r===null?i.child=Ts(i,null,f,u):Fn(r,i,f,u),i.child;case 11:return _0(r,i,i.type,i.pendingProps,u);case 7:return Fn(r,i,i.pendingProps,u),i.child;case 8:return Fn(r,i,i.pendingProps.children,u),i.child;case 12:return Fn(r,i,i.pendingProps.children,u),i.child;case 10:return f=i.pendingProps,ki(i,i.type,f.value),Fn(r,i,f.children,u),i.child;case 9:return y=i.type._context,f=i.pendingProps.children,Cs(i),y=$n(y),f=f(y),i.flags|=1,Fn(r,i,f,u),i.child;case 14:return T0(r,i,i.type,i.pendingProps,u);case 15:return A0(r,i,i.type,i.pendingProps,u);case 19:return U0(r,i,u);case 31:return LA(r,i,u);case 22:return R0(r,i,u,i.pendingProps);case 24:return Cs(i),f=$n(yn),r===null?(y=bm(),y===null&&(y=Mt,v=ym(),y.pooledCache=v,v.refCount++,v!==null&&(y.pooledCacheLanes|=u),y=v),i.memoizedState={parent:f,cache:y},wm(i),ki(i,yn,y)):((r.lanes&u)!==0&&(Sm(r,i),iu(i,null,null,u),au()),y=r.memoizedState,v=i.memoizedState,y.parent!==f?(y={parent:f,cache:f},i.memoizedState=y,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=y),ki(i,yn,f)):(f=v.cache,ki(i,yn,f),f!==y.cache&&gm(i,[yn],u,!0))),Fn(r,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Va(r){r.flags|=4}function rp(r,i,u,f,y){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(y&335544128)===y)if(r.stateNode.complete)r.flags|=8192;else if(hw())r.flags|=8192;else throw _s=dd,xm}else r.flags&=-16777217}function $0(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!nS(i))if(hw())r.flags|=8192;else throw _s=dd,xm}function _d(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Ce():536870912,r.lanes|=i,Rl|=i)}function du(r,i){if(!mt)switch(r.tailMode){case"hidden":i=r.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function $t(r){var i=r.alternate!==null&&r.alternate.child===r.child,u=0,f=0;if(i)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags&65011712,f|=y.flags&65011712,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags,f|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=f,r.childLanes=u,i}function UA(r,i,u){var f=i.pendingProps;switch(dm(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 u=i.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),Ha(yn),me(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(vl(i)?Va(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,hm())),$t(i),null;case 26:var y=i.type,v=i.memoizedState;return r===null?(Va(i),v!==null?($t(i),$0(i,v)):($t(i),rp(i,y,null,f,u))):v?v!==r.memoizedState?(Va(i),$t(i),$0(i,v)):($t(i),i.flags&=-16777217):(r=r.memoizedProps,r!==f&&Va(i),$t(i),rp(i,y,r,f,u)),null;case 27:if(Ue(i),u=re.current,y=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&Va(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return $t(i),null}r=G.current,vl(i)?xx(i):(r=Qw(y,f,u),i.stateNode=r,Va(i))}return $t(i),null;case 5:if(Ue(i),y=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&Va(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return $t(i),null}if(v=G.current,vl(i))xx(i);else{var j=Hd(re.current);switch(v){case 1:v=j.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:v=j.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":v=j.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":v=j.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":v=j.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof f.is=="string"?j.createElement("select",{is:f.is}):j.createElement("select"),f.multiple?v.multiple=!0:f.size&&(v.size=f.size);break;default:v=typeof f.is=="string"?j.createElement(y,{is:f.is}):j.createElement(y)}}v[dn]=i,v[Zt]=f;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)v.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=v;e:switch(Hn(v,y,f),y){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Va(i)}}return $t(i),rp(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,u),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==f&&Va(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(a(166));if(r=re.current,vl(i)){if(r=i.stateNode,u=i.memoizedProps,f=null,y=Bn,y!==null)switch(y.tag){case 27:case 5:f=y.memoizedProps}r[dn]=i,r=!!(r.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||Lw(r.nodeValue,u)),r||Si(i,!0)}else r=Hd(r).createTextNode(f),r[dn]=i,i.stateNode=r}return $t(i),null;case 31:if(u=i.memoizedState,r===null||r.memoizedState!==null){if(f=vl(i),u!==null){if(r===null){if(!f)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[dn]=i}else ks(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;$t(i),r=!1}else u=hm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return i.flags&256?(Mr(i),i):(Mr(i),null);if((i.flags&128)!==0)throw Error(a(558))}return $t(i),null;case 13:if(f=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(y=vl(i),f!==null&&f.dehydrated!==null){if(r===null){if(!y)throw Error(a(318));if(y=i.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(a(317));y[dn]=i}else ks(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;$t(i),y=!1}else y=hm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=y),y=!0;if(!y)return i.flags&256?(Mr(i),i):(Mr(i),null)}return Mr(i),(i.flags&128)!==0?(i.lanes=u,i):(u=f!==null,r=r!==null&&r.memoizedState!==null,u&&(f=i.child,y=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(y=f.alternate.memoizedState.cachePool.pool),v=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(v=f.memoizedState.cachePool.pool),v!==y&&(f.flags|=2048)),u!==r&&u&&(i.child.flags|=8192),_d(i,i.updateQueue),$t(i),null);case 4:return me(),r===null&&Cp(i.stateNode.containerInfo),$t(i),null;case 10:return Ha(i.type),$t(i),null;case 19:if($(hn),f=i.memoizedState,f===null)return $t(i),null;if(y=(i.flags&128)!==0,v=f.rendering,v===null)if(y)du(f,!1);else{if(nn!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=pd(r),v!==null){for(i.flags|=128,du(f,!1),r=v.updateQueue,i.updateQueue=r,_d(i,r),i.subtreeFlags=0,r=u,u=i.child;u!==null;)px(u,r),u=u.sibling;return T(hn,hn.current&1|2),mt&&$a(i,f.treeForkCount),i.child}r=r.sibling}f.tail!==null&&un()>zd&&(i.flags|=128,y=!0,du(f,!1),i.lanes=4194304)}else{if(!y)if(r=pd(v),r!==null){if(i.flags|=128,y=!0,r=r.updateQueue,i.updateQueue=r,_d(i,r),du(f,!0),f.tail===null&&f.tailMode==="hidden"&&!v.alternate&&!mt)return $t(i),null}else 2*un()-f.renderingStartTime>zd&&u!==536870912&&(i.flags|=128,y=!0,du(f,!1),i.lanes=4194304);f.isBackwards?(v.sibling=i.child,i.child=v):(r=f.last,r!==null?r.sibling=v:i.child=v,f.last=v)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=un(),r.sibling=null,u=hn.current,T(hn,y?u&1|2:u&1),mt&&$a(i,f.treeForkCount),r):($t(i),null);case 22:case 23:return Mr(i),Em(),f=i.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(u&536870912)!==0&&(i.flags&128)===0&&($t(i),i.subtreeFlags&6&&(i.flags|=8192)):$t(i),u=i.updateQueue,u!==null&&_d(i,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048),r!==null&&$(Es),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ha(yn),$t(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function BA(r,i){switch(dm(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ha(yn),me(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Ue(i),null;case 31:if(i.memoizedState!==null){if(Mr(i),i.alternate===null)throw Error(a(340));ks()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Mr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ks()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return $(hn),null;case 4:return me(),null;case 10:return Ha(i.type),null;case 22:case 23:return Mr(i),Em(),r!==null&&$(Es),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ha(yn),null;case 25:return null;default:return null}}function F0(r,i){switch(dm(i),i.tag){case 3:Ha(yn),me();break;case 26:case 27:case 5:Ue(i);break;case 4:me();break;case 31:i.memoizedState!==null&&Mr(i);break;case 13:Mr(i);break;case 19:$(hn);break;case 10:Ha(i.type);break;case 22:case 23:Mr(i),Em(),r!==null&&$(Es);break;case 24:Ha(yn)}}function fu(r,i){try{var u=i.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var y=f.next;u=y;do{if((u.tag&r)===r){f=void 0;var v=u.create,j=u.inst;f=v(),j.destroy=f}u=u.next}while(u!==y)}}catch(A){Tt(i,i.return,A)}}function Ti(r,i,u){try{var f=i.updateQueue,y=f!==null?f.lastEffect:null;if(y!==null){var v=y.next;f=v;do{if((f.tag&r)===r){var j=f.inst,A=j.destroy;if(A!==void 0){j.destroy=void 0,y=i;var H=u,ee=A;try{ee()}catch(ce){Tt(y,H,ce)}}}f=f.next}while(f!==v)}}catch(ce){Tt(i,i.return,ce)}}function H0(r){var i=r.updateQueue;if(i!==null){var u=r.stateNode;try{zx(i,u)}catch(f){Tt(r,r.return,f)}}}function q0(r,i,u){u.props=Rs(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(f){Tt(r,i,f)}}function hu(r,i){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof u=="function"?r.refCleanup=u(f):u.current=f}}catch(y){Tt(r,i,y)}}function Ca(r,i){var u=r.ref,f=r.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(y){Tt(r,i,y)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Tt(r,i,y)}else u.current=null}function Z0(r){var i=r.type,u=r.memoizedProps,f=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(y){Tt(r,r.return,y)}}function ap(r,i,u){try{var f=r.stateNode;o2(f,r.type,u,i),f[Zt]=i}catch(y){Tt(r,r.return,y)}}function G0(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ii(r.type)||r.tag===4}function ip(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||G0(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&&Ii(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 sp(r,i,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(r),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Pa));else if(f!==4&&(f===27&&Ii(r.type)&&(u=r.stateNode,i=null),r=r.child,r!==null))for(sp(r,i,u),r=r.sibling;r!==null;)sp(r,i,u),r=r.sibling}function Td(r,i,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?u.insertBefore(r,i):u.appendChild(r);else if(f!==4&&(f===27&&Ii(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(Td(r,i,u),r=r.sibling;r!==null;)Td(r,i,u),r=r.sibling}function V0(r){var i=r.stateNode,u=r.memoizedProps;try{for(var f=r.type,y=i.attributes;y.length;)i.removeAttributeNode(y[0]);Hn(i,f,u),i[dn]=r,i[Zt]=u}catch(v){Tt(r,r.return,v)}}var Qa=!1,xn=!1,lp=!1,Q0=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function $A(r,i){if(r=r.containerInfo,_p=Yd,r=sx(r),em(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var y=f.anchorOffset,v=f.focusNode;f=f.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var j=0,A=-1,H=-1,ee=0,ce=0,he=r,ne=null;t:for(;;){for(var oe;he!==u||y!==0&&he.nodeType!==3||(A=j+y),he!==v||f!==0&&he.nodeType!==3||(H=j+f),he.nodeType===3&&(j+=he.nodeValue.length),(oe=he.firstChild)!==null;)ne=he,he=oe;for(;;){if(he===r)break t;if(ne===u&&++ee===y&&(A=j),ne===v&&++ce===f&&(H=j),(oe=he.nextSibling)!==null)break;he=ne,ne=he.parentNode}he=oe}u=A===-1||H===-1?null:{start:A,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for(Tp={focusedElem:r,selectionRange:u},Yd=!1,Dn=i;Dn!==null;)if(i=Dn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Dn=r;else for(;Dn!==null;){switch(i=Dn,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(u=0;u<r.length;u++)y=r[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,u=i,y=v.memoizedProps,v=v.memoizedState,f=u.stateNode;try{var Te=Rs(u.type,y);r=f.getSnapshotBeforeUpdate(Te,v),f.__reactInternalSnapshotBeforeUpdate=r}catch(Ze){Tt(u,u.return,Ze)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,u=r.nodeType,u===9)Op(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Op(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,Dn=r;break}Dn=i.return}}function K0(r,i,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:Ya(r,u),f&4&&fu(5,u);break;case 1:if(Ya(r,u),f&4)if(r=u.stateNode,i===null)try{r.componentDidMount()}catch(j){Tt(u,u.return,j)}else{var y=Rs(u.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(y,i,r.__reactInternalSnapshotBeforeUpdate)}catch(j){Tt(u,u.return,j)}}f&64&&H0(u),f&512&&hu(u,u.return);break;case 3:if(Ya(r,u),f&64&&(r=u.updateQueue,r!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{zx(r,i)}catch(j){Tt(u,u.return,j)}}break;case 27:i===null&&f&4&&V0(u);case 26:case 5:Ya(r,u),i===null&&f&4&&Z0(u),f&512&&hu(u,u.return);break;case 12:Ya(r,u);break;case 31:Ya(r,u),f&4&&W0(r,u);break;case 13:Ya(r,u),f&4&&J0(r,u),f&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=YA.bind(null,u),g2(r,u))));break;case 22:if(f=u.memoizedState!==null||Qa,!f){i=i!==null&&i.memoizedState!==null||xn,y=Qa;var v=xn;Qa=f,(xn=i)&&!v?Xa(r,u,(u.subtreeFlags&8772)!==0):Ya(r,u),Qa=y,xn=v}break;case 30:break;default:Ya(r,u)}}function Y0(r){var i=r.alternate;i!==null&&(r.alternate=null,Y0(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Pe(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 Gt=null,pr=!1;function Ka(r,i,u){for(u=u.child;u!==null;)X0(r,i,u),u=u.sibling}function X0(r,i,u){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Ht,u)}catch{}switch(u.tag){case 26:xn||Ca(u,i),Ka(r,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:xn||Ca(u,i);var f=Gt,y=pr;Ii(u.type)&&(Gt=u.stateNode,pr=!1),Ka(r,i,u),Su(u.stateNode),Gt=f,pr=y;break;case 5:xn||Ca(u,i);case 6:if(f=Gt,y=pr,Gt=null,Ka(r,i,u),Gt=f,pr=y,Gt!==null)if(pr)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(u.stateNode)}catch(v){Tt(u,i,v)}else try{Gt.removeChild(u.stateNode)}catch(v){Tt(u,i,v)}break;case 18:Gt!==null&&(pr?(r=Gt,Hw(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),Ul(r)):Hw(Gt,u.stateNode));break;case 4:f=Gt,y=pr,Gt=u.stateNode.containerInfo,pr=!0,Ka(r,i,u),Gt=f,pr=y;break;case 0:case 11:case 14:case 15:Ti(2,u,i),xn||Ti(4,u,i),Ka(r,i,u);break;case 1:xn||(Ca(u,i),f=u.stateNode,typeof f.componentWillUnmount=="function"&&q0(u,i,f)),Ka(r,i,u);break;case 21:Ka(r,i,u);break;case 22:xn=(f=xn)||u.memoizedState!==null,Ka(r,i,u),xn=f;break;default:Ka(r,i,u)}}function W0(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Ul(r)}catch(u){Tt(i,i.return,u)}}}function J0(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Ul(r)}catch(u){Tt(i,i.return,u)}}function FA(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Q0),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Q0),i;default:throw Error(a(435,r.tag))}}function Ad(r,i){var u=FA(r);i.forEach(function(f){if(!u.has(f)){u.add(f);var y=XA.bind(null,r,f);f.then(y,y)}})}function gr(r,i){var u=i.deletions;if(u!==null)for(var f=0;f<u.length;f++){var y=u[f],v=r,j=i,A=j;e:for(;A!==null;){switch(A.tag){case 27:if(Ii(A.type)){Gt=A.stateNode,pr=!1;break e}break;case 5:Gt=A.stateNode,pr=!1;break e;case 3:case 4:Gt=A.stateNode.containerInfo,pr=!0;break e}A=A.return}if(Gt===null)throw Error(a(160));X0(v,j,y),Gt=null,pr=!1,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)ew(i,r),i=i.sibling}var ga=null;function ew(r,i){var u=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:gr(i,r),yr(r),f&4&&(Ti(3,r,r.return),fu(3,r),Ti(5,r,r.return));break;case 1:gr(i,r),yr(r),f&512&&(xn||u===null||Ca(u,u.return)),f&64&&Qa&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var y=ga;if(gr(i,r),yr(r),f&512&&(xn||u===null||Ca(u,u.return)),f&4){var v=u!==null?u.memoizedState:null;if(f=r.memoizedState,u===null)if(f===null)if(r.stateNode===null){e:{f=r.type,u=r.memoizedProps,y=y.ownerDocument||y;t:switch(f){case"title":v=y.getElementsByTagName("title")[0],(!v||v[vi]||v[dn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=y.createElement(f),y.head.insertBefore(v,y.querySelector("head > title"))),Hn(v,f,u),v[dn]=r,ht(v),f=v;break e;case"link":var j=eS("link","href",y).get(f+(u.href||""));if(j){for(var A=0;A<j.length;A++)if(v=j[A],v.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&v.getAttribute("rel")===(u.rel==null?null:u.rel)&&v.getAttribute("title")===(u.title==null?null:u.title)&&v.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){j.splice(A,1);break t}}v=y.createElement(f),Hn(v,f,u),y.head.appendChild(v);break;case"meta":if(j=eS("meta","content",y).get(f+(u.content||""))){for(A=0;A<j.length;A++)if(v=j[A],v.getAttribute("content")===(u.content==null?null:""+u.content)&&v.getAttribute("name")===(u.name==null?null:u.name)&&v.getAttribute("property")===(u.property==null?null:u.property)&&v.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&v.getAttribute("charset")===(u.charSet==null?null:u.charSet)){j.splice(A,1);break t}}v=y.createElement(f),Hn(v,f,u),y.head.appendChild(v);break;default:throw Error(a(468,f))}v[dn]=r,ht(v),f=v}r.stateNode=f}else tS(y,r.type,r.stateNode);else r.stateNode=Jw(y,f,r.memoizedProps);else v!==f?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,f===null?tS(y,r.type,r.stateNode):Jw(y,f,r.memoizedProps)):f===null&&r.stateNode!==null&&ap(r,r.memoizedProps,u.memoizedProps)}break;case 27:gr(i,r),yr(r),f&512&&(xn||u===null||Ca(u,u.return)),u!==null&&f&4&&ap(r,r.memoizedProps,u.memoizedProps);break;case 5:if(gr(i,r),yr(r),f&512&&(xn||u===null||Ca(u,u.return)),r.flags&32){y=r.stateNode;try{ol(y,"")}catch(Te){Tt(r,r.return,Te)}}f&4&&r.stateNode!=null&&(y=r.memoizedProps,ap(r,y,u!==null?u.memoizedProps:y)),f&1024&&(lp=!0);break;case 6:if(gr(i,r),yr(r),f&4){if(r.stateNode===null)throw Error(a(162));f=r.memoizedProps,u=r.stateNode;try{u.nodeValue=f}catch(Te){Tt(r,r.return,Te)}}break;case 3:if(Gd=null,y=ga,ga=qd(i.containerInfo),gr(i,r),ga=y,yr(r),f&4&&u!==null&&u.memoizedState.isDehydrated)try{Ul(i.containerInfo)}catch(Te){Tt(r,r.return,Te)}lp&&(lp=!1,tw(r));break;case 4:f=ga,ga=qd(r.stateNode.containerInfo),gr(i,r),yr(r),ga=f;break;case 12:gr(i,r),yr(r);break;case 31:gr(i,r),yr(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Ad(r,f)));break;case 13:gr(i,r),yr(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Od=un()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Ad(r,f)));break;case 22:y=r.memoizedState!==null;var H=u!==null&&u.memoizedState!==null,ee=Qa,ce=xn;if(Qa=ee||y,xn=ce||H,gr(i,r),xn=ce,Qa=ee,yr(r),f&8192)e:for(i=r.stateNode,i._visibility=y?i._visibility&-2:i._visibility|1,y&&(u===null||H||Qa||xn||Os(r)),u=null,i=r;;){if(i.tag===5||i.tag===26){if(u===null){H=u=i;try{if(v=H.stateNode,y)j=v.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{A=H.stateNode;var he=H.memoizedProps.style,ne=he!=null&&he.hasOwnProperty("display")?he.display:null;A.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Te){Tt(H,H.return,Te)}}}else if(i.tag===6){if(u===null){H=i;try{H.stateNode.nodeValue=y?"":H.memoizedProps}catch(Te){Tt(H,H.return,Te)}}}else if(i.tag===18){if(u===null){H=i;try{var oe=H.stateNode;y?qw(oe,!0):qw(H.stateNode,!1)}catch(Te){Tt(H,H.return,Te)}}}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;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=r.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,Ad(r,u))));break;case 19:gr(i,r),yr(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Ad(r,f)));break;case 30:break;case 21:break;default:gr(i,r),yr(r)}}function yr(r){var i=r.flags;if(i&2){try{for(var u,f=r.return;f!==null;){if(G0(f)){u=f;break}f=f.return}if(u==null)throw Error(a(160));switch(u.tag){case 27:var y=u.stateNode,v=ip(r);Td(r,v,y);break;case 5:var j=u.stateNode;u.flags&32&&(ol(j,""),u.flags&=-33);var A=ip(r);Td(r,A,j);break;case 3:case 4:var H=u.stateNode.containerInfo,ee=ip(r);sp(r,ee,H);break;default:throw Error(a(161))}}catch(ce){Tt(r,r.return,ce)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function tw(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;tw(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;)K0(r,i.alternate,i),i=i.sibling}function Os(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ti(4,i,i.return),Os(i);break;case 1:Ca(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&q0(i,i.return,u),Os(i);break;case 27:Su(i.stateNode);case 26:case 5:Ca(i,i.return),Os(i);break;case 22:i.memoizedState===null&&Os(i);break;case 30:Os(i);break;default:Os(i)}r=r.sibling}}function Xa(r,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,y=r,v=i,j=v.flags;switch(v.tag){case 0:case 11:case 15:Xa(y,v,u),fu(4,v);break;case 1:if(Xa(y,v,u),f=v,y=f.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ee){Tt(f,f.return,ee)}if(f=v,y=f.updateQueue,y!==null){var A=f.stateNode;try{var H=y.shared.hiddenCallbacks;if(H!==null)for(y.shared.hiddenCallbacks=null,y=0;y<H.length;y++)Ox(H[y],A)}catch(ee){Tt(f,f.return,ee)}}u&&j&64&&H0(v),hu(v,v.return);break;case 27:V0(v);case 26:case 5:Xa(y,v,u),u&&f===null&&j&4&&Z0(v),hu(v,v.return);break;case 12:Xa(y,v,u);break;case 31:Xa(y,v,u),u&&j&4&&W0(y,v);break;case 13:Xa(y,v,u),u&&j&4&&J0(y,v);break;case 22:v.memoizedState===null&&Xa(y,v,u),hu(v,v.return);break;case 30:break;default:Xa(y,v,u)}i=i.sibling}}function op(r,i){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&Jo(u))}function up(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Jo(r))}function ya(r,i,u,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)nw(r,i,u,f),i=i.sibling}function nw(r,i,u,f){var y=i.flags;switch(i.tag){case 0:case 11:case 15:ya(r,i,u,f),y&2048&&fu(9,i);break;case 1:ya(r,i,u,f);break;case 3:ya(r,i,u,f),y&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Jo(r)));break;case 12:if(y&2048){ya(r,i,u,f),r=i.stateNode;try{var v=i.memoizedProps,j=v.id,A=v.onPostCommit;typeof A=="function"&&A(j,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(H){Tt(i,i.return,H)}}else ya(r,i,u,f);break;case 31:ya(r,i,u,f);break;case 13:ya(r,i,u,f);break;case 23:break;case 22:v=i.stateNode,j=i.alternate,i.memoizedState!==null?v._visibility&2?ya(r,i,u,f):mu(r,i):v._visibility&2?ya(r,i,u,f):(v._visibility|=2,_l(r,i,u,f,(i.subtreeFlags&10256)!==0||!1)),y&2048&&op(j,i);break;case 24:ya(r,i,u,f),y&2048&&up(i.alternate,i);break;default:ya(r,i,u,f)}}function _l(r,i,u,f,y){for(y=y&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,j=i,A=u,H=f,ee=j.flags;switch(j.tag){case 0:case 11:case 15:_l(v,j,A,H,y),fu(8,j);break;case 23:break;case 22:var ce=j.stateNode;j.memoizedState!==null?ce._visibility&2?_l(v,j,A,H,y):mu(v,j):(ce._visibility|=2,_l(v,j,A,H,y)),y&&ee&2048&&op(j.alternate,j);break;case 24:_l(v,j,A,H,y),y&&ee&2048&&up(j.alternate,j);break;default:_l(v,j,A,H,y)}i=i.sibling}}function mu(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=r,f=i,y=f.flags;switch(f.tag){case 22:mu(u,f),y&2048&&op(f.alternate,f);break;case 24:mu(u,f),y&2048&&up(f.alternate,f);break;default:mu(u,f)}i=i.sibling}}var pu=8192;function Tl(r,i,u){if(r.subtreeFlags&pu)for(r=r.child;r!==null;)rw(r,i,u),r=r.sibling}function rw(r,i,u){switch(r.tag){case 26:Tl(r,i,u),r.flags&pu&&r.memoizedState!==null&&_2(u,ga,r.memoizedState,r.memoizedProps);break;case 5:Tl(r,i,u);break;case 3:case 4:var f=ga;ga=qd(r.stateNode.containerInfo),Tl(r,i,u),ga=f;break;case 22:r.memoizedState===null&&(f=r.alternate,f!==null&&f.memoizedState!==null?(f=pu,pu=16777216,Tl(r,i,u),pu=f):Tl(r,i,u));break;default:Tl(r,i,u)}}function aw(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 gu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];Dn=f,sw(f,r)}aw(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)iw(r),r=r.sibling}function iw(r){switch(r.tag){case 0:case 11:case 15:gu(r),r.flags&2048&&Ti(9,r,r.return);break;case 3:gu(r);break;case 12:gu(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Rd(r)):gu(r);break;default:gu(r)}}function Rd(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];Dn=f,sw(f,r)}aw(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ti(8,i,i.return),Rd(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Rd(i));break;default:Rd(i)}r=r.sibling}}function sw(r,i){for(;Dn!==null;){var u=Dn;switch(u.tag){case 0:case 11:case 15:Ti(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Jo(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,Dn=f;else e:for(u=r;Dn!==null;){f=Dn;var y=f.sibling,v=f.return;if(Y0(f),f===u){Dn=null;break e}if(y!==null){y.return=v,Dn=y;break e}Dn=v}}}var HA={getCacheForType:function(r){var i=$n(yn),u=i.data.get(r);return u===void 0&&(u=r(),i.data.set(r,u)),u},cacheSignal:function(){return $n(yn).controller.signal}},qA=typeof WeakMap=="function"?WeakMap:Map,Ct=0,Mt=null,st=null,ct=0,_t=0,Dr=null,Ai=!1,Al=!1,cp=!1,Wa=0,nn=0,Ri=0,zs=0,dp=0,Ir=0,Rl=0,yu=null,vr=null,fp=!1,Od=0,lw=0,zd=1/0,Md=null,Oi=null,Nn=0,zi=null,Ol=null,Ja=0,hp=0,mp=null,ow=null,vu=0,pp=null;function Lr(){return(Ct&2)!==0&&ct!==0?ct&-ct:Z.T!==null?wp():Lo()}function uw(){if(Ir===0)if((ct&536870912)===0||mt){var r=ha;ha<<=1,(ha&3932160)===0&&(ha=262144),Ir=r}else Ir=536870912;return r=zr.current,r!==null&&(r.flags|=32),Ir}function br(r,i,u){(r===Mt&&(_t===2||_t===9)||r.cancelPendingCommit!==null)&&(zl(r,0),Mi(r,ct,Ir,!1)),pn(r,u),((Ct&2)===0||r!==Mt)&&(r===Mt&&((Ct&2)===0&&(zs|=u),nn===4&&Mi(r,ct,Ir,!1)),Ea(r))}function cw(r,i,u){if((Ct&6)!==0)throw Error(a(327));var f=!u&&(i&127)===0&&(i&r.expiredLanes)===0||Sa(r,i),y=f?VA(r,i):yp(r,i,!0),v=f;do{if(y===0){Al&&!f&&Mi(r,i,0,!1);break}else{if(u=r.current.alternate,v&&!ZA(u)){y=yp(r,i,!1),v=!1;continue}if(y===2){if(v=i,r.errorRecoveryDisabledLanes&v)var j=0;else j=r.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var A=r;y=yu;var H=A.current.memoizedState.isDehydrated;if(H&&(zl(A,j).flags|=256),j=yp(A,j,!1),j!==2){if(cp&&!H){A.errorRecoveryDisabledLanes|=v,zs|=v,y=4;break e}v=vr,vr=y,v!==null&&(vr===null?vr=v:vr.push.apply(vr,v))}y=j}if(v=!1,y!==2)continue}}if(y===1){zl(r,0),Mi(r,i,0,!0);break}e:{switch(f=r,v=y,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Mi(f,i,Ir,!Ai);break e;case 2:vr=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(y=Od+300-un(),10<y)){if(Mi(f,i,Ir,!Ai),Da(f,0,!0)!==0)break e;Ja=i,f.timeoutHandle=$w(dw.bind(null,f,u,vr,Md,fp,i,Ir,zs,Rl,Ai,v,"Throttled",-0,0),y);break e}dw(f,u,vr,Md,fp,i,Ir,zs,Rl,Ai,v,null,-0,0)}}break}while(!0);Ea(r)}function dw(r,i,u,f,y,v,j,A,H,ee,ce,he,ne,oe){if(r.timeoutHandle=-1,he=i.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pa},rw(i,v,he);var Te=(v&62914560)===v?Od-un():(v&4194048)===v?lw-un():0;if(Te=T2(he,Te),Te!==null){Ja=v,r.cancelPendingCommit=Te(bw.bind(null,r,i,v,u,f,y,j,A,H,ce,he,null,ne,oe)),Mi(r,v,j,!ee);return}}bw(r,i,v,u,f,y,j,A,H)}function ZA(r){for(var i=r;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var y=u[f],v=y.getSnapshot;y=y.value;try{if(!Rr(v(),y))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;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 Mi(r,i,u,f){i&=~dp,i&=~zs,r.suspendedLanes|=i,r.pingedLanes&=~i,f&&(r.warmLanes|=i),f=r.expirationTimes;for(var y=i;0<y;){var v=31-it(y),j=1<<v;f[v]=-1,y&=~j}u!==0&&yi(r,u,i)}function Dd(){return(Ct&6)===0?(bu(0),!1):!0}function gp(){if(st!==null){if(_t===0)var r=st.return;else r=st,Fa=js=null,Om(r),kl=null,tu=0,r=st;for(;r!==null;)F0(r.alternate,r),r=r.return;st=null}}function zl(r,i){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,d2(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),Ja=0,gp(),Mt=r,st=u=Ba(r.current,null),ct=i,_t=0,Dr=null,Ai=!1,Al=Sa(r,i),cp=!1,Rl=Ir=dp=zs=Ri=nn=0,vr=yu=null,fp=!1,(i&8)!==0&&(i|=i&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=i;0<f;){var y=31-it(f),v=1<<y;i|=r[y],f&=~v}return Wa=i,nd(),u}function fw(r,i){Ye=null,Z.H=uu,i===Sl||i===cd?(i=_x(),_t=3):i===xm?(i=_x(),_t=4):_t=i===Qm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Dr=i,st===null&&(nn=1,jd(r,Vr(i,r.current)))}function hw(){var r=zr.current;return r===null?!0:(ct&4194048)===ct?Xr===null:(ct&62914560)===ct||(ct&536870912)!==0?r===Xr:!1}function mw(){var r=Z.H;return Z.H=uu,r===null?uu:r}function pw(){var r=Z.A;return Z.A=HA,r}function Id(){nn=4,Ai||(ct&4194048)!==ct&&zr.current!==null||(Al=!0),(Ri&134217727)===0&&(zs&134217727)===0||Mt===null||Mi(Mt,ct,Ir,!1)}function yp(r,i,u){var f=Ct;Ct|=2;var y=mw(),v=pw();(Mt!==r||ct!==i)&&(Md=null,zl(r,i)),i=!1;var j=nn;e:do try{if(_t!==0&&st!==null){var A=st,H=Dr;switch(_t){case 8:gp(),j=6;break e;case 3:case 2:case 9:case 6:zr.current===null&&(i=!0);var ee=_t;if(_t=0,Dr=null,Ml(r,A,H,ee),u&&Al){j=0;break e}break;default:ee=_t,_t=0,Dr=null,Ml(r,A,H,ee)}}GA(),j=nn;break}catch(ce){fw(r,ce)}while(!0);return i&&r.shellSuspendCounter++,Fa=js=null,Ct=f,Z.H=y,Z.A=v,st===null&&(Mt=null,ct=0,nd()),j}function GA(){for(;st!==null;)gw(st)}function VA(r,i){var u=Ct;Ct|=2;var f=mw(),y=pw();Mt!==r||ct!==i?(Md=null,zd=un()+500,zl(r,i)):Al=Sa(r,i);e:do try{if(_t!==0&&st!==null){i=st;var v=Dr;t:switch(_t){case 1:_t=0,Dr=null,Ml(r,i,v,1);break;case 2:case 9:if(Ex(v)){_t=0,Dr=null,yw(i);break}i=function(){_t!==2&&_t!==9||Mt!==r||(_t=7),Ea(r)},v.then(i,i);break e;case 3:_t=7;break e;case 4:_t=5;break e;case 7:Ex(v)?(_t=0,Dr=null,yw(i)):(_t=0,Dr=null,Ml(r,i,v,7));break;case 5:var j=null;switch(st.tag){case 26:j=st.memoizedState;case 5:case 27:var A=st;if(j?nS(j):A.stateNode.complete){_t=0,Dr=null;var H=A.sibling;if(H!==null)st=H;else{var ee=A.return;ee!==null?(st=ee,Ld(ee)):st=null}break t}}_t=0,Dr=null,Ml(r,i,v,5);break;case 6:_t=0,Dr=null,Ml(r,i,v,6);break;case 8:gp(),nn=6;break e;default:throw Error(a(462))}}QA();break}catch(ce){fw(r,ce)}while(!0);return Fa=js=null,Z.H=f,Z.A=y,Ct=u,st!==null?0:(Mt=null,ct=0,nd(),nn)}function QA(){for(;st!==null&&!pi();)gw(st)}function gw(r){var i=B0(r.alternate,r,Wa);r.memoizedProps=r.pendingProps,i===null?Ld(r):st=i}function yw(r){var i=r,u=i.alternate;switch(i.tag){case 15:case 0:i=M0(u,i,i.pendingProps,i.type,void 0,ct);break;case 11:i=M0(u,i,i.pendingProps,i.type.render,i.ref,ct);break;case 5:Om(i);default:F0(u,i),i=st=px(i,Wa),i=B0(u,i,Wa)}r.memoizedProps=r.pendingProps,i===null?Ld(r):st=i}function Ml(r,i,u,f){Fa=js=null,Om(i),kl=null,tu=0;var y=i.return;try{if(IA(r,y,i,u,ct)){nn=1,jd(r,Vr(u,r.current)),st=null;return}}catch(v){if(y!==null)throw st=y,v;nn=1,jd(r,Vr(u,r.current)),st=null;return}i.flags&32768?(mt||f===1?r=!0:Al||(ct&536870912)!==0?r=!1:(Ai=r=!0,(f===2||f===9||f===3||f===6)&&(f=zr.current,f!==null&&f.tag===13&&(f.flags|=16384))),vw(i,r)):Ld(i)}function Ld(r){var i=r;do{if((i.flags&32768)!==0){vw(i,Ai);return}r=i.return;var u=UA(i.alternate,i,Wa);if(u!==null){st=u;return}if(i=i.sibling,i!==null){st=i;return}st=i=r}while(i!==null);nn===0&&(nn=5)}function vw(r,i){do{var u=BA(r.alternate,r);if(u!==null){u.flags&=32767,st=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(r=r.sibling,r!==null)){st=r;return}st=r=u}while(r!==null);nn=6,st=null}function bw(r,i,u,f,y,v,j,A,H){r.cancelPendingCommit=null;do Pd();while(Nn!==0);if((Ct&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=im,Ar(r,u,v,j,A,H),r===Mt&&(st=Mt=null,ct=0),Ol=i,zi=r,Ja=u,hp=v,mp=y,ow=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,WA($e,function(){return jw(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=Z.T,Z.T=null,y=te.p,te.p=2,j=Ct,Ct|=4;try{$A(r,i,u)}finally{Ct=j,te.p=y,Z.T=f}}Nn=1,xw(),ww(),Sw()}}function xw(){if(Nn===1){Nn=0;var r=zi,i=Ol,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=Z.T,Z.T=null;var f=te.p;te.p=2;var y=Ct;Ct|=4;try{ew(i,r);var v=Tp,j=sx(r.containerInfo),A=v.focusedElem,H=v.selectionRange;if(j!==A&&A&&A.ownerDocument&&ix(A.ownerDocument.documentElement,A)){if(H!==null&&em(A)){var ee=H.start,ce=H.end;if(ce===void 0&&(ce=ee),"selectionStart"in A)A.selectionStart=ee,A.selectionEnd=Math.min(ce,A.value.length);else{var he=A.ownerDocument||document,ne=he&&he.defaultView||window;if(ne.getSelection){var oe=ne.getSelection(),Te=A.textContent.length,Ze=Math.min(H.start,Te),zt=H.end===void 0?Ze:Math.min(H.end,Te);!oe.extend&&Ze>zt&&(j=zt,zt=Ze,Ze=j);var Y=ax(A,Ze),Q=ax(A,zt);if(Y&&Q&&(oe.rangeCount!==1||oe.anchorNode!==Y.node||oe.anchorOffset!==Y.offset||oe.focusNode!==Q.node||oe.focusOffset!==Q.offset)){var J=he.createRange();J.setStart(Y.node,Y.offset),oe.removeAllRanges(),Ze>zt?(oe.addRange(J),oe.extend(Q.node,Q.offset)):(J.setEnd(Q.node,Q.offset),oe.addRange(J))}}}}for(he=[],oe=A;oe=oe.parentNode;)oe.nodeType===1&&he.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<he.length;A++){var fe=he[A];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Yd=!!_p,Tp=_p=null}finally{Ct=y,te.p=f,Z.T=u}}r.current=i,Nn=2}}function ww(){if(Nn===2){Nn=0;var r=zi,i=Ol,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=Z.T,Z.T=null;var f=te.p;te.p=2;var y=Ct;Ct|=4;try{K0(r,i.alternate,i)}finally{Ct=y,te.p=f,Z.T=u}}Nn=3}}function Sw(){if(Nn===4||Nn===3){Nn=0,gi();var r=zi,i=Ol,u=Ja,f=ow;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Nn=5:(Nn=0,Ol=zi=null,kw(r,r.pendingLanes));var y=r.pendingLanes;if(y===0&&(Oi=null),ma(u),i=i.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Ht,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=Z.T,y=te.p,te.p=2,Z.T=null;try{for(var v=r.onRecoverableError,j=0;j<f.length;j++){var A=f[j];v(A.value,{componentStack:A.stack})}}finally{Z.T=i,te.p=y}}(Ja&3)!==0&&Pd(),Ea(r),y=r.pendingLanes,(u&261930)!==0&&(y&42)!==0?r===pp?vu++:(vu=0,pp=r):vu=0,bu(0)}}function kw(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Jo(i)))}function Pd(){return xw(),ww(),Sw(),jw()}function jw(){if(Nn!==5)return!1;var r=zi,i=hp;hp=0;var u=ma(Ja),f=Z.T,y=te.p;try{te.p=32>u?32:u,Z.T=null,u=mp,mp=null;var v=zi,j=Ja;if(Nn=0,Ol=zi=null,Ja=0,(Ct&6)!==0)throw Error(a(331));var A=Ct;if(Ct|=4,iw(v.current),nw(v,v.current,j,u),Ct=A,bu(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Ht,v)}catch{}return!0}finally{te.p=y,Z.T=f,kw(r,i)}}function Cw(r,i,u){i=Vr(u,i),i=Vm(r.stateNode,i,2),r=Ei(r,i,2),r!==null&&(pn(r,2),Ea(r))}function Tt(r,i,u){if(r.tag===3)Cw(r,r,u);else for(;i!==null;){if(i.tag===3){Cw(i,r,u);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Oi===null||!Oi.has(f))){r=Vr(u,r),u=E0(2),f=Ei(i,u,2),f!==null&&(N0(u,f,i,r),pn(f,2),Ea(f));break}}i=i.return}}function vp(r,i,u){var f=r.pingCache;if(f===null){f=r.pingCache=new qA;var y=new Set;f.set(i,y)}else y=f.get(i),y===void 0&&(y=new Set,f.set(i,y));y.has(u)||(cp=!0,y.add(u),r=KA.bind(null,r,i,u),i.then(r,r))}function KA(r,i,u){var f=r.pingCache;f!==null&&f.delete(i),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Mt===r&&(ct&u)===u&&(nn===4||nn===3&&(ct&62914560)===ct&&300>un()-Od?(Ct&2)===0&&zl(r,0):dp|=u,Rl===ct&&(Rl=0)),Ea(r)}function Ew(r,i){i===0&&(i=Ce()),r=ws(r,i),r!==null&&(pn(r,i),Ea(r))}function YA(r){var i=r.memoizedState,u=0;i!==null&&(u=i.retryLane),Ew(r,u)}function XA(r,i){var u=0;switch(r.tag){case 31:case 13:var f=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(a(314))}f!==null&&f.delete(i),Ew(r,u)}function WA(r,i){return Pn(r,i)}var Ud=null,Dl=null,bp=!1,Bd=!1,xp=!1,Di=0;function Ea(r){r!==Dl&&r.next===null&&(Dl===null?Ud=Dl=r:Dl=Dl.next=r),Bd=!0,bp||(bp=!0,e2())}function bu(r,i){if(!xp&&Bd){xp=!0;do for(var u=!1,f=Ud;f!==null;){if(r!==0){var y=f.pendingLanes;if(y===0)var v=0;else{var j=f.suspendedLanes,A=f.pingedLanes;v=(1<<31-it(42|r)+1)-1,v&=y&~(j&~A),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,Aw(f,v))}else v=ct,v=Da(f,f===Mt?v:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(v&3)===0||Sa(f,v)||(u=!0,Aw(f,v));f=f.next}while(u);xp=!1}}function JA(){Nw()}function Nw(){Bd=bp=!1;var r=0;Di!==0&&c2()&&(r=Di);for(var i=un(),u=null,f=Ud;f!==null;){var y=f.next,v=_w(f,i);v===0?(f.next=null,u===null?Ud=y:u.next=y,y===null&&(Dl=u)):(u=f,(r!==0||(v&3)!==0)&&(Bd=!0)),f=y}Nn!==0&&Nn!==5||bu(r),Di!==0&&(Di=0)}function _w(r,i){for(var u=r.suspendedLanes,f=r.pingedLanes,y=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var j=31-it(v),A=1<<j,H=y[j];H===-1?((A&u)===0||(A&f)!==0)&&(y[j]=qt(A,i)):H<=i&&(r.expiredLanes|=A),v&=~A}if(i=Mt,u=ct,u=Da(r,r===i?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,u===0||r===i&&(_t===2||_t===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&hr(f),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||Sa(r,u)){if(i=u&-u,i===r.callbackPriority)return i;switch(f!==null&&hr(f),ma(u)){case 2:case 8:u=ge;break;case 32:u=$e;break;case 268435456:u=at;break;default:u=$e}return f=Tw.bind(null,r),u=Pn(u,f),r.callbackPriority=i,r.callbackNode=u,i}return f!==null&&f!==null&&hr(f),r.callbackPriority=2,r.callbackNode=null,2}function Tw(r,i){if(Nn!==0&&Nn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(Pd()&&r.callbackNode!==u)return null;var f=ct;return f=Da(r,r===Mt?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(cw(r,f,i),_w(r,un()),r.callbackNode!=null&&r.callbackNode===u?Tw.bind(null,r):null)}function Aw(r,i){if(Pd())return null;cw(r,i,!0)}function e2(){f2(function(){(Ct&6)!==0?Pn(ue,JA):Nw()})}function wp(){if(Di===0){var r=xl;r===0&&(r=fa,fa<<=1,(fa&261888)===0&&(fa=256)),Di=r}return Di}function Rw(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Qc(""+r)}function Ow(r,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,r.id&&u.setAttribute("form",r.id),i.parentNode.insertBefore(u,i),r=new FormData(r),u.parentNode.removeChild(u),r}function t2(r,i,u,f,y){if(i==="submit"&&u&&u.stateNode===y){var v=Rw((y[Zt]||null).action),j=f.submitter;j&&(i=(i=j[Zt]||null)?Rw(i.formAction):j.getAttribute("formAction"),i!==null&&(v=i,j=null));var A=new Wc("action","action",null,f,y);r.push({event:A,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Di!==0){var H=j?Ow(y,j):new FormData(y);$m(u,{pending:!0,data:H,method:y.method,action:v},null,H)}}else typeof v=="function"&&(A.preventDefault(),H=j?Ow(y,j):new FormData(y),$m(u,{pending:!0,data:H,method:y.method,action:v},v,H))},currentTarget:y}]})}}for(var Sp=0;Sp<am.length;Sp++){var kp=am[Sp],n2=kp.toLowerCase(),r2=kp[0].toUpperCase()+kp.slice(1);pa(n2,"on"+r2)}pa(ux,"onAnimationEnd"),pa(cx,"onAnimationIteration"),pa(dx,"onAnimationStart"),pa("dblclick","onDoubleClick"),pa("focusin","onFocus"),pa("focusout","onBlur"),pa(bA,"onTransitionRun"),pa(xA,"onTransitionStart"),pa(wA,"onTransitionCancel"),pa(fx,"onTransitionEnd"),Mn("onMouseEnter",["mouseout","mouseover"]),Mn("onMouseLeave",["mouseout","mouseover"]),Mn("onPointerEnter",["pointerout","pointerover"]),Mn("onPointerLeave",["pointerout","pointerover"]),gn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gn("onBeforeInput",["compositionend","keypress","textInput","paste"]),gn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xu="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(" "),a2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xu));function zw(r,i){i=(i&4)!==0;for(var u=0;u<r.length;u++){var f=r[u],y=f.event;f=f.listeners;e:{var v=void 0;if(i)for(var j=f.length-1;0<=j;j--){var A=f[j],H=A.instance,ee=A.currentTarget;if(A=A.listener,H!==v&&y.isPropagationStopped())break e;v=A,y.currentTarget=ee;try{v(y)}catch(ce){td(ce)}y.currentTarget=null,v=H}else for(j=0;j<f.length;j++){if(A=f[j],H=A.instance,ee=A.currentTarget,A=A.listener,H!==v&&y.isPropagationStopped())break e;v=A,y.currentTarget=ee;try{v(y)}catch(ce){td(ce)}y.currentTarget=null,v=H}}}}function lt(r,i){var u=i[sl];u===void 0&&(u=i[sl]=new Set);var f=r+"__bubble";u.has(f)||(Mw(i,r,2,!1),u.add(f))}function jp(r,i,u){var f=0;i&&(f|=4),Mw(u,r,f,i)}var $d="_reactListening"+Math.random().toString(36).slice(2);function Cp(r){if(!r[$d]){r[$d]=!0,Xt.forEach(function(u){u!=="selectionchange"&&(a2.has(u)||jp(u,!1,r),jp(u,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[$d]||(i[$d]=!0,jp("selectionchange",!1,i))}}function Mw(r,i,u,f){switch(uS(i)){case 2:var y=O2;break;case 8:y=z2;break;default:y=Bp}u=y.bind(null,i,u,r),y=void 0,!Zh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),f?y!==void 0?r.addEventListener(i,u,{capture:!0,passive:y}):r.addEventListener(i,u,!0):y!==void 0?r.addEventListener(i,u,{passive:y}):r.addEventListener(i,u,!1)}function Ep(r,i,u,f,y){var v=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var j=f.tag;if(j===3||j===4){var A=f.stateNode.containerInfo;if(A===y)break;if(j===4)for(j=f.return;j!==null;){var H=j.tag;if((H===3||H===4)&&j.stateNode.containerInfo===y)return;j=j.return}for(;A!==null;){if(j=F(A),j===null)return;if(H=j.tag,H===5||H===6||H===26||H===27){f=v=j;continue e}A=A.parentNode}}f=f.return}Ub(function(){var ee=v,ce=Hh(u),he=[];e:{var ne=hx.get(r);if(ne!==void 0){var oe=Wc,Te=r;switch(r){case"keypress":if(Yc(u)===0)break e;case"keydown":case"keyup":oe=XT;break;case"focusin":Te="focus",oe=Kh;break;case"focusout":Te="blur",oe=Kh;break;case"beforeblur":case"afterblur":oe=Kh;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=Fb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=UT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=eA;break;case ux:case cx:case dx:oe=FT;break;case fx:oe=nA;break;case"scroll":case"scrollend":oe=LT;break;case"wheel":oe=aA;break;case"copy":case"cut":case"paste":oe=qT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=qb;break;case"toggle":case"beforetoggle":oe=sA}var Ze=(i&4)!==0,zt=!Ze&&(r==="scroll"||r==="scrollend"),Y=Ze?ne!==null?ne+"Capture":null:ne;Ze=[];for(var Q=ee,J;Q!==null;){var fe=Q;if(J=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||J===null||Y===null||(fe=Fo(Q,Y),fe!=null&&Ze.push(wu(Q,fe,J))),zt)break;Q=Q.return}0<Ze.length&&(ne=new oe(ne,Te,null,u,ce),he.push({event:ne,listeners:Ze}))}}if((i&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",oe=r==="mouseout"||r==="pointerout",ne&&u!==Fh&&(Te=u.relatedTarget||u.fromElement)&&(F(Te)||Te[Ia]))break e;if((oe||ne)&&(ne=ce.window===ce?ce:(ne=ce.ownerDocument)?ne.defaultView||ne.parentWindow:window,oe?(Te=u.relatedTarget||u.toElement,oe=ee,Te=Te?F(Te):null,Te!==null&&(zt=o(Te),Ze=Te.tag,Te!==zt||Ze!==5&&Ze!==27&&Ze!==6)&&(Te=null)):(oe=null,Te=ee),oe!==Te)){if(Ze=Fb,fe="onMouseLeave",Y="onMouseEnter",Q="mouse",(r==="pointerout"||r==="pointerover")&&(Ze=qb,fe="onPointerLeave",Y="onPointerEnter",Q="pointer"),zt=oe==null?ne:Ne(oe),J=Te==null?ne:Ne(Te),ne=new Ze(fe,Q+"leave",oe,u,ce),ne.target=zt,ne.relatedTarget=J,fe=null,F(ce)===ee&&(Ze=new Ze(Y,Q+"enter",Te,u,ce),Ze.target=J,Ze.relatedTarget=zt,fe=Ze),zt=fe,oe&&Te)t:{for(Ze=i2,Y=oe,Q=Te,J=0,fe=Y;fe;fe=Ze(fe))J++;fe=0;for(var Be=Q;Be;Be=Ze(Be))fe++;for(;0<J-fe;)Y=Ze(Y),J--;for(;0<fe-J;)Q=Ze(Q),fe--;for(;J--;){if(Y===Q||Q!==null&&Y===Q.alternate){Ze=Y;break t}Y=Ze(Y),Q=Ze(Q)}Ze=null}else Ze=null;oe!==null&&Dw(he,ne,oe,Ze,!1),Te!==null&&zt!==null&&Dw(he,zt,Te,Ze,!0)}}e:{if(ne=ee?Ne(ee):window,oe=ne.nodeName&&ne.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ne.type==="file")var kt=Wb;else if(Yb(ne))if(Jb)kt=gA;else{kt=mA;var De=hA}else oe=ne.nodeName,!oe||oe.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&$h(ee.elementType)&&(kt=Wb):kt=pA;if(kt&&(kt=kt(r,ee))){Xb(he,kt,u,ce);break e}De&&De(r,ne,ee),r==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Bh(ne,"number",ne.value)}switch(De=ee?Ne(ee):window,r){case"focusin":(Yb(De)||De.contentEditable==="true")&&(fl=De,tm=ee,Yo=null);break;case"focusout":Yo=tm=fl=null;break;case"mousedown":nm=!0;break;case"contextmenu":case"mouseup":case"dragend":nm=!1,lx(he,u,ce);break;case"selectionchange":if(vA)break;case"keydown":case"keyup":lx(he,u,ce)}var Xe;if(Xh)e:{switch(r){case"compositionstart":var dt="onCompositionStart";break e;case"compositionend":dt="onCompositionEnd";break e;case"compositionupdate":dt="onCompositionUpdate";break e}dt=void 0}else dl?Qb(r,u)&&(dt="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(dt="onCompositionStart");dt&&(Zb&&u.locale!=="ko"&&(dl||dt!=="onCompositionStart"?dt==="onCompositionEnd"&&dl&&(Xe=Bb()):(bi=ce,Gh="value"in bi?bi.value:bi.textContent,dl=!0)),De=Fd(ee,dt),0<De.length&&(dt=new Hb(dt,r,null,u,ce),he.push({event:dt,listeners:De}),Xe?dt.data=Xe:(Xe=Kb(u),Xe!==null&&(dt.data=Xe)))),(Xe=oA?uA(r,u):cA(r,u))&&(dt=Fd(ee,"onBeforeInput"),0<dt.length&&(De=new Hb("onBeforeInput","beforeinput",null,u,ce),he.push({event:De,listeners:dt}),De.data=Xe)),t2(he,r,ee,u,ce)}zw(he,i)})}function wu(r,i,u){return{instance:r,listener:i,currentTarget:u}}function Fd(r,i){for(var u=i+"Capture",f=[];r!==null;){var y=r,v=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||v===null||(y=Fo(r,u),y!=null&&f.unshift(wu(r,y,v)),y=Fo(r,i),y!=null&&f.push(wu(r,y,v))),r.tag===3)return f;r=r.return}return[]}function i2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Dw(r,i,u,f,y){for(var v=i._reactName,j=[];u!==null&&u!==f;){var A=u,H=A.alternate,ee=A.stateNode;if(A=A.tag,H!==null&&H===f)break;A!==5&&A!==26&&A!==27||ee===null||(H=ee,y?(ee=Fo(u,v),ee!=null&&j.unshift(wu(u,ee,H))):y||(ee=Fo(u,v),ee!=null&&j.push(wu(u,ee,H)))),u=u.return}j.length!==0&&r.push({event:i,listeners:j})}var s2=/\r\n?/g,l2=/\u0000|\uFFFD/g;function Iw(r){return(typeof r=="string"?r:""+r).replace(s2,`
|
|
49
|
+
`).replace(l2,"")}function Lw(r,i){return i=Iw(i),Iw(r)===i}function Ot(r,i,u,f,y,v){switch(u){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||ol(r,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&ol(r,""+f);break;case"className":Gc(r,"class",f);break;case"tabIndex":Gc(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Gc(r,u,f);break;case"style":Lb(r,f,v);break;case"data":if(i!=="object"){Gc(r,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||u!=="href")){r.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(u);break}f=Qc(""+f),r.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){r.setAttribute(u,"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"&&(u==="formAction"?(i!=="input"&&Ot(r,i,"name",y.name,y,null),Ot(r,i,"formEncType",y.formEncType,y,null),Ot(r,i,"formMethod",y.formMethod,y,null),Ot(r,i,"formTarget",y.formTarget,y,null)):(Ot(r,i,"encType",y.encType,y,null),Ot(r,i,"method",y.method,y,null),Ot(r,i,"target",y.target,y,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(u);break}f=Qc(""+f),r.setAttribute(u,f);break;case"onClick":f!=null&&(r.onclick=Pa);break;case"onScroll":f!=null&<("scroll",r);break;case"onScrollEnd":f!=null&<("scrollend",r);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(a(60));r.innerHTML=u}}break;case"multiple":r.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":r.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){r.removeAttribute("xlink:href");break}u=Qc(""+f),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(u,""+f):r.removeAttribute(u);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":f&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":f===!0?r.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(u,f):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(u,f):r.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(u):r.setAttribute(u,f);break;case"popover":lt("beforetoggle",r),lt("toggle",r),Zc(r,"popover",f);break;case"xlinkActuate":La(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":La(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":La(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":La(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":La(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":La(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":La(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":La(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":La(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Zc(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=DT.get(u)||u,Zc(r,u,f))}}function Np(r,i,u,f,y,v){switch(u){case"style":Lb(r,f,v);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(a(60));r.innerHTML=u}}break;case"children":typeof f=="string"?ol(r,f):(typeof f=="number"||typeof f=="bigint")&&ol(r,""+f);break;case"onScroll":f!=null&<("scroll",r);break;case"onScrollEnd":f!=null&<("scrollend",r);break;case"onClick":f!=null&&(r.onclick=Pa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Un.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),i=u.slice(2,y?u.length-7:void 0),v=r[Zt]||null,v=v!=null?v[u]:null,typeof v=="function"&&r.removeEventListener(i,v,y),typeof f=="function")){typeof v!="function"&&v!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(i,f,y);break e}u in r?r[u]=f:f===!0?r.setAttribute(u,""):Zc(r,u,f)}}}function Hn(r,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":lt("error",r),lt("load",r);var f=!1,y=!1,v;for(v in u)if(u.hasOwnProperty(v)){var j=u[v];if(j!=null)switch(v){case"src":f=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ot(r,i,v,j,u,null)}}y&&Ot(r,i,"srcSet",u.srcSet,u,null),f&&Ot(r,i,"src",u.src,u,null);return;case"input":lt("invalid",r);var A=v=j=y=null,H=null,ee=null;for(f in u)if(u.hasOwnProperty(f)){var ce=u[f];if(ce!=null)switch(f){case"name":y=ce;break;case"type":j=ce;break;case"checked":H=ce;break;case"defaultChecked":ee=ce;break;case"value":v=ce;break;case"defaultValue":A=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(a(137,i));break;default:Ot(r,i,f,ce,u,null)}}zb(r,v,A,H,ee,j,y,!1);return;case"select":lt("invalid",r),f=j=v=null;for(y in u)if(u.hasOwnProperty(y)&&(A=u[y],A!=null))switch(y){case"value":v=A;break;case"defaultValue":j=A;break;case"multiple":f=A;default:Ot(r,i,y,A,u,null)}i=v,u=j,r.multiple=!!f,i!=null?ll(r,!!f,i,!1):u!=null&&ll(r,!!f,u,!0);return;case"textarea":lt("invalid",r),v=y=f=null;for(j in u)if(u.hasOwnProperty(j)&&(A=u[j],A!=null))switch(j){case"value":f=A;break;case"defaultValue":y=A;break;case"children":v=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(a(91));break;default:Ot(r,i,j,A,u,null)}Db(r,f,y,v);return;case"option":for(H in u)if(u.hasOwnProperty(H)&&(f=u[H],f!=null))switch(H){case"selected":r.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Ot(r,i,H,f,u,null)}return;case"dialog":lt("beforetoggle",r),lt("toggle",r),lt("cancel",r),lt("close",r);break;case"iframe":case"object":lt("load",r);break;case"video":case"audio":for(f=0;f<xu.length;f++)lt(xu[f],r);break;case"image":lt("error",r),lt("load",r);break;case"details":lt("toggle",r);break;case"embed":case"source":case"link":lt("error",r),lt("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(ee in u)if(u.hasOwnProperty(ee)&&(f=u[ee],f!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ot(r,i,ee,f,u,null)}return;default:if($h(i)){for(ce in u)u.hasOwnProperty(ce)&&(f=u[ce],f!==void 0&&Np(r,i,ce,f,u,void 0));return}}for(A in u)u.hasOwnProperty(A)&&(f=u[A],f!=null&&Ot(r,i,A,f,u,null))}function o2(r,i,u,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,v=null,j=null,A=null,H=null,ee=null,ce=null;for(oe in u){var he=u[oe];if(u.hasOwnProperty(oe)&&he!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":H=he;default:f.hasOwnProperty(oe)||Ot(r,i,oe,null,f,he)}}for(var ne in f){var oe=f[ne];if(he=u[ne],f.hasOwnProperty(ne)&&(oe!=null||he!=null))switch(ne){case"type":v=oe;break;case"name":y=oe;break;case"checked":ee=oe;break;case"defaultChecked":ce=oe;break;case"value":j=oe;break;case"defaultValue":A=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,i));break;default:oe!==he&&Ot(r,i,ne,oe,f,he)}}Uh(r,j,A,H,ee,ce,v,y);return;case"select":oe=j=A=ne=null;for(v in u)if(H=u[v],u.hasOwnProperty(v)&&H!=null)switch(v){case"value":break;case"multiple":oe=H;default:f.hasOwnProperty(v)||Ot(r,i,v,null,f,H)}for(y in f)if(v=f[y],H=u[y],f.hasOwnProperty(y)&&(v!=null||H!=null))switch(y){case"value":ne=v;break;case"defaultValue":A=v;break;case"multiple":j=v;default:v!==H&&Ot(r,i,y,v,f,H)}i=A,u=j,f=oe,ne!=null?ll(r,!!u,ne,!1):!!f!=!!u&&(i!=null?ll(r,!!u,i,!0):ll(r,!!u,u?[]:"",!1));return;case"textarea":oe=ne=null;for(A in u)if(y=u[A],u.hasOwnProperty(A)&&y!=null&&!f.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Ot(r,i,A,null,f,y)}for(j in f)if(y=f[j],v=u[j],f.hasOwnProperty(j)&&(y!=null||v!=null))switch(j){case"value":ne=y;break;case"defaultValue":oe=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(a(91));break;default:y!==v&&Ot(r,i,j,y,f,v)}Mb(r,ne,oe);return;case"option":for(var Te in u)if(ne=u[Te],u.hasOwnProperty(Te)&&ne!=null&&!f.hasOwnProperty(Te))switch(Te){case"selected":r.selected=!1;break;default:Ot(r,i,Te,null,f,ne)}for(H in f)if(ne=f[H],oe=u[H],f.hasOwnProperty(H)&&ne!==oe&&(ne!=null||oe!=null))switch(H){case"selected":r.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Ot(r,i,H,ne,f,oe)}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 Ze in u)ne=u[Ze],u.hasOwnProperty(Ze)&&ne!=null&&!f.hasOwnProperty(Ze)&&Ot(r,i,Ze,null,f,ne);for(ee in f)if(ne=f[ee],oe=u[ee],f.hasOwnProperty(ee)&&ne!==oe&&(ne!=null||oe!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:Ot(r,i,ee,ne,f,oe)}return;default:if($h(i)){for(var zt in u)ne=u[zt],u.hasOwnProperty(zt)&&ne!==void 0&&!f.hasOwnProperty(zt)&&Np(r,i,zt,void 0,f,ne);for(ce in f)ne=f[ce],oe=u[ce],!f.hasOwnProperty(ce)||ne===oe||ne===void 0&&oe===void 0||Np(r,i,ce,ne,f,oe);return}}for(var Y in u)ne=u[Y],u.hasOwnProperty(Y)&&ne!=null&&!f.hasOwnProperty(Y)&&Ot(r,i,Y,null,f,ne);for(he in f)ne=f[he],oe=u[he],!f.hasOwnProperty(he)||ne===oe||ne==null&&oe==null||Ot(r,i,he,ne,f,oe)}function Pw(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function u2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var y=u[f],v=y.transferSize,j=y.initiatorType,A=y.duration;if(v&&A&&Pw(j)){for(j=0,A=y.responseEnd,f+=1;f<u.length;f++){var H=u[f],ee=H.startTime;if(ee>A)break;var ce=H.transferSize,he=H.initiatorType;ce&&Pw(he)&&(H=H.responseEnd,j+=ce*(H<A?1:(A-ee)/(H-ee)))}if(--f,i+=8*(v+j)/(y.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 _p=null,Tp=null;function Hd(r){return r.nodeType===9?r:r.ownerDocument}function Uw(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 Bw(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 Ap(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 Rp=null;function c2(){var r=window.event;return r&&r.type==="popstate"?r===Rp?!1:(Rp=r,!0):(Rp=null,!1)}var $w=typeof setTimeout=="function"?setTimeout:void 0,d2=typeof clearTimeout=="function"?clearTimeout:void 0,Fw=typeof Promise=="function"?Promise:void 0,f2=typeof queueMicrotask=="function"?queueMicrotask:typeof Fw<"u"?function(r){return Fw.resolve(null).then(r).catch(h2)}:$w;function h2(r){setTimeout(function(){throw r})}function Ii(r){return r==="head"}function Hw(r,i){var u=i,f=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(f===0){r.removeChild(y),Ul(i);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")Su(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,Su(u);for(var v=u.firstChild;v;){var j=v.nextSibling,A=v.nodeName;v[vi]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=j}}else u==="body"&&Su(r.ownerDocument.body);u=y}while(u);Ul(i)}function qw(r,i){var u=r;r=0;do{var f=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=f}while(u)}function Op(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Op(u),Pe(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function m2(r,i,u,f){for(;r.nodeType===1;){var y=u;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[vi])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!==y.rel||r.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||r.getAttribute("title")!==(y.title==null?null:y.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(y.src==null?null:y.src)||r.getAttribute("type")!==(y.type==null?null:y.type)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=y.name==null?null:""+y.name;if(y.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=Wr(r.nextSibling),r===null)break}return null}function p2(r,i,u){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=Wr(r.nextSibling),r===null))return null;return r}function Zw(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 zp(r){return r.data==="$?"||r.data==="$~"}function Mp(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function g2(r,i){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||u.readyState!=="loading")i();else{var f=function(){i(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}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 Dp=null;function Gw(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"||u==="/&"){if(i===0)return Wr(r.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}r=r.nextSibling}return null}function Vw(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return r;i--}else u!=="/$"&&u!=="/&"||i++}r=r.previousSibling}return null}function Qw(r,i,u){switch(i=Hd(u),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 Su(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Pe(r)}var Jr=new Map,Kw=new Set;function qd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ei=te.d;te.d={f:y2,r:v2,D:b2,C:x2,L:w2,m:S2,X:j2,S:k2,M:C2};function y2(){var r=ei.f(),i=Dd();return r||i}function v2(r){var i=pe(r);i!==null&&i.tag===5&&i.type==="form"?f0(i):ei.r(r)}var Il=typeof document>"u"?null:document;function Yw(r,i,u){var f=Il;if(f&&typeof i=="string"&&i){var y=Zr(i);y='link[rel="'+r+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),Kw.has(y)||(Kw.add(y),r={rel:r,crossOrigin:u,href:i},f.querySelector(y)===null&&(i=f.createElement("link"),Hn(i,"link",r),ht(i),f.head.appendChild(i)))}}function b2(r){ei.D(r),Yw("dns-prefetch",r,null)}function x2(r,i){ei.C(r,i),Yw("preconnect",r,i)}function w2(r,i,u){ei.L(r,i,u);var f=Il;if(f&&r&&i){var y='link[rel="preload"][as="'+Zr(i)+'"]';i==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Zr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Zr(u.imageSizes)+'"]')):y+='[href="'+Zr(r)+'"]';var v=y;switch(i){case"style":v=Ll(r);break;case"script":v=Pl(r)}Jr.has(v)||(r=g({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:r,as:i},u),Jr.set(v,r),f.querySelector(y)!==null||i==="style"&&f.querySelector(ku(v))||i==="script"&&f.querySelector(ju(v))||(i=f.createElement("link"),Hn(i,"link",r),ht(i),f.head.appendChild(i)))}}function S2(r,i){ei.m(r,i);var u=Il;if(u&&r){var f=i&&typeof i.as=="string"?i.as:"script",y='link[rel="modulepreload"][as="'+Zr(f)+'"][href="'+Zr(r)+'"]',v=y;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Pl(r)}if(!Jr.has(v)&&(r=g({rel:"modulepreload",href:r},i),Jr.set(v,r),u.querySelector(y)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(ju(v)))return}f=u.createElement("link"),Hn(f,"link",r),ht(f),u.head.appendChild(f)}}}function k2(r,i,u){ei.S(r,i,u);var f=Il;if(f&&r){var y=wt(f).hoistableStyles,v=Ll(r);i=i||"default";var j=y.get(v);if(!j){var A={loading:0,preload:null};if(j=f.querySelector(ku(v)))A.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},u),(u=Jr.get(v))&&Ip(r,u);var H=j=f.createElement("link");ht(H),Hn(H,"link",r),H._p=new Promise(function(ee,ce){H.onload=ee,H.onerror=ce}),H.addEventListener("load",function(){A.loading|=1}),H.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Zd(j,i,f)}j={type:"stylesheet",instance:j,count:1,state:A},y.set(v,j)}}}function j2(r,i){ei.X(r,i);var u=Il;if(u&&r){var f=wt(u).hoistableScripts,y=Pl(r),v=f.get(y);v||(v=u.querySelector(ju(y)),v||(r=g({src:r,async:!0},i),(i=Jr.get(y))&&Lp(r,i),v=u.createElement("script"),ht(v),Hn(v,"link",r),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(y,v))}}function C2(r,i){ei.M(r,i);var u=Il;if(u&&r){var f=wt(u).hoistableScripts,y=Pl(r),v=f.get(y);v||(v=u.querySelector(ju(y)),v||(r=g({src:r,async:!0,type:"module"},i),(i=Jr.get(y))&&Lp(r,i),v=u.createElement("script"),ht(v),Hn(v,"link",r),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(y,v))}}function Xw(r,i,u,f){var y=(y=re.current)?qd(y):null;if(!y)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=Ll(u.href),u=wt(y).hoistableStyles,f=u.get(i),f||(f={type:"style",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=Ll(u.href);var v=wt(y).hoistableStyles,j=v.get(r);if(j||(y=y.ownerDocument||y,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,j),(v=y.querySelector(ku(r)))&&!v._p&&(j.instance=v,j.state.loading=5),Jr.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Jr.set(r,u),v||E2(y,r,u,j.state))),i&&f===null)throw Error(a(528,""));return j}if(i&&f!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Pl(u),u=wt(y).hoistableScripts,f=u.get(i),f||(f={type:"script",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Ll(r){return'href="'+Zr(r)+'"'}function ku(r){return'link[rel="stylesheet"]['+r+"]"}function Ww(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function E2(r,i,u,f){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=r.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),Hn(i,"link",u),ht(i),r.head.appendChild(i))}function Pl(r){return'[src="'+Zr(r)+'"]'}function ju(r){return"script[async]"+r}function Jw(r,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var f=r.querySelector('style[data-href~="'+Zr(u.href)+'"]');if(f)return i.instance=f,ht(f),f;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),ht(f),Hn(f,"style",y),Zd(f,u.precedence,r),i.instance=f;case"stylesheet":y=Ll(u.href);var v=r.querySelector(ku(y));if(v)return i.state.loading|=4,i.instance=v,ht(v),v;f=Ww(u),(y=Jr.get(y))&&Ip(f,y),v=(r.ownerDocument||r).createElement("link"),ht(v);var j=v;return j._p=new Promise(function(A,H){j.onload=A,j.onerror=H}),Hn(v,"link",f),i.state.loading|=4,Zd(v,u.precedence,r),i.instance=v;case"script":return v=Pl(u.src),(y=r.querySelector(ju(v)))?(i.instance=y,ht(y),y):(f=u,(y=Jr.get(v))&&(f=g({},u),Lp(f,y)),r=r.ownerDocument||r,y=r.createElement("script"),ht(y),Hn(y,"link",f),r.head.appendChild(y),i.instance=y);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,Zd(f,u.precedence,r));return i.instance}function Zd(r,i,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=f.length?f[f.length-1]:null,v=y,j=0;j<f.length;j++){var A=f[j];if(A.dataset.precedence===i)v=A;else if(v!==y)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(r,i.firstChild))}function Ip(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Lp(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Gd=null;function eS(r,i,u){if(Gd===null){var f=new Map,y=Gd=new Map;y.set(u,f)}else y=Gd,f=y.get(u),f||(f=new Map,y.set(u,f));if(f.has(r))return f;for(f.set(r,null),u=u.getElementsByTagName(r),y=0;y<u.length;y++){var v=u[y];if(!(v[vi]||v[dn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var j=v.getAttribute(i)||"";j=r+j;var A=f.get(j);A?A.push(v):f.set(j,[v])}}return f}function tS(r,i,u){r=r.ownerDocument||r,r.head.insertBefore(u,i==="title"?r.querySelector("head > title"):null)}function N2(r,i,u){if(u===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 nS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function _2(r,i,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Ll(f.href),v=i.querySelector(ku(y));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Vd.bind(r),i.then(r,r)),u.state.loading|=4,u.instance=v,ht(v);return}v=i.ownerDocument||i,f=Ww(f),(y=Jr.get(y))&&Ip(f,y),v=v.createElement("link"),ht(v);var j=v;j._p=new Promise(function(A,H){j.onload=A,j.onerror=H}),Hn(v,"link",f),u.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=Vd.bind(r),i.addEventListener("load",u),i.addEventListener("error",u))}}var Pp=0;function T2(r,i){return r.stylesheets&&r.count===0&&Kd(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var f=setTimeout(function(){if(r.stylesheets&&Kd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Pp===0&&(Pp=62500*u2());var y=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Kd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Pp?50:800)+i);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(f),clearTimeout(y)}}:null}function Vd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Qd=null;function Kd(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Qd=new Map,i.forEach(A2,r),Qd=null,Vd.call(r))}function A2(r,i){if(!(i.state.loading&4)){var u=Qd.get(r);if(u)var f=u.get(null);else{u=new Map,Qd.set(r,u);for(var y=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<y.length;v++){var j=y[v];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(u.set(j.dataset.precedence,j),f=j)}f&&u.set(null,f)}y=i.instance,j=y.getAttribute("data-precedence"),v=u.get(j)||f,v===f&&u.set(null,y),u.set(j,y),this.count++,f=Vd.bind(this),y.addEventListener("load",f),y.addEventListener("error",f),v?v.parentNode.insertBefore(y,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(y,r.firstChild)),i.state.loading|=4}}var Cu={$$typeof:R,Provider:null,Consumer:null,_currentValue:je,_currentValue2:je,_threadCount:0};function R2(r,i,u,f,y,v,j,A,H){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=tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tt(0),this.hiddenUpdates=tt(null),this.identifierPrefix=f,this.onUncaughtError=y,this.onCaughtError=v,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function rS(r,i,u,f,y,v,j,A,H,ee,ce,he){return r=new R2(r,i,u,j,H,ee,ce,he,A),i=1,v===!0&&(i|=24),v=Or(3,null,null,i),r.current=v,v.stateNode=r,i=ym(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:f,isDehydrated:u,cache:i},wm(v),r}function aS(r){return r?(r=pl,r):pl}function iS(r,i,u,f,y,v){y=aS(y),f.context===null?f.context=y:f.pendingContext=y,f=Ci(i),f.payload={element:u},v=v===void 0?null:v,v!==null&&(f.callback=v),u=Ei(r,f,i),u!==null&&(br(u,r,i),ru(u,r,i))}function sS(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<i?u:i}}function Up(r,i){sS(r,i),(r=r.alternate)&&sS(r,i)}function lS(r){if(r.tag===13||r.tag===31){var i=ws(r,67108864);i!==null&&br(i,r,67108864),Up(r,67108864)}}function oS(r){if(r.tag===13||r.tag===31){var i=Lr();i=rr(i);var u=ws(r,i);u!==null&&br(u,r,i),Up(r,i)}}var Yd=!0;function O2(r,i,u,f){var y=Z.T;Z.T=null;var v=te.p;try{te.p=2,Bp(r,i,u,f)}finally{te.p=v,Z.T=y}}function z2(r,i,u,f){var y=Z.T;Z.T=null;var v=te.p;try{te.p=8,Bp(r,i,u,f)}finally{te.p=v,Z.T=y}}function Bp(r,i,u,f){if(Yd){var y=$p(f);if(y===null)Ep(r,i,f,Xd,u),cS(r,f);else if(D2(y,r,i,u,f))f.stopPropagation();else if(cS(r,f),i&4&&-1<M2.indexOf(r)){for(;y!==null;){var v=pe(y);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var j=Vn(v.pendingLanes);if(j!==0){var A=v;for(A.pendingLanes|=2,A.entangledLanes|=2;j;){var H=1<<31-it(j);A.entanglements[1]|=H,j&=~H}Ea(v),(Ct&6)===0&&(zd=un()+500,bu(0))}}break;case 31:case 13:A=ws(v,2),A!==null&&br(A,v,2),Dd(),Up(v,2)}if(v=$p(f),v===null&&Ep(r,i,f,Xd,u),v===y)break;y=v}y!==null&&f.stopPropagation()}else Ep(r,i,f,null,u)}}function $p(r){return r=Hh(r),Fp(r)}var Xd=null;function Fp(r){if(Xd=null,r=F(r),r!==null){var i=o(r);if(i===null)r=null;else{var u=i.tag;if(u===13){if(r=c(i),r!==null)return r;r=null}else if(u===31){if(r=d(i),r!==null)return r;r=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Xd=r,null}function uS(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(da()){case ue:return 2;case ge:return 8;case $e:case Ve:return 32;case at:return 268435456;default:return 32}default:return 32}}var Hp=!1,Li=null,Pi=null,Ui=null,Eu=new Map,Nu=new Map,Bi=[],M2="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 cS(r,i){switch(r){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":Pi=null;break;case"mouseover":case"mouseout":Ui=null;break;case"pointerover":case"pointerout":Eu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nu.delete(i.pointerId)}}function _u(r,i,u,f,y,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:u,eventSystemFlags:f,nativeEvent:v,targetContainers:[y]},i!==null&&(i=pe(i),i!==null&&lS(i)),r):(r.eventSystemFlags|=f,i=r.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),r)}function D2(r,i,u,f,y){switch(i){case"focusin":return Li=_u(Li,r,i,u,f,y),!0;case"dragenter":return Pi=_u(Pi,r,i,u,f,y),!0;case"mouseover":return Ui=_u(Ui,r,i,u,f,y),!0;case"pointerover":var v=y.pointerId;return Eu.set(v,_u(Eu.get(v)||null,r,i,u,f,y)),!0;case"gotpointercapture":return v=y.pointerId,Nu.set(v,_u(Nu.get(v)||null,r,i,u,f,y)),!0}return!1}function dS(r){var i=F(r.target);if(i!==null){var u=o(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){r.blockedOn=i,Po(r.priority,function(){oS(u)});return}}else if(i===31){if(i=d(u),i!==null){r.blockedOn=i,Po(r.priority,function(){oS(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Wd(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var u=$p(r.nativeEvent);if(u===null){u=r.nativeEvent;var f=new u.constructor(u.type,u);Fh=f,u.target.dispatchEvent(f),Fh=null}else return i=pe(u),i!==null&&lS(i),r.blockedOn=u,!1;i.shift()}return!0}function fS(r,i,u){Wd(r)&&u.delete(i)}function I2(){Hp=!1,Li!==null&&Wd(Li)&&(Li=null),Pi!==null&&Wd(Pi)&&(Pi=null),Ui!==null&&Wd(Ui)&&(Ui=null),Eu.forEach(fS),Nu.forEach(fS)}function Jd(r,i){r.blockedOn===i&&(r.blockedOn=null,Hp||(Hp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,I2)))}var ef=null;function hS(r){ef!==r&&(ef=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ef===r&&(ef=null);for(var i=0;i<r.length;i+=3){var u=r[i],f=r[i+1],y=r[i+2];if(typeof f!="function"){if(Fp(f||u)===null)continue;break}var v=pe(u);v!==null&&(r.splice(i,3),i-=3,$m(v,{pending:!0,data:y,method:u.method,action:f},f,y))}}))}function Ul(r){function i(H){return Jd(H,r)}Li!==null&&Jd(Li,r),Pi!==null&&Jd(Pi,r),Ui!==null&&Jd(Ui,r),Eu.forEach(i),Nu.forEach(i);for(var u=0;u<Bi.length;u++){var f=Bi[u];f.blockedOn===r&&(f.blockedOn=null)}for(;0<Bi.length&&(u=Bi[0],u.blockedOn===null);)dS(u),u.blockedOn===null&&Bi.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var y=u[f],v=u[f+1],j=y[Zt]||null;if(typeof v=="function")j||hS(u);else if(j){var A=null;if(v&&v.hasAttribute("formAction")){if(y=v,j=v[Zt]||null)A=j.formAction;else if(Fp(y)!==null)continue}else A=j.action;typeof A=="function"?u[f+1]=A:(u.splice(f,3),f-=3),hS(u)}}}function mS(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(j){return y=j})},focusReset:"manual",scroll:"manual"})}function i(){y!==null&&(y(),y=null),f||setTimeout(u,20)}function u(){if(!f&&!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 f=!1,y=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),y!==null&&(y(),y=null)}}}function qp(r){this._internalRoot=r}tf.prototype.render=qp.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var u=i.current,f=Lr();iS(u,f,r,i,null,null)},tf.prototype.unmount=qp.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;iS(r.current,2,null,r,null,null),Dd(),i[Ia]=null}};function tf(r){this._internalRoot=r}tf.prototype.unstable_scheduleHydration=function(r){if(r){var i=Lo();r={blockedOn:null,target:r,priority:i};for(var u=0;u<Bi.length&&i!==0&&i<Bi[u].priority;u++);Bi.splice(u,0,r),u===0&&dS(r)}};var pS=t.version;if(pS!=="19.2.4")throw Error(a(527,pS,"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?p(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 nf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nf.isDisabled&&nf.supportsFiber)try{Ht=nf.inject(L2),Lt=nf}catch{}}return Au.createRoot=function(r,i){if(!s(r))throw Error(a(299));var u=!1,f="",y=S0,v=k0,j=j0;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=rS(r,1,!1,null,null,u,f,null,y,v,j,mS),r[Ia]=i.current,Cp(r),new qp(i)},Au.hydrateRoot=function(r,i,u){if(!s(r))throw Error(a(299));var f=!1,y="",v=S0,j=k0,A=j0,H=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(j=u.onCaughtError),u.onRecoverableError!==void 0&&(A=u.onRecoverableError),u.formState!==void 0&&(H=u.formState)),i=rS(r,1,!0,i,u??null,f,y,H,v,j,A,mS),i.context=aS(null),u=i.current,f=Lr(),f=rr(f),y=Ci(f),y.callback=null,Ei(u,y,f),u=f,i.current.lanes=u,pn(i,u),Ea(i),r[Ia]=i.current,Cp(r),new tf(i)},Au.version="19.2.4",Au}var ES;function Q2(){if(ES)return Qp.exports;ES=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(),Qp.exports=V2(),Qp.exports}var K2=Q2(),Ws=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(){}},Us,Ki,ao,uj,Y2=(uj=class extends Ws{constructor(){super();_e(this,Us);_e(this,Ki);_e(this,ao);ke(this,ao,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Ki)||this.setEventListener(U(this,ao))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Ki))==null||t.call(this),ke(this,Ki,void 0))}setEventListener(t){var n;ke(this,ao,t),(n=U(this,Ki))==null||n.call(this),ke(this,Ki,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){U(this,Us)!==t&&(ke(this,Us,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof U(this,Us)=="boolean"?U(this,Us):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Us=new WeakMap,Ki=new WeakMap,ao=new WeakMap,uj),iv=new Y2,X2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Yi,nv,cj,W2=(cj=class{constructor(){_e(this,Yi,X2);_e(this,nv,!1)}setTimeoutProvider(e){ke(this,Yi,e)}setTimeout(e,t){return U(this,Yi).setTimeout(e,t)}clearTimeout(e){U(this,Yi).clearTimeout(e)}setInterval(e,t){return U(this,Yi).setInterval(e,t)}clearInterval(e){U(this,Yi).clearInterval(e)}},Yi=new WeakMap,nv=new WeakMap,cj),Is=new W2;function J2(e){setTimeout(e,0)}var eR=typeof window>"u"||"Deno"in globalThis;function Xn(){}function tR(e,t){return typeof e=="function"?e(t):e}function Vg(e){return typeof e=="number"&&e>=0&&e!==1/0}function Sj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function is(e,t){return typeof e=="function"?e(t):e}function na(e,t){return typeof e=="function"?e(t):e}function NS(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:o,queryKey:c,stale:d}=e;if(c){if(a){if(t.queryHash!==sv(c,t.options))return!1}else if(!ac(t.queryKey,c))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||s&&s!==t.state.fetchStatus||o&&!o(t))}function _S(e,t){const{exact:n,status:a,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Qs(t.options.mutationKey)!==Qs(o))return!1}else if(!ac(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function sv(e,t){return((t==null?void 0:t.queryKeyHashFn)||Qs)(e)}function Qs(e){return JSON.stringify(e,(t,n)=>Qg(n)?Object.keys(n).sort().reduce((a,s)=>(a[s]=n[s],a),{}):n)}function ac(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ac(e[n],t[n])):!1}var nR=Object.prototype.hasOwnProperty;function lv(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=TS(e)&&TS(t);if(!a&&!(Qg(e)&&Qg(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),d=c.length,m=a?new Array(d):{};let h=0;for(let p=0;p<d;p++){const g=a?p:c[p],x=e[g],w=t[g];if(x===w){m[g]=x,(a?p<o:nR.call(e,g))&&h++;continue}if(x===null||w===null||typeof x!="object"||typeof w!="object"){m[g]=w;continue}const S=lv(x,w,n+1);m[g]=S,S===x&&h++}return o===d&&h===o?e:m}function ic(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 TS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qg(e){if(!AS(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!AS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function AS(e){return Object.prototype.toString.call(e)==="[object Object]"}function rR(e){return new Promise(t=>{Is.setTimeout(t,e)})}function Kg(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?lv(e,t):t}function aR(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function iR(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var ov=Symbol();function kj(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ov?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function uv(e,t){return typeof e=="function"?e(...t):!!e}function sR(e,t,n){let a=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),a||(a=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var sc=(()=>{let e=()=>eR;return{isServer(){return e()},setIsServer(t){e=t}}})();function Yg(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function a(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{a({status:"fulfilled",value:s}),e(s)},n.reject=s=>{a({status:"rejected",reason:s}),t(s)},n}var lR=J2;function oR(){let e=[],t=0,n=d=>{d()},a=d=>{d()},s=lR;const o=d=>{t?e.push(d):s(()=>{n(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{a(()=>{d.forEach(m=>{n(m)})})})};return{batch:d=>{let m;t++;try{m=d()}finally{t--,t||c()}return m},batchCalls:d=>(...m)=>{o(()=>{d(...m)})},schedule:o,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{a=d},setScheduler:d=>{s=d}}}var sn=oR(),io,Xi,so,dj,uR=(dj=class extends Ws{constructor(){super();_e(this,io,!0);_e(this,Xi);_e(this,so);ke(this,so,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(){U(this,Xi)||this.setEventListener(U(this,so))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Xi))==null||t.call(this),ke(this,Xi,void 0))}setEventListener(t){var n;ke(this,so,t),(n=U(this,Xi))==null||n.call(this),ke(this,Xi,t(this.setOnline.bind(this)))}setOnline(t){U(this,io)!==t&&(ke(this,io,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return U(this,io)}},io=new WeakMap,Xi=new WeakMap,so=new WeakMap,dj),If=new uR;function cR(e){return Math.min(1e3*2**e,3e4)}function jj(e){return(e??"online")==="online"?If.isOnline():!0}var Xg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Cj(e){let t=!1,n=0,a;const s=Yg(),o=()=>s.status!=="pending",c=k=>{var C;if(!o()){const E=new Xg(k);x(E),(C=e.onCancel)==null||C.call(e,E)}},d=()=>{t=!0},m=()=>{t=!1},h=()=>iv.isFocused()&&(e.networkMode==="always"||If.isOnline())&&e.canRun(),p=()=>jj(e.networkMode)&&e.canRun(),g=k=>{o()||(a==null||a(),s.resolve(k))},x=k=>{o()||(a==null||a(),s.reject(k))},w=()=>new Promise(k=>{var C;a=E=>{(o()||h())&&k(E)},(C=e.onPause)==null||C.call(e)}).then(()=>{var k;a=void 0,o()||(k=e.onContinue)==null||k.call(e)}),S=()=>{if(o())return;let k;const C=n===0?e.initialPromise:void 0;try{k=C??e.fn()}catch(E){k=Promise.reject(E)}Promise.resolve(k).then(g).catch(E=>{var O;if(o())return;const N=e.retry??(sc.isServer()?0:3),R=e.retryDelay??cR,z=typeof R=="function"?R(n,E):R,L=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,E);if(t||!L){x(E);return}n++,(O=e.onFail)==null||O.call(e,n,E),rR(z).then(()=>h()?void 0:w()).then(()=>{t?x(E):S()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(a==null||a(),s),cancelRetry:d,continueRetry:m,canStart:p,start:()=>(p()?S():w().then(S),s)}}var Bs,fj,Ej=(fj=class{constructor(){_e(this,Bs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vg(this.gcTime)&&ke(this,Bs,Is.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sc.isServer()?1/0:300*1e3))}clearGcTimeout(){U(this,Bs)&&(Is.clearTimeout(U(this,Bs)),ke(this,Bs,void 0))}},Bs=new WeakMap,fj),$s,lo,ea,Fs,In,xc,Hs,Br,Nj,ni,hj,dR=(hj=class extends Ej{constructor(t){super();_e(this,Br);_e(this,$s);_e(this,lo);_e(this,ea);_e(this,Fs);_e(this,In);_e(this,xc);_e(this,Hs);ke(this,Hs,!1),ke(this,xc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ke(this,Fs,t.client),ke(this,ea,U(this,Fs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ke(this,$s,OS(this.options)),this.state=t.state??U(this,$s),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=U(this,In))==null?void 0:t.promise}setOptions(t){if(this.options={...U(this,xc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=OS(this.options);n.data!==void 0&&(this.setState(RS(n.data,n.dataUpdatedAt)),ke(this,$s,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,ea).remove(this)}setData(t,n){const a=Kg(this.state.data,t,this.options);return Ge(this,Br,ni).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Ge(this,Br,ni).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,s;const n=(a=U(this,In))==null?void 0:a.promise;return(s=U(this,In))==null||s.cancel(t),n?n.then(Xn).catch(Xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return U(this,$s)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>na(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ov||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>is(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Sj(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,In))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,In))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),U(this,ea).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(U(this,In)&&(U(this,Hs)||Ge(this,Br,Nj).call(this)?U(this,In).cancel({revert:!0}):U(this,In).cancelRetry()),this.scheduleGc()),U(this,ea).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ge(this,Br,ni).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,p,g,x,w,S,k,C,E,N,R;if(this.state.fetchStatus!=="idle"&&((m=U(this,In))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,In))return U(this,In).continueRetry(),U(this,In).promise}if(t&&this.setOptions(t),!this.options.queryFn){const z=this.observers.find(L=>L.options.queryFn);z&&this.setOptions(z.options)}const a=new AbortController,s=z=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>(ke(this,Hs,!0),a.signal)})},o=()=>{const z=kj(this.options,n),O=(()=>{const B={client:U(this,Fs),queryKey:this.queryKey,meta:this.meta};return s(B),B})();return ke(this,Hs,!1),this.options.persister?this.options.persister(z,O,this):z(O)},d=(()=>{const z={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:U(this,Fs),state:this.state,fetchFn:o};return s(z),z})();(h=this.options.behavior)==null||h.onFetch(d,this),ke(this,lo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=d.fetchOptions)==null?void 0:p.meta))&&Ge(this,Br,ni).call(this,{type:"fetch",meta:(g=d.fetchOptions)==null?void 0:g.meta}),ke(this,In,Cj({initialPromise:n==null?void 0:n.initialPromise,fn:d.fetchFn,onCancel:z=>{z instanceof Xg&&z.revert&&this.setState({...U(this,lo),fetchStatus:"idle"}),a.abort()},onFail:(z,L)=>{Ge(this,Br,ni).call(this,{type:"failed",failureCount:z,error:L})},onPause:()=>{Ge(this,Br,ni).call(this,{type:"pause"})},onContinue:()=>{Ge(this,Br,ni).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const z=await U(this,In).start();if(z===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(z),(w=(x=U(this,ea).config).onSuccess)==null||w.call(x,z,this),(k=(S=U(this,ea).config).onSettled)==null||k.call(S,z,this.state.error,this),z}catch(z){if(z instanceof Xg){if(z.silent)return U(this,In).promise;if(z.revert){if(this.state.data===void 0)throw z;return this.state.data}}throw Ge(this,Br,ni).call(this,{type:"error",error:z}),(E=(C=U(this,ea).config).onError)==null||E.call(C,z,this),(R=(N=U(this,ea).config).onSettled)==null||R.call(N,this.state.data,z,this),z}finally{this.scheduleGc()}}},$s=new WeakMap,lo=new WeakMap,ea=new WeakMap,Fs=new WeakMap,In=new WeakMap,xc=new WeakMap,Hs=new WeakMap,Br=new WeakSet,Nj=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ni=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,..._j(a.data,this.options),fetchMeta:t.meta??null};case"success":const s={...a,...RS(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ke(this,lo,t.manual?s:void 0),s;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),sn.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),U(this,ea).notify({query:this,type:"updated",action:t})})},hj);function _j(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jj(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function RS(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function OS(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 Sr,pt,wc,lr,qs,oo,ri,Wi,Sc,uo,co,Zs,Gs,Ji,fo,Nt,Ku,Wg,Jg,ey,ty,ny,ry,ay,Tj,mj,cv=(mj=class extends Ws{constructor(t,n){super();_e(this,Nt);_e(this,Sr);_e(this,pt);_e(this,wc);_e(this,lr);_e(this,qs);_e(this,oo);_e(this,ri);_e(this,Wi);_e(this,Sc);_e(this,uo);_e(this,co);_e(this,Zs);_e(this,Gs);_e(this,Ji);_e(this,fo,new Set);this.options=n,ke(this,Sr,t),ke(this,Wi,null),ke(this,ri,Yg()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,pt).addObserver(this),zS(U(this,pt),this.options)?Ge(this,Nt,Ku).call(this):this.updateResult(),Ge(this,Nt,ty).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return iy(U(this,pt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return iy(U(this,pt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ge(this,Nt,ny).call(this),Ge(this,Nt,ry).call(this),U(this,pt).removeObserver(this)}setOptions(t){const n=this.options,a=U(this,pt);if(this.options=U(this,Sr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof na(this.options.enabled,U(this,pt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ge(this,Nt,ay).call(this),U(this,pt).setOptions(this.options),n._defaulted&&!ic(this.options,n)&&U(this,Sr).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,pt),observer:this});const s=this.hasListeners();s&&MS(U(this,pt),a,this.options,n)&&Ge(this,Nt,Ku).call(this),this.updateResult(),s&&(U(this,pt)!==a||na(this.options.enabled,U(this,pt))!==na(n.enabled,U(this,pt))||is(this.options.staleTime,U(this,pt))!==is(n.staleTime,U(this,pt)))&&Ge(this,Nt,Wg).call(this);const o=Ge(this,Nt,Jg).call(this);s&&(U(this,pt)!==a||na(this.options.enabled,U(this,pt))!==na(n.enabled,U(this,pt))||o!==U(this,Ji))&&Ge(this,Nt,ey).call(this,o)}getOptimisticResult(t){const n=U(this,Sr).getQueryCache().build(U(this,Sr),t),a=this.createResult(n,t);return hR(this,a)&&(ke(this,lr,a),ke(this,oo,this.options),ke(this,qs,U(this,pt).state)),a}getCurrentResult(){return U(this,lr)}trackResult(t,n){return new Proxy(t,{get:(a,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&U(this,ri).status==="pending"&&U(this,ri).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,s))})}trackProp(t){U(this,fo).add(t)}getCurrentQuery(){return U(this,pt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=U(this,Sr).defaultQueryOptions(t),a=U(this,Sr).getQueryCache().build(U(this,Sr),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Ge(this,Nt,Ku).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,lr)))}createResult(t,n){var V;const a=U(this,pt),s=this.options,o=U(this,lr),c=U(this,qs),d=U(this,oo),h=t!==a?t.state:U(this,wc),{state:p}=t;let g={...p},x=!1,w;if(n._optimisticResults){const D=this.hasListeners(),K=!D&&zS(t,n),ae=D&&MS(t,a,n,s);(K||ae)&&(g={...g,..._j(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:S,errorUpdatedAt:k,status:C}=g;w=g.data;let E=!1;if(n.placeholderData!==void 0&&w===void 0&&C==="pending"){let D;o!=null&&o.isPlaceholderData&&n.placeholderData===(d==null?void 0:d.placeholderData)?(D=o.data,E=!0):D=typeof n.placeholderData=="function"?n.placeholderData((V=U(this,co))==null?void 0:V.state.data,U(this,co)):n.placeholderData,D!==void 0&&(C="success",w=Kg(o==null?void 0:o.data,D,n),x=!0)}if(n.select&&w!==void 0&&!E)if(o&&w===(c==null?void 0:c.data)&&n.select===U(this,Sc))w=U(this,uo);else try{ke(this,Sc,n.select),w=n.select(w),w=Kg(o==null?void 0:o.data,w,n),ke(this,uo,w),ke(this,Wi,null)}catch(D){ke(this,Wi,D)}U(this,Wi)&&(S=U(this,Wi),w=U(this,uo),k=Date.now(),C="error");const N=g.fetchStatus==="fetching",R=C==="pending",z=C==="error",L=R&&N,O=w!==void 0,I={status:C,fetchStatus:g.fetchStatus,isPending:R,isSuccess:C==="success",isError:z,isInitialLoading:L,isLoading:L,data:w,dataUpdatedAt:g.dataUpdatedAt,error:S,errorUpdatedAt:k,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&&!R,isLoadingError:z&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:z&&O,isStale:dv(t,n),refetch:this.refetch,promise:U(this,ri),isEnabled:na(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=I.data!==void 0,K=I.status==="error"&&!D,ae=X=>{K?X.reject(I.error):D&&X.resolve(I.data)},be=()=>{const X=ke(this,ri,I.promise=Yg());ae(X)},W=U(this,ri);switch(W.status){case"pending":t.queryHash===a.queryHash&&ae(W);break;case"fulfilled":(K||I.data!==W.value)&&be();break;case"rejected":(!K||I.error!==W.reason)&&be();break}}return I}updateResult(){const t=U(this,lr),n=this.createResult(U(this,pt),this.options);if(ke(this,qs,U(this,pt).state),ke(this,oo,this.options),U(this,qs).data!==void 0&&ke(this,co,U(this,pt)),ic(n,t))return;ke(this,lr,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!U(this,fo).size)return!0;const c=new Set(o??U(this,fo));return this.options.throwOnError&&c.add("error"),Object.keys(U(this,lr)).some(d=>{const m=d;return U(this,lr)[m]!==t[m]&&c.has(m)})};Ge(this,Nt,Tj).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ge(this,Nt,ty).call(this)}},Sr=new WeakMap,pt=new WeakMap,wc=new WeakMap,lr=new WeakMap,qs=new WeakMap,oo=new WeakMap,ri=new WeakMap,Wi=new WeakMap,Sc=new WeakMap,uo=new WeakMap,co=new WeakMap,Zs=new WeakMap,Gs=new WeakMap,Ji=new WeakMap,fo=new WeakMap,Nt=new WeakSet,Ku=function(t){Ge(this,Nt,ay).call(this);let n=U(this,pt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Xn)),n},Wg=function(){Ge(this,Nt,ny).call(this);const t=is(this.options.staleTime,U(this,pt));if(sc.isServer()||U(this,lr).isStale||!Vg(t))return;const a=Sj(U(this,lr).dataUpdatedAt,t)+1;ke(this,Zs,Is.setTimeout(()=>{U(this,lr).isStale||this.updateResult()},a))},Jg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,pt)):this.options.refetchInterval)??!1},ey=function(t){Ge(this,Nt,ry).call(this),ke(this,Ji,t),!(sc.isServer()||na(this.options.enabled,U(this,pt))===!1||!Vg(U(this,Ji))||U(this,Ji)===0)&&ke(this,Gs,Is.setInterval(()=>{(this.options.refetchIntervalInBackground||iv.isFocused())&&Ge(this,Nt,Ku).call(this)},U(this,Ji)))},ty=function(){Ge(this,Nt,Wg).call(this),Ge(this,Nt,ey).call(this,Ge(this,Nt,Jg).call(this))},ny=function(){U(this,Zs)&&(Is.clearTimeout(U(this,Zs)),ke(this,Zs,void 0))},ry=function(){U(this,Gs)&&(Is.clearInterval(U(this,Gs)),ke(this,Gs,void 0))},ay=function(){const t=U(this,Sr).getQueryCache().build(U(this,Sr),this.options);if(t===U(this,pt))return;const n=U(this,pt);ke(this,pt,t),ke(this,wc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Tj=function(t){sn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(U(this,lr))}),U(this,Sr).getQueryCache().notify({query:U(this,pt),type:"observerResultsUpdated"})})},mj);function fR(e,t){return na(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zS(e,t){return fR(e,t)||e.state.data!==void 0&&iy(e,t,t.refetchOnMount)}function iy(e,t,n){if(na(t.enabled,e)!==!1&&is(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&dv(e,t)}return!1}function MS(e,t,n,a){return(e!==t||na(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&dv(e,n)}function dv(e,t){return na(t.enabled,e)!==!1&&e.isStaleByTime(is(t.staleTime,e))}function hR(e,t){return!ic(e.getCurrentResult(),t)}function DS(e){return{onFetch:(t,n)=>{var p,g,x,w,S;const a=t.options,s=(x=(g=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:g.fetchMore)==null?void 0:x.direction,o=((w=t.state.data)==null?void 0:w.pages)||[],c=((S=t.state.data)==null?void 0:S.pageParams)||[];let d={pages:[],pageParams:[]},m=0;const h=async()=>{let k=!1;const C=R=>{sR(R,()=>t.signal,()=>k=!0)},E=kj(t.options,t.fetchOptions),N=async(R,z,L)=>{if(k)return Promise.reject();if(z==null&&R.pages.length)return Promise.resolve(R);const B=(()=>{const K={client:t.client,queryKey:t.queryKey,pageParam:z,direction:L?"backward":"forward",meta:t.options.meta};return C(K),K})(),I=await E(B),{maxPages:V}=t.options,D=L?iR:aR;return{pages:D(R.pages,I,V),pageParams:D(R.pageParams,z,V)}};if(s&&o.length){const R=s==="backward",z=R?mR:IS,L={pages:o,pageParams:c},O=z(a,L);d=await N(L,O,R)}else{const R=e??o.length;do{const z=m===0?c[0]??a.initialPageParam:IS(a,d);if(m>0&&z==null)break;d=await N(d,z),m++}while(m<R)}return d};t.options.persister?t.fetchFn=()=>{var k,C;return(C=(k=t.options).persister)==null?void 0:C.call(k,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function IS(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 mR(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 kc,_a,Kn,Vs,Ta,Zi,pj,pR=(pj=class extends Ej{constructor(t){super();_e(this,Ta);_e(this,kc);_e(this,_a);_e(this,Kn);_e(this,Vs);ke(this,kc,t.client),this.mutationId=t.mutationId,ke(this,Kn,t.mutationCache),ke(this,_a,[]),this.state=t.state||Aj(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){U(this,_a).includes(t)||(U(this,_a).push(t),this.clearGcTimeout(),U(this,Kn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ke(this,_a,U(this,_a).filter(n=>n!==t)),this.scheduleGc(),U(this,Kn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,_a).length||(this.state.status==="pending"?this.scheduleGc():U(this,Kn).remove(this))}continue(){var t;return((t=U(this,Vs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,d,m,h,p,g,x,w,S,k,C,E,N,R,z,L,O,B;const n=()=>{Ge(this,Ta,Zi).call(this,{type:"continue"})},a={client:U(this,kc),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,Vs,Cj({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(I,V)=>{Ge(this,Ta,Zi).call(this,{type:"failed",failureCount:I,error:V})},onPause:()=>{Ge(this,Ta,Zi).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,Kn).canRun(this)}));const s=this.state.status==="pending",o=!U(this,Vs).canStart();try{if(s)n();else{Ge(this,Ta,Zi).call(this,{type:"pending",variables:t,isPaused:o}),U(this,Kn).config.onMutate&&await U(this,Kn).config.onMutate(t,this,a);const V=await((d=(c=this.options).onMutate)==null?void 0:d.call(c,t,a));V!==this.state.context&&Ge(this,Ta,Zi).call(this,{type:"pending",context:V,variables:t,isPaused:o})}const I=await U(this,Vs).start();return await((h=(m=U(this,Kn).config).onSuccess)==null?void 0:h.call(m,I,t,this.state.context,this,a)),await((g=(p=this.options).onSuccess)==null?void 0:g.call(p,I,t,this.state.context,a)),await((w=(x=U(this,Kn).config).onSettled)==null?void 0:w.call(x,I,null,this.state.variables,this.state.context,this,a)),await((k=(S=this.options).onSettled)==null?void 0:k.call(S,I,null,t,this.state.context,a)),Ge(this,Ta,Zi).call(this,{type:"success",data:I}),I}catch(I){try{await((E=(C=U(this,Kn).config).onError)==null?void 0:E.call(C,I,t,this.state.context,this,a))}catch(V){Promise.reject(V)}try{await((R=(N=this.options).onError)==null?void 0:R.call(N,I,t,this.state.context,a))}catch(V){Promise.reject(V)}try{await((L=(z=U(this,Kn).config).onSettled)==null?void 0:L.call(z,void 0,I,this.state.variables,this.state.context,this,a))}catch(V){Promise.reject(V)}try{await((B=(O=this.options).onSettled)==null?void 0:B.call(O,void 0,I,t,this.state.context,a))}catch(V){Promise.reject(V)}throw Ge(this,Ta,Zi).call(this,{type:"error",error:I}),I}finally{U(this,Kn).runNext(this)}}},kc=new WeakMap,_a=new WeakMap,Kn=new WeakMap,Vs=new WeakMap,Ta=new WeakSet,Zi=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),sn.batch(()=>{U(this,_a).forEach(a=>{a.onMutationUpdate(t)}),U(this,Kn).notify({mutation:this,type:"updated",action:t})})},pj);function Aj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ai,va,jc,gj,gR=(gj=class extends Ws{constructor(t={}){super();_e(this,ai);_e(this,va);_e(this,jc);this.config=t,ke(this,ai,new Set),ke(this,va,new Map),ke(this,jc,0)}build(t,n,a){const s=new pR({client:t,mutationCache:this,mutationId:++rf(this,jc)._,options:t.defaultMutationOptions(n),state:a});return this.add(s),s}add(t){U(this,ai).add(t);const n=af(t);if(typeof n=="string"){const a=U(this,va).get(n);a?a.push(t):U(this,va).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(U(this,ai).delete(t)){const n=af(t);if(typeof n=="string"){const a=U(this,va).get(n);if(a)if(a.length>1){const s=a.indexOf(t);s!==-1&&a.splice(s,1)}else a[0]===t&&U(this,va).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=af(t);if(typeof n=="string"){const a=U(this,va).get(n),s=a==null?void 0:a.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var a;const n=af(t);if(typeof n=="string"){const s=(a=U(this,va).get(n))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){sn.batch(()=>{U(this,ai).forEach(t=>{this.notify({type:"removed",mutation:t})}),U(this,ai).clear(),U(this,va).clear()})}getAll(){return Array.from(U(this,ai))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>_S(n,a))}findAll(t={}){return this.getAll().filter(n=>_S(t,n))}notify(t){sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return sn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Xn))))}},ai=new WeakMap,va=new WeakMap,jc=new WeakMap,gj);function af(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ii,es,kr,si,oi,Nf,sy,yj,yR=(yj=class extends Ws{constructor(n,a){super();_e(this,oi);_e(this,ii);_e(this,es);_e(this,kr);_e(this,si);ke(this,ii,n),this.setOptions(a),this.bindMethods(),Ge(this,oi,Nf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const a=this.options;this.options=U(this,ii).defaultMutationOptions(n),ic(this.options,a)||U(this,ii).getMutationCache().notify({type:"observerOptionsUpdated",mutation:U(this,kr),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&Qs(a.mutationKey)!==Qs(this.options.mutationKey)?this.reset():((s=U(this,kr))==null?void 0:s.state.status)==="pending"&&U(this,kr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=U(this,kr))==null||n.removeObserver(this)}onMutationUpdate(n){Ge(this,oi,Nf).call(this),Ge(this,oi,sy).call(this,n)}getCurrentResult(){return U(this,es)}reset(){var n;(n=U(this,kr))==null||n.removeObserver(this),ke(this,kr,void 0),Ge(this,oi,Nf).call(this),Ge(this,oi,sy).call(this)}mutate(n,a){var s;return ke(this,si,a),(s=U(this,kr))==null||s.removeObserver(this),ke(this,kr,U(this,ii).getMutationCache().build(U(this,ii),this.options)),U(this,kr).addObserver(this),U(this,kr).execute(n)}},ii=new WeakMap,es=new WeakMap,kr=new WeakMap,si=new WeakMap,oi=new WeakSet,Nf=function(){var a;const n=((a=U(this,kr))==null?void 0:a.state)??Aj();ke(this,es,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},sy=function(n){sn.batch(()=>{var a,s,o,c,d,m,h,p;if(U(this,si)&&this.hasListeners()){const g=U(this,es).variables,x=U(this,es).context,w={client:U(this,ii),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(a=U(this,si)).onSuccess)==null||s.call(a,n.data,g,x,w)}catch(S){Promise.reject(S)}try{(c=(o=U(this,si)).onSettled)==null||c.call(o,n.data,null,g,x,w)}catch(S){Promise.reject(S)}}else if((n==null?void 0:n.type)==="error"){try{(m=(d=U(this,si)).onError)==null||m.call(d,n.error,g,x,w)}catch(S){Promise.reject(S)}try{(p=(h=U(this,si)).onSettled)==null||p.call(h,void 0,n.error,g,x,w)}catch(S){Promise.reject(S)}}}this.listeners.forEach(g=>{g(U(this,es))})})},yj);function LS(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function vR(e,t,n){const a=e.slice(0);return a[t]=n,a}var ho,Ur,mo,po,ta,ts,Cc,Ec,Nc,_c,Gn,ly,oy,uy,cy,dy,vj,bR=(vj=class extends Ws{constructor(t,n,a){super();_e(this,Gn);_e(this,ho);_e(this,Ur);_e(this,mo);_e(this,po);_e(this,ta);_e(this,ts);_e(this,Cc);_e(this,Ec);_e(this,Nc);_e(this,_c,[]);ke(this,ho,t),ke(this,po,a),ke(this,mo,[]),ke(this,ta,[]),ke(this,Ur,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&U(this,ta).forEach(t=>{t.subscribe(n=>{Ge(this,Gn,cy).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,U(this,ta).forEach(t=>{t.destroy()})}setQueries(t,n){ke(this,mo,t),ke(this,po,n),sn.batch(()=>{const a=U(this,ta),s=Ge(this,Gn,uy).call(this,U(this,mo));s.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=s.map(g=>g.observer),c=o.map(g=>g.getCurrentResult()),d=a.length!==o.length,m=o.some((g,x)=>g!==a[x]),h=d||m,p=h?!0:c.some((g,x)=>{const w=U(this,Ur)[x];return!w||!ic(g,w)});!h&&!p||(h&&(ke(this,_c,s),ke(this,ta,o)),ke(this,Ur,c),this.hasListeners()&&(h&&(LS(a,o).forEach(g=>{g.destroy()}),LS(o,a).forEach(g=>{g.subscribe(x=>{Ge(this,Gn,cy).call(this,g,x)})})),Ge(this,Gn,dy).call(this)))})}getCurrentResult(){return U(this,Ur)}getQueries(){return U(this,ta).map(t=>t.getCurrentQuery())}getObservers(){return U(this,ta)}getOptimisticResult(t,n){const a=Ge(this,Gn,uy).call(this,t),s=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[s,c=>Ge(this,Gn,oy).call(this,c??s,n,o),()=>Ge(this,Gn,ly).call(this,s,a)]}},ho=new WeakMap,Ur=new WeakMap,mo=new WeakMap,po=new WeakMap,ta=new WeakMap,ts=new WeakMap,Cc=new WeakMap,Ec=new WeakMap,Nc=new WeakMap,_c=new WeakMap,Gn=new WeakSet,ly=function(t,n){return n.map((a,s)=>{const o=t[s];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{n.forEach(d=>{d.observer.trackProp(c)})})})},oy=function(t,n,a){if(n){const s=U(this,Nc),o=a!==void 0&&s!==void 0&&(s.length!==a.length||a.some((c,d)=>c!==s[d]));return(!U(this,ts)||U(this,Ur)!==U(this,Ec)||o||n!==U(this,Cc))&&(ke(this,Cc,n),ke(this,Ec,U(this,Ur)),a!==void 0&&ke(this,Nc,a),ke(this,ts,lv(U(this,ts),n(t)))),U(this,ts)}return t},uy=function(t){const n=new Map;U(this,ta).forEach(s=>{const o=s.options.queryHash;if(!o)return;const c=n.get(o);c?c.push(s):n.set(o,[s])});const a=[];return t.forEach(s=>{var m;const o=U(this,ho).defaultQueryOptions(s),d=((m=n.get(o.queryHash))==null?void 0:m.shift())??new cv(U(this,ho),o);a.push({defaultedQueryOptions:o,observer:d})}),a},cy=function(t,n){const a=U(this,ta).indexOf(t);a!==-1&&(ke(this,Ur,vR(U(this,Ur),a,n)),Ge(this,Gn,dy).call(this))},dy=function(){var t;if(this.hasListeners()){const n=U(this,ts),a=Ge(this,Gn,ly).call(this,U(this,Ur),U(this,_c)),s=Ge(this,Gn,oy).call(this,a,(t=U(this,po))==null?void 0:t.combine);n!==s&&sn.batch(()=>{this.listeners.forEach(o=>{o(U(this,Ur))})})}},vj),Aa,bj,xR=(bj=class extends Ws{constructor(t={}){super();_e(this,Aa);this.config=t,ke(this,Aa,new Map)}build(t,n,a){const s=n.queryKey,o=n.queryHash??sv(s,n);let c=this.get(o);return c||(c=new dR({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(s)}),this.add(c)),c}add(t){U(this,Aa).has(t.queryHash)||(U(this,Aa).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=U(this,Aa).get(t.queryHash);n&&(t.destroy(),n===t&&U(this,Aa).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){sn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return U(this,Aa).get(t)}getAll(){return[...U(this,Aa).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>NS(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>NS(t,a)):n}notify(t){sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){sn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){sn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Aa=new WeakMap,bj),an,ns,rs,go,yo,as,vo,bo,xj,wR=(xj=class{constructor(e={}){_e(this,an);_e(this,ns);_e(this,rs);_e(this,go);_e(this,yo);_e(this,as);_e(this,vo);_e(this,bo);ke(this,an,e.queryCache||new xR),ke(this,ns,e.mutationCache||new gR),ke(this,rs,e.defaultOptions||{}),ke(this,go,new Map),ke(this,yo,new Map),ke(this,as,0)}mount(){rf(this,as)._++,U(this,as)===1&&(ke(this,vo,iv.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,an).onFocus())})),ke(this,bo,If.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,an).onOnline())})))}unmount(){var e,t;rf(this,as)._--,U(this,as)===0&&((e=U(this,vo))==null||e.call(this),ke(this,vo,void 0),(t=U(this,bo))==null||t.call(this),ke(this,bo,void 0))}isFetching(e){return U(this,an).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,ns).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=U(this,an).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=U(this,an).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(is(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return U(this,an).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),s=U(this,an).get(a.queryHash),o=s==null?void 0:s.state.data,c=tR(t,o);if(c!==void 0)return U(this,an).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return sn.batch(()=>U(this,an).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=U(this,an).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=U(this,an);sn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=U(this,an);return sn.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=sn.batch(()=>U(this,an).findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(Xn).catch(Xn)}invalidateQueries(e,t={}){return sn.batch(()=>(U(this,an).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=sn.batch(()=>U(this,an).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Xn)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(Xn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=U(this,an).build(this,t);return n.isStaleByTime(is(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Xn).catch(Xn)}fetchInfiniteQuery(e){return e.behavior=DS(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Xn).catch(Xn)}ensureInfiniteQueryData(e){return e.behavior=DS(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return If.isOnline()?U(this,ns).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,an)}getMutationCache(){return U(this,ns)}getDefaultOptions(){return U(this,rs)}setDefaultOptions(e){ke(this,rs,e)}setQueryDefaults(e,t){U(this,go).set(Qs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,go).values()],n={};return t.forEach(a=>{ac(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){U(this,yo).set(Qs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,yo).values()],n={};return t.forEach(a=>{ac(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...U(this,rs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sv(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===ov&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...U(this,rs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,an).clear(),U(this,ns).clear()}},an=new WeakMap,ns=new WeakMap,rs=new WeakMap,go=new WeakMap,yo=new WeakMap,as=new WeakMap,vo=new WeakMap,bo=new WeakMap,xj),Rj=b.createContext(void 0),Cn=e=>{const t=b.useContext(Rj);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},SR=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Rj.Provider,{value:e,children:t})),Oj=b.createContext(!1),zj=()=>b.useContext(Oj);Oj.Provider;function kR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jR=b.createContext(kR()),Mj=()=>b.useContext(jR),Dj=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?uv(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},Ij=e=>{b.useEffect(()=>{e.clearReset()},[e])},Lj=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||uv(n,[e.error,a])),Pj=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...s)=>n(a(...s)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},CR=(e,t)=>e.isLoading&&e.isFetching&&!t,fy=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,hy=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ER({queries:e,...t},n){const a=Cn(),s=zj(),o=Mj(),c=b.useMemo(()=>e.map(k=>{const C=a.defaultQueryOptions(k);return C._optimisticResults=s?"isRestoring":"optimistic",C}),[e,a,s]);c.forEach(k=>{Pj(k);const C=a.getQueryCache().get(k.queryHash);Dj(k,o,C)}),Ij(o);const[d]=b.useState(()=>new bR(a,c,t)),[m,h,p]=d.getOptimisticResult(c,t.combine),g=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(k=>g?d.subscribe(sn.batchCalls(k)):Xn,[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),b.useEffect(()=>{d.setQueries(c,t)},[c,t,d]);const w=m.some((k,C)=>fy(c[C],k))?m.flatMap((k,C)=>{const E=c[C];if(E&&fy(E,k)){const N=new cv(a,E);return hy(E,N,o)}return[]}):[];if(w.length>0)throw Promise.all(w);const S=m.find((k,C)=>{const E=c[C];return E&&Lj({result:k,errorResetBoundary:o,throwOnError:E.throwOnError,query:a.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(S!=null&&S.error)throw S.error;return h(p())}function NR(e,t,n){var x,w,S,k;const a=zj(),s=Mj(),o=Cn(),c=o.defaultQueryOptions(e);(w=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||w.call(x,c);const d=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",Pj(c),Dj(c,s,d),Ij(s);const m=!o.getQueryCache().get(c.queryHash),[h]=b.useState(()=>new t(o,c)),p=h.getOptimisticResult(c),g=!a&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(C=>{const E=g?h.subscribe(sn.batchCalls(C)):Xn;return h.updateResult(),E},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),b.useEffect(()=>{h.setOptions(c)},[c,h]),fy(c,p))throw hy(c,h,s);if(Lj({result:p,errorResetBoundary:s,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw p.error;if((k=(S=o.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||k.call(S,c,p),c.experimental_prefetchInRender&&!sc.isServer()&&CR(p,a)){const C=m?hy(c,h,s):d==null?void 0:d.promise;C==null||C.catch(Xn).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?p:h.trackResult(p)}function Ke(e,t){return NR(e,cv)}function bt(e,t){const n=Cn(),[a]=b.useState(()=>new yR(n,e));b.useEffect(()=>{a.setOptions(e)},[a,e]);const s=b.useSyncExternalStore(b.useCallback(c=>a.subscribe(sn.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=b.useCallback((c,d)=>{a.mutate(c,d).catch(Xn)},[a]);if(s.error&&uv(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.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 PS="popstate";function US(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function _R(e={}){function t(a,s){var h;let o=(h=s.state)==null?void 0:h.masked,{pathname:c,search:d,hash:m}=o||a.location;return my("",{pathname:c,search:d,hash:m},s.state&&s.state.usr||null,s.state&&s.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,s){return typeof s=="string"?s:lc(s)}return AR(t,n,null,e)}function Vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ia(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function TR(){return Math.random().toString(36).substring(2,10)}function BS(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 my(e,t,n=null,a,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Eo(t):t,state:n,key:t&&t.key||a||TR(),unstable_mask:s}}function lc({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 Eo(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 AR(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:o=!1}=a,c=s.history,d="POP",m=null,h=p();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function p(){return(c.state||{idx:null}).idx}function g(){d="POP";let C=p(),E=C==null?null:C-h;h=C,m&&m({action:d,location:k.location,delta:E})}function x(C,E){d="PUSH";let N=US(C)?C:my(k.location,C,E);h=p()+1;let R=BS(N,h),z=k.createHref(N.unstable_mask||N);try{c.pushState(R,"",z)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;s.location.assign(z)}o&&m&&m({action:d,location:k.location,delta:1})}function w(C,E){d="REPLACE";let N=US(C)?C:my(k.location,C,E);h=p();let R=BS(N,h),z=k.createHref(N.unstable_mask||N);c.replaceState(R,"",z),o&&m&&m({action:d,location:k.location,delta:0})}function S(C){return RR(C)}let k={get action(){return d},get location(){return e(s,c)},listen(C){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(PS,g),m=C,()=>{s.removeEventListener(PS,g),m=null}},createHref(C){return t(s,C)},createURL:S,encodeLocation(C){let E=S(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:w,go(C){return c.go(C)}};return k}function RR(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Vt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:lc(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function Uj(e,t,n="/"){return OR(e,t,n,!1)}function OR(e,t,n,a){let s=typeof t=="string"?Eo(t):t,o=ui(s.pathname||"/",n);if(o==null)return null;let c=Bj(e);zR(c);let d=null;for(let m=0;d==null&&m<c.length;++m){let h=qR(o);d=FR(c[m],h,a)}return d}function Bj(e,t=[],n=[],a="",s=!1){let o=(c,d,m=s,h)=>{let p={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(a)&&m)return;Vt(p.relativePath.startsWith(a),`Absolute route path "${p.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(a.length)}let g=Oa([a,p.relativePath]),x=n.concat(p);c.children&&c.children.length>0&&(Vt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Bj(c.children,t,x,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:BR(g,c.index),routesMeta:x})};return e.forEach((c,d)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))o(c,d);else for(let h of $j(c.path))o(c,d,!0,h)}),t}function $j(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return s?[o,""]:[o];let c=$j(a.join("/")),d=[];return d.push(...c.map(m=>m===""?o:[o,m].join("/"))),s&&d.push(...c),d.map(m=>e.startsWith("/")&&m===""?"/":m)}function zR(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$R(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var MR=/^:[\w-]+$/,DR=3,IR=2,LR=1,PR=10,UR=-2,$S=e=>e==="*";function BR(e,t){let n=e.split("/"),a=n.length;return n.some($S)&&(a+=UR),t&&(a+=IR),n.filter(s=>!$S(s)).reduce((s,o)=>s+(MR.test(o)?DR:o===""?LR:PR),a)}function $R(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function FR(e,t,n=!1){let{routesMeta:a}=e,s={},o="/",c=[];for(let d=0;d<a.length;++d){let m=a[d],h=d===a.length-1,p=o==="/"?t:t.slice(o.length)||"/",g=Lf({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},p),x=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Lf({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},p)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:Oa([o,g.pathname]),pathnameBase:QR(Oa([o,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(o=Oa([o,g.pathnameBase]))}return c}function Lf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=HR(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],c=o.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:a.reduce((h,{paramName:p,isOptional:g},x)=>{if(p==="*"){let S=d[x]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const w=d[x];return g&&!w?h[p]=void 0:h[p]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function HR(e,t=!1,n=!0){ia(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,m,h,p)=>{if(a.push({paramName:d,isOptional:m!=null}),m){let g=p.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function qR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ia(!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 ui(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 ZR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function GR(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?Eo(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=FS(n.substring(1),"/"):o=FS(n,t)):o=t,{pathname:o,search:KR(a),hash:YR(s)}}function FS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Wp(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 VR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fv(e){let t=VR(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function rh(e,t,n,a=!1){let s;typeof e=="string"?s=Eo(e):(s={...e},Vt(!s.pathname||!s.pathname.includes("?"),Wp("?","pathname","search",s)),Vt(!s.pathname||!s.pathname.includes("#"),Wp("#","pathname","hash",s)),Vt(!s.search||!s.search.includes("#"),Wp("#","search","hash",s)));let o=e===""||s.pathname==="",c=o?"/":s.pathname,d;if(c==null)d=n;else{let g=t.length-1;if(!a&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}d=g>=0?t[g]:"/"}let m=GR(s,d),h=c&&c!=="/"&&c.endsWith("/"),p=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||p)&&(m.pathname+="/"),m}var Oa=e=>e.join("/").replace(/\/\/+/g,"/"),QR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),KR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,YR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,XR=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 WR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function JR(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Fj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Hj(e,t){let n=e;if(typeof n!="string"||!ZR.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(Fj)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),d=ui(c.pathname,t);c.origin===o.origin&&d!=null?n=d+c.search+c.hash:s=!0}catch{ia(!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:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var qj=["POST","PUT","PATCH","DELETE"];new Set(qj);var eO=["GET",...qj];new Set(eO);var No=b.createContext(null);No.displayName="DataRouter";var ah=b.createContext(null);ah.displayName="DataRouterState";var tO=b.createContext(!1),Zj=b.createContext({isTransitioning:!1});Zj.displayName="ViewTransition";var nO=b.createContext(new Map);nO.displayName="Fetchers";var rO=b.createContext(null);rO.displayName="Await";var Fr=b.createContext(null);Fr.displayName="Navigation";var Tc=b.createContext(null);Tc.displayName="Location";var la=b.createContext({outlet:null,matches:[],isDataRoute:!1});la.displayName="Route";var hv=b.createContext(null);hv.displayName="RouteError";var Gj="REACT_ROUTER_ERROR",aO="REDIRECT",iO="ROUTE_ERROR_RESPONSE";function sO(e){if(e.startsWith(`${Gj}:${aO}:{`))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 lO(e){if(e.startsWith(`${Gj}:${iO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new XR(t.status,t.statusText,t.data)}catch{}}function oO(e,{relative:t}={}){Vt(_o(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=b.useContext(Fr),{hash:s,pathname:o,search:c}=Ac(e,{relative:t}),d=o;return n!=="/"&&(d=o==="/"?n:Oa([n,o])),a.createHref({pathname:d,search:c,hash:s})}function _o(){return b.useContext(Tc)!=null}function Er(){return Vt(_o(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Tc).location}var Vj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Qj(e){b.useContext(Fr).static||b.useLayoutEffect(e)}function Tn(){let{isDataRoute:e}=b.useContext(la);return e?kO():uO()}function uO(){Vt(_o(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(No),{basename:t,navigator:n}=b.useContext(Fr),{matches:a}=b.useContext(la),{pathname:s}=Er(),o=JSON.stringify(fv(a)),c=b.useRef(!1);return Qj(()=>{c.current=!0}),b.useCallback((m,h={})=>{if(ia(c.current,Vj),!c.current)return;if(typeof m=="number"){n.go(m);return}let p=rh(m,JSON.parse(o),s,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Oa([t,p.pathname])),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,o,s,e])}var cO=b.createContext(null);function dO(e){let t=b.useContext(la).outlet;return b.useMemo(()=>t&&b.createElement(cO.Provider,{value:e},t),[t,e])}function Kj(){let{matches:e}=b.useContext(la),t=e[e.length-1];return t?t.params:{}}function Ac(e,{relative:t}={}){let{matches:n}=b.useContext(la),{pathname:a}=Er(),s=JSON.stringify(fv(n));return b.useMemo(()=>rh(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function fO(e,t){return Yj(e,t)}function Yj(e,t,n){var C;Vt(_o(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(Fr),{matches:s}=b.useContext(la),o=s[s.length-1],c=o?o.params:{},d=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let E=h&&h.path||"";Wj(d,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let p=Er(),g;if(t){let E=typeof t=="string"?Eo(t):t;Vt(m==="/"||((C=E.pathname)==null?void 0:C.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${E.pathname}" was given in the \`location\` prop.`),g=E}else g=p;let x=g.pathname||"/",w=x;if(m!=="/"){let E=m.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let S=Uj(e,{pathname:w});ia(h||S!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),ia(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.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 k=yO(S&&S.map(E=>Object.assign({},E,{params:Object.assign({},c,E.params),pathname:Oa([m,a.encodeLocation?a.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:Oa([m,a.encodeLocation?a.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),s,n);return t&&k?b.createElement(Tc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},k):k}function hO(){let e=SO(),t=WR(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)",s={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=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:s},n):null,c)}var mO=b.createElement(hO,null),Xj=class extends b.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=lO(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(la.Provider,{value:this.props.routeContext},b.createElement(hv.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(pO,{error:e},t):t}};Xj.contextType=tO;var Jp=new WeakMap;function pO({children:e,error:t}){let{basename:n}=b.useContext(Fr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=sO(t.digest);if(a){let s=Jp.get(t);if(s)throw s;let o=Hj(a.location,n);if(Fj&&!Jp.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 Jp.set(t,c),c}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function gO({routeContext:e,match:t,children:n}){let a=b.useContext(No);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(la.Provider,{value:e},n)}function yO(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 s=e,o=a==null?void 0:a.errors;if(o!=null){let p=s.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);Vt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,p+1))}let c=!1,d=-1;if(n&&a){c=a.renderFallback;for(let p=0;p<s.length;p++){let g=s[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(d=p),g.route.id){let{loaderData:x,errors:w}=a,S=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||S){n.isStatic&&(c=!0),d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(p,g)=>{var x,w;m(p,{location:a.location,params:((w=(x=a.matches)==null?void 0:x[0])==null?void 0:w.params)??{},unstable_pattern:JR(a.matches),errorInfo:g})}:void 0;return s.reduceRight((p,g,x)=>{let w,S=!1,k=null,C=null;a&&(w=o&&g.route.id?o[g.route.id]:void 0,k=g.route.errorElement||mO,c&&(d<0&&x===0?(Wj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):d===x&&(S=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(s.slice(0,x+1)),N=()=>{let R;return w?R=k:S?R=C:g.route.Component?R=b.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=p,b.createElement(gO,{match:g,routeContext:{outlet:p,matches:E,isDataRoute:a!=null},children:R})};return a&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?b.createElement(Xj,{location:a.location,revalidation:a.revalidation,component:k,error:w,children:N(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):N()},null)}function mv(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vO(e){let t=b.useContext(No);return Vt(t,mv(e)),t}function bO(e){let t=b.useContext(ah);return Vt(t,mv(e)),t}function xO(e){let t=b.useContext(la);return Vt(t,mv(e)),t}function pv(e){let t=xO(e),n=t.matches[t.matches.length-1];return Vt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function wO(){return pv("useRouteId")}function SO(){var a;let e=b.useContext(hv),t=bO("useRouteError"),n=pv("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function kO(){let{router:e}=vO("useNavigate"),t=pv("useNavigate"),n=b.useRef(!1);return Qj(()=>{n.current=!0}),b.useCallback(async(s,o={})=>{ia(n.current,Vj),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var HS={};function Wj(e,t,n){!t&&!HS[e]&&(HS[e]=!0,ia(!1,n))}b.memo(jO);function jO({routes:e,future:t,state:n,isStatic:a,onError:s}){return Yj(e,void 0,{state:n,isStatic:a,onError:s})}function or({to:e,replace:t,state:n,relative:a}){Vt(_o(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=b.useContext(Fr);ia(!s,"<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}=b.useContext(la),{pathname:c}=Er(),d=Tn(),m=rh(e,fv(o),c,a==="path"),h=JSON.stringify(m);return b.useEffect(()=>{d(JSON.parse(h),{replace:t,state:n,relative:a})},[d,h,a,t,n]),null}function Pf(e){return dO(e.context)}function Dt(e){Vt(!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 CO({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:o=!1,unstable_useTransitions:c}){Vt(!_o(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:d,navigator:s,static:o,unstable_useTransitions:c,future:{}}),[d,s,o,c]);typeof n=="string"&&(n=Eo(n));let{pathname:h="/",search:p="",hash:g="",state:x=null,key:w="default",unstable_mask:S}=n,k=b.useMemo(()=>{let C=ui(h,d);return C==null?null:{location:{pathname:C,search:p,hash:g,state:x,key:w,unstable_mask:S},navigationType:a}},[d,h,p,g,x,w,a,S]);return ia(k!=null,`<Router basename="${d}"> is not able to match the URL "${h}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:b.createElement(Fr.Provider,{value:m},b.createElement(Tc.Provider,{children:t,value:k}))}function EO({children:e,location:t}){return fO(py(e),t)}function py(e,t=[]){let n=[];return b.Children.forEach(e,(a,s)=>{if(!b.isValidElement(a))return;let o=[...t,s];if(a.type===b.Fragment){n.push.apply(n,py(a.props.children,o));return}Vt(a.type===Dt,`[${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>`),Vt(!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=py(a.props.children,o)),n.push(c)}),n}var _f="get",Tf="application/x-www-form-urlencoded";function ih(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function NO(e){return ih(e)&&e.tagName.toLowerCase()==="button"}function _O(e){return ih(e)&&e.tagName.toLowerCase()==="form"}function TO(e){return ih(e)&&e.tagName.toLowerCase()==="input"}function AO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function RO(e,t){return e.button===0&&(!t||t==="_self")&&!AO(e)}function gy(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(s=>[n,s]):[[n,a]])},[]))}function OO(e,t){let n=gy(e);return t&&t.forEach((a,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var sf=null;function zO(){if(sf===null)try{new FormData(document.createElement("form"),0),sf=!1}catch{sf=!0}return sf}var MO=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function eg(e){return e!=null&&!MO.has(e)?(ia(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tf}"`),null):e}function DO(e,t){let n,a,s,o,c;if(_O(e)){let d=e.getAttribute("action");a=d?ui(d,t):null,n=e.getAttribute("method")||_f,s=eg(e.getAttribute("enctype"))||Tf,o=new FormData(e)}else if(NO(e)||TO(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||d.getAttribute("action");if(a=m?ui(m,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||_f,s=eg(e.getAttribute("formenctype"))||eg(d.getAttribute("enctype"))||Tf,o=new FormData(d,e),!zO()){let{name:h,type:p,value:g}=e;if(p==="image"){let x=h?`${h}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else h&&o.append(h,g)}}else{if(ih(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=_f,a=null,s=Tf,c=e}return o&&s==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gv(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function IO(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&ui(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function LO(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 PO(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 UO(e,t,n){let a=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let c=await LO(o,n);return c.links?c.links():[]}return[]}));return HO(a.flat(1).filter(PO).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function qS(e,t,n,a,s,o){let c=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,d=(m,h)=>{var p;return n[h].pathname!==m.pathname||((p=n[h].route.path)==null?void 0:p.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>c(m,h)||d(m,h)):o==="data"?t.filter((m,h)=>{var g;let p=a.routes[m.route.id];if(!p||!p.hasLoader)return!1;if(c(m,h)||d(m,h))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.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 x=="boolean")return x}return!0}):[]}function BO(e,t,{includeHydrateFallback:n}={}){return $O(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function $O(e){return[...new Set(e)]}function FO(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function HO(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let o=JSON.stringify(FO(s));return n.has(o)||(n.add(o),a.push({key:o,link:s})),a},[])}function Jj(){let e=b.useContext(No);return gv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function qO(){let e=b.useContext(ah);return gv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var yv=b.createContext(void 0);yv.displayName="FrameworkContext";function eC(){let e=b.useContext(yv);return gv(e,"You must render this element inside a <HydratedRouter> element"),e}function ZO(e,t){let n=b.useContext(yv),[a,s]=b.useState(!1),[o,c]=b.useState(!1),{onFocus:d,onBlur:m,onMouseEnter:h,onMouseLeave:p,onTouchStart:g}=t,x=b.useRef(null);b.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let k=E=>{E.forEach(N=>{c(N.isIntersecting)})},C=new IntersectionObserver(k,{threshold:.5});return x.current&&C.observe(x.current),()=>{C.disconnect()}}},[e]),b.useEffect(()=>{if(a){let k=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(k)}}},[a]);let w=()=>{s(!0)},S=()=>{s(!1),c(!1)};return n?e!=="intent"?[o,x,{}]:[o,x,{onFocus:Ru(d,w),onBlur:Ru(m,S),onMouseEnter:Ru(h,w),onMouseLeave:Ru(p,S),onTouchStart:Ru(g,w)}]:[!1,x,{}]}function Ru(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function GO({page:e,...t}){let{router:n}=Jj(),a=b.useMemo(()=>Uj(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?b.createElement(QO,{page:e,matches:a,...t}):null}function VO(e){let{manifest:t,routeModules:n}=eC(),[a,s]=b.useState([]);return b.useEffect(()=>{let o=!1;return UO(e,t,n).then(c=>{o||s(c)}),()=>{o=!0}},[e,t,n]),a}function QO({page:e,matches:t,...n}){let a=Er(),{future:s,manifest:o,routeModules:c}=eC(),{basename:d}=Jj(),{loaderData:m,matches:h}=qO(),p=b.useMemo(()=>qS(e,t,h,o,a,"data"),[e,t,h,o,a]),g=b.useMemo(()=>qS(e,t,h,o,a,"assets"),[e,t,h,o,a]),x=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let k=new Set,C=!1;if(t.forEach(N=>{var z;let R=o.routes[N.route.id];!R||!R.hasLoader||(!p.some(L=>L.route.id===N.route.id)&&N.route.id in m&&((z=c[N.route.id])!=null&&z.shouldRevalidate)||R.hasClientLoader?C=!0:k.add(N.route.id))}),k.size===0)return[];let E=IO(e,d,s.unstable_trailingSlashAwareDataRequests,"data");return C&&k.size>0&&E.searchParams.set("_routes",t.filter(N=>k.has(N.route.id)).map(N=>N.route.id).join(",")),[E.pathname+E.search]},[d,s.unstable_trailingSlashAwareDataRequests,m,a,o,p,t,e,c]),w=b.useMemo(()=>BO(g,o),[g,o]),S=VO(g);return b.createElement(b.Fragment,null,x.map(k=>b.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...n})),w.map(k=>b.createElement("link",{key:k,rel:"modulepreload",href:k,...n})),S.map(({key:k,link:C})=>b.createElement("link",{key:k,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function KO(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var YO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{YO&&(window.__reactRouterVersion="7.13.1")}catch{}function XO({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=b.useRef();s.current==null&&(s.current=_R({window:a,v5Compat:!0}));let o=s.current,[c,d]=b.useState({action:o.action,location:o.location}),m=b.useCallback(h=>{n===!1?d(h):b.startTransition(()=>d(h))},[n]);return b.useLayoutEffect(()=>o.listen(m),[o,m]),b.createElement(CO,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var tC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rc=b.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:o,replace:c,unstable_mask:d,state:m,target:h,to:p,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:w,...S},k){let{basename:C,navigator:E,unstable_useTransitions:N}=b.useContext(Fr),R=typeof p=="string"&&tC.test(p),z=Hj(p,C);p=z.to;let L=oO(p,{relative:s}),O=Er(),B=null;if(d){let X=rh(d,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);C!=="/"&&(X.pathname=X.pathname==="/"?C:Oa([C,X.pathname])),B=E.createHref(X)}let[I,V,D]=ZO(a,S),K=ez(p,{replace:c,unstable_mask:d,state:m,target:h,preventScrollReset:g,relative:s,viewTransition:x,unstable_defaultShouldRevalidate:w,unstable_useTransitions:N});function ae(X){t&&t(X),X.defaultPrevented||K(X)}let be=!(z.isExternal||o),W=b.createElement("a",{...S,...D,href:(be?B:void 0)||z.absoluteURL||L,onClick:be?ae:t,ref:KO(k,V),target:h,"data-discover":!R&&n==="render"?"true":void 0});return I&&!R?b.createElement(b.Fragment,null,W,b.createElement(GO,{page:L})):W});Rc.displayName="Link";var vv=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:o,to:c,viewTransition:d,children:m,...h},p){let g=Ac(c,{relative:h.relative}),x=Er(),w=b.useContext(ah),{navigator:S,basename:k}=b.useContext(Fr),C=w!=null&&iz(g)&&d===!0,E=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,N=x.pathname,R=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(N=N.toLowerCase(),R=R?R.toLowerCase():null,E=E.toLowerCase()),R&&k&&(R=ui(R,k)||R);const z=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let L=N===E||!s&&N.startsWith(E)&&N.charAt(z)==="/",O=R!=null&&(R===E||!s&&R.startsWith(E)&&R.charAt(E.length)==="/"),B={isActive:L,isPending:O,isTransitioning:C},I=L?t:void 0,V;typeof a=="function"?V=a(B):V=[a,L?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let D=typeof o=="function"?o(B):o;return b.createElement(Rc,{...h,"aria-current":I,className:V,ref:p,style:D,to:c,viewTransition:d},typeof m=="function"?m(B):m)});vv.displayName="NavLink";var WO=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:o,method:c=_f,action:d,onSubmit:m,relative:h,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:x,...w},S)=>{let{unstable_useTransitions:k}=b.useContext(Fr),C=rz(),E=az(d,{relative:h}),N=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&tC.test(d),z=L=>{if(m&&m(L),L.defaultPrevented)return;L.preventDefault();let O=L.nativeEvent.submitter,B=(O==null?void 0:O.getAttribute("formmethod"))||c,I=()=>C(O||L.currentTarget,{fetcherKey:t,method:B,navigate:n,replace:s,state:o,relative:h,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:x});k&&n!==!1?b.startTransition(()=>I()):I()};return b.createElement("form",{ref:S,method:N,action:E,onSubmit:a?m:z,...w,"data-discover":!R&&e==="render"?"true":void 0})});WO.displayName="Form";function JO(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nC(e){let t=b.useContext(No);return Vt(t,JO(e)),t}function ez(e,{target:t,replace:n,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let p=Tn(),g=Er(),x=Ac(e,{relative:c});return b.useCallback(w=>{if(RO(w,t)){w.preventDefault();let S=n!==void 0?n:lc(g)===lc(x),k=()=>p(e,{replace:S,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:m});h?b.startTransition(()=>k()):k()}},[g,p,x,n,a,s,t,e,o,c,d,m,h])}function sh(e){ia(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=b.useRef(gy(e)),n=b.useRef(!1),a=Er(),s=b.useMemo(()=>OO(a.search,n.current?null:t.current),[a.search]),o=Tn(),c=b.useCallback((d,m)=>{const h=gy(typeof d=="function"?d(new URLSearchParams(s)):d);n.current=!0,o("?"+h,m)},[o,s]);return[s,c]}var tz=0,nz=()=>`__${String(++tz)}__`;function rz(){let{router:e}=nC("useSubmit"),{basename:t}=b.useContext(Fr),n=wO(),a=e.fetch,s=e.navigate;return b.useCallback(async(o,c={})=>{let{action:d,method:m,encType:h,formData:p,body:g}=DO(o,t);if(c.navigate===!1){let x=c.fetcherKey||nz();await a(x,n,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:p,body:g,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await s(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:p,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,s,t,n])}function az(e,{relative:t}={}){let{basename:n}=b.useContext(Fr),a=b.useContext(la);Vt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),o={...Ac(e||".",{relative:t})},c=Er();if(e==null){o.search=c.search;let d=new URLSearchParams(o.search),m=d.getAll("index");if(m.some(p=>p==="")){d.delete("index"),m.filter(g=>g).forEach(g=>d.append("index",g));let p=d.toString();o.search=p?`?${p}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Oa([n,o.pathname])),lc(o)}function iz(e,{relative:t}={}){let n=b.useContext(Zj);Vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=nC("useViewTransitionState"),s=Ac(e,{relative:t});if(!n.isTransitioning)return!1;let o=ui(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=ui(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Lf(s.pathname,c)!=null||Lf(s.pathname,o)!=null}const sz="/api/v1";async function lz(e,t){const n=await fetch(`${sz}/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 s;try{s=JSON.parse(a).error??a}catch{s=a}throw new Error(s)}return await n.json()}const rC="/api/v1",bv="first-tree-hub:tokens";let yy=null;function Ou(e){yy=e}function An(e){if(!yy)throw new Error(`withOrg("${e}") called before an organization is selected`);return`/orgs/${encodeURIComponent(yy)}${e}`}function vy(e,t){return`/orgs/${encodeURIComponent(e)}${t}`}function lh(){const e=localStorage.getItem(bv);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function by(e){localStorage.setItem(bv,JSON.stringify(e))}function aC(){localStorage.removeItem(bv)}class Js extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let zu=null;async function oz(){const e=lh();return e!=null&&e.refreshToken?iC(e.refreshToken):null}async function iC(e){return zu||(zu=(async()=>{try{const t=await fetch(`${rC}/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 by(a),a}catch{return null}finally{zu=null}})(),zu)}async function Mu(e,t){const{method:n="GET",body:a}=t??{},s=d=>{const m={};return d&&(m.Authorization=`Bearer ${d}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${rC}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=lh();let c=await s(o==null?void 0:o.accessToken);if(c.status===401&&(o!=null&&o.refreshToken)){const d=await iC(o.refreshToken);d&&(c=await s(d.accessToken))}if(!c.ok){c.status===401&&(aC(),window.dispatchEvent(new CustomEvent("auth:logout")));const d=await c.text();let m,h;try{const p=JSON.parse(d);m=p.error??d,Array.isArray(p.details)&&(h=p.details.filter(g=>typeof g=="object"&&g!==null&&Array.isArray(g.path)))}catch{m=d}throw new Js(c.status,m,h)}if(c.status!==204)return await c.json()}const Ee={get:e=>Mu(e),post:(e,t)=>Mu(e,{method:"POST",body:t}),patch:(e,t)=>Mu(e,{method:"PATCH",body:t}),put:(e,t)=>Mu(e,{method:"PUT",body:t}),delete:e=>Mu(e,{method:"DELETE"})},xv="onboarding:joinPath",uz="onboarding:draft",xy="onboarding:step1Confirmed";function sC(){return typeof window>"u"?!1:window.sessionStorage.getItem(xy)==="1"}function cz(e){typeof window>"u"||(e?window.sessionStorage.setItem(xy,"1"):window.sessionStorage.removeItem(xy))}const wy="onboarding:agentUuid";function dz(){return typeof window>"u"?null:window.sessionStorage.getItem(wy)}function fz(e){typeof window>"u"||(e?window.sessionStorage.setItem(wy,e):window.sessionStorage.removeItem(wy))}function lC(e){typeof window>"u"||window.sessionStorage.setItem(xv,e)}function oC(){if(typeof window>"u")return null;const e=window.sessionStorage.getItem(xv);return e==="solo"||e==="invite"?e:null}function hz(){typeof window>"u"||window.sessionStorage.removeItem(xv)}function mz(e,t){return`${e??"unknown-org"}:${t??"unknown-member"}`}function wv(e){return`${uz}:${e}`}function pz(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 gz(e){if(typeof window>"u")return null;const t=window.sessionStorage.getItem(wv(e));if(!t)return null;try{return pz(JSON.parse(t))}catch{return null}}function yz(e,t){typeof window>"u"||window.sessionStorage.setItem(wv(e),JSON.stringify(t))}function vz(e){typeof window>"u"||window.sessionStorage.removeItem(wv(e))}function bz(){if(typeof window>"u")return;const e=window.sessionStorage,t=[];for(let n=0;n<e.length;n++){const a=e.key(n);a!=null&&a.startsWith("onboarding:")&&t.push(a)}for(const n of t)e.removeItem(n)}const uC=b.createContext(null),Sy="first-tree-hub:selectedOrganizationId";function xz(){try{return localStorage.getItem(Sy)}catch{return null}}function tg(e){try{e===null?localStorage.removeItem(Sy):localStorage.setItem(Sy,e)}catch{}}function wz({children:e}){const t=Cn(),[n,a]=b.useState(()=>!!lh()),[s,o]=b.useState(null),[c,d]=b.useState([]),[m,h]=b.useState(()=>{const V=xz();return Ou(V),V}),[p,g]=b.useState(null),[x,w]=b.useState(null),[S,k]=b.useState(!1),C=b.useCallback(()=>{aC(),tg(null),Ou(null),t.clear(),bz(),a(!1),o(null),d([]),h(null),g(null),w(null),k(!1)},[t]),E=b.useCallback(async()=>{var V,D;try{const K=await Ee.get("/me");o(K.user??null);const ae=K.memberships??[];d(ae);const be=((V=K.onboarding)==null?void 0:V.step)??null;g(be),w(((D=K.onboarding)==null?void 0:D.dismissedAt)??null),be==="completed"&&hz(),h(W=>{var te;const X=W&&ae.some(je=>je.organizationId===W)?W:null;if(X)return Ou(X),X;const Z=K.defaultOrganizationId??((te=ae[0])==null?void 0:te.organizationId)??null;return tg(Z),Ou(Z),Z})}catch{}finally{k(!0)}},[]),N=b.useCallback(async(V,D)=>{const K=await lz(V,D);by({accessToken:K.accessToken,refreshToken:K.refreshToken}),a(!0),await E()},[E]),R=b.useCallback(async V=>{by(V),a(!0),await E()},[E]),z=b.useCallback(async V=>{tg(V),Ou(V),t.clear(),h(V),await E()},[E,t]),L=b.useRef(null);b.useEffect(()=>{L.current=x},[x]);const O=b.useCallback(async()=>{const V=L.current;w(new Date().toISOString());try{const D=await Ee.patch("/me/onboarding",{dismissed:!0});D!=null&&D.dismissedAt&&w(D.dismissedAt)}catch{w(V)}},[]),B=b.useCallback(async()=>{const V=L.current;w(null);try{await Ee.patch("/me/onboarding",{dismissed:!1})}catch{w(V)}},[]);b.useEffect(()=>{n&&!s&&E()},[n,s,E]),b.useEffect(()=>{const V=()=>C();return window.addEventListener("auth:logout",V),()=>window.removeEventListener("auth:logout",V)},[C]);const I=b.useMemo(()=>c.length===0?null:c.find(D=>D.organizationId===m)??c[0]??null,[c,m]);return l.jsx(uC.Provider,{value:{isAuthenticated:n,meLoaded:S,user:s,memberships:c,currentMembership:I,organizationId:(I==null?void 0:I.organizationId)??null,memberId:(I==null?void 0:I.id)??null,role:(I==null?void 0:I.role)??null,agentId:(I==null?void 0:I.agentId)??null,onboardingStep:p,onboardingDismissedAt:x,dismissOnboarding:O,restoreOnboarding:B,login:N,adoptTokens:R,selectOrganization:z,refreshMe:E,logout:C},children:e})}function yt(){const e=b.useContext(uC);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const Sz="modulepreload",kz=function(e){return"/"+e},ZS={},jz=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),m=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));s=c(n.map(h=>{if(h=kz(h),h in ZS)return;ZS[h]=!0;const p=h.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":Sz,p||(x.as="script"),x.crossOrigin="",x.href=h,m&&x.setAttribute("nonce",m),document.head.appendChild(x),p)return new Promise((w,S)=>{x.addEventListener("load",w),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return s.then(c=>{for(const d of c||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})},Cz=b.lazy(()=>jz(()=>import("./index-JGwkYWtM.js"),[]).then(e=>({default:e.LandingPage}))),GS=()=>l.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function Ez(){const{isAuthenticated:e,meLoaded:t}=yt(),n=Er();return e?t?l.jsx(Pf,{}):l.jsx(GS,{}):n.pathname==="/"?l.jsx(b.Suspense,{fallback:l.jsx(GS,{}),children:l.jsx(Cz,{})}):l.jsx(or,{to:"/login",replace:!0,state:{from:n}})}/**
|
|
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 cC=(...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 Nz=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 _z=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 VS=e=>{const t=_z(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 Tz={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 Az=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 Rz=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:o,iconNode:c,...d},m)=>b.createElement("svg",{ref:m,...Tz,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:cC("lucide",s),...!o&&!Az(d)&&{"aria-hidden":"true"},...d},[...c.map(([h,p])=>b.createElement(h,p)),...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 et=(e,t)=>{const n=b.forwardRef(({className:a,...s},o)=>b.createElement(Rz,{ref:o,iconNode:t,className:cC(`lucide-${Nz(VS(e))}`,`lucide-${e}`,a),...s}));return n.displayName=VS(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 Oz=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Sv=et("arrow-left",Oz);/**
|
|
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 zz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],dC=et("arrow-right",zz);/**
|
|
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 Mz=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],fC=et("arrow-up",Mz);/**
|
|
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 Dz=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Iz=et("at-sign",Dz);/**
|
|
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 Lz=[["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"}]],Pz=et("bell",Lz);/**
|
|
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 Uz=[["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"}]],hC=et("bot",Uz);/**
|
|
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 Bz=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],$z=et("building-2",Bz);/**
|
|
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 Fz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cr=et("check",Fz);/**
|
|
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 Hz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kv=et("chevron-down",Hz);/**
|
|
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 qz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],mC=et("chevron-right",qz);/**
|
|
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 Zz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Gz=et("circle-check",Zz);/**
|
|
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 Vz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],Qz=et("circle-pause",Vz);/**
|
|
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 Kz=[["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"}]],jv=et("copy",Kz);/**
|
|
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 Yz=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Xz=et("ellipsis",Yz);/**
|
|
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 Wz=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Cv=et("external-link",Wz);/**
|
|
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 Jz=[["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"}]],eM=et("eye-off",Jz);/**
|
|
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 tM=[["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"}]],pC=et("eye",tM);/**
|
|
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 nM=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],rM=et("folder-tree",nM);/**
|
|
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 aM=[["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"}]],gC=et("github",aM);/**
|
|
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 iM=[["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"}]],sM=et("layout-dashboard",iM);/**
|
|
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 lM=[["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"}]],ky=et("link-2",lM);/**
|
|
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 oM=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],yC=et("loader-circle",oM);/**
|
|
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 uM=[["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"}]],oh=et("lock",uM);/**
|
|
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 cM=[["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"}]],dM=et("log-out",cM);/**
|
|
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 fM=[["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"}]],Ev=et("message-square",fM);/**
|
|
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 hM=[["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"}]],mM=et("moon",hM);/**
|
|
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 pM=[["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"}]],gM=et("paperclip",pM);/**
|
|
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 yM=[["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"}]],Nv=et("pencil",yM);/**
|
|
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 vM=[["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"}]],vC=et("play",vM);/**
|
|
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 bM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xa=et("plus",bM);/**
|
|
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 xM=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],wM=et("refresh-cw",xM);/**
|
|
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 SM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],uh=et("search",SM);/**
|
|
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 kM=[["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"}]],jM=et("sun",kM);/**
|
|
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 CM=[["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"}]],Uf=et("trash-2",CM);/**
|
|
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 EM=[["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"}]],To=et("triangle-alert",EM);/**
|
|
276
|
+
* @license lucide-react v0.577.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const NM=[["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"}]],_M=et("undo-2",NM);/**
|
|
281
|
+
* @license lucide-react v0.577.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const TM=[["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"}]],bC=et("user-plus",TM);/**
|
|
286
|
+
* @license lucide-react v0.577.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const AM=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],xC=et("user",AM);/**
|
|
291
|
+
* @license lucide-react v0.577.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const RM=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],OM=et("users",RM);/**
|
|
296
|
+
* @license lucide-react v0.577.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const zM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],os=et("x",zM);/**
|
|
301
|
+
* @license lucide-react v0.577.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const MM=[["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"}]],DM=et("zap",MM);function wC(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=wC(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function SC(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=wC(e))&&(a&&(a+=" "),a+=t);return a}const IM=(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},LM=(e,t)=>({classGroupId:e,validator:t}),kC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Bf="-",QS=[],PM="arbitrary..",UM=e=>{const t=$M(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return BM(c);const d=c.split(Bf),m=d[0]===""&&d.length>1?1:0;return jC(d,m,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const m=a[c],h=n[c];return m?h?IM(h,m):m:h||QS}return n[c]||QS}}},jC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const h=jC(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const d=t===0?e.join(Bf):e.slice(t).join(Bf),m=c.length;for(let h=0;h<m;h++){const p=c[h];if(p.validator(d))return p.classGroupId}},BM=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?PM+a:void 0})(),$M=e=>{const{theme:t,classGroups:n}=e;return FM(n,t)},FM=(e,t)=>{const n=kC();for(const a in e){const s=e[a];_v(s,n,a,t)}return n},_v=(e,t,n,a)=>{const s=e.length;for(let o=0;o<s;o++){const c=e[o];HM(c,t,n,a)}},HM=(e,t,n,a)=>{if(typeof e=="string"){qM(e,t,n);return}if(typeof e=="function"){ZM(e,t,n,a);return}GM(e,t,n,a)},qM=(e,t,n)=>{const a=e===""?t:CC(t,e);a.classGroupId=n},ZM=(e,t,n,a)=>{if(VM(e)){_v(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(LM(n,e))},GM=(e,t,n,a)=>{const s=Object.entries(e),o=s.length;for(let c=0;c<o;c++){const[d,m]=s[c];_v(m,CC(t,d),n,a)}},CC=(e,t)=>{let n=e;const a=t.split(Bf),s=a.length;for(let o=0;o<s;o++){const c=a[o];let d=n.nextPart.get(c);d||(d=kC(),n.nextPart.set(c,d)),n=d}return n},VM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,QM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(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 s(o,c),c},set(o,c){o in n?n[o]=c:s(o,c)}}},jy="!",KS=":",KM=[],YS=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),YM=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const o=[];let c=0,d=0,m=0,h;const p=s.length;for(let k=0;k<p;k++){const C=s[k];if(c===0&&d===0){if(C===KS){o.push(s.slice(m,k)),m=k+1;continue}if(C==="/"){h=k;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const g=o.length===0?s:s.slice(m);let x=g,w=!1;g.endsWith(jy)?(x=g.slice(0,-1),w=!0):g.startsWith(jy)&&(x=g.slice(1),w=!0);const S=h&&h>m?h-m:void 0;return YS(o,w,x,S)};if(t){const s=t+KS,o=a;a=c=>c.startsWith(s)?o(c.slice(s.length)):YS(KM,!1,c,void 0,!0)}if(n){const s=a;a=o=>n({className:o,parseClassName:s})}return a},XM=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let o=0;o<n.length;o++){const c=n[o],d=c[0]==="[",m=t.has(c);d||m?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(c)):s.push(c)}return s.length>0&&(s.sort(),a.push(...s)),a}},WM=e=>({cache:QM(e.cacheSize),parseClassName:YM(e),sortModifiers:XM(e),...UM(e)}),JM=/\s+/,e3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:o}=t,c=[],d=e.trim().split(JM);let m="";for(let h=d.length-1;h>=0;h-=1){const p=d[h],{isExternal:g,modifiers:x,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:k}=n(p);if(g){m=p+(m.length>0?" "+m:m);continue}let C=!!k,E=a(C?S.substring(0,k):S);if(!E){if(!C){m=p+(m.length>0?" "+m:m);continue}if(E=a(S),!E){m=p+(m.length>0?" "+m:m);continue}C=!1}const N=x.length===0?"":x.length===1?x[0]:o(x).join(":"),R=w?N+jy:N,z=R+E;if(c.indexOf(z)>-1)continue;c.push(z);const L=s(E,C);for(let O=0;O<L.length;++O){const B=L[O];c.push(R+B)}m=p+(m.length>0?" "+m:m)}return m},t3=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=EC(n))&&(s&&(s+=" "),s+=a);return s},EC=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=EC(e[a]))&&(n&&(n+=" "),n+=t);return n},n3=(e,...t)=>{let n,a,s,o;const c=m=>{const h=t.reduce((p,g)=>g(p),e());return n=WM(h),a=n.cache.get,s=n.cache.set,o=d,d(m)},d=m=>{const h=a(m);if(h)return h;const p=e3(m,n);return s(m,p),p};return o=c,(...m)=>o(t3(...m))},r3=[],_n=e=>{const t=n=>n[e]||r3;return t.isThemeGetter=!0,t},NC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_C=/^\((?:(\w[\w-]*):)?(.+)\)$/i,a3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,i3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s3=/\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$/,l3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,o3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,u3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fi=e=>a3.test(e),nt=e=>!!e&&!Number.isNaN(Number(e)),Hi=e=>!!e&&Number.isInteger(Number(e)),ng=e=>e.endsWith("%")&&nt(e.slice(0,-1)),ti=e=>i3.test(e),TC=()=>!0,c3=e=>s3.test(e)&&!l3.test(e),Tv=()=>!1,d3=e=>o3.test(e),f3=e=>u3.test(e),h3=e=>!Oe(e)&&!ze(e),m3=e=>hs(e,OC,Tv),Oe=e=>NC.test(e),Ms=e=>hs(e,zC,c3),XS=e=>hs(e,S3,nt),p3=e=>hs(e,DC,TC),g3=e=>hs(e,MC,Tv),WS=e=>hs(e,AC,Tv),y3=e=>hs(e,RC,f3),lf=e=>hs(e,IC,d3),ze=e=>_C.test(e),Du=e=>el(e,zC),v3=e=>el(e,MC),JS=e=>el(e,AC),b3=e=>el(e,OC),x3=e=>el(e,RC),of=e=>el(e,IC,!0),w3=e=>el(e,DC,!0),hs=(e,t,n)=>{const a=NC.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},el=(e,t,n=!1)=>{const a=_C.exec(e);return a?a[1]?t(a[1]):n:!1},AC=e=>e==="position"||e==="percentage",RC=e=>e==="image"||e==="url",OC=e=>e==="length"||e==="size"||e==="bg-size",zC=e=>e==="length",S3=e=>e==="number",MC=e=>e==="family-name",DC=e=>e==="number"||e==="weight",IC=e=>e==="shadow",k3=()=>{const e=_n("color"),t=_n("font"),n=_n("text"),a=_n("font-weight"),s=_n("tracking"),o=_n("leading"),c=_n("breakpoint"),d=_n("container"),m=_n("spacing"),h=_n("radius"),p=_n("shadow"),g=_n("inset-shadow"),x=_n("text-shadow"),w=_n("drop-shadow"),S=_n("blur"),k=_n("perspective"),C=_n("aspect"),E=_n("ease"),N=_n("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...z(),ze,Oe],O=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],I=()=>[ze,Oe,m],V=()=>[Fi,"full","auto",...I()],D=()=>[Hi,"none","subgrid",ze,Oe],K=()=>["auto",{span:["full",Hi,ze,Oe]},Hi,ze,Oe],ae=()=>[Hi,"auto",ze,Oe],be=()=>["auto","min","max","fr",ze,Oe],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...I()],te=()=>[Fi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],je=()=>[Fi,"screen","full","dvw","lvw","svw","min","max","fit",...I()],Ae=()=>[Fi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],M=()=>[e,ze,Oe],P=()=>[...z(),JS,WS,{position:[ze,Oe]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",b3,m3,{size:[ze,Oe]}],G=()=>[ng,Du,Ms],q=()=>["","none","full",h,ze,Oe],re=()=>["",nt,Du,Ms],xe=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[nt,ng,JS,WS],Ie=()=>["","none",S,ze,Oe],Ue=()=>["none",nt,ze,Oe],ft=()=>["none",nt,ze,Oe],ut=()=>[nt,ze,Oe],ie=()=>[Fi,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ti],breakpoint:[ti],color:[TC],container:[ti],"drop-shadow":[ti],ease:["in","out","in-out"],font:[h3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ti],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ti],shadow:[ti],spacing:["px",nt],text:[ti],"text-shadow":[ti],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fi,Oe,ze,C]}],container:["container"],columns:[{columns:[nt,Oe,ze,d]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:L()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Hi,"auto",ze,Oe]}],basis:[{basis:[Fi,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,Fi,"auto","initial","none",Oe]}],grow:[{grow:["",nt,ze,Oe]}],shrink:[{shrink:["",nt,ze,Oe]}],order:[{order:[Hi,"first","last","none",ze,Oe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":be()}],"auto-rows":[{"auto-rows":be()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],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":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...je()]}],"min-inline-size":[{"min-inline":["auto",...je()]}],"max-inline-size":[{"max-inline":["none",...je()]}],"block-size":[{block:["auto",...Ae()]}],"min-block-size":[{"min-block":["auto",...Ae()]}],"max-block-size":[{"max-block":["none",...Ae()]}],w:[{w:[d,"screen",...te()]}],"min-w":[{"min-w":[d,"screen","none",...te()]}],"max-w":[{"max-w":[d,"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,Du,Ms]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,w3,p3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ng,Oe]}],"font-family":[{font:[v3,g3,t]}],"font-features":[{"font-features":[Oe]}],"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:[s,ze,Oe]}],"line-clamp":[{"line-clamp":[nt,"none",ze,XS]}],leading:[{leading:[o,...I()]}],"list-image":[{"list-image":["none",ze,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ze,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",ze,Ms]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[nt,"auto",ze,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze,Oe]}],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",ze,Oe]}],"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:$()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hi,ze,Oe],radial:["",ze,Oe],conic:[Hi,ze,Oe]},x3,y3]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,ze,Oe]}],"outline-w":[{outline:["",nt,Du,Ms]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",p,of,lf]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",g,of,lf]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[nt,Ms]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",x,of,lf]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[nt,ze,Oe]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"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":[nt]}],"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":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"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":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"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":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"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":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"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":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"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":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"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":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[ze,Oe]}],"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":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"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":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ze,Oe]}],filter:[{filter:["","none",ze,Oe]}],blur:[{blur:Ie()}],brightness:[{brightness:[nt,ze,Oe]}],contrast:[{contrast:[nt,ze,Oe]}],"drop-shadow":[{"drop-shadow":["","none",w,of,lf]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",nt,ze,Oe]}],"hue-rotate":[{"hue-rotate":[nt,ze,Oe]}],invert:[{invert:["",nt,ze,Oe]}],saturate:[{saturate:[nt,ze,Oe]}],sepia:[{sepia:["",nt,ze,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",ze,Oe]}],"backdrop-blur":[{"backdrop-blur":Ie()}],"backdrop-brightness":[{"backdrop-brightness":[nt,ze,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[nt,ze,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,ze,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,ze,Oe]}],"backdrop-invert":[{"backdrop-invert":["",nt,ze,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[nt,ze,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[nt,ze,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,ze,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ze,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",ze,Oe]}],ease:[{ease:["linear","initial",E,ze,Oe]}],delay:[{delay:[nt,ze,Oe]}],animate:[{animate:["none",N,ze,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,ze,Oe]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Ue()}],"rotate-x":[{"rotate-x":Ue()}],"rotate-y":[{"rotate-y":Ue()}],"rotate-z":[{"rotate-z":Ue()}],scale:[{scale:ft()}],"scale-x":[{"scale-x":ft()}],"scale-y":[{"scale-y":ft()}],"scale-z":[{"scale-z":ft()}],"scale-3d":["scale-3d"],skew:[{skew:ut()}],"skew-x":[{"skew-x":ut()}],"skew-y":[{"skew-y":ut()}],transform:[{transform:[ze,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"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:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"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",ze,Oe]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ze,Oe]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[nt,Du,Ms,XS]}],stroke:[{stroke:["none",...M()]}],"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"]}},j3=n3(k3);function Me(...e){return j3(SC(e))}function oc(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 LC(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(e)):"—"}function C3(e){return Ee.delete(`/clients/${encodeURIComponent(e)}`)}function Oc(){return Ee.get(An("/activity"))}function ci(){return Ee.get("/me/clients")}function ch(e){return Ee.get(`/clients/${e}`)}function E3(e){return Ee.post(`/clients/${e}/disconnect`)}function N3(){return Ee.post("/me/connect-tokens")}const e1=e=>["agent-sessions",e];function _3(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 T3(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 A3(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function PC(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 Ee.get(`/agents/${e}/sessions${a?`?${a}`:""}`)}function R3(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 s=a.toString();return Ee.get(`/agents/${e}/sessions/${t}/events${s?`?${s}`:""}`)}var t1=1,O3=.9,z3=.8,M3=.17,rg=.1,ag=.999,D3=.9999,I3=.99,L3=/[\\\/_+.#"@\[\(\{&]/,P3=/[\\\/_+.#"@\[\(\{&]/g,U3=/[\s-]/,UC=/[\s-]/g;function Cy(e,t,n,a,s,o,c){if(o===t.length)return s===e.length?t1:I3;var d=`${s},${o}`;if(c[d]!==void 0)return c[d];for(var m=a.charAt(o),h=n.indexOf(m,s),p=0,g,x,w,S;h>=0;)g=Cy(e,t,n,a,h+1,o+1,c),g>p&&(h===s?g*=t1:L3.test(e.charAt(h-1))?(g*=z3,w=e.slice(s,h-1).match(P3),w&&s>0&&(g*=Math.pow(ag,w.length))):U3.test(e.charAt(h-1))?(g*=O3,S=e.slice(s,h-1).match(UC),S&&s>0&&(g*=Math.pow(ag,S.length))):(g*=M3,s>0&&(g*=Math.pow(ag,h-s))),e.charAt(h)!==t.charAt(o)&&(g*=D3)),(g<rg&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(x=Cy(e,t,n,a,h+1,o+2,c),x*rg>g&&(g=x*rg)),g>p&&(p=g),h=n.indexOf(m,h+1);return c[d]=p,p}function n1(e){return e.toLowerCase().replace(UC," ")}function B3(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Cy(e,t,n1(e),n1(t),0,0,{})}function ss(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function r1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function us(...e){return t=>{let n=!1;const a=e.map(s=>{const o=r1(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<a.length;s++){const o=a[s];typeof o=="function"?o():r1(e[s],null)}}}}function tl(...e){return b.useCallback(us(...e),e)}function $3(e,t){const n=b.createContext(t),a=o=>{const{children:c,...d}=o,m=b.useMemo(()=>d,Object.values(d));return l.jsx(n.Provider,{value:m,children:c})};a.displayName=e+"Provider";function s(o){const c=b.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,s]}function F3(e,t=[]){let n=[];function a(o,c){const d=b.createContext(c),m=n.length;n=[...n,c];const h=g=>{var E;const{scope:x,children:w,...S}=g,k=((E=x==null?void 0:x[e])==null?void 0:E[m])||d,C=b.useMemo(()=>S,Object.values(S));return l.jsx(k.Provider,{value:C,children:w})};h.displayName=o+"Provider";function p(g,x){var k;const w=((k=x==null?void 0:x[e])==null?void 0:k[m])||d,S=b.useContext(w);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,p]}const s=()=>{const o=n.map(c=>b.createContext(c));return function(d){const m=(d==null?void 0:d[e])||o;return b.useMemo(()=>({[`__scope${e}`]:{...d,[e]:m}}),[d,m])}};return s.scopeName=e,[a,H3(s,...t)]}function H3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const c=a.reduce((d,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...d,...g}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var uc=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},q3=av[" useId ".trim().toString()]||(()=>{}),Z3=0;function li(e){const[t,n]=b.useState(q3());return uc(()=>{n(a=>a??String(Z3++))},[e]),t?`radix-${t}`:""}var G3=av[" useInsertionEffect ".trim().toString()]||uc;function V3({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[s,o,c]=Q3({defaultProp:t,onChange:n}),d=e!==void 0,m=d?e:s;{const p=b.useRef(e!==void 0);b.useEffect(()=>{const g=p.current;g!==d&&console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${d?"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.`),p.current=d},[d,a])}const h=b.useCallback(p=>{var g;if(d){const x=K3(p)?p(e):p;x!==e&&((g=c.current)==null||g.call(c,x))}else o(p)},[d,e,o,c]);return[m,h]}function Q3({defaultProp:e,onChange:t}){const[n,a]=b.useState(e),s=b.useRef(n),o=b.useRef(t);return G3(()=>{o.current=t},[t]),b.useEffect(()=>{var c;s.current!==n&&((c=o.current)==null||c.call(o,n),s.current=n)},[n,s]),[n,a,o]}function K3(e){return typeof e=="function"}var Av=wj();const Y3=nh(Av);function BC(e){const t=X3(e),n=b.forwardRef((a,s)=>{const{children:o,...c}=a,d=b.Children.toArray(o),m=d.find(J3);if(m){const h=m.props.children,p=d.map(g=>g===m?b.Children.count(h)>1?b.Children.only(null):b.isValidElement(h)?h.props.children:null:g);return l.jsx(t,{...c,ref:s,children:b.isValidElement(h)?b.cloneElement(h,void 0,p):null})}return l.jsx(t,{...c,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function X3(e){const t=b.forwardRef((n,a)=>{const{children:s,...o}=n;if(b.isValidElement(s)){const c=tD(s),d=eD(o,s.props);return s.type!==b.Fragment&&(d.ref=a?us(a,c):c),b.cloneElement(s,d)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var W3=Symbol("radix.slottable");function J3(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===W3}function eD(e,t){const n={...t};for(const a in t){const s=e[a],o=t[a];/^on[A-Z]/.test(a)?s&&o?n[a]=(...d)=>{const m=o(...d);return s(...d),m}:s&&(n[a]=s):a==="style"?n[a]={...s,...o}:a==="className"&&(n[a]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function tD(e){var a,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.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"],fi=nD.reduce((e,t)=>{const n=BC(`Primitive.${t}`),a=b.forwardRef((s,o)=>{const{asChild:c,...d}=s,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function rD(e,t){e&&Av.flushSync(()=>e.dispatchEvent(t))}function cc(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function aD(e,t=globalThis==null?void 0:globalThis.document){const n=cc(e);b.useEffect(()=>{const a=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var iD="DismissableLayer",Ey="dismissableLayer.update",sD="dismissableLayer.pointerDownOutside",lD="dismissableLayer.focusOutside",a1,$C=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),FC=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:c,onDismiss:d,...m}=e,h=b.useContext($C),[p,g]=b.useState(null),x=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=b.useState({}),S=tl(t,B=>g(B)),k=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=k.indexOf(C),N=p?k.indexOf(p):-1,R=h.layersWithOutsidePointerEventsDisabled.size>0,z=N>=E,L=cD(B=>{const I=B.target,V=[...h.branches].some(D=>D.contains(I));!z||V||(s==null||s(B),c==null||c(B),B.defaultPrevented||d==null||d())},x),O=dD(B=>{const I=B.target;[...h.branches].some(D=>D.contains(I))||(o==null||o(B),c==null||c(B),B.defaultPrevented||d==null||d())},x);return aD(B=>{N===h.layers.size-1&&(a==null||a(B),!B.defaultPrevented&&d&&(B.preventDefault(),d()))},x),b.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(a1=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),i1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=a1)}},[p,x,n,h]),b.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),i1())},[p,h]),b.useEffect(()=>{const B=()=>w({});return document.addEventListener(Ey,B),()=>document.removeEventListener(Ey,B)},[]),l.jsx(fi.div,{...m,ref:S,style:{pointerEvents:R?z?"auto":"none":void 0,...e.style},onFocusCapture:ss(e.onFocusCapture,O.onFocusCapture),onBlurCapture:ss(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:ss(e.onPointerDownCapture,L.onPointerDownCapture)})});FC.displayName=iD;var oD="DismissableLayerBranch",uD=b.forwardRef((e,t)=>{const n=b.useContext($C),a=b.useRef(null),s=tl(t,a);return b.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),l.jsx(fi.div,{...e,ref:s})});uD.displayName=oD;function cD(e,t=globalThis==null?void 0:globalThis.document){const n=cc(e),a=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const o=d=>{if(d.target&&!a.current){let m=function(){HC(sD,n,h,{discrete:!0})};const h={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=m,t.addEventListener("click",s.current,{once:!0})):m()}else t.removeEventListener("click",s.current);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function dD(e,t=globalThis==null?void 0:globalThis.document){const n=cc(e),a=b.useRef(!1);return b.useEffect(()=>{const s=o=>{o.target&&!a.current&&HC(lD,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function i1(){const e=new CustomEvent(Ey);document.dispatchEvent(e)}function HC(e,t,n,{discrete:a}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),a?rD(s,o):s.dispatchEvent(o)}var ig="focusScope.autoFocusOnMount",sg="focusScope.autoFocusOnUnmount",s1={bubbles:!1,cancelable:!0},fD="FocusScope",qC=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...c}=e,[d,m]=b.useState(null),h=cc(s),p=cc(o),g=b.useRef(null),x=tl(t,k=>m(k)),w=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(a){let k=function(R){if(w.paused||!d)return;const z=R.target;d.contains(z)?g.current=z:Gi(g.current,{select:!0})},C=function(R){if(w.paused||!d)return;const z=R.relatedTarget;z!==null&&(d.contains(z)||Gi(g.current,{select:!0}))},E=function(R){if(document.activeElement===document.body)for(const L of R)L.removedNodes.length>0&&Gi(d)};document.addEventListener("focusin",k),document.addEventListener("focusout",C);const N=new MutationObserver(E);return d&&N.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",C),N.disconnect()}}},[a,d,w.paused]),b.useEffect(()=>{if(d){o1.add(w);const k=document.activeElement;if(!d.contains(k)){const E=new CustomEvent(ig,s1);d.addEventListener(ig,h),d.dispatchEvent(E),E.defaultPrevented||(hD(vD(ZC(d)),{select:!0}),document.activeElement===k&&Gi(d))}return()=>{d.removeEventListener(ig,h),setTimeout(()=>{const E=new CustomEvent(sg,s1);d.addEventListener(sg,p),d.dispatchEvent(E),E.defaultPrevented||Gi(k??document.body,{select:!0}),d.removeEventListener(sg,p),o1.remove(w)},0)}}},[d,h,p,w]);const S=b.useCallback(k=>{if(!n&&!a||w.paused)return;const C=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,E=document.activeElement;if(C&&E){const N=k.currentTarget,[R,z]=mD(N);R&&z?!k.shiftKey&&E===z?(k.preventDefault(),n&&Gi(R,{select:!0})):k.shiftKey&&E===R&&(k.preventDefault(),n&&Gi(z,{select:!0})):E===N&&k.preventDefault()}},[n,a,w.paused]);return l.jsx(fi.div,{tabIndex:-1,...c,ref:x,onKeyDown:S})});qC.displayName=fD;function hD(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(Gi(a,{select:t}),document.activeElement!==n)return}function mD(e){const t=ZC(e),n=l1(t,e),a=l1(t.reverse(),e);return[n,a]}function ZC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function l1(e,t){for(const n of e)if(!pD(n,{upTo:t}))return n}function pD(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 gD(e){return e instanceof HTMLInputElement&&"select"in e}function Gi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gD(e)&&t&&e.select()}}var o1=yD();function yD(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=u1(e,t),e.unshift(t)},remove(t){var n;e=u1(e,t),(n=e[0])==null||n.resume()}}}function u1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function vD(e){return e.filter(t=>t.tagName!=="A")}var bD="Portal",GC=b.forwardRef((e,t)=>{var d;const{container:n,...a}=e,[s,o]=b.useState(!1);uc(()=>o(!0),[]);const c=n||s&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?Y3.createPortal(l.jsx(fi.div,{...a,ref:t}),c):null});GC.displayName=bD;function xD(e,t){return b.useReducer((n,a)=>t[n][a]??n,e)}var dh=e=>{const{present:t,children:n}=e,a=wD(t),s=typeof n=="function"?n({present:a.isPresent}):b.Children.only(n),o=tl(a.ref,SD(s));return typeof n=="function"||a.isPresent?b.cloneElement(s,{ref:o}):null};dh.displayName="Presence";function wD(e){const[t,n]=b.useState(),a=b.useRef(null),s=b.useRef(e),o=b.useRef("none"),c=e?"mounted":"unmounted",[d,m]=xD(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const h=uf(a.current);o.current=d==="mounted"?h:"none"},[d]),uc(()=>{const h=a.current,p=s.current;if(p!==e){const x=o.current,w=uf(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(p&&x!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,m]),uc(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,g=w=>{const k=uf(a.current).includes(CSS.escape(w.animationName));if(w.target===t&&k&&(m("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=w=>{w.target===t&&(o.current=uf(a.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:b.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function uf(e){return(e==null?void 0:e.animationName)||"none"}function SD(e){var a,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lg=0;function kD(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??c1()),document.body.insertAdjacentElement("beforeend",e[1]??c1()),lg++,()=>{lg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lg--}},[])}function c1(){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 Ra=function(){return Ra=Object.assign||function(t){for(var n,a=1,s=arguments.length;a<s;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ra.apply(this,arguments)};function VC(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 s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)t.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(n[a[s]]=e[a[s]]);return n}function jD(e,t,n){if(n||arguments.length===2)for(var a=0,s=t.length,o;a<s;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 Af="right-scroll-bar-position",Rf="width-before-scroll-bar",CD="with-scroll-bars-hidden",ED="--removed-body-scroll-bar-size";function og(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ND(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var s=n.value;s!==a&&(n.value=a,n.callback(a,s))}}}})[0];return n.callback=t,n.facade}var _D=typeof window<"u"?b.useLayoutEffect:b.useEffect,d1=new WeakMap;function TD(e,t){var n=ND(null,function(a){return e.forEach(function(s){return og(s,a)})});return _D(function(){var a=d1.get(n);if(a){var s=new Set(a),o=new Set(e),c=n.current;s.forEach(function(d){o.has(d)||og(d,null)}),o.forEach(function(d){s.has(d)||og(d,c)})}d1.set(n,e)},[e]),n}function AD(e){return e}function RD(e,t){t===void 0&&(t=AD);var n=[],a=!1,s={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(d){return d!==c})}},assignSyncMedium:function(o){for(a=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(d){return o(d)},filter:function(){return n}}},assignMedium:function(o){a=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(o),c=n}var m=function(){var p=c;c=[],p.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(p){c.push(p),h()},filter:function(p){return c=c.filter(p),n}}}};return s}function OD(e){e===void 0&&(e={});var t=RD(null);return t.options=Ra({async:!0,ssr:!1},e),t}var QC=function(e){var t=e.sideCar,n=VC(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 b.createElement(a,Ra({},n))};QC.isSideCarExport=!0;function zD(e,t){return e.useMedium(t),QC}var KC=OD(),ug=function(){},fh=b.forwardRef(function(e,t){var n=b.useRef(null),a=b.useState({onScrollCapture:ug,onWheelCapture:ug,onTouchMoveCapture:ug}),s=a[0],o=a[1],c=e.forwardProps,d=e.children,m=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,x=e.sideCar,w=e.noRelative,S=e.noIsolation,k=e.inert,C=e.allowPinchZoom,E=e.as,N=E===void 0?"div":E,R=e.gapMode,z=VC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=x,O=TD([n,t]),B=Ra(Ra({},z),s);return b.createElement(b.Fragment,null,p&&b.createElement(L,{sideCar:KC,removeScrollBar:h,shards:g,noRelative:w,noIsolation:S,inert:k,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:R}),c?b.cloneElement(b.Children.only(d),Ra(Ra({},B),{ref:O})):b.createElement(N,Ra({},B,{className:m,ref:O}),d))});fh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};fh.classNames={fullWidth:Rf,zeroRight:Af};var MD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function DD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=MD();return t&&e.setAttribute("nonce",t),e}function ID(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function LD(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var PD=function(){var e=0,t=null;return{add:function(n){e==0&&(t=DD())&&(ID(t,n),LD(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},UD=function(){var e=PD();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},YC=function(){var e=UD(),t=function(n){var a=n.styles,s=n.dynamic;return e(a,s),null};return t},BD={left:0,top:0,right:0,gap:0},cg=function(e){return parseInt(e||"",10)||0},$D=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[cg(n),cg(a),cg(s)]},FD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return BD;var t=$D(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])}},HD=YC(),to="data-scroll-locked",qD=function(e,t,n,a){var s=e.left,o=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
306
|
+
.`.concat(CD,` {
|
|
307
|
+
overflow: hidden `).concat(a,`;
|
|
308
|
+
padding-right: `).concat(d,"px ").concat(a,`;
|
|
309
|
+
}
|
|
310
|
+
body[`).concat(to,`] {
|
|
311
|
+
overflow: hidden `).concat(a,`;
|
|
312
|
+
overscroll-behavior: contain;
|
|
313
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
314
|
+
padding-left: `.concat(s,`px;
|
|
315
|
+
padding-top: `).concat(o,`px;
|
|
316
|
+
padding-right: `).concat(c,`px;
|
|
317
|
+
margin-left:0;
|
|
318
|
+
margin-top:0;
|
|
319
|
+
margin-right: `).concat(d,"px ").concat(a,`;
|
|
320
|
+
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.`).concat(Af,` {
|
|
324
|
+
right: `).concat(d,"px ").concat(a,`;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.`).concat(Rf,` {
|
|
328
|
+
margin-right: `).concat(d,"px ").concat(a,`;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.`).concat(Af," .").concat(Af,` {
|
|
332
|
+
right: 0 `).concat(a,`;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.`).concat(Rf," .").concat(Rf,` {
|
|
336
|
+
margin-right: 0 `).concat(a,`;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
body[`).concat(to,`] {
|
|
340
|
+
`).concat(ED,": ").concat(d,`px;
|
|
341
|
+
}
|
|
342
|
+
`)},f1=function(){var e=parseInt(document.body.getAttribute(to)||"0",10);return isFinite(e)?e:0},ZD=function(){b.useEffect(function(){return document.body.setAttribute(to,(f1()+1).toString()),function(){var e=f1()-1;e<=0?document.body.removeAttribute(to):document.body.setAttribute(to,e.toString())}},[])},GD=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,s=a===void 0?"margin":a;ZD();var o=b.useMemo(function(){return FD(s)},[s]);return b.createElement(HD,{styles:qD(o,!t,s,n?"":"!important")})},Ny=!1;if(typeof window<"u")try{var cf=Object.defineProperty({},"passive",{get:function(){return Ny=!0,!0}});window.addEventListener("test",cf,cf),window.removeEventListener("test",cf,cf)}catch{Ny=!1}var Bl=Ny?{passive:!1}:!1,VD=function(e){return e.tagName==="TEXTAREA"},XC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!VD(e)&&n[t]==="visible")},QD=function(e){return XC(e,"overflowY")},KD=function(e){return XC(e,"overflowX")},h1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var s=WC(e,a);if(s){var o=JC(e,a),c=o[1],d=o[2];if(c>d)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},YD=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},XD=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},WC=function(e,t){return e==="v"?QD(t):KD(t)},JC=function(e,t){return e==="v"?YD(t):XD(t)},WD=function(e,t){return e==="h"&&t==="rtl"?-1:1},JD=function(e,t,n,a,s){var o=WD(e,window.getComputedStyle(t).direction),c=o*a,d=n.target,m=t.contains(d),h=!1,p=c>0,g=0,x=0;do{if(!d)break;var w=JC(e,d),S=w[0],k=w[1],C=w[2],E=k-C-o*S;(S||E)&&WC(e,d)&&(g+=E,x+=S);var N=d.parentNode;d=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!m&&d!==document.body||m&&(t.contains(d)||t===d));return(p&&Math.abs(g)<1||!p&&Math.abs(x)<1)&&(h=!0),h},df=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},m1=function(e){return[e.deltaX,e.deltaY]},p1=function(e){return e&&"current"in e?e.current:e},eI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tI=function(e){return`
|
|
343
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
344
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
345
|
+
`)},nI=0,$l=[];function rI(e){var t=b.useRef([]),n=b.useRef([0,0]),a=b.useRef(),s=b.useState(nI++)[0],o=b.useState(YC)[0],c=b.useRef(e);b.useEffect(function(){c.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var k=jD([e.lockRef.current],(e.shards||[]).map(p1),!0).filter(Boolean);return k.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),k.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=b.useCallback(function(k,C){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!c.current.allowPinchZoom;var E=df(k),N=n.current,R="deltaX"in k?k.deltaX:N[0]-E[0],z="deltaY"in k?k.deltaY:N[1]-E[1],L,O=k.target,B=Math.abs(R)>Math.abs(z)?"h":"v";if("touches"in k&&B==="h"&&O.type==="range")return!1;var I=window.getSelection(),V=I&&I.anchorNode,D=V?V===O||V.contains(O):!1;if(D)return!1;var K=h1(B,O);if(!K)return!0;if(K?L=B:(L=B==="v"?"h":"v",K=h1(B,O)),!K)return!1;if(!a.current&&"changedTouches"in k&&(R||z)&&(a.current=L),!L)return!0;var ae=a.current||L;return JD(ae,C,k,ae==="h"?R:z)},[]),m=b.useCallback(function(k){var C=k;if(!(!$l.length||$l[$l.length-1]!==o)){var E="deltaY"in C?m1(C):df(C),N=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&eI(L.delta,E)})[0];if(N&&N.should){C.cancelable&&C.preventDefault();return}if(!N){var R=(c.current.shards||[]).map(p1).filter(Boolean).filter(function(L){return L.contains(C.target)}),z=R.length>0?d(C,R[0]):!c.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),h=b.useCallback(function(k,C,E,N){var R={name:k,delta:C,target:E,should:N,shadowParent:aI(E)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(z){return z!==R})},1)},[]),p=b.useCallback(function(k){n.current=df(k),a.current=void 0},[]),g=b.useCallback(function(k){h(k.type,m1(k),k.target,d(k,e.lockRef.current))},[]),x=b.useCallback(function(k){h(k.type,df(k),k.target,d(k,e.lockRef.current))},[]);b.useEffect(function(){return $l.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",m,Bl),document.addEventListener("touchmove",m,Bl),document.addEventListener("touchstart",p,Bl),function(){$l=$l.filter(function(k){return k!==o}),document.removeEventListener("wheel",m,Bl),document.removeEventListener("touchmove",m,Bl),document.removeEventListener("touchstart",p,Bl)}},[]);var w=e.removeScrollBar,S=e.inert;return b.createElement(b.Fragment,null,S?b.createElement(o,{styles:tI(s)}):null,w?b.createElement(GD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const iI=zD(KC,rI);var eE=b.forwardRef(function(e,t){return b.createElement(fh,Ra({},e,{ref:t,sideCar:iI}))});eE.classNames=fh.classNames;var sI=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fl=new WeakMap,ff=new WeakMap,hf={},dg=0,tE=function(e){return e&&(e.host||tE(e.parentNode))},lI=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=tE(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})},oI=function(e,t,n,a){var s=lI(t,Array.isArray(e)?e:[e]);hf[n]||(hf[n]=new WeakMap);var o=hf[n],c=[],d=new Set,m=new Set(s),h=function(g){!g||d.has(g)||(d.add(g),h(g.parentNode))};s.forEach(h);var p=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(x){if(d.has(x))p(x);else try{var w=x.getAttribute(a),S=w!==null&&w!=="false",k=(Fl.get(x)||0)+1,C=(o.get(x)||0)+1;Fl.set(x,k),o.set(x,C),c.push(x),k===1&&S&&ff.set(x,!0),C===1&&x.setAttribute(n,"true"),S||x.setAttribute(a,"true")}catch(E){console.error("aria-hidden: cannot operate on ",x,E)}})};return p(t),d.clear(),dg++,function(){c.forEach(function(g){var x=Fl.get(g)-1,w=o.get(g)-1;Fl.set(g,x),o.set(g,w),x||(ff.has(g)||g.removeAttribute(a),ff.delete(g)),w||g.removeAttribute(n)}),dg--,dg||(Fl=new WeakMap,Fl=new WeakMap,ff=new WeakMap,hf={})}},uI=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),s=sI(e);return s?(a.push.apply(a,Array.from(s.querySelectorAll("[aria-live], script"))),oI(a,s,n,"aria-hidden")):function(){return null}},hh="Dialog",[nE]=F3(hh),[cI,wa]=nE(hh),rE=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:s,onOpenChange:o,modal:c=!0}=e,d=b.useRef(null),m=b.useRef(null),[h,p]=V3({prop:a,defaultProp:s??!1,onChange:o,caller:hh});return l.jsx(cI,{scope:t,triggerRef:d,contentRef:m,contentId:li(),titleId:li(),descriptionId:li(),open:h,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(g=>!g),[p]),modal:c,children:n})};rE.displayName=hh;var aE="DialogTrigger",dI=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=wa(aE,n),o=tl(t,s.triggerRef);return l.jsx(fi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":zv(s.open),...a,ref:o,onClick:ss(e.onClick,s.onOpenToggle)})});dI.displayName=aE;var Rv="DialogPortal",[fI,iE]=nE(Rv,{forceMount:void 0}),sE=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:s}=e,o=wa(Rv,t);return l.jsx(fI,{scope:t,forceMount:n,children:b.Children.map(a,c=>l.jsx(dh,{present:n||o.open,children:l.jsx(GC,{asChild:!0,container:s,children:c})}))})};sE.displayName=Rv;var $f="DialogOverlay",lE=b.forwardRef((e,t)=>{const n=iE($f,e.__scopeDialog),{forceMount:a=n.forceMount,...s}=e,o=wa($f,e.__scopeDialog);return o.modal?l.jsx(dh,{present:a||o.open,children:l.jsx(mI,{...s,ref:t})}):null});lE.displayName=$f;var hI=BC("DialogOverlay.RemoveScroll"),mI=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=wa($f,n);return l.jsx(eE,{as:hI,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(fi.div,{"data-state":zv(s.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Ks="DialogContent",oE=b.forwardRef((e,t)=>{const n=iE(Ks,e.__scopeDialog),{forceMount:a=n.forceMount,...s}=e,o=wa(Ks,e.__scopeDialog);return l.jsx(dh,{present:a||o.open,children:o.modal?l.jsx(pI,{...s,ref:t}):l.jsx(gI,{...s,ref:t})})});oE.displayName=Ks;var pI=b.forwardRef((e,t)=>{const n=wa(Ks,e.__scopeDialog),a=b.useRef(null),s=tl(t,n.contentRef,a);return b.useEffect(()=>{const o=a.current;if(o)return uI(o)},[]),l.jsx(uE,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ss(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ss(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&o.preventDefault()}),onFocusOutside:ss(e.onFocusOutside,o=>o.preventDefault())})}),gI=b.forwardRef((e,t)=>{const n=wa(Ks,e.__scopeDialog),a=b.useRef(!1),s=b.useRef(!1);return l.jsx(uE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(a.current||(d=n.triggerRef.current)==null||d.focus(),o.preventDefault()),a.current=!1,s.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"&&(s.current=!0));const c=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),uE=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:o,...c}=e,d=wa(Ks,n),m=b.useRef(null),h=tl(t,m);return kD(),l.jsxs(l.Fragment,{children:[l.jsx(qC,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(FC,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":zv(d.open),...c,ref:h,onDismiss:()=>d.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(yI,{titleId:d.titleId}),l.jsx(bI,{contentRef:m,descriptionId:d.descriptionId})]})]})}),Ov="DialogTitle",cE=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=wa(Ov,n);return l.jsx(fi.h2,{id:s.titleId,...a,ref:t})});cE.displayName=Ov;var dE="DialogDescription",fE=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=wa(dE,n);return l.jsx(fi.p,{id:s.descriptionId,...a,ref:t})});fE.displayName=dE;var hE="DialogClose",mE=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=wa(hE,n);return l.jsx(fi.button,{type:"button",...a,ref:t,onClick:ss(e.onClick,()=>s.onOpenChange(!1))})});mE.displayName=hE;function zv(e){return e?"open":"closed"}var pE="DialogTitleWarning",[UY,gE]=$3(pE,{contentName:Ks,titleName:Ov,docsSlug:"dialog"}),yI=({titleId:e})=>{const t=gE(pE),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
346
|
+
|
|
347
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
348
|
+
|
|
349
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vI="DialogDescriptionWarning",bI=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gE(vI).contentName}}.`;return b.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},yE=rE,vE=sE,bE=lE,xE=oE,xI=cE,wI=fE,SI=mE,kI=Symbol.for("react.lazy"),Ff=av[" use ".trim().toString()];function jI(e){return typeof e=="object"&&e!==null&&"then"in e}function wE(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===kI&&"_payload"in e&&jI(e._payload)}function SE(e){const t=EI(e),n=b.forwardRef((a,s)=>{let{children:o,...c}=a;wE(o)&&typeof Ff=="function"&&(o=Ff(o._payload));const d=b.Children.toArray(o),m=d.find(_I);if(m){const h=m.props.children,p=d.map(g=>g===m?b.Children.count(h)>1?b.Children.only(null):b.isValidElement(h)?h.props.children:null:g);return l.jsx(t,{...c,ref:s,children:b.isValidElement(h)?b.cloneElement(h,void 0,p):null})}return l.jsx(t,{...c,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var CI=SE("Slot");function EI(e){const t=b.forwardRef((n,a)=>{let{children:s,...o}=n;if(wE(s)&&typeof Ff=="function"&&(s=Ff(s._payload)),b.isValidElement(s)){const c=AI(s),d=TI(o,s.props);return s.type!==b.Fragment&&(d.ref=a?us(a,c):c),b.cloneElement(s,d)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NI=Symbol("radix.slottable");function _I(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NI}function TI(e,t){const n={...t};for(const a in t){const s=e[a],o=t[a];/^on[A-Z]/.test(a)?s&&o?n[a]=(...d)=>{const m=o(...d);return s(...d),m}:s&&(n[a]=s):a==="style"?n[a]={...s,...o}:a==="className"&&(n[a]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function AI(e){var a,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var RI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hi=RI.reduce((e,t)=>{const n=SE(`Primitive.${t}`),a=b.forwardRef((s,o)=>{const{asChild:c,...d}=s,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Iu='[cmdk-group=""]',fg='[cmdk-group-items=""]',OI='[cmdk-group-heading=""]',kE='[cmdk-item=""]',g1=`${kE}:not([aria-disabled="true"])`,_y="cmdk-item-select",Gl="data-value",zI=(e,t,n)=>B3(e,t,n),jE=b.createContext(void 0),zc=()=>b.useContext(jE),CE=b.createContext(void 0),Mv=()=>b.useContext(CE),EE=b.createContext(void 0),NE=b.forwardRef((e,t)=>{let n=Vl(()=>{var $,T;return{search:"",value:(T=($=e.value)!=null?$:e.defaultValue)!=null?T:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=Vl(()=>new Set),s=Vl(()=>new Map),o=Vl(()=>new Map),c=Vl(()=>new Set),d=_E(e),{label:m,children:h,value:p,onValueChange:g,filter:x,shouldFilter:w,loop:S,disablePointerSelection:k=!1,vimBindings:C=!0,...E}=e,N=li(),R=li(),z=li(),L=b.useRef(null),O=qI();Ys(()=>{if(p!==void 0){let $=p.trim();n.current.value=$,B.emit()}},[p]),Ys(()=>{O(6,be)},[]);let B=b.useMemo(()=>({subscribe:$=>(c.current.add($),()=>c.current.delete($)),snapshot:()=>n.current,setState:($,T,G)=>{var q,re,xe,we;if(!Object.is(n.current[$],T)){if(n.current[$]=T,$==="search")ae(),D(),O(1,K);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let me=document.getElementById(z);me?me.focus():(q=document.getElementById(N))==null||q.focus()}if(O(7,()=>{var me;n.current.selectedItemId=(me=W())==null?void 0:me.id,B.emit()}),G||O(5,be),((re=d.current)==null?void 0:re.value)!==void 0){let me=T??"";(we=(xe=d.current).onValueChange)==null||we.call(xe,me);return}}B.emit()}},emit:()=>{c.current.forEach($=>$())}}),[]),I=b.useMemo(()=>({value:($,T,G)=>{var q;T!==((q=o.current.get($))==null?void 0:q.value)&&(o.current.set($,{value:T,keywords:G}),n.current.filtered.items.set($,V(T,G)),O(2,()=>{D(),B.emit()}))},item:($,T)=>(a.current.add($),T&&(s.current.has(T)?s.current.get(T).add($):s.current.set(T,new Set([$]))),O(3,()=>{ae(),D(),n.current.value||K(),B.emit()}),()=>{o.current.delete($),a.current.delete($),n.current.filtered.items.delete($);let G=W();O(4,()=>{ae(),(G==null?void 0:G.getAttribute("id"))===$&&K(),B.emit()})}),group:$=>(s.current.has($)||s.current.set($,new Set),()=>{o.current.delete($),s.current.delete($)}),filter:()=>d.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:N,inputId:z,labelId:R,listInnerRef:L}),[]);function V($,T){var G,q;let re=(q=(G=d.current)==null?void 0:G.filter)!=null?q:zI;return $?re($,n.current.search,T):0}function D(){if(!n.current.search||d.current.shouldFilter===!1)return;let $=n.current.filtered.items,T=[];n.current.filtered.groups.forEach(q=>{let re=s.current.get(q),xe=0;re.forEach(we=>{let me=$.get(we);xe=Math.max(me,xe)}),T.push([q,xe])});let G=L.current;X().sort((q,re)=>{var xe,we;let me=q.getAttribute("id"),Ie=re.getAttribute("id");return((xe=$.get(Ie))!=null?xe:0)-((we=$.get(me))!=null?we:0)}).forEach(q=>{let re=q.closest(fg);re?re.appendChild(q.parentElement===re?q:q.closest(`${fg} > *`)):G.appendChild(q.parentElement===G?q:q.closest(`${fg} > *`))}),T.sort((q,re)=>re[1]-q[1]).forEach(q=>{var re;let xe=(re=L.current)==null?void 0:re.querySelector(`${Iu}[${Gl}="${encodeURIComponent(q[0])}"]`);xe==null||xe.parentElement.appendChild(xe)})}function K(){let $=X().find(G=>G.getAttribute("aria-disabled")!=="true"),T=$==null?void 0:$.getAttribute(Gl);B.setState("value",T||void 0)}function ae(){var $,T,G,q;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let re=0;for(let xe of a.current){let we=(T=($=o.current.get(xe))==null?void 0:$.value)!=null?T:"",me=(q=(G=o.current.get(xe))==null?void 0:G.keywords)!=null?q:[],Ie=V(we,me);n.current.filtered.items.set(xe,Ie),Ie>0&&re++}for(let[xe,we]of s.current)for(let me of we)if(n.current.filtered.items.get(me)>0){n.current.filtered.groups.add(xe);break}n.current.filtered.count=re}function be(){var $,T,G;let q=W();q&&((($=q.parentElement)==null?void 0:$.firstChild)===q&&((G=(T=q.closest(Iu))==null?void 0:T.querySelector(OI))==null||G.scrollIntoView({block:"nearest"})),q.scrollIntoView({block:"nearest"}))}function W(){var $;return($=L.current)==null?void 0:$.querySelector(`${kE}[aria-selected="true"]`)}function X(){var $;return Array.from((($=L.current)==null?void 0:$.querySelectorAll(g1))||[])}function Z($){let T=X()[$];T&&B.setState("value",T.getAttribute(Gl))}function te($){var T;let G=W(),q=X(),re=q.findIndex(we=>we===G),xe=q[re+$];(T=d.current)!=null&&T.loop&&(xe=re+$<0?q[q.length-1]:re+$===q.length?q[0]:q[re+$]),xe&&B.setState("value",xe.getAttribute(Gl))}function je($){let T=W(),G=T==null?void 0:T.closest(Iu),q;for(;G&&!q;)G=$>0?FI(G,Iu):HI(G,Iu),q=G==null?void 0:G.querySelector(g1);q?B.setState("value",q.getAttribute(Gl)):te($)}let Ae=()=>Z(X().length-1),M=$=>{$.preventDefault(),$.metaKey?Ae():$.altKey?je(1):te(1)},P=$=>{$.preventDefault(),$.metaKey?Z(0):$.altKey?je(-1):te(-1)};return b.createElement(hi.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:$=>{var T;(T=E.onKeyDown)==null||T.call(E,$);let G=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||G))switch($.key){case"n":case"j":{C&&$.ctrlKey&&M($);break}case"ArrowDown":{M($);break}case"p":case"k":{C&&$.ctrlKey&&P($);break}case"ArrowUp":{P($);break}case"Home":{$.preventDefault(),Z(0);break}case"End":{$.preventDefault(),Ae();break}case"Enter":{$.preventDefault();let q=W();if(q){let re=new Event(_y);q.dispatchEvent(re)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:GI},m),mh(e,$=>b.createElement(CE.Provider,{value:B},b.createElement(jE.Provider,{value:I},$))))}),MI=b.forwardRef((e,t)=>{var n,a;let s=li(),o=b.useRef(null),c=b.useContext(EE),d=zc(),m=_E(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;Ys(()=>{if(!h)return d.item(s,c==null?void 0:c.id)},[h]);let p=TE(s,o,[e.value,e.children,o],e.keywords),g=Mv(),x=cs(O=>O.value&&O.value===p.current),w=cs(O=>h||d.filter()===!1?!0:O.search?O.filtered.items.get(s)>0:!0);b.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(_y,S),()=>O.removeEventListener(_y,S)},[w,e.onSelect,e.disabled]);function S(){var O,B;k(),(B=(O=m.current).onSelect)==null||B.call(O,p.current)}function k(){g.setState("value",p.current,!0)}if(!w)return null;let{disabled:C,value:E,onSelect:N,forceMount:R,keywords:z,...L}=e;return b.createElement(hi.div,{ref:us(o,t),...L,id:s,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!x,"data-disabled":!!C,"data-selected":!!x,onPointerMove:C||d.getDisablePointerSelection()?void 0:k,onClick:C?void 0:S},e.children)}),DI=b.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:s,...o}=e,c=li(),d=b.useRef(null),m=b.useRef(null),h=li(),p=zc(),g=cs(w=>s||p.filter()===!1?!0:w.search?w.filtered.groups.has(c):!0);Ys(()=>p.group(c),[]),TE(c,d,[e.value,e.heading,m]);let x=b.useMemo(()=>({id:c,forceMount:s}),[s]);return b.createElement(hi.div,{ref:us(d,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&b.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),mh(e,w=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},b.createElement(EE.Provider,{value:x},w))))}),II=b.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,s=b.useRef(null),o=cs(c=>!c.search);return!n&&!o?null:b.createElement(hi.div,{ref:us(s,t),...a,"cmdk-separator":"",role:"separator"})}),LI=b.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,s=e.value!=null,o=Mv(),c=cs(h=>h.search),d=cs(h=>h.selectedItemId),m=zc();return b.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),b.createElement(hi.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":d,id:m.inputId,type:"text",value:s?e.value:c,onChange:h=>{s||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),PI=b.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...s}=e,o=b.useRef(null),c=b.useRef(null),d=cs(h=>h.selectedItemId),m=zc();return b.useEffect(()=>{if(c.current&&o.current){let h=c.current,p=o.current,g,x=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;p.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(g),x.unobserve(h)}}},[]),b.createElement(hi.div,{ref:us(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":a,id:m.listId},mh(e,h=>b.createElement("div",{ref:us(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),UI=b.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:s,contentClassName:o,container:c,...d}=e;return b.createElement(yE,{open:n,onOpenChange:a},b.createElement(vE,{container:c},b.createElement(bE,{"cmdk-overlay":"",className:s}),b.createElement(xE,{"aria-label":e.label,"cmdk-dialog":"",className:o},b.createElement(NE,{ref:t,...d}))))}),BI=b.forwardRef((e,t)=>cs(n=>n.filtered.count===0)?b.createElement(hi.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),$I=b.forwardRef((e,t)=>{let{progress:n,children:a,label:s="Loading...",...o}=e;return b.createElement(hi.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},mh(e,c=>b.createElement("div",{"aria-hidden":!0},c)))}),Nr=Object.assign(NE,{List:PI,Item:MI,Input:LI,Group:DI,Separator:II,Dialog:UI,Empty:BI,Loading:$I});function FI(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function HI(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function _E(e){let t=b.useRef(e);return Ys(()=>{t.current=e}),t}var Ys=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Vl(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function cs(e){let t=Mv(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function TE(e,t,n,a=[]){let s=b.useRef(),o=zc();return Ys(()=>{var c;let d=(()=>{var h;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(h=p.current.textContent)==null?void 0:h.trim():s.current}})(),m=a.map(h=>h.trim());o.value(e,d,m),(c=t.current)==null||c.setAttribute(Gl,d),s.current=d}),s}var qI=()=>{let[e,t]=b.useState(),n=Vl(()=>new Map);return Ys(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,s)=>{n.current.set(a,s),t({})}};function ZI(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function mh({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(ZI(t),{ref:t.ref},n(t.props.children)):n(t)}var GI={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Rn=yE,VI=vE,AE=b.forwardRef(({className:e,...t},n)=>l.jsx(bE,{ref:n,className:Me("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}));AE.displayName="DialogOverlay";const En=b.forwardRef(({className:e,children:t,...n},a)=>l.jsxs(VI,{children:[l.jsx(AE,{}),l.jsxs(xE,{ref:a,className:Me("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,l.jsxs(SI,{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:[l.jsx(os,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));En.displayName="DialogContent";function Ln({className:e,...t}){return l.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function fr({className:e,...t}){return l.jsx("div",{className:Me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const On=b.forwardRef(({className:e,...t},n)=>l.jsx(xI,{ref:n,className:Me("text-subtitle leading-none tracking-tight",e),...t}));On.displayName="DialogTitle";const Dv=b.forwardRef(({className:e,...t},n)=>l.jsx(wI,{ref:n,className:Me("text-body text-muted-foreground",e),...t}));Dv.displayName="DialogDescription";const RE=b.forwardRef(({className:e,...t},n)=>l.jsx(Nr,{ref:n,className:Me("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));RE.displayName=Nr.displayName;function QI({open:e,onOpenChange:t,children:n}){return l.jsx(Rn,{open:e,onOpenChange:t,children:l.jsx(En,{className:"overflow-hidden p-0 shadow-lg",children:l.jsx(RE,{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 OE=b.forwardRef(({className:e,...t},n)=>l.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[l.jsx(uh,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),l.jsx(Nr.Input,{ref:n,className:Me("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})]}));OE.displayName=Nr.Input.displayName;const zE=b.forwardRef(({className:e,...t},n)=>l.jsx(Nr.List,{ref:n,className:Me("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));zE.displayName=Nr.List.displayName;const ME=b.forwardRef((e,t)=>l.jsx(Nr.Empty,{ref:t,className:"py-6 text-center text-body",...e}));ME.displayName=Nr.Empty.displayName;const Of=b.forwardRef(({className:e,...t},n)=>l.jsx(Nr.Group,{ref:n,className:Me("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}));Of.displayName=Nr.Group.displayName;const Ty=b.forwardRef(({className:e,...t},n)=>l.jsx(Nr.Separator,{ref:n,className:Me("-mx-1 h-px bg-border",e),...t}));Ty.displayName=Nr.Separator.displayName;const zf=b.forwardRef(({className:e,...t},n)=>l.jsx(Nr.Item,{ref:n,className:Me("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}));zf.displayName=Nr.Item.displayName;function Mc(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 Ee.get(An(`/agents${n?`?${n}`:""}`))}function KI(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return Ee.get(An(`/agents/all${n?`?${n}`:""}`))}function Iv(){return Ee.get("/me/managed-agents")}function YI(e){return Ee.get(`/agents/${encodeURIComponent(e)}`)}function XI(e){return Ee.post(An("/agents"),e)}function WI(e){return Ee.get(An(`/agents/names/${encodeURIComponent(e)}/availability`))}function Ay(e,t){return Ee.patch(`/agents/${encodeURIComponent(e)}`,t)}function JI(e,t){return Ee.patch(`/agents/${encodeURIComponent(e)}/rebind`,t)}function DE(e){return Ee.delete(`/agents/${encodeURIComponent(e)}`)}function IE(e){return Ee.post(`/agents/${encodeURIComponent(e)}/suspend`,{})}function LE(e){return Ee.post(`/agents/${encodeURIComponent(e)}/reactivate`,{})}function e4(e){return Ee.post(`/agents/${encodeURIComponent(e)}/test`,{})}function ph(){const{data:e}=Ke({queryKey:["agents","name-map"],queryFn:()=>Mc({limit:100}),staleTime:3e4}),{data:t}=Ke({queryKey:["managed-agents","name-map"],queryFn:Iv,staleTime:3e4});return b.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 Lv(){const{data:e}=Ke({queryKey:["agents","name-map"],queryFn:()=>Mc({limit:100}),staleTime:3e4}),{data:t}=Ke({queryKey:["managed-agents","name-map"],queryFn:Iv,staleTime:3e4});return b.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 t4=[{path:"/",label:"Workspace"},{path:"/context",label:"Context"},{path:"/team",label:"Team"},{path:"/settings",label:"Settings"}];function n4({open:e,onOpenChange:t}){const n=Tn(),a=ph(),{data:s}=Ke({queryKey:["activity"],queryFn:Oc,enabled:e,staleTime:3e4}),o=(s==null?void 0:s.agents)??[],d=Ke({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const p of o)try{const g=await PC(p.agentId);for(const x of g)h.push({agentId:p.agentId,session:x})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return l.jsxs(QI,{open:e,onOpenChange:t,children:[l.jsx(OE,{placeholder:"Jump to agent, chat, or page…"}),l.jsxs(zE,{children:[l.jsx(ME,{children:"No results"}),o.length>0&&l.jsx(Of,{heading:"Agents",children:o.map(h=>{const p=a(h.agentId);return l.jsxs(zf,{value:`agent ${p} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[l.jsx(hC,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),l.jsx("span",{className:"flex-1 truncate",children:p}),l.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),d.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(Ty,{}),l.jsx(Of,{heading:"Chats",children:d.map(({agentId:h,session:p})=>{const g=a(h);return l.jsxs(zf,{value:`chat ${g} ${p.chatId}`,onSelect:()=>m(`/?a=${h}&c=${p.chatId}`),children:[l.jsx(Ev,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),l.jsx("span",{className:"flex-1 truncate",children:g}),l.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:p.chatId.slice(0,8)})]},`${h}-${p.chatId}`)})})]}),l.jsx(Ty,{}),l.jsx(Of,{heading:"Pages",children:t4.map(h=>l.jsxs(zf,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[l.jsx(sM,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),l.jsx("span",{children:h.label})]},h.path))})]})]})}function r4(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function a4(){var a;const{user:e}=yt(),{data:t}=Ke({queryKey:["clients"],queryFn:ci,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=r4(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const i4=160;function s4(){const e=Tn(),{rows:t,firstHostname:n}=a4();if(t.length===0)return null;const a=t.length>1,s=a?`${t.length} computers disconnected. Click to manage.`:`${n??"Your computer"} is disconnected. Click to manage.`;return l.jsxs("button",{type:"button",onClick:()=>e("/settings/computers"),title:s,"aria-label":s,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:[l.jsx(l4,{}),a?l.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[l.jsx("span",{className:"font-semibold",children:t.length})," computers disconnected"]}):l.jsxs("span",{className:"inline-flex items-center",style:{gap:5,minWidth:0},children:[l.jsx("span",{className:"mono text-label font-medium",style:{maxWidth:i4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"color-mix(in oklch, var(--state-error) 60%, var(--fg))"},children:n??"computer"}),l.jsx("span",{style:{flexShrink:0},children:"disconnected"})]})]})}function l4(){return l.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:8,height:8,flexShrink:0,display:"inline-block"},children:[l.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-error)"}}),l.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 Dc(e){return l.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[l.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),l.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),l.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),l.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),l.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),l.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),l.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),l.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),l.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),l.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function y1(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 Ee.get(An(`/notifications${n?`?${n}`:""}`))}function o4(e){return Ee.post(An(`/notifications/${e}/read`))}function u4(){return Ee.post(An("/notifications/read-all"))}const c4={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 d4(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function f4({notification:e,onClick:t,clickable:n}){const a=(c4[e.type]??e.type).toString(),s=d4(e.severity),o=n??!0;return l.jsxs("button",{type:"button",onClick:t,className:Me("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 ${s}`,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:[l.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[l.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),l.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:oc(e.createdAt)})]}),l.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function h4(){var w;const[e,t]=b.useState(!1),[n,a]=b.useState(null),s=b.useRef(null),o=Tn(),c=Cn(),{data:d}=Ke({queryKey:["notifications","bell"],queryFn:()=>y1({limit:8}),refetchInterval:1e4}),{data:m}=Ke({queryKey:["notifications","unread-count"],queryFn:()=>y1({read:!1,limit:100}),refetchInterval:1e4}),h=((w=m==null?void 0:m.items)==null?void 0:w.length)??0,p=h>0,g=b.useCallback(async S=>{S.read||(o4(S.id).catch(()=>{}),c.invalidateQueries({queryKey:["notifications"]})),t(!1),S.agentId&&S.chatId?o(`/?a=${S.agentId}&c=${S.chatId}`):S.agentId&&o(`/?a=${S.agentId}`)},[o,c]),x=b.useCallback(async()=>{a(null);try{await u4(),await c.invalidateQueries({queryKey:["notifications"]})}catch(S){a(S instanceof Error?S.message:"Failed to mark all as read")}},[c]);return l.jsxs("div",{className:"relative",children:[l.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:[l.jsx(Pz,{className:"h-4 w-4"}),p&&l.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&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),l.jsxs("div",{ref:s,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:[l.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[l.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),p&&l.jsx("button",{type:"button",onClick:x,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&l.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}),l.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(d!=null&&d.items)||d.items.length===0?l.jsx("div",{className:"text-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-4_5) 0"},children:"No notifications"}):d.items.map(S=>l.jsx(f4,{notification:S,clickable:!!S.agentId,onClick:()=>g(S)},S.id))})]})]})]})}function m4(){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 p4(){const[e,t]=b.useState(m4);return b.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),l.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"?l.jsx(jM,{className:"h-4 w-4"}):l.jsx(mM,{className:"h-4 w-4"})})}function g4(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function v1({src:e,name:t,size:n=28,className:a}){const s=`${n}px`;return e?l.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:s,height:s,borderRadius:"50%",objectFit:"cover",display:"block"}}):l.jsx("span",{className:a,role:"img","aria-label":t,style:{width:s,height:s,borderRadius:"50%",background:"var(--accent)",color:"var(--bg-raised)",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,userSelect:"none"},children:l.jsx("span",{className:"text-subtitle font-semibold",children:g4(t)})})}const b1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,x1=SC,y4=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return x1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,c=Object.keys(s).map(h=>{const p=n==null?void 0:n[h],g=o==null?void 0:o[h];if(p===null)return null;const x=b1(p)||b1(g);return s[h][x]}),d=n&&Object.entries(n).reduce((h,p)=>{let[g,x]=p;return x===void 0||(h[g]=x),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,p)=>{let{class:g,className:x,...w}=p;return Object.entries(w).every(S=>{let[k,C]=S;return Array.isArray(C)?C.includes({...o,...d}[k]):{...o,...d}[k]===C})?[...h,g,x]:h},[]);return x1(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},v4=y4("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"}}),ye=b.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...s},o)=>{const c=a?CI:"button";return l.jsx(c,{className:Me(v4({variant:t,size:n,className:e})),ref:o,...s})});ye.displayName="Button";const Ut=b.forwardRef(({className:e,type:t,...n},a)=>l.jsx("input",{type:t,className:Me("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}));Ut.displayName="Input";function b4({action:e,onClose:t}){const n=e!==null;return l.jsx(Rn,{open:n,onOpenChange:a=>!a&&t(),children:l.jsxs(En,{children:[l.jsxs(Ln,{children:[l.jsx(On,{children:e==="join"?"Join a team":"Create a new team"}),l.jsx(Dv,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&l.jsx(w4,{onDone:t}),e==="join"&&l.jsx(S4,{onDone:t})]})})}function x4(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function w4({onDone:e}){const{adoptTokens:t}=yt(),n=Tn(),[a,s]=b.useState(""),[o,c]=b.useState(null),[d,m]=b.useState(!1);b.useEffect(()=>{s(""),c(null),m(!1)},[]);const h=async p=>{p.preventDefault();const g=a.trim();if(g){m(!0),c(null);try{const x=await Ee.post("/me/organizations",{name:x4(g),displayName:g});await t(x.tokens),e(),n("/",{replace:!0})}catch(x){c(x instanceof Error?x.message:"Failed to create team")}finally{m(!1)}}};return l.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&l.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),l.jsx(Ut,{id:"team-display-name","aria-label":"Team name",value:a,onChange:p=>s(p.target.value),placeholder:"Acme Robotics",autoFocus:!0}),l.jsx(ye,{type:"submit",className:"w-full",disabled:d||!a.trim(),children:d?"Creating…":"Create team"})]})}function S4({onDone:e}){const{adoptTokens:t}=yt(),n=Tn(),[a,s]=b.useState(""),[o,c]=b.useState(null),[d,m]=b.useState(!1);b.useEffect(()=>{s(""),c(null),m(!1)},[]);const h=async p=>{if(p.preventDefault(),!!a.trim()){m(!0),c(null);try{const g=a.trim(),x=/\/invite\/([^/?#]+)/.exec(g),w=(x==null?void 0:x[1])??g,S=await Ee.post("/me/organizations/join",{token:w});await t(S.tokens),e(),n("/",{replace:!0})}catch(g){c(g instanceof Error?g.message:"Failed to join team")}finally{m(!1)}}};return l.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&l.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),l.jsx(Ut,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:p=>s(p.target.value),placeholder:"abc123… or https://hub/invite/abc123",autoFocus:!0}),l.jsx(ye,{type:"submit",className:"w-full",disabled:d||!a.trim(),children:d?"Joining…":"Join team"})]})}function k4(){var L,O;const{organizationId:e,role:t,user:n,selectOrganization:a,logout:s}=yt(),o=Tn(),[c,d]=b.useState([]),[m,h]=b.useState(!1),[p,g]=b.useState(null),x=b.useRef(null);b.useEffect(()=>{(async()=>{try{const B=await Ee.get("/me/organizations");d(B)}catch{}})()},[]),b.useEffect(()=>{const B=V=>{m&&x.current&&!x.current.contains(V.target)&&h(!1)},I=V=>{m&&V.key==="Escape"&&h(!1)};return window.addEventListener("mousedown",B),window.addEventListener("keydown",I),()=>{window.removeEventListener("mousedown",B),window.removeEventListener("keydown",I)}},[m]);const w=(n==null?void 0:n.displayName)??"User",S=(n==null?void 0:n.username)??"",k=(n==null?void 0:n.avatarUrl)??null,C=c.find(B=>B.id===e)??null,E=(C==null?void 0:C.role)??(t==="admin"||t==="member"?t:null),N=async B=>{if(B===e){h(!1);return}try{await a(B),h(!1),o("/",{replace:!0})}catch{}},R=()=>{h(!1),g("create")},z=()=>{h(!1),g("join")};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{ref:x,className:"relative","data-testid":"user-menu",children:[l.jsx("button",{type:"button","aria-label":`User menu, ${w}`,"aria-haspopup":"menu","aria-expanded":m,onClick:()=>h(B=>!B),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:m?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:l.jsx(v1,{src:k,name:w,size:28})}),m&&l.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[l.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[l.jsx(v1,{src:k,name:w,size:32}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:w}),S&&S!==w&&l.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",S]})]})]}),c.length>0&&l.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[l.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Current team"}),c.length===1?l.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[l.jsx("span",{style:{width:14,display:"inline-flex"},children:l.jsx(cr,{className:"h-3.5 w-3.5"})}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:(L=c[0])==null?void 0:L.displayName}),l.jsx(w1,{role:((O=c[0])==null?void 0:O.role)??E})]}):l.jsx("div",{children:c.map(B=>l.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void N(B.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:[l.jsx("span",{style:{width:14,display:"inline-flex"},children:B.id===e?l.jsx(cr,{className:"h-3.5 w-3.5"}):null}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:B.displayName}),l.jsx(w1,{role:B.role})]},B.id))})]}),l.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[l.jsxs("button",{type:"button",role:"menuitem",onClick:R,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:[l.jsx(xa,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Create new team"})]}),l.jsxs("button",{type:"button",role:"menuitem",onClick:z,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:[l.jsx(bC,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Join with invite link"})]})]}),l.jsx("div",{className:"py-1",children:l.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),s()},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:[l.jsx(dM,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Sign out"})]})})]})]}),l.jsx(b4,{action:p,onClose:()=>g(null)})]})}function w1({role:e}){return e!=="admin"&&e!=="member"?null:l.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",color:e==="admin"?"var(--accent-dim)":"var(--fg-3)",border:"var(--hairline) solid var(--border)",background:e==="admin"?"var(--accent-bg)":"var(--bg-sunken)"},children:e})}const j4=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/context",label:"Context",end:!1,kbd:"⌘2"},{to:"/team",label:"Team",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}];function C4(){const[e,t]=b.useState(!1),n=Er(),a=n.pathname==="/"||n.search.includes("a=");return b.useEffect(()=>{const s=o=>{(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="k"&&(o.preventDefault(),t(c=>!c))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[]),l.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[l.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:[l.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3_5)",justifySelf:"start",minWidth:0},children:[l.jsxs("span",{className:"flex items-center",style:{gap:10,flexShrink:0},children:[l.jsx(Dc,{width:16,height:18,style:{color:"var(--fg)"}}),l.jsx("span",{className:"text-title",style:{color:"var(--fg)"},children:"First Tree"})]}),l.jsx(s4,{})]}),l.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:j4.map(s=>l.jsx(vv,{to:s.to,end:s.end,style:{pointerEvents:"auto"},className:({isActive:o})=>Me("inline-flex items-center transition-colors",o?"":"hover:text-[var(--fg)]"),children:({isActive:o})=>l.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:o?"var(--fg)":"var(--fg-3)",background:o?"var(--bg-hover)":"transparent"},children:[s.label,o&&l.jsx("span",{className:"kbd",children:s.kbd})]})},s.to))}),l.jsxs("div",{className:"flex items-center",style:{gap:6,justifySelf:"end"},children:[l.jsxs("button",{type:"button",onClick:()=>t(!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:s=>{s.currentTarget.style.color="var(--fg)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--fg-3)"},children:[l.jsx(uh,{className:"h-4 w-4"}),l.jsx("span",{children:"Jump to…"}),l.jsx("span",{className:"kbd",children:"⌘K"})]}),l.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),l.jsx(h4,{}),l.jsx(p4,{}),l.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),l.jsx(k4,{})]})]}),l.jsx(n4,{open:e,onOpenChange:t}),a?l.jsx(Pf,{}):l.jsx("main",{className:"flex-1 overflow-auto",children:l.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:l.jsx(Pf,{})})})]})}const PE=b.createContext(null),E4=5e3;function N4({children:e}){const[t,n]=b.useState([]),a=b.useCallback(c=>{n(d=>d.filter(m=>m.id!==c))},[]),o={addToast:b.useCallback(c=>{const d=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;n(m=>[...m,{...c,id:d}])},[])};return l.jsxs(PE.Provider,{value:o,children:[e,l.jsx(_4,{toasts:t,onDismiss:a})]})}function Ic(){const e=b.useContext(PE);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function _4({toasts:e,onDismiss:t}){return e.length===0?null:l.jsx("div",{style:{position:"fixed",bottom:"var(--sp-4)",right:"var(--sp-4)",zIndex:100,display:"flex",flexDirection:"column",gap:"var(--sp-2)",pointerEvents:"none",maxWidth:380},"aria-live":"polite","aria-atomic":"false",children:e.map(n=>l.jsx(T4,{toast:n,onDismiss:()=>t(n.id)},n.id))})}function T4({toast:e,onDismiss:t}){const n=b.useRef(t);return n.current=t,b.useEffect(()=>{if(e.durationMs===null)return;const a=e.durationMs??E4,s=setTimeout(()=>n.current(),a);return()=>clearTimeout(s)},[e.durationMs]),l.jsxs("div",{role:"status",style:{pointerEvents:"auto",display:"flex",alignItems:"flex-start",gap:"var(--sp-2)",padding:"var(--sp-3) var(--sp-3_5)",background:"var(--surface-1)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",boxShadow:"var(--shadow-md)",animation:"toast-slide-in 180ms ease-out"},children:[l.jsxs("div",{className:"flex-1 min-w-0",style:{display:"flex",flexDirection:"column",gap:"var(--sp-1)"},children:[l.jsx("p",{className:"text-body font-medium",style:{margin:0,color:"var(--fg)"},children:e.title}),e.description?l.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-3)"},children:e.description}):null,e.action?l.jsx("button",{type:"button",onClick:()=>{var a;(a=e.action)==null||a.onClick(),t()},className:"text-label font-medium hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{alignSelf:"flex-start",marginTop:"var(--sp-1)",padding:0,background:"transparent",border:"none",color:"var(--accent)",cursor:"pointer"},children:e.action.label}):null]}),l.jsx("button",{type:"button",onClick:t,"aria-label":"Dismiss",className:"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{padding:"var(--sp-1)",background:"transparent",border:"none",borderRadius:"var(--radius-input)",cursor:"pointer",color:"var(--fg-4)",flexShrink:0},children:l.jsx(os,{className:"h-4 w-4"})})]})}function de(e,t,n){function a(d,m){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,m);const h=c.prototype,p=Object.keys(h);for(let g=0;g<p.length;g++){const x=p[g];x in d||(d[x]=h[x].bind(d))}}const s=(n==null?void 0:n.Parent)??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function c(d){var m;const h=n!=null&&n.Parent?new o:this;a(h,d),(m=h._zod).deferred??(m.deferred=[]);for(const p of h._zod.deferred)p();return h}return Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:d=>{var m,h;return n!=null&&n.Parent&&d instanceof n.Parent?!0:(h=(m=d==null?void 0:d._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class no extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class UE extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const BE={};function ds(e){return BE}function $E(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>t.indexOf(+a)===-1).map(([a,s])=>s)}function Ry(e,t){return typeof t=="bigint"?t.toString():t}function gh(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Pv(e){return e==null}function Uv(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function A4(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let s=(a.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(s=Number.parseInt(m[1]))}const o=n>s?n:s,c=Number.parseInt(e.toFixed(o).replace(".","")),d=Number.parseInt(t.toFixed(o).replace(".",""));return c%d/10**o}const S1=Symbol("evaluating");function Et(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==S1)return a===void 0&&(a=S1,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function nl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ms(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function k1(e){return JSON.stringify(e)}function R4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const FE="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function dc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const O4=gh(()=>{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 xo(e){if(dc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(dc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function HE(e){return xo(e)?{...e}:Array.isArray(e)?[...e]:e}const z4=new Set(["string","number","symbol"]);function wo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ps(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 Le(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 M4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const D4={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 I4(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=ms(e._zod.def,{get shape(){const c={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(c[d]=n.shape[d])}return nl(this,"shape",c),c},checks:[]});return ps(e,o)}function L4(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=ms(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete c[d]}return nl(this,"shape",c),c},checks:[]});return ps(e,o)}function P4(e,t){if(!xo(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 s=ms(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return nl(this,"shape",o),o}});return ps(e,s)}function U4(e,t){if(!xo(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=ms(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return nl(this,"shape",a),a}});return ps(e,n)}function B4(e,t){const n=ms(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return nl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return ps(e,n)}function $4(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=ms(t._zod.def,{get shape(){const d=t._zod.def.shape,m={...d};if(n)for(const h in n){if(!(h in d))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:d[h]}):d[h])}else for(const h in d)m[h]=e?new e({type:"optional",innerType:d[h]}):d[h];return nl(this,"shape",m),m},checks:[]});return ps(t,c)}function F4(e,t,n){const a=ms(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};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:s[c]}))}else for(const c in s)o[c]=new e({type:"nonoptional",innerType:s[c]});return nl(this,"shape",o),o}});return ps(t,a)}function Xl(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 Wl(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function mf(e){return typeof e=="string"?e:e==null?void 0:e.message}function fs(e,t,n){var s,o,c,d,m,h;const a={...e,path:e.path??[]};if(!e.message){const p=mf((c=(o=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:o.error)==null?void 0:c.call(o,e))??mf((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??mf((m=n.customError)==null?void 0:m.call(n,e))??mf((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";a.message=p}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function Bv(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function fc(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const qE=(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,Ry,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ZE=de("$ZodError",qE),GE=de("$ZodError",qE,{Parent:Error});function H4(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function q4(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const o of s.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,d=0;for(;d<o.path.length;){const m=o.path[d];d===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(o))):c[m]=c[m]||{_errors:[]},c=c[m],d++}}};return a(e),n}const $v=e=>(t,n,a,s)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new no;if(c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(m=>fs(m,o,ds())));throw FE(d,s==null?void 0:s.callee),d}return c.value},Fv=e=>async(t,n,a,s)=>{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 d=new((s==null?void 0:s.Err)??e)(c.issues.map(m=>fs(m,o,ds())));throw FE(d,s==null?void 0:s.callee),d}return c.value},yh=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new no;return o.issues.length?{success:!1,error:new(e??ZE)(o.issues.map(c=>fs(c,s,ds())))}:{success:!0,data:o.value}},Z4=yh(GE),vh=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(c=>fs(c,s,ds())))}:{success:!0,data:o.value}},G4=vh(GE),V4=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return $v(e)(t,n,s)},Q4=e=>(t,n,a)=>$v(e)(t,n,a),K4=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Fv(e)(t,n,s)},Y4=e=>async(t,n,a)=>Fv(e)(t,n,a),X4=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return yh(e)(t,n,s)},W4=e=>(t,n,a)=>yh(e)(t,n,a),J4=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return vh(e)(t,n,s)},e5=e=>async(t,n,a)=>vh(e)(t,n,a),t5=/^[cC][^\s-]{8,}$/,n5=/^[0-9a-z]+$/,r5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,a5=/^[0-9a-vA-V]{20}$/,i5=/^[A-Za-z0-9]{27}$/,s5=/^[a-zA-Z0-9_-]{21}$/,l5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,o5=/^([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})$/,j1=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)$/,u5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,c5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function d5(){return new RegExp(c5,"u")}const f5=/^(?:(?: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])$/,h5=/^(([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}|:))$/,m5=/^((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])$/,p5=/^(([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])$/,g5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,VE=/^[A-Za-z0-9_-]*$/,y5=/^\+[1-9]\d{6,14}$/,QE="(?:(?:\\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])))",v5=new RegExp(`^${QE}$`);function KE(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 b5(e){return new RegExp(`^${KE(e)}$`)}function x5(e){const t=KE({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(`^${QE}T(?:${a})$`)}const w5=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}$`)},S5=/^-?\d+$/,YE=/^-?\d+(?:\.\d+)?$/,k5=/^(?:true|false)$/i,j5=/^null$/i,C5=/^[^A-Z]*$/,E5=/^[^a-z]*$/,_r=de("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),XE={number:"number",bigint:"bigint",object:"date"},WE=de("$ZodCheckLessThan",(e,t)=>{_r.init(e,t);const n=XE[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.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})}}),JE=de("$ZodCheckGreaterThan",(e,t)=>{_r.init(e,t);const n=XE[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.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})}}),N5=de("$ZodCheckMultipleOf",(e,t)=>{_r.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):A4(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})}}),_5=de("$ZodCheckNumberFormat",(e,t)=>{var c;_r.init(e,t),t.format=t.format||"float64";const n=(c=t.format)==null?void 0:c.includes("int"),a=n?"int":"number",[s,o]=D4[t.format];e._zod.onattach.push(d=>{const m=d._zod.bag;m.format=t.format,m.minimum=s,m.maximum=o,n&&(m.pattern=S5)}),e._zod.check=d=>{const m=d.value;if(n){if(!Number.isInteger(m)){d.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?d.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}):d.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<s&&d.issues.push({origin:"number",input:m,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),m>o&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),T5=de("$ZodCheckMaxLength",(e,t)=>{var n;_r.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Pv(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const c=Bv(s);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),A5=de("$ZodCheckMinLength",(e,t)=>{var n;_r.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Pv(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const c=Bv(s);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),R5=de("$ZodCheckLengthEquals",(e,t)=>{var n;_r.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Pv(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,o=s.length;if(o===t.length)return;const c=Bv(s),d=o>t.length;a.issues.push({origin:c,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),bh=de("$ZodCheckStringFormat",(e,t)=>{var n,a;_r.init(e,t),e._zod.onattach.push(s=>{const o=s._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=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),O5=de("$ZodCheckRegex",(e,t)=>{bh.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})}}),z5=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=C5),bh.init(e,t)}),M5=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=E5),bh.init(e,t)}),D5=de("$ZodCheckIncludes",(e,t)=>{_r.init(e,t);const n=wo(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),I5=de("$ZodCheckStartsWith",(e,t)=>{_r.init(e,t);const n=new RegExp(`^${wo(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),L5=de("$ZodCheckEndsWith",(e,t)=>{_r.init(e,t);const n=new RegExp(`.*${wo(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),P5=de("$ZodCheckOverwrite",(e,t)=>{_r.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class U5{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(`
|
|
350
|
+
`).filter(c=>c),s=Math.min(...a.map(c=>c.length-c.trimStart().length)),o=a.map(c=>c.slice(s)).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,s=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,s.join(`
|
|
351
|
+
`))}}const B5={major:4,minor:3,patch:6},Qt=de("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=B5;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=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const o=(d,m,h)=>{let p=Xl(d),g;for(const x of m){if(x._zod.def.when){if(!x._zod.def.when(d))continue}else if(p)continue;const w=d.issues.length,S=x._zod.check(d);if(S instanceof Promise&&(h==null?void 0:h.async)===!1)throw new no;if(g||S instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await S,d.issues.length!==w&&(p||(p=Xl(d,w)))});else{if(d.issues.length===w)continue;p||(p=Xl(d,w))}}return g?g.then(()=>d):d},c=(d,m,h)=>{if(Xl(d))return d.aborted=!0,d;const p=o(m,a,h);if(p instanceof Promise){if(h.async===!1)throw new no;return p.then(g=>e._zod.parse(g,h))}return e._zod.parse(p,h)};e._zod.run=(d,m)=>{if(m.skipChecks)return e._zod.parse(d,m);if(m.direction==="backward"){const p=e._zod.parse({value:d.value,issues:[]},{...m,skipChecks:!0});return p instanceof Promise?p.then(g=>c(g,d,m)):c(p,d,m)}const h=e._zod.parse(d,m);if(h instanceof Promise){if(m.async===!1)throw new no;return h.then(p=>o(p,a,m))}return o(h,a,m)}}Et(e,"~standard",()=>({validate:o=>{var c;try{const d=Z4(e,o);return d.success?{value:d.data}:{issues:(c=d.error)==null?void 0:c.issues}}catch{return G4(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}))}),Hv=de("$ZodString",(e,t)=>{var n;Qt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??w5(e._zod.bag),e._zod.parse=(a,s)=>{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}}),Kt=de("$ZodStringFormat",(e,t)=>{bh.init(e,t),Hv.init(e,t)}),$5=de("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=o5),Kt.init(e,t)}),F5=de("$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=j1(a))}else t.pattern??(t.pattern=j1());Kt.init(e,t)}),H5=de("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=u5),Kt.init(e,t)}),q5=de("$ZodURL",(e,t)=>{Kt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.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(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.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=s.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Z5=de("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=d5()),Kt.init(e,t)}),G5=de("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=s5),Kt.init(e,t)}),V5=de("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=t5),Kt.init(e,t)}),Q5=de("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=n5),Kt.init(e,t)}),K5=de("$ZodULID",(e,t)=>{t.pattern??(t.pattern=r5),Kt.init(e,t)}),Y5=de("$ZodXID",(e,t)=>{t.pattern??(t.pattern=a5),Kt.init(e,t)}),X5=de("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=i5),Kt.init(e,t)}),W5=de("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=x5(t)),Kt.init(e,t)}),J5=de("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=v5),Kt.init(e,t)}),eL=de("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=b5(t)),Kt.init(e,t)}),tL=de("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=l5),Kt.init(e,t)}),nL=de("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=f5),Kt.init(e,t),e._zod.bag.format="ipv4"}),rL=de("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=h5),Kt.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})}}}),aL=de("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=m5),Kt.init(e,t)}),iL=de("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=p5),Kt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,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://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function eN(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const sL=de("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=g5),Kt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{eN(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function lL(e){if(!VE.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return eN(n)}const oL=de("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=VE),Kt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{lL(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),uL=de("$ZodE164",(e,t)=>{t.pattern??(t.pattern=y5),Kt.init(e,t)});function cL(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const dL=de("$ZodJWT",(e,t)=>{Kt.init(e,t),e._zod.check=n=>{cL(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),tN=de("$ZodNumber",(e,t)=>{Qt.init(e,t),e._zod.pattern=e._zod.bag.pattern??YE,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const o=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...o?{received:o}:{}}),n}}),fL=de("$ZodNumberFormat",(e,t)=>{_5.init(e,t),tN.init(e,t)}),hL=de("$ZodBoolean",(e,t)=>{Qt.init(e,t),e._zod.pattern=k5,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),mL=de("$ZodNull",(e,t)=>{Qt.init(e,t),e._zod.pattern=j5,e._zod.values=new Set([null]),e._zod.parse=(n,a)=>{const s=n.value;return s===null||n.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),n}}),pL=de("$ZodUnknown",(e,t)=>{Qt.init(e,t),e._zod.parse=n=>n}),gL=de("$ZodNever",(e,t)=>{Qt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function C1(e,t,n){e.issues.length&&t.issues.push(...Wl(n,e.issues)),t.value[n]=e.value}const yL=de("$ZodArray",(e,t)=>{Qt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const o=[];for(let c=0;c<s.length;c++){const d=s[c],m=t.element._zod.run({value:d,issues:[]},a);m instanceof Promise?o.push(m.then(h=>C1(h,n,c))):C1(m,n,c)}return o.length?Promise.all(o).then(()=>n):n}});function Hf(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...Wl(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function nN(e){var a,s,o,c;const t=Object.keys(e.shape);for(const d of t)if(!((c=(o=(s=(a=e.shape)==null?void 0:a[d])==null?void 0:s._zod)==null?void 0:o.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${d}": expected a Zod schema`);const n=M4(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function rN(e,t,n,a,s,o){const c=[],d=s.keySet,m=s.catchall._zod,h=m.def.type,p=m.optout==="optional";for(const g in t){if(d.has(g))continue;if(h==="never"){c.push(g);continue}const x=m.run({value:t[g],issues:[]},a);x instanceof Promise?e.push(x.then(w=>Hf(w,n,g,t,p))):Hf(x,n,g,t,p)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const vL=de("$ZodObject",(e,t)=>{Qt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...d};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=gh(()=>nN(t));Et(e._zod,"propValues",()=>{const d=t.shape,m={};for(const h in d){const p=d[h]._zod;if(p.values){m[h]??(m[h]=new Set);for(const g of p.values)m[h].add(g)}}return m});const s=dc,o=t.catchall;let c;e._zod.parse=(d,m)=>{c??(c=a.value);const h=d.value;if(!s(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;d.value={};const p=[],g=c.shape;for(const x of c.keys){const w=g[x],S=w._zod.optout==="optional",k=w._zod.run({value:h[x],issues:[]},m);k instanceof Promise?p.push(k.then(C=>Hf(C,d,x,h,S))):Hf(k,d,x,h,S)}return o?rN(p,h,d,m,a.value,e):p.length?Promise.all(p).then(()=>d):d}}),bL=de("$ZodObjectJIT",(e,t)=>{vL.init(e,t);const n=e._zod.parse,a=gh(()=>nN(t)),s=x=>{var R;const w=new U5(["shape","payload","ctx"]),S=a.value,k=z=>{const L=k1(z);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};w.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const z of S.keys)C[z]=`key_${E++}`;w.write("const newResult = {};");for(const z of S.keys){const L=C[z],O=k1(z),B=x[z],I=((R=B==null?void 0:B._zod)==null?void 0:R.optout)==="optional";w.write(`const ${L} = ${k(z)};`),I?w.write(`
|
|
352
|
+
if (${L}.issues.length) {
|
|
353
|
+
if (${O} in input) {
|
|
354
|
+
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
355
|
+
...iss,
|
|
356
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
357
|
+
})));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (${L}.value === undefined) {
|
|
362
|
+
if (${O} in input) {
|
|
363
|
+
newResult[${O}] = undefined;
|
|
364
|
+
}
|
|
365
|
+
} else {
|
|
366
|
+
newResult[${O}] = ${L}.value;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
`):w.write(`
|
|
370
|
+
if (${L}.issues.length) {
|
|
371
|
+
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
372
|
+
...iss,
|
|
373
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
374
|
+
})));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
if (${L}.value === undefined) {
|
|
378
|
+
if (${O} in input) {
|
|
379
|
+
newResult[${O}] = undefined;
|
|
380
|
+
}
|
|
381
|
+
} else {
|
|
382
|
+
newResult[${O}] = ${L}.value;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
`)}w.write("payload.value = newResult;"),w.write("return payload;");const N=w.compile();return(z,L)=>N(x,z,L)};let o;const c=dc,d=!BE.jitless,h=d&&O4.value,p=t.catchall;let g;e._zod.parse=(x,w)=>{g??(g=a.value);const S=x.value;return c(S)?d&&h&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(o||(o=s(t.shape)),x=o(x,w),p?rN([],S,x,w,g,e):x):n(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),x)}});function E1(e,t,n,a){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!Xl(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(c=>fs(c,a,ds())))}),t)}const aN=de("$ZodUnion",(e,t)=>{Qt.init(e,t),Et(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),Et(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),Et(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),Et(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${s.map(o=>Uv(o.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,o)=>{if(n)return a(s,o);let c=!1;const d=[];for(const m of t.options){const h=m._zod.run({value:s.value,issues:[]},o);if(h instanceof Promise)d.push(h),c=!0;else{if(h.issues.length===0)return h;d.push(h)}}return c?Promise.all(d).then(m=>E1(m,s,e,o)):E1(d,s,e,o)}}),xL=de("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,aN.init(e,t);const n=e._zod.parse;Et(e._zod,"propValues",()=>{const s={};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[d,m]of Object.entries(c)){s[d]||(s[d]=new Set);for(const h of m)s[d].add(h)}}return s});const a=gh(()=>{var c;const s=t.options,o=new Map;for(const d of s){const m=(c=d._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(d)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,d)}}return o});e._zod.parse=(s,o)=>{const c=s.value;if(!dc(c))return s.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),s;const d=a.value.get(c==null?void 0:c[t.discriminator]);return d?d._zod.run(s,o):t.unionFallback?n(s,o):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),s)}}),wL=de("$ZodIntersection",(e,t)=>{Qt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,o=t.left._zod.run({value:s,issues:[]},a),c=t.right._zod.run({value:s,issues:[]},a);return o instanceof Promise||c instanceof Promise?Promise.all([o,c]).then(([m,h])=>N1(n,m,h)):N1(n,o,c)}});function Oy(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(xo(e)&&xo(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),s={...e,...t};for(const o of a){const c=Oy(e[o],t[o]);if(!c.valid)return{valid:!1,mergeErrorPath:[o,...c.mergeErrorPath]};s[o]=c.data}return{valid:!0,data:s}}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 s=e[a],o=t[a],c=Oy(s,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 N1(e,t,n){const a=new Map;let s;for(const d of t.issues)if(d.code==="unrecognized_keys"){s??(s=d);for(const m of d.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const m of d.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(d);const o=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(o.length&&s&&e.issues.push({...s,keys:o}),Xl(e))return e;const c=Oy(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 SL=de("$ZodRecord",(e,t)=>{Qt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!xo(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const o=[],c=t.keyType._zod.values;if(c){n.value={};const d=new Set;for(const h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);const p=t.valueType._zod.run({value:s[h],issues:[]},a);p instanceof Promise?o.push(p.then(g=>{g.issues.length&&n.issues.push(...Wl(h,g.issues)),n.value[h]=g.value})):(p.issues.length&&n.issues.push(...Wl(h,p.issues)),n.value[h]=p.value)}let m;for(const h in s)d.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:m})}else{n.value={};for(const d of Reflect.ownKeys(s)){if(d==="__proto__")continue;let m=t.keyType._zod.run({value:d,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&YE.test(d)&&m.issues.length){const g=t.keyType._zod.run({value:Number(d),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[d]=s[d]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>fs(g,a,ds())),input:d,path:[d],inst:e});continue}const p=t.valueType._zod.run({value:s[d],issues:[]},a);p instanceof Promise?o.push(p.then(g=>{g.issues.length&&n.issues.push(...Wl(d,g.issues)),n.value[m.value]=g.value})):(p.issues.length&&n.issues.push(...Wl(d,p.issues)),n.value[m.value]=p.value)}}return o.length?Promise.all(o).then(()=>n):n}}),kL=de("$ZodEnum",(e,t)=>{Qt.init(e,t);const n=$E(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>z4.has(typeof s)).map(s=>typeof s=="string"?wo(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const c=s.value;return a.has(c)||s.issues.push({code:"invalid_value",values:n,input:c,inst:e}),s}}),jL=de("$ZodLiteral",(e,t)=>{if(Qt.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"?wo(a):a?wo(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const o=a.value;return n.has(o)||a.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),a}}),CL=de("$ZodTransform",(e,t)=>{Qt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new UE(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(n.value=c,n));if(s instanceof Promise)throw new no;return n.value=s,n}});function _1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const iN=de("$ZodOptional",(e,t)=>{Qt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Et(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Uv(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(o=>_1(o,n.value)):_1(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),EL=de("$ZodExactOptional",(e,t)=>{iN.init(e,t),Et(e._zod,"values",()=>t.innerType._zod.values),Et(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),NL=de("$ZodNullable",(e,t)=>{Qt.init(e,t),Et(e._zod,"optin",()=>t.innerType._zod.optin),Et(e._zod,"optout",()=>t.innerType._zod.optout),Et(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Uv(n.source)}|null)$`):void 0}),Et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),_L=de("$ZodDefault",(e,t)=>{Qt.init(e,t),e._zod.optin="optional",Et(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 s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(o=>T1(o,t)):T1(s,t)}});function T1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const TL=de("$ZodPrefault",(e,t)=>{Qt.init(e,t),e._zod.optin="optional",Et(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))}),AL=de("$ZodNonOptional",(e,t)=>{Qt.init(e,t),Et(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 s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(o=>A1(o,e)):A1(s,e)}});function A1(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 RL=de("$ZodCatch",(e,t)=>{Qt.init(e,t),Et(e._zod,"optin",()=>t.innerType._zod.optin),Et(e._zod,"optout",()=>t.innerType._zod.optout),Et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(c=>fs(c,a,ds()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>fs(o,a,ds()))},input:n.value}),n.issues=[]),n)}}),OL=de("$ZodPipe",(e,t)=>{Qt.init(e,t),Et(e._zod,"values",()=>t.in._zod.values),Et(e._zod,"optin",()=>t.in._zod.optin),Et(e._zod,"optout",()=>t.out._zod.optout),Et(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=>pf(c,t.in,a)):pf(o,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(o=>pf(o,t.out,a)):pf(s,t.out,a)}});function pf(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zL=de("$ZodReadonly",(e,t)=>{Qt.init(e,t),Et(e._zod,"propValues",()=>t.innerType._zod.propValues),Et(e._zod,"values",()=>t.innerType._zod.values),Et(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),Et(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 s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(R1):R1(s)}});function R1(e){return e.value=Object.freeze(e.value),e}const ML=de("$ZodCustom",(e,t)=>{_r.init(e,t),Qt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(o=>O1(o,n,a,e));O1(s,n,a,e)}});function O1(e,t,n,a){if(!e){const s={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),t.issues.push(fc(s))}}var z1;class DL{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 s={...a,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function IL(){return new DL}(z1=globalThis).__zod_globalRegistry??(z1.__zod_globalRegistry=IL());const Yu=globalThis.__zod_globalRegistry;function LL(e,t){return new e({type:"string",...Le(t)})}function PL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Le(t)})}function M1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Le(t)})}function UL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Le(t)})}function BL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Le(t)})}function $L(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Le(t)})}function FL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Le(t)})}function HL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Le(t)})}function qL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Le(t)})}function ZL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Le(t)})}function GL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Le(t)})}function VL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Le(t)})}function QL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Le(t)})}function KL(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Le(t)})}function YL(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Le(t)})}function XL(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Le(t)})}function WL(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Le(t)})}function JL(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Le(t)})}function eP(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Le(t)})}function tP(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Le(t)})}function nP(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Le(t)})}function rP(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Le(t)})}function aP(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Le(t)})}function iP(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Le(t)})}function sP(e,t){return new e({type:"string",format:"date",check:"string_format",...Le(t)})}function lP(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Le(t)})}function oP(e,t){return new e({type:"string",format:"duration",check:"string_format",...Le(t)})}function uP(e,t){return new e({type:"number",checks:[],...Le(t)})}function cP(e,t){return new e({type:"number",coerce:!0,checks:[],...Le(t)})}function dP(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Le(t)})}function fP(e,t){return new e({type:"boolean",...Le(t)})}function hP(e,t){return new e({type:"null",...Le(t)})}function mP(e){return new e({type:"unknown"})}function pP(e,t){return new e({type:"never",...Le(t)})}function D1(e,t){return new WE({check:"less_than",...Le(t),value:e,inclusive:!1})}function hg(e,t){return new WE({check:"less_than",...Le(t),value:e,inclusive:!0})}function I1(e,t){return new JE({check:"greater_than",...Le(t),value:e,inclusive:!1})}function mg(e,t){return new JE({check:"greater_than",...Le(t),value:e,inclusive:!0})}function L1(e,t){return new N5({check:"multiple_of",...Le(t),value:e})}function sN(e,t){return new T5({check:"max_length",...Le(t),maximum:e})}function qf(e,t){return new A5({check:"min_length",...Le(t),minimum:e})}function lN(e,t){return new R5({check:"length_equals",...Le(t),length:e})}function gP(e,t){return new O5({check:"string_format",format:"regex",...Le(t),pattern:e})}function yP(e){return new z5({check:"string_format",format:"lowercase",...Le(e)})}function vP(e){return new M5({check:"string_format",format:"uppercase",...Le(e)})}function bP(e,t){return new D5({check:"string_format",format:"includes",...Le(t),includes:e})}function xP(e,t){return new I5({check:"string_format",format:"starts_with",...Le(t),prefix:e})}function wP(e,t){return new L5({check:"string_format",format:"ends_with",...Le(t),suffix:e})}function Ao(e){return new P5({check:"overwrite",tx:e})}function SP(e){return Ao(t=>t.normalize(e))}function kP(){return Ao(e=>e.trim())}function jP(){return Ao(e=>e.toLowerCase())}function CP(){return Ao(e=>e.toUpperCase())}function EP(){return Ao(e=>R4(e))}function NP(e,t,n){return new e({type:"array",element:t,...Le(n)})}function _P(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Le(n)})}function TP(e){const t=AP(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(fc(a,n.value,t._zod.def));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(fc(s))}},e(n.value,n)));return t}function AP(e,t){const n=new _r({check:"custom",...Le(t)});return n._zod.check=e,n}function oN(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)??Yu,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 Sn(e,t,n={path:[],schemaPath:[]}){var p,g;var a;const s=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 d=(g=(p=e._zod).toJSONSchema)==null?void 0:g.call(p);if(d)c.schema=d;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,x);else{const S=c.schema,k=t.processors[s.type];if(!k)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);k(e,t,S,x)}const w=e._zod.parent;w&&(c.ref||(c.ref=w),Sn(w,t,x),t.seen.get(w).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&ir(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 uN(e,t){var c,d,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 p of e.seen.entries()){const g=(c=e.metadataRegistry.get(p[0]))==null?void 0:c.id;if(g){const x=a.get(g);if(x&&x!==p[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,p[0])}}const s=p=>{var k;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const C=(k=e.external.registry.get(p[0]))==null?void 0:k.id,E=e.external.uri??(R=>R);if(C)return{ref:E(C)};const N=p[1].defId??p[1].schema.id??`schema${e.counter++}`;return p[1].defId=N,{defId:N,ref:`${E("__shared")}#/${g}/${N}`}}if(p[1]===n)return{ref:"#"};const w=`#/${g}/`,S=p[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:w+S}},o=p=>{if(p[1].schema.$ref)return;const g=p[1],{ref:x,defId:w}=s(p);g.def={...g.schema},w&&(g.defId=w);const S=g.schema;for(const k in S)delete S[k];S.$ref=x};if(e.cycles==="throw")for(const p of e.seen.entries()){const g=p[1];if(g.cycle)throw new Error(`Cycle detected: #/${(d=g.cycle)==null?void 0:d.join("/")}/<root>
|
|
386
|
+
|
|
387
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of e.seen.entries()){const g=p[1];if(t===p[0]){o(p);continue}if(e.external){const w=(m=e.external.registry.get(p[0]))==null?void 0:m.id;if(t!==p[0]&&w){o(p);continue}}if((h=e.metadataRegistry.get(p[0]))==null?void 0:h.id){o(p);continue}if(g.cycle){o(p);continue}if(g.count>1&&e.reused==="ref"){o(p);continue}}}function cN(e,t){var c,d,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const p=e.seen.get(h);if(p.ref===null)return;const g=p.def??p.schema,x={...g},w=p.ref;if(p.ref=null,w){a(w);const k=e.seen.get(w),C=k.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(C)):Object.assign(g,C),Object.assign(g,x),h._zod.parent===w)for(const N in g)N==="$ref"||N==="allOf"||N in x||delete g[N];if(C.$ref&&k.def)for(const N in g)N==="$ref"||N==="allOf"||N in k.def&&JSON.stringify(g[N])===JSON.stringify(k.def[N])&&delete g[N]}const S=h._zod.parent;if(S&&S!==w){a(S);const k=e.seen.get(S);if(k!=null&&k.schema.$ref&&(g.$ref=k.schema.$ref,k.def))for(const C in g)C==="$ref"||C==="allOf"||C in k.def&&JSON.stringify(g[C])===JSON.stringify(k.def[C])&&delete g[C]}e.override({zodSchema:h,jsonSchema:g,path:p.path??[]})};for(const h of[...e.seen.entries()].reverse())a(h[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const h=(d=e.external.registry.get(t))==null?void 0:d.id;if(!h)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(h)}Object.assign(s,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const p=h[1];p.def&&p.defId&&(o[p.defId]=p.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const h=JSON.parse(JSON.stringify(s));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Zf(t,"input",e.processors),output:Zf(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function ir(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 ir(a.element,n);if(a.type==="set")return ir(a.valueType,n);if(a.type==="lazy")return ir(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 ir(a.innerType,n);if(a.type==="intersection")return ir(a.left,n)||ir(a.right,n);if(a.type==="record"||a.type==="map")return ir(a.keyType,n)||ir(a.valueType,n);if(a.type==="pipe")return ir(a.in,n)||ir(a.out,n);if(a.type==="object"){for(const s in a.shape)if(ir(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(ir(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(ir(s,n))return!0;return!!(a.rest&&ir(a.rest,n))}return!1}const RP=(e,t={})=>n=>{const a=oN({...n,processors:t});return Sn(e,a),uN(a,e),cN(a,e)},Zf=(e,t,n={})=>a=>{const{libraryOptions:s,target:o}=a??{},c=oN({...s??{},target:o,io:t,processors:n});return Sn(e,c),uN(c,e),cN(c,e)},OP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zP=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:o,maximum:c,format:d,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof c=="number"&&(s.maxLength=c),d&&(s.format=OP[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),h&&(s.contentEncoding=h),m&&m.size>0){const p=[...m];p.length===1?s.pattern=p[0].source:p.length>1&&(s.allOf=[...p.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},MP=(e,t,n,a)=>{const s=n,{minimum:o,maximum:c,format:d,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:p}=e._zod.bag;typeof d=="string"&&d.includes("int")?s.type="integer":s.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=p,s.exclusiveMinimum=!0):s.exclusiveMinimum=p),typeof o=="number"&&(s.minimum=o,typeof p=="number"&&t.target!=="draft-04"&&(p>=o?delete s.minimum:delete s.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=h,s.exclusiveMaximum=!0):s.exclusiveMaximum=h),typeof c=="number"&&(s.maximum=c,typeof h=="number"&&t.target!=="draft-04"&&(h<=c?delete s.maximum:delete s.exclusiveMaximum)),typeof m=="number"&&(s.multipleOf=m)},DP=(e,t,n,a)=>{n.type="boolean"},IP=(e,t,n,a)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},LP=(e,t,n,a)=>{n.not={}},PP=(e,t,n,a)=>{},UP=(e,t,n,a)=>{const s=e._zod.def,o=$E(s.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},BP=(e,t,n,a)=>{const s=e._zod.def,o=[];for(const c of s.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},$P=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},FP=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},HP=(e,t,n,a)=>{const s=n,o=e._zod.def,{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Sn(o.element,t,{...a,path:[...a.path,"items"]})},qP=(e,t,n,a)=>{var h;const s=n,o=e._zod.def;s.type="object",s.properties={};const c=o.shape;for(const p in c)s.properties[p]=Sn(c[p],t,{...a,path:[...a.path,"properties",p]});const d=new Set(Object.keys(c)),m=new Set([...d].filter(p=>{const g=o.shape[p]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));m.size>0&&(s.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=Sn(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},ZP=(e,t,n,a)=>{const s=e._zod.def,o=s.inclusive===!1,c=s.options.map((d,m)=>Sn(d,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=c:n.anyOf=c},GP=(e,t,n,a)=>{const s=e._zod.def,o=Sn(s.left,t,{...a,path:[...a.path,"allOf",0]}),c=Sn(s.right,t,{...a,path:[...a.path,"allOf",1]}),d=h=>"allOf"in h&&Object.keys(h).length===1,m=[...d(o)?o.allOf:[o],...d(c)?c.allOf:[c]];n.allOf=m},VP=(e,t,n,a)=>{const s=n,o=e._zod.def;s.type="object";const c=o.keyType,d=c._zod.bag,m=d==null?void 0:d.patterns;if(o.mode==="loose"&&m&&m.size>0){const p=Sn(o.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const g of m)s.patternProperties[g.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Sn(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Sn(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=c._zod.values;if(h){const p=[...h].filter(g=>typeof g=="string"||typeof g=="number");p.length>0&&(s.required=p)}},QP=(e,t,n,a)=>{const s=e._zod.def,o=Sn(s.innerType,t,a),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=s.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},KP=(e,t,n,a)=>{const s=e._zod.def;Sn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType},YP=(e,t,n,a)=>{const s=e._zod.def;Sn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},XP=(e,t,n,a)=>{const s=e._zod.def;Sn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},WP=(e,t,n,a)=>{const s=e._zod.def;Sn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType;let c;try{c=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},JP=(e,t,n,a)=>{const s=e._zod.def,o=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Sn(o,t,a);const c=t.seen.get(e);c.ref=o},eU=(e,t,n,a)=>{const s=e._zod.def;Sn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType,n.readOnly=!0},dN=(e,t,n,a)=>{const s=e._zod.def;Sn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType},tU=de("ZodISODateTime",(e,t)=>{W5.init(e,t),en.init(e,t)});function nU(e){return iP(tU,e)}const rU=de("ZodISODate",(e,t)=>{J5.init(e,t),en.init(e,t)});function aU(e){return sP(rU,e)}const iU=de("ZodISOTime",(e,t)=>{eL.init(e,t),en.init(e,t)});function sU(e){return lP(iU,e)}const lU=de("ZodISODuration",(e,t)=>{tL.init(e,t),en.init(e,t)});function oU(e){return oP(lU,e)}const uU=(e,t)=>{ZE.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>q4(e,n)},flatten:{value:n=>H4(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ry,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ry,2)}},isEmpty:{get(){return e.issues.length===0}}})},oa=de("ZodError",uU,{Parent:Error}),cU=$v(oa),dU=Fv(oa),fU=yh(oa),hU=vh(oa),mU=V4(oa),pU=Q4(oa),gU=K4(oa),yU=Y4(oa),vU=X4(oa),bU=W4(oa),xU=J4(oa),wU=e5(oa),Yt=de("ZodType",(e,t)=>(Qt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Zf(e,"input"),output:Zf(e,"output")}}),e.toJSONSchema=RP(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ms(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)=>ps(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>cU(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>fU(e,n,a),e.parseAsync=async(n,a)=>dU(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>hU(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>mU(e,n,a),e.decode=(n,a)=>pU(e,n,a),e.encodeAsync=async(n,a)=>gU(e,n,a),e.decodeAsync=async(n,a)=>yU(e,n,a),e.safeEncode=(n,a)=>vU(e,n,a),e.safeDecode=(n,a)=>bU(e,n,a),e.safeEncodeAsync=async(n,a)=>xU(e,n,a),e.safeDecodeAsync=async(n,a)=>wU(e,n,a),e.refine=(n,a)=>e.check(p6(n,a)),e.superRefine=n=>e.check(g6(n)),e.overwrite=n=>e.check(Ao(n)),e.optional=()=>B1(e),e.exactOptional=()=>n6(e),e.nullable=()=>$1(e),e.nullish=()=>B1($1(e)),e.nonoptional=n=>o6(e,n),e.array=()=>gt(e),e.or=n=>xh([e,n]),e.and=n=>XU(e,n),e.transform=n=>My(e,mN(n)),e.default=n=>i6(e,n),e.prefault=n=>l6(e,n),e.catch=n=>c6(e,n),e.pipe=n=>My(e,n),e.readonly=()=>h6(e),e.describe=n=>{const a=e.clone();return Yu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=Yu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Yu.get(e);const a=e.clone();return Yu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),fN=de("_ZodString",(e,t)=>{Hv.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(a,s,o)=>zP(e,a,s);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(gP(...a)),e.includes=(...a)=>e.check(bP(...a)),e.startsWith=(...a)=>e.check(xP(...a)),e.endsWith=(...a)=>e.check(wP(...a)),e.min=(...a)=>e.check(qf(...a)),e.max=(...a)=>e.check(sN(...a)),e.length=(...a)=>e.check(lN(...a)),e.nonempty=(...a)=>e.check(qf(1,...a)),e.lowercase=a=>e.check(yP(a)),e.uppercase=a=>e.check(vP(a)),e.trim=()=>e.check(kP()),e.normalize=(...a)=>e.check(SP(...a)),e.toLowerCase=()=>e.check(jP()),e.toUpperCase=()=>e.check(CP()),e.slugify=()=>e.check(EP())}),SU=de("ZodString",(e,t)=>{Hv.init(e,t),fN.init(e,t),e.email=n=>e.check(PL(kU,n)),e.url=n=>e.check(HL(jU,n)),e.jwt=n=>e.check(aP(UU,n)),e.emoji=n=>e.check(qL(CU,n)),e.guid=n=>e.check(M1(P1,n)),e.uuid=n=>e.check(UL(gf,n)),e.uuidv4=n=>e.check(BL(gf,n)),e.uuidv6=n=>e.check($L(gf,n)),e.uuidv7=n=>e.check(FL(gf,n)),e.nanoid=n=>e.check(ZL(EU,n)),e.guid=n=>e.check(M1(P1,n)),e.cuid=n=>e.check(GL(NU,n)),e.cuid2=n=>e.check(VL(_U,n)),e.ulid=n=>e.check(QL(TU,n)),e.base64=n=>e.check(tP(IU,n)),e.base64url=n=>e.check(nP(LU,n)),e.xid=n=>e.check(KL(AU,n)),e.ksuid=n=>e.check(YL(RU,n)),e.ipv4=n=>e.check(XL(OU,n)),e.ipv6=n=>e.check(WL(zU,n)),e.cidrv4=n=>e.check(JL(MU,n)),e.cidrv6=n=>e.check(eP(DU,n)),e.e164=n=>e.check(rP(PU,n)),e.datetime=n=>e.check(nU(n)),e.date=n=>e.check(aU(n)),e.time=n=>e.check(sU(n)),e.duration=n=>e.check(oU(n))});function _(e){return LL(SU,e)}const en=de("ZodStringFormat",(e,t)=>{Kt.init(e,t),fN.init(e,t)}),kU=de("ZodEmail",(e,t)=>{H5.init(e,t),en.init(e,t)}),P1=de("ZodGUID",(e,t)=>{$5.init(e,t),en.init(e,t)}),gf=de("ZodUUID",(e,t)=>{F5.init(e,t),en.init(e,t)}),jU=de("ZodURL",(e,t)=>{q5.init(e,t),en.init(e,t)}),CU=de("ZodEmoji",(e,t)=>{Z5.init(e,t),en.init(e,t)}),EU=de("ZodNanoID",(e,t)=>{G5.init(e,t),en.init(e,t)}),NU=de("ZodCUID",(e,t)=>{V5.init(e,t),en.init(e,t)}),_U=de("ZodCUID2",(e,t)=>{Q5.init(e,t),en.init(e,t)}),TU=de("ZodULID",(e,t)=>{K5.init(e,t),en.init(e,t)}),AU=de("ZodXID",(e,t)=>{Y5.init(e,t),en.init(e,t)}),RU=de("ZodKSUID",(e,t)=>{X5.init(e,t),en.init(e,t)}),OU=de("ZodIPv4",(e,t)=>{nL.init(e,t),en.init(e,t)}),zU=de("ZodIPv6",(e,t)=>{rL.init(e,t),en.init(e,t)}),MU=de("ZodCIDRv4",(e,t)=>{aL.init(e,t),en.init(e,t)}),DU=de("ZodCIDRv6",(e,t)=>{iL.init(e,t),en.init(e,t)}),IU=de("ZodBase64",(e,t)=>{sL.init(e,t),en.init(e,t)}),LU=de("ZodBase64URL",(e,t)=>{oL.init(e,t),en.init(e,t)}),PU=de("ZodE164",(e,t)=>{uL.init(e,t),en.init(e,t)}),UU=de("ZodJWT",(e,t)=>{dL.init(e,t),en.init(e,t)}),qv=de("ZodNumber",(e,t)=>{tN.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(a,s,o)=>MP(e,a,s),e.gt=(a,s)=>e.check(I1(a,s)),e.gte=(a,s)=>e.check(mg(a,s)),e.min=(a,s)=>e.check(mg(a,s)),e.lt=(a,s)=>e.check(D1(a,s)),e.lte=(a,s)=>e.check(hg(a,s)),e.max=(a,s)=>e.check(hg(a,s)),e.int=a=>e.check(U1(a)),e.safe=a=>e.check(U1(a)),e.positive=a=>e.check(I1(0,a)),e.nonnegative=a=>e.check(mg(0,a)),e.negative=a=>e.check(D1(0,a)),e.nonpositive=a=>e.check(hg(0,a)),e.multipleOf=(a,s)=>e.check(L1(a,s)),e.step=(a,s)=>e.check(L1(a,s)),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 qe(e){return uP(qv,e)}const BU=de("ZodNumberFormat",(e,t)=>{fL.init(e,t),qv.init(e,t)});function U1(e){return dP(BU,e)}const $U=de("ZodBoolean",(e,t)=>{hL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>DP(e,n,a)});function Zn(e){return fP($U,e)}const FU=de("ZodNull",(e,t)=>{mL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>IP(e,n,a)});function HU(e){return hP(FU,e)}const qU=de("ZodUnknown",(e,t)=>{pL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>PP()});function Jt(){return mP(qU)}const ZU=de("ZodNever",(e,t)=>{gL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>LP(e,n,a)});function GU(e){return pP(ZU,e)}const VU=de("ZodArray",(e,t)=>{yL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>HP(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(qf(n,a)),e.nonempty=n=>e.check(qf(1,n)),e.max=(n,a)=>e.check(sN(n,a)),e.length=(n,a)=>e.check(lN(n,a)),e.unwrap=()=>e.element});function gt(e,t){return NP(VU,e,t)}const QU=de("ZodObject",(e,t)=>{bL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>qP(e,n,a,s),Et(e,"shape",()=>t.shape),e.keyof=()=>Fe(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Jt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Jt()}),e.strict=()=>e.clone({...e._zod.def,catchall:GU()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>P4(e,n),e.safeExtend=n=>U4(e,n),e.merge=n=>B4(e,n),e.pick=n=>I4(e,n),e.omit=n=>L4(e,n),e.partial=(...n)=>$4(pN,e,n[0]),e.required=(...n)=>F4(gN,e,n[0])});function se(e,t){const n={type:"object",shape:e??{},...Le(t)};return new QU(n)}const hN=de("ZodUnion",(e,t)=>{aN.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>ZP(e,n,a,s),e.options=t.options});function xh(e,t){return new hN({type:"union",options:e,...Le(t)})}const KU=de("ZodDiscriminatedUnion",(e,t)=>{hN.init(e,t),xL.init(e,t)});function wh(e,t,n){return new KU({type:"union",options:t,discriminator:e,...Le(n)})}const YU=de("ZodIntersection",(e,t)=>{wL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>GP(e,n,a,s)});function XU(e,t){return new YU({type:"intersection",left:e,right:t})}const WU=de("ZodRecord",(e,t)=>{SL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>VP(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function on(e,t,n){return new WU({type:"record",keyType:e,valueType:t,...Le(n)})}const zy=de("ZodEnum",(e,t)=>{kL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(a,s,o)=>UP(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{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 zy({...t,checks:[],...Le(s),entries:o})},e.exclude=(a,s)=>{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 zy({...t,checks:[],...Le(s),entries:o})}});function Fe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new zy({type:"enum",entries:n,...Le(t)})}const JU=de("ZodLiteral",(e,t)=>{jL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>BP(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 JU({type:"literal",values:Array.isArray(e)?e:[e],...Le(t)})}const e6=de("ZodTransform",(e,t)=>{CL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>FP(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new UE(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(fc(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(fc(c))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(o=>(n.value=o,n)):(n.value=s,n)}});function mN(e){return new e6({type:"transform",transform:e})}const pN=de("ZodOptional",(e,t)=>{iN.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>dN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function B1(e){return new pN({type:"optional",innerType:e})}const t6=de("ZodExactOptional",(e,t)=>{EL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>dN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function n6(e){return new t6({type:"optional",innerType:e})}const r6=de("ZodNullable",(e,t)=>{NL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>QP(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function $1(e){return new r6({type:"nullable",innerType:e})}const a6=de("ZodDefault",(e,t)=>{_L.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>YP(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function i6(e,t){return new a6({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():HE(t)}})}const s6=de("ZodPrefault",(e,t)=>{TL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>XP(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function l6(e,t){return new s6({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():HE(t)}})}const gN=de("ZodNonOptional",(e,t)=>{AL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>KP(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function o6(e,t){return new gN({type:"nonoptional",innerType:e,...Le(t)})}const u6=de("ZodCatch",(e,t)=>{RL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>WP(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function c6(e,t){return new u6({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const d6=de("ZodPipe",(e,t)=>{OL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>JP(e,n,a,s),e.in=t.in,e.out=t.out});function My(e,t){return new d6({type:"pipe",in:e,out:t})}const f6=de("ZodReadonly",(e,t)=>{zL.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>eU(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function h6(e){return new f6({type:"readonly",innerType:e})}const m6=de("ZodCustom",(e,t)=>{ML.init(e,t),Yt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>$P(e,n)});function p6(e,t={}){return _P(m6,e,t)}function g6(e){return TP(e)}function y6(e,t){return My(mN(e),t)}const Ls={custom:"custom"};function Sh(e){return cP(qv,e)}const v6=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function b6(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function yN(e,t){const n=b6(e),a=new Map;for(const o of t)o.name&&a.set(o.name.toLowerCase(),o.agentId);if(a.size===0)return[];const s=new Set;for(const o of n.matchAll(v6)){const c=o[1];if(!c)continue;const d=a.get(c.toLowerCase());d&&s.add(d)}return[...s]}const x6=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,F1="/";function vN(e){return!e||typeof e!="string"||e.length>256||!x6.test(e)?"/":e}const w6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},bN=Fe(["feishu","slack","kael"]),xN=Fe(["active","inactive"]);se({platform:bN,agentId:_().min(1),credentials:on(_(),Jt()),status:xN.default("active")});se({agentId:_().min(1).optional(),credentials:on(_(),Jt()).optional(),status:xN.optional()});se({id:qe(),platform:_(),agentId:_(),hasCredentials:Zn(),status:_(),createdAt:_(),updatedAt:_()});const S6=Fe(["code","reverse_token","oauth","manual"]);se({appId:_().min(1),appSecret:_().min(1)});se({platform:bN,externalUserId:_().min(1),agentId:_().min(1),boundVia:S6.default("manual"),displayName:_().max(200).optional()});se({id:qe(),platform:_(),externalUserId:_(),agentId:_(),boundVia:_().nullable(),displayName:_().nullable(),createdAt:_()});se({feishuUserId:_().min(1),displayName:_().max(200).optional()});se({configId:qe(),platform:_(),agentId:_(),appId:_(),connected:Zn(),lastActiveAt:_().nullable()});const k6=32e3,Zv=/^[a-z0-9][a-z0-9_-]{0,63}$/i,j6=/^[A-Z][A-Z0-9_]*$/,wN=se({append:_().max(k6).default("")}),C6=se({name:_().regex(Zv,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:ln("stdio"),command:_().min(1),args:gt(_()).optional()}),E6=se({name:_().regex(Zv,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:ln("http"),url:_().url(),headers:on(_(),_()).optional()}),N6=se({name:_().regex(Zv,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:ln("sse"),url:_().url(),headers:on(_(),_()).optional()}),SN=wh("transport",[C6,E6,N6]),kN=se({key:_().regex(j6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:_(),sensitive:Zn().default(!1)}),Gv=se({url:_().min(1),ref:_().min(1).optional(),localPath:_().min(1).optional()}),jN=se({prompt:wN.default({append:""}),model:_().default("opus"),mcpServers:gt(SN).default([]),env:gt(kN).default([]),gitRepos:gt(Gv).default([])}),_6=jN.extend({kind:ln("claude-code")}),T6=jN.extend({kind:ln("codex")}),A6=wh("kind",[_6,T6]),R6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,c)=>{const d=o.name.toLowerCase();n.has(d)&&t.addIssue({code:Ls.custom,path:["mcpServers",c,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(d)});const a=new Set;e.env.forEach((o,c)=>{a.has(o.key)&&t.addIssue({code:Ls.custom,path:["env",c,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const s=new Set;e.gitRepos.forEach((o,c)=>{const d=o.localPath??Vf(o.url);d&&(s.has(d)&&t.addIssue({code:Ls.custom,path:["gitRepos",c,"localPath"],message:`Duplicate git repo local path "${d}"`}),s.add(d))})},CN=y6(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,A6).superRefine((e,t)=>{R6(e,t)}),O6=se({agentId:_(),version:qe().int().positive(),payload:CN,updatedAt:_(),updatedBy:_()}),EN=se({prompt:wN,model:_(),mcpServers:gt(SN),env:gt(kN),gitRepos:gt(Gv)}).partial();se({expectedVersion:qe().int().positive(),payload:EN});se({payload:EN});se({current:O6,next:CN,diff:gt(se({path:_(),op:Fe(["add","remove","replace"]),before:Jt().optional(),after:Jt().optional()}))});const Gf="***";function Vf(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}const NN=Fe(["online","offline"]),_N=Fe(["idle","working","blocked","error"]);Fe(["active","suspended","evicted","errored"]);const z6=Fe(["active","suspended","errored"]);se({chatId:_().min(1),state:z6});se({runtimeState:_N});se({agentId:_().min(1),runtimeType:_().max(50),runtimeVersion:_().max(50).optional()});Fe(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);se({agentId:_(),status:NN,connectedAt:_().nullable(),lastSeenAt:_(),clientId:_().nullable().optional(),runtimeType:_().nullable().optional(),runtimeVersion:_().nullable().optional(),runtimeState:_N.nullable().optional(),activeSessions:qe().int().nullable().optional(),totalSessions:qe().int().nullable().optional(),runtimeUpdatedAt:_().nullable().optional()});se({total:qe().int(),running:qe().int(),byState:se({idle:qe().int(),working:qe().int(),blocked:qe().int(),error:qe().int()}),clients:qe().int()});const Qf={CLAUDE_CODE:"claude-code",CODEX:"codex"},kh=Fe(["claude-code","codex"]),jh=Fe(["human","personal_assistant","autonomous_agent"]),H1={PRIVATE:"private",ORGANIZATION:"organization"},Vv=Fe(["private","organization"]),M6=Fe(["admin-api","portal"]);Fe(["active","suspended"]);const Dy=/^[a-z0-9][a-z0-9_-]{0,63}$/,Jl=64,D6=["admin","agent","first-tree","hub","me","null","system","undefined"],I6=new Set(D6);function Iy(e){return I6.has(e)}se({name:_().min(1).max(64).regex(Dy,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!Iy(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:jh,displayName:_().min(1).max(200).optional(),delegateMention:_().max(100).optional(),organizationId:_().min(1).max(100).optional(),source:M6.optional(),visibility:Vv.optional(),metadata:on(_(),Jt()).optional(),managerId:_().optional(),clientId:_().min(1).max(100).optional(),runtimeProvider:kh.optional(),gitRepos:gt(Gv).optional()});se({type:jh.optional(),displayName:_().min(1).max(200).optional(),delegateMention:_().max(100).nullable().optional(),visibility:Vv.optional(),metadata:on(_(),Jt()).optional(),managerId:_().nullable().optional(),clientId:_().min(1).max(100).nullable().optional()});se({clientId:_().min(1).max(100),runtimeProvider:kh,force:Zn().optional()});se({uuid:_(),name:_().nullable(),organizationId:_(),type:jh,displayName:_(),delegateMention:_().nullable(),inboxId:_(),status:_(),source:_().nullable().optional(),visibility:Vv,metadata:on(_(),Jt()),managerId:_().nullable(),clientId:_().nullable(),runtimeProvider:kh,presenceStatus:NN.optional(),createdAt:_(),updatedAt:_()});se({repo:_().nullable(),branch:_().nullable()});se({type:ln("agent:pinned"),agentId:_(),name:_().nullable(),displayName:_(),agentType:jh,runtimeProvider:kh});se({username:_().min(1),password:_().min(1)});se({accessToken:_(),refreshToken:_()});se({refreshToken:_().min(1)});se({token:_().min(1)});se({token:_(),expiresIn:qe(),command:_()});const L6=["issue","pull_request","discussion","commit"],P6=Fe(L6),U6=se({source:ln("github"),entityType:P6,entityKey:_().min(1),entityUrl:_().url().optional()}),B6=se({source:ln("feishu"),externalChannelId:_().min(1)}),$6=wh("source",[U6,B6]),F6=xh([se({}).strict(),$6]),H6=Fe(["direct","group","thread"]);se({type:H6,topic:_().max(500).optional(),participantIds:gt(_()).min(1),metadata:F6.optional()});const TN=se({agentId:_(),role:_(),mode:_(),joinedAt:_()});TN.extend({name:_().nullable(),displayName:_(),type:_()});const q6=se({id:_(),organizationId:_(),type:_(),topic:_().nullable(),lifecyclePolicy:_().nullable().optional(),metadata:on(_(),Jt()),createdAt:_(),updatedAt:_()});q6.extend({participants:gt(TN),title:_(),firstMessagePreview:_().nullable()});se({topic:_().trim().max(500).nullable()});se({agentId:_().min(1)});se({agentId:_().min(1)});const Z6=Fe(["connected","disconnected"]),G6=Fe(["ok","expired"]);se({id:_(),userId:_().nullable(),status:Z6,authState:G6,sdkVersion:_().max(50).nullable(),hostname:_().max(100).nullable(),os:_().max(50).nullable(),agentCount:qe().int().min(0),connectedAt:_().nullable(),lastSeenAt:_(),metadata:on(_(),Jt()).nullable()});const V6=se({wsInboxDeliver:Zn().default(!1)}).partial();se({clientId:_().min(1).max(100),hostname:_().max(100).optional(),os:_().max(50).optional(),sdkVersion:_().max(50).optional(),wireCapabilities:V6.optional()});se({clientId:_(),previousUserId:_().nullable(),unpinnedAgentCount:qe().int().nonnegative()});const Q6=Fe(["ok","missing","unauthenticated","error"]),K6=Fe(["api_key","oauth","auth_json","none"]),Y6=se({state:Q6,available:Zn(),authenticated:Zn(),sdkVersion:_().nullable().optional(),authMethod:K6,error:_().nullable().optional(),detectedAt:_()}),X6=on(_(),Y6);se({capabilities:X6});se({limit:Sh().int().min(1).max(100).default(20),cursor:_().optional()});const W6=Fe(["active","stale","unavailable"]),J6=Fe(["ok","warning","error"]),eB=se({label:_(),detail:_().nullable(),severity:J6}),tB=Fe(["root","domain","subdomain","leaf"]),Qv=Fe(["added","edited","removed"]),nB=Fe(["parent","soft_link","markdown_link"]),rB=Fe(["low","medium","high"]),aB=se({id:_(),path:_(),sourcePath:_().nullable(),title:_(),kind:tB,owners:gt(_()),parentId:_().nullable(),preview:_().nullable(),relatedNodeIds:gt(_()),affectedContextArea:_(),changeType:Qv.nullable(),changedAtCommit:_().nullable()}),iB=se({source:_(),target:_(),kind:nB}),sB=se({path:_(),nodeId:_().nullable(),type:Qv,commit:_().nullable(),changedAt:_().nullable(),changedBy:_().nullable(),summary:_().nullable()}),lB=se({id:_(),nodeId:_().nullable(),path:_(),title:_(),changeType:Qv,affectedContextArea:_(),reason:_(),summary:_(),changedBy:_().nullable(),owners:gt(_()),relatedNodeIds:gt(_()),sourceCommit:_().nullable(),riskLevel:rB}),oB=se({addedCount:qe().int().nonnegative(),editedCount:qe().int().nonnegative(),removedCount:qe().int().nonnegative(),changedNodeCount:qe().int().nonnegative()});se({repo:_().nullable(),branch:_().nullable(),headCommit:_().nullable(),syncedAt:_().nullable(),snapshotStatus:W6,contextStatus:eB,summary:oB,updates:gt(lB),nodes:gt(aB),edges:gt(iB),changes:gt(sB)});const uB=["User","Organization"],cB=Fe(uB),dB=["read","write","admin"],fB=Fe(dB),hB=on(_(),fB),mB=gt(_());se({login:_().optional(),accessToken:_().optional(),accessTokenExpiresAt:_().datetime({offset:!0}).optional(),refreshToken:_().optional(),refreshTokenExpiresAt:_().datetime({offset:!0}).optional()});se({installationId:qe().int().positive()});se({installationId:qe().int().positive(),accountType:cB,accountLogin:_(),accountGithubId:qe().int().positive(),permissions:hB,events:mB,suspended:Zn(),manageUrl:_().url(),createdAt:_().datetime({offset:!0}),updatedAt:_().datetime({offset:!0})});const pB=["image/png","image/jpeg","image/gif","image/webp"],Kv=Fe(pB);se({data:_().min(1),mimeType:Kv,filename:_().min(1),size:qe().int().nonnegative().optional(),imageId:_().uuid().optional()});se({imageId:_().uuid(),mimeType:Kv,filename:_().min(1),size:qe().int().nonnegative().optional()});se({type:ln("image_payload"),imageId:_().uuid(),chatId:_(),base64:_().min(1),mimeType:Kv,filename:_().min(1),size:qe().int().nonnegative().optional()});const Yv=Fe(["hub_ui","cli","feishu","github","api"]),AN=Fe(["text","markdown","card","reference","file","question","question_answer"]);se({format:AN.default("text"),content:Jt(),metadata:on(_(),Jt()).optional(),inReplyTo:_().optional(),replyToInbox:_().optional(),replyToChat:_().optional(),source:Yv.optional()});se({format:AN.default("text"),content:Jt(),metadata:on(_(),Jt()).optional(),replyToInbox:_().optional(),replyToChat:_().optional(),source:Yv.optional()});const gB=se({id:_(),chatId:_(),senderId:_(),format:_(),content:Jt(),metadata:on(_(),Jt()),replyToInbox:_().nullable(),replyToChat:_().nullable(),inReplyTo:_().nullable(),source:Yv.nullable(),createdAt:_()}),yB=se({senderId:_(),chatId:_(),replyToChat:_().nullable()}).nullable(),vB=Fe(["full","mention_only"]),bB=se({id:_(),senderId:_(),format:_(),content:Jt(),metadata:on(_(),Jt()).default({}),createdAt:_()}),RN=gB.extend({configVersion:qe().int().positive(),recipientMode:vB.default("full"),inReplyToSnapshot:yB.default(null),precedingMessages:gt(bB).default([])});Fe(["pending","delivered","acked","failed"]);const xB=se({id:qe(),inboxId:_(),messageId:_(),chatId:_().nullable(),status:_(),retryCount:qe(),createdAt:_(),deliveredAt:_().nullable(),ackedAt:_().nullable()});xB.extend({message:RN});se({limit:Sh().int().min(1).max(50).default(10)});se({type:ln("inbox:deliver"),entryId:qe().int().nonnegative(),inboxId:_().min(1),chatId:_().nullable(),message:RN}).passthrough();se({type:ln("inbox:ack"),entryId:qe().int().nonnegative()});const wB=7;se({organizationId:_(),organizationName:_(),organizationDisplayName:_(),role:_(),expiresAt:_().nullable()});se({id:_(),organizationId:_(),token:_(),inviteUrl:_(),role:_(),createdAt:_(),expiresAt:_().nullable()});se({token:_().min(1)});se({}).optional();const SB=["all","unread","watching"],kB=Fe(SB),ON=Fe(["participant","watching"]);se({cursor:_().optional(),limit:Sh().int().min(1).max(200).default(50),filter:kB.default("all")});const jB=se({agentId:_(),displayName:_(),type:_()}),CB=se({chatId:_(),type:_(),membershipKind:ON,title:_(),topic:_().nullable(),participants:gt(jB),participantCount:qe().int(),lastMessageAt:_().nullable(),lastMessagePreview:_().nullable(),unreadMentionCount:qe().int(),canReply:Zn()});se({rows:gt(CB),nextCursor:_().nullable()});se({participantIds:gt(_().min(1)).min(1),topic:_().trim().max(500).optional().nullable()});se({participantIds:gt(_().min(1)).min(1)});se({chatId:_(),lastReadAt:_(),unreadMentionCount:qe().int()});se({chatId:_(),membershipKind:ON.nullable()});se({type:ln("chat:message"),chatId:_()});Fe(["connect","create_agent","completed"]);se({id:_(),name:_(),displayName:_(),role:Fe(["admin","member"])});se({name:_().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:_().min(1).max(200)});se({dismissed:Zn().optional()});const EB=Fe(["team_renamed","agent_created","tree_chat_started","tree_intro_dismissed"]);se({event:EB,attrs:on(_(),xh([_(),qe(),Zn(),HU()])).optional()});se({id:_(),organizationId:_(),organizationName:_(),role:Fe(["admin","member"]),agentId:_()});const NB={ADMIN:"admin",MEMBER:"member"},Xv=Fe(["admin","member"]),_B=se({id:_(),userId:_(),organizationId:_(),agentId:_(),role:Xv,createdAt:_()});se({username:_().min(1).max(100),displayName:_().min(1).max(200),role:Xv.default("member")});se({role:Xv.optional(),displayName:_().min(1).max(200).optional()});_B.extend({username:_(),displayName:_(),password:_()});const TB=Fe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),zN=Fe(["high","medium","low"]);se({id:_(),organizationId:_(),type:TB,severity:zN,agentId:_().nullable(),chatId:_().nullable(),message:_(),read:Zn(),createdAt:_()});se({limit:Sh().int().min(1).max(100).default(20),cursor:_().optional(),severity:zN.optional(),read:Fe(["true","false"]).transform(e=>e==="true").optional(),agentId:_().optional()});se({next:_().max(256).optional()});se({code:_().min(1),state:_().min(1),installation_id:_().regex(/^\d+$/).optional(),setup_action:Fe(["install","update","request"]).optional()});se({githubId:_().min(1),login:_().min(1),email:_().email().optional(),displayName:_().optional(),next:_().max(256).optional(),installationId:_().regex(/^\d+$/).optional(),installationAccountType:Fe(["User","Organization"]).optional(),installationAccountLogin:_().min(1).optional(),installationAccountGithubId:_().regex(/^\d+$/).optional()});const AB=/^(?:[A-Za-z0-9_.-]+@)?[A-Za-z0-9.-]+:(?!\d+(?:\/|$))[^/:@\s][^:@\s]*$/;function RB(e){return e.includes("://")?!1:AB.test(e)}const Ch=_().min(1).superRefine((e,t)=>{if(RB(e))return;let n;try{n=new URL(e)}catch{t.addIssue({code:Ls.custom,message:"Repo URL must be HTTPS, SSH (ssh://...), or scp-like (git@host:path)."});return}if(n.protocol!=="https:"&&n.protocol!=="ssh:"){t.addIssue({code:Ls.custom,message:"Repo URL must use HTTPS or SSH."});return}if(n.password.length>0){t.addIssue({code:Ls.custom,message:"Repo URL must not include credentials."});return}if(n.protocol==="https:"&&n.username.length>0){t.addIssue({code:Ls.custom,message:"Repo URL must not include credentials."});return}}),OB=se({repo:Ch.optional(),branch:_().default("main")}),zB=se({repo:Ch.nullish(),branch:_().min(1).nullish()}),MB=se({repo:_().optional(),branch:_().optional()}),DB=se({webhookSecretCipher:_().optional()}),IB=se({webhookSecret:_().min(1).nullish()}),LB=se({webhookSecretConfigured:Zn(),webhookUrl:_()}),PB=se({repos:gt(se({url:Ch,defaultBranch:_().optional()})).default([])}),UB=se({repos:gt(se({url:Ch,defaultBranch:_().min(1).optional()})).optional()}),BB=se({repos:gt(se({url:_(),defaultBranch:_().optional()}))}),$B={context_tree:{storage:OB,input:zB,output:MB,readPolicy:"member"},github_integration:{storage:DB,input:IB,output:LB,readPolicy:"admin"},source_repos:{storage:PB,input:UB,output:BB,readPolicy:"member"}},FB=Object.keys($B);Fe(FB);const MN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;se({name:_().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=>!MN.test(e),"Name must not be a UUID format"),displayName:_().min(1).max(200),maxAgents:qe().int().min(0).default(0),maxMessagesPerMinute:qe().int().min(0).default(0),features:on(_(),Jt()).default({})});se({name:_().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=>!MN.test(e),"Name must not be a UUID format").optional(),displayName:_().min(1).max(200).optional(),maxAgents:qe().int().min(0).optional(),maxMessagesPerMinute:qe().int().min(0).optional(),features:on(_(),Jt()).optional()});se({id:_(),name:_(),displayName:_(),maxAgents:qe(),maxMessagesPerMinute:qe(),features:on(_(),Jt()),createdAt:_(),updatedAt:_()});const HB=se({workingCount:qe().int().nonnegative(),errorMask:Zn()}),qB=se({type:ln("pulse:tick"),organizationId:_(),agents:on(_(),gt(HB).length(32))}),ZB=se({label:_().min(1),description:_(),preview:_().nullable().optional()}),GB=se({question:_().min(1),header:_().min(1).max(24),options:gt(ZB).min(2).max(4),multiSelect:Zn()}),VB=Fe(["html","markdown"]).nullable(),QB=se({correlationId:_().min(1),questions:gt(GB).min(1).max(4),previewFormat:VB,allowFreeText:Zn()}),KB=se({correlationId:_().min(1),answers:on(_().min(1),_())});se({answers:on(_().min(1),_())});Fe(["pending","answered","superseded"]);const YB=Fe(["tool_call","error","assistant_text","thinking","turn_end"]),DN=se({toolUseId:_(),name:_(),args:Jt(),status:Fe(["pending","ok","error"]),durationMs:qe().int().nonnegative().optional(),resultPreview:_().max(400).optional()}),IN=se({source:Fe(["sdk","runtime","tool"]),message:_().max(2e3)}),LN=se({text:_().max(8e3)}),PN=se({}),UN=se({status:Fe(["success","error"])}),XB=wh("kind",[se({kind:ln("tool_call"),payload:DN}),se({kind:ln("error"),payload:IN}),se({kind:ln("assistant_text"),payload:LN}),se({kind:ln("thinking"),payload:PN}),se({kind:ln("turn_end"),payload:UN})]);se({id:_(),agentId:_(),chatId:_(),seq:qe().int().positive(),kind:YB,payload:xh([DN,IN,LN,PN,UN]),createdAt:_()});se({agentId:_(),chatId:_(),event:XB});se({agentId:_(),chatId:_()});se({type:ln("session:reconcile"),agentId:_().min(1),chatIds:gt(_().min(1)).max(500)});se({type:ln("session:reconcile:result"),agentId:_().min(1),staleChatIds:gt(_().min(1))});const WB=se({organizationId:_(),agentCount:qe(),chatCount:qe(),messageCount:qe()});se({totalAgents:qe(),totalChats:qe(),totalMessages:qe(),byOrganization:gt(WB)});const JB=Fe(["active","suspended"]);se({id:_(),username:_(),displayName:_(),avatarUrl:_().nullable(),status:JB,createdAt:_(),updatedAt:_()});se({username:_().min(1).max(100),displayName:_().min(1).max(200),password:_().min(8).max(200)});se({displayName:_().min(1).max(200).optional(),password:_().min(8).max(200).optional()});se({type:ln("auth"),token:_().min(1)});const e9=se({wsInboxDeliver:Zn().default(!1)}).partial();se({type:ln("server:welcome"),serverCommandVersion:_().min(1),serverTimeMs:qe().int().nonnegative(),capabilities:e9.optional()}).passthrough();const BN=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function t9(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 s=n[a],o=t[a];!s||!o||(o.workingCount+=s.workingCount,o.errorMask=o.errorMask||s.errorMask)}return t}const n9=2e3,r9=3e4;let Qi=null,hc=!1,Kf=0,Wu=null;const Ly=new Set;let Vi=null,Ps=0;function a9(e){for(const t of Ly)try{t(e)}catch{}if(Vi){if(e.type==="notification")Vi.invalidateQueries({queryKey:["notifications"]});else if(e.type==="session:state")Vi.invalidateQueries({queryKey:["activity"]}),Vi.invalidateQueries({queryKey:["sessions"]});else if(e.type==="chat:message"){const t=typeof e.chatId=="string"?e.chatId:null;Vi.invalidateQueries({queryKey:["me","chats"]}),t&&(Vi.invalidateQueries({queryKey:["chat-messages",t]}),Vi.invalidateQueries({queryKey:["chat-detail",t]}))}}}function Wv(){const e=lh();if(!(e!=null&&e.accessToken))return;let t=null;try{t=localStorage.getItem("first-tree-hub:selectedOrganizationId")}catch{t=null}if(!t)return;const a=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/orgs/${encodeURIComponent(t)}/ws/?token=${e.accessToken}`,s=new WebSocket(a);Qi=s,s.onmessage=o=>{if(s===Qi)try{const c=JSON.parse(o.data);a9(c)}catch{}},s.onopen=()=>{s===Qi&&(Kf=0)},s.onclose=o=>{if(s===Qi&&(Qi=null,!(hc||Ps===0))){if(o.code===4001){oz().then(c=>{hc||Ps===0||(c?(Kf=0,Wv()):q1())});return}q1()}}}function q1(){Kf++;const e=Math.min(n9*2**(Kf-1),r9);Wu=setTimeout(()=>{Wu=null,!hc&&Ps>0&&Wv()},e)}function i9(){hc=!0,Wu&&(clearTimeout(Wu),Wu=null),Qi&&(Qi.close(1e3,"unmount"),Qi=null)}function $N(e){const{onMessage:t,enabled:n=!0}=e??{},a=Cn(),s=b.useRef(t);s.current=t,b.useEffect(()=>{Vi=a},[a]),b.useEffect(()=>{if(!n)return;const o=c=>{var d;return(d=s.current)==null?void 0:d.call(s,c)};return Ly.add(o),Ps++,Ps===1&&(hc=!1,Wv()),()=>{Ly.delete(o),Ps--,Ps===0&&i9()}},[n])}const s9=b.createContext({aggregated:BN,agents:{},receivedAtMs:null,stale:!0});function l9({children:e}){const[t,n]=b.useState({aggregated:BN,agents:{},receivedAtMs:null}),[a,s]=b.useState(()=>Date.now());$N({onMessage:c=>{const d=qB.safeParse(c);d.success&&n({aggregated:t9(d.data.agents),agents:d.data.agents,receivedAtMs:Date.now()})}}),b.useEffect(()=>{const c=setInterval(()=>s(Date.now()),1e4);return()=>clearInterval(c)},[]);const o=b.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return l.jsx(s9.Provider,{value:o,children:e})}function Eh(e){return Ee.get(`/agents/${e}/config`)}function Nh(e,t){return Ee.patch(`/agents/${e}/config`,t)}function o9(e,t){return Ee.post(`/agents/${e}/config/dry-run`,{payload:t})}function u9(e){return Ee.get(`/agents/${e}/client-status`)}function c9({className:e,style:t,...n}){return l.jsx("div",{className:Me("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function d9({onClick:e,children:t}){return l.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 f9(){return l.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function h9({children:e,mono:t}){return l.jsx("span",{className:Me("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}const m9={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 Cr({tone:e="neutral",className:t,style:n,...a}){const s=m9[e],o={background:s.bg,color:s.fg,border:`var(--hairline) solid ${s.bd}`,...n};return l.jsx("span",{className:Me("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})}function Py({children:e,right:t,className:n,style:a,...s}){return l.jsxs("div",{className:Me("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},...s,children:[l.jsx("span",{children:e}),t]})}function Jv({className:e,style:t,...n}){return l.jsx("span",{className:Me("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function Ju({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?l.jsxs("span",{className:Me("shrink-0",n),style:a,role:"img","aria-label":"working",children:[l.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),l.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"?l.jsx("span",{className:Me("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:l.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?l.jsx("span",{className:Me("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"?l.jsx("span",{className:Me("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):l.jsx("span",{className:Me("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function p9(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function mc({state:e,className:t}){const n=e!==null&&p9(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return l.jsxs("span",{className:Me("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[l.jsx(Ju,{state:n,size:7}),n]})}function yf({label:e,value:t,accent:n}){return l.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[l.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),l.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function g9({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?l.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:l.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[l.jsxs("span",{children:["Runs on ",l.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),l.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function y9(e){const{agent:t}=e,[n,a]=b.useState(!1),[s,o]=b.useState(!1),c=t.displayName||t.name||t.uuid;return l.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:[l.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[l.jsx(To,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),l.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),l.jsxs("div",{children:[t.status==="active"?l.jsx(pg,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:l.jsx(ye,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):l.jsx(pg,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:l.jsx(ye,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),l.jsx(pg,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:l.jsxs(ye,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[l.jsx(Uf,{className:"h-3 w-3"}),"Delete"]})})]}),l.jsx(v9,{open:s,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),l.jsx(b9,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function pg(e){return l.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:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),l.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),l.jsx("div",{children:e.action})]})}function v9({open:e,onOpenChange:t,label:n,onConfirm:a,pending:s}){return l.jsx(Rn,{open:e,onOpenChange:t,children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsxs(On,{children:['Suspend "',n,'"?']})}),l.jsx("div",{className:"space-y-3",children:l.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."})}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:s,children:"Cancel"}),l.jsx(ye,{type:"button",variant:"destructive",onClick:a,disabled:s,children:s?"Suspending…":"Suspend"})]})]})})}function b9({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:s}){const[o,c]=b.useState("");function d(m){m.preventDefault(),o===n&&a()}return l.jsx(Rn,{open:e,onOpenChange:m=>{t(m),m||c("")},children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsxs(On,{children:['Delete "',n,'"?']})}),l.jsxs("form",{onSubmit:d,className:"space-y-4",children:[l.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",l.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),l.jsx(Ut,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:s,children:"Cancel"}),l.jsx(ye,{type:"submit",variant:"destructive",disabled:o!==n||s,children:s?"Deleting…":"Delete"})]})]})]})})}var x9="Label",FN=b.forwardRef((e,t)=>l.jsx(hi.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));FN.displayName=x9;var w9=FN;const vt=b.forwardRef(({className:e,...t},n)=>l.jsx(w9,{ref:n,className:Me("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));vt.displayName="Label";const kn=b.forwardRef(({className:e,style:t,...n},a)=>l.jsx("div",{ref:a,className:Me("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));kn.displayName="Panel";const ua=b.forwardRef(({className:e,style:t,...n},a)=>l.jsx("div",{ref:a,className:Me("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}));ua.displayName="PanelHeader";const ca=b.forwardRef(({className:e,style:t,...n},a)=>l.jsx("div",{ref:a,className:Me("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));ca.displayName="PanelTitle";const Jn=b.forwardRef(({className:e,style:t,...n},a)=>l.jsx("div",{ref:a,className:Me(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Jn.displayName="PanelBody";const S9={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 eb({status:e,onEdit:t,onDelete:n,onUndo:a,children:s,disabled:o}){const c=S9[e],d=e==="deleted";return l.jsxs("div",{className:Me("flex items-center gap-2 rounded border px-3 py-2 text-body",d?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[l.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:s}),c.label&&l.jsx("span",{className:Me("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",c.tone),children:c.label}),!o&&(d?l.jsxs(ye,{size:"sm",variant:"ghost",onClick:a,children:[l.jsx(_M,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):l.jsxs("div",{className:"flex gap-1 shrink-0",children:[l.jsxs(ye,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[l.jsx(Nv,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"sr-only",children:"Edit"})]}),l.jsxs(ye,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[l.jsx(Uf,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function k9(e){const[t,n]=b.useState(null),[a,s]=b.useState(()=>new Set),o=d=>s(m=>{const h=new Set(m);return h.has(d)?h.delete(d):h.add(d),h}),c=e.items.filter(d=>d.status!=="deleted").length;return l.jsxs(kn,{children:[l.jsxs(ua,{children:[l.jsxs(ca,{children:["Environment variables (",c,")"]}),!e.disabled&&l.jsxs(ye,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[l.jsx(xa,{className:"h-3 w-3"})," Add"]})]}),l.jsx(Jn,{className:"space-y-2",children:e.items.length===0?l.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(d=>{const m=d.value.sensitive,h=d.value.value===Gf,p=m&&!h&&!!d.value.value,g=a.has(d.key);let x;return m?p&&g?x=d.value.value:x="••••••":x=d.value.value||l.jsx("em",{children:"(empty)"}),l.jsxs(eb,{status:d.status,onEdit:()=>n({mode:"edit",key:d.key,initial:d.value}),onDelete:()=>e.onDelete(d.key),onUndo:()=>e.onUndoDelete(d.key),disabled:e.disabled,children:[l.jsx("span",{className:"font-mono font-medium",children:d.value.key}),l.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:x}),m&&l.jsx(oh,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&l.jsx("button",{type:"button",onClick:()=>p&&o(d.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:p?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:!p,style:{padding:0,opacity:p?1:.4},children:g?l.jsx(eM,{className:"h-3.5 w-3.5"}):l.jsx(pC,{className:"h-3.5 w-3.5"})})]},d.key)})}),t&&l.jsx(j9,{open:!!t,onOpenChange:d=>!d&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:d=>{t.mode==="edit"?e.onUpdate(t.key,d):e.onAdd(d),n(null)}})]})}function j9({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:s}){const[o,c]=b.useState((n==null?void 0:n.key)??""),[d,m]=b.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,p]=b.useState((n==null?void 0:n.sensitive)??!1),[g,x]=b.useState(null);b.useEffect(()=>{e&&(c((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),p((n==null?void 0:n.sensitive)??!1),x(null))},[e,n]);function w(S){if(S.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){x("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){x(`Another entry already uses key "${o}".`);return}let k=d;if(h&&(n!=null&&n.sensitive)&&!d&&(k=Gf),!h&&!n&&!d){x("Value is required for non-sensitive entries.");return}s({key:o,value:k,sensitive:h})}return l.jsx(Rn,{open:e,onOpenChange:t,children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:n?"Edit environment variable":"Add environment variable"})}),l.jsxs("form",{onSubmit:w,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"env-key",children:"Key"}),l.jsx(Ut,{id:"env-key",value:o,onChange:S=>c(S.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&l.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"env-value",children:"Value"}),l.jsx(Ut,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:d,onChange:S=>m(S.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),l.jsxs("label",{className:"flex items-center gap-2 text-body",children:[l.jsx("input",{type:"checkbox",checked:h,onChange:S=>p(S.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),l.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&&l.jsx("p",{className:"text-body text-destructive",children:g}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),l.jsx(ye,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function C9(e){const[t,n]=b.useState(null),a=e.items.filter(s=>s.status!=="deleted").length;return l.jsxs(kn,{children:[l.jsxs(ua,{children:[l.jsxs(ca,{children:["Git repositories (",a,")"]}),!e.disabled&&l.jsxs(ye,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[l.jsx(xa,{className:"h-3 w-3"})," Add"]})]}),l.jsx(Jn,{className:"space-y-2",children:e.items.length===0?l.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(s=>{const o=s.value.localPath??Vf(s.value.url);return l.jsxs(eb,{status:s.status,onEdit:()=>n({mode:"edit",key:s.key,initial:s.value}),onDelete:()=>e.onDelete(s.key),onUndo:()=>e.onUndoDelete(s.key),disabled:e.disabled,children:[l.jsx("span",{className:"font-mono text-caption",children:s.value.url}),s.value.ref&&l.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",s.value.ref]}),l.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},s.key)})}),t&&l.jsx(E9,{open:!!t,onOpenChange:s=>!s&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenPaths:e.otherPaths(t.mode==="edit"?t.key:null),onSubmit:s=>{t.mode==="edit"?e.onUpdate(t.key,s):e.onAdd(s),n(null)}})]})}function E9({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:s}){const[o,c]=b.useState((n==null?void 0:n.url)??""),[d,m]=b.useState((n==null?void 0:n.ref)??""),[h,p]=b.useState((n==null?void 0:n.localPath)??""),[g,x]=b.useState(null);b.useEffect(()=>{e&&(c((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),p((n==null?void 0:n.localPath)??""),x(null))},[e,n]);function w(S){S.preventDefault();const k=o.trim();if(!k){x("URL is required.");return}const C=h.trim()||Vf(k);if(C&&a.has(C)){x(`Another repo already occupies local path "${C}".`);return}const E={url:k,...d.trim()?{ref:d.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};s(E)}return l.jsx(Rn,{open:e,onOpenChange:t,children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:n?"Edit Git repository":"Add Git repository"})}),l.jsxs("form",{onSubmit:w,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"git-url",children:"URL"}),l.jsx(Ut,{id:"git-url",value:o,onChange:S=>c(S.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),l.jsx(Ut,{id:"git-ref",value:d,onChange:S=>m(S.target.value),placeholder:"main",className:"font-mono"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"git-path",children:"Local path (optional)"}),l.jsx(Ut,{id:"git-path",value:h,onChange:S=>p(S.target.value),placeholder:Vf(o)||"repo-name",className:"font-mono"}),l.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&l.jsx("p",{className:"text-body text-destructive",children:g}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),l.jsx(ye,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function HN({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:s="—",className:o,style:c,title:d}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return l.jsx("span",{className:Me("mono text-label",o),style:{color:"var(--fg-4)",...c},title:d,children:s});const p=d??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,x=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?l.jsxs("span",{className:Me("inline-flex flex-col leading-tight",o),style:{gap:1,...c},title:p??void 0,children:[h&&l.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&l.jsxs("span",{className:"mono text-caption",style:{color:x},children:["@",e]})]}):l.jsxs("span",{className:Me("inline-flex items-baseline gap-1.5",o),style:c,title:p??void 0,children:[h&&l.jsx("span",{style:{color:g},children:t}),m&&l.jsxs("span",{className:"mono text-caption",style:{color:x},children:["@",e]})]})}function qN(){return Ee.get(An("/members"))}function N9(e,t){return Ee.patch(An(`/members/${encodeURIComponent(e)}`),t)}function _9(e){return Ee.delete(An(`/members/${encodeURIComponent(e)}`))}function ZN(){const{data:e}=Ke({queryKey:["members","name-map"],queryFn:qN,staleTime:3e4});return b.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 T9({agent:e,onSave:t}){const[n,a]=b.useState(!1),s=Lv(),o=ZN(),c=e.metadata,d=c==null?void 0:c.tree,m=typeof(d==null?void 0:d.role)=="string"?d.role:null,h=Array.isArray(d==null?void 0:d.domains)?(d==null?void 0:d.domains).filter(x=>typeof x=="string"):[],p=e.managerId?o(e.managerId):null,g=e.delegateMention?s(e.delegateMention):null;return l.jsxs(kn,{children:[l.jsxs(ua,{children:[l.jsx(ca,{children:"Profile"}),e.status==="active"&&l.jsxs(ye,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[l.jsx(Nv,{className:"h-3 w-3"})," Edit"]})]}),l.jsxs(Jn,{className:"text-body space-y-1",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&l.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),l.jsxs("span",{className:"text-muted-foreground",children:["delegate ",l.jsx(HN,{name:g.name,displayName:g.displayName})]})]})]}),l.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[l.jsxs("span",{children:["owner ",l.jsx("span",{className:"text-foreground",children:p??"—"})]}),m&&l.jsxs("span",{children:["role ",l.jsx("span",{className:"text-foreground",children:m})]}),l.jsxs("span",{children:["type ",l.jsx(Cr,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),l.jsxs("span",{children:["visibility"," ",l.jsx(Cr,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&l.jsxs("span",{children:["domains"," ",l.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(x=>l.jsx(Cr,{tone:"outline",children:x},x))})]})]})]}),l.jsx(A9,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function A9({agent:e,open:t,onOpenChange:n,onSave:a}){var z;const{memberId:s,role:o}=yt(),[c,d]=b.useState(e.displayName),[m,h]=b.useState(e.delegateMention??""),[p,g]=b.useState(e.visibility),[x,w]=b.useState(!1),[S,k]=b.useState(null);b.useEffect(()=>{t&&(d(e.displayName),h(e.delegateMention??""),g(e.visibility),k(null))},[t,e]);const C=e.type==="human",E=o==="admin"||e.managerId===s,N=Ke({queryKey:["agents-for-delegate"],queryFn:async()=>(await Mc({limit:100})).items.filter(O=>O.type==="personal_assistant"&&O.status==="active"),enabled:t&&C});async function R(L){L.preventDefault(),k(null);const O=c.trim();if(!O){k("Display name is required.");return}w(!0);try{const B={displayName:O,delegateMention:m||null};p!==e.visibility&&(B.visibility=p),await a(B),n(!1)}catch(B){k(B instanceof Error?B.message:String(B))}finally{w(!1)}}return l.jsx(Rn,{open:t,onOpenChange:n,children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:"Edit Identity"})}),l.jsxs("form",{onSubmit:R,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{children:"Agent name"}),l.jsx(Ut,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),l.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"id-display",children:"Display Name"}),l.jsx(Ut,{id:"id-display",value:c,onChange:L=>d(L.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"id-visibility",children:"Visibility"}),l.jsxs("select",{id:"id-visibility",value:p,onChange:L=>g(L.target.value),disabled:!E,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[l.jsx("option",{value:H1.PRIVATE,children:"Private — only the manager"}),l.jsx("option",{value:H1.ORGANIZATION,children:"Organization — all members"})]}),l.jsx("p",{className:"text-caption text-muted-foreground",children:E?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),C&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"id-delegate",children:"Delegate Mention"}),l.jsxs("select",{id:"id-delegate",value:m,onChange:L=>h(L.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:[l.jsx("option",{value:"",children:"None"}),(z=N.data)==null?void 0:z.map(L=>l.jsx("option",{value:L.uuid,children:L.displayName?`${L.displayName} (@${L.name??L.uuid})`:L.name?`@${L.name}`:L.uuid},L.uuid))]}),l.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),S&&l.jsx("p",{className:"text-body text-destructive",children:S}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:x,children:"Cancel"}),l.jsx(ye,{type:"submit",disabled:x,children:x?"Saving…":"Save"})]})]})]})})}function R9(e){return e==="working"?"accent":e==="error"?"error":"outline"}function O9(e){const[t,n]=b.useState(null),a=e.items.filter(s=>s.status!=="deleted").length;return l.jsxs(kn,{children:[l.jsxs(ua,{children:[l.jsxs(ca,{children:["MCP servers (",a,")"]}),!e.disabled&&l.jsxs(ye,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[l.jsx(xa,{className:"h-3 w-3"})," Add"]})]}),l.jsx(Jn,{className:"space-y-2",children:e.items.length===0?l.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(s=>{const o=s.status==="deleted"||!e.toolHealth?"unknown":e.toolHealth(s.value.name);return l.jsxs(eb,{status:s.status,onEdit:()=>n({mode:"edit",key:s.key,initial:s.value}),onDelete:()=>e.onDelete(s.key),onUndo:()=>e.onUndoDelete(s.key),disabled:e.disabled,children:[l.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:s.value.transport}),l.jsx("span",{className:"font-medium font-mono",children:s.value.name}),l.jsx(Cr,{tone:R9(o),children:o}),l.jsx("span",{className:"text-caption text-muted-foreground truncate",children:z9(s.value)})]},s.key)})}),t&&l.jsx(M9,{open:!!t,onOpenChange:s=>!s&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenNames:e.otherNames(t.mode==="edit"?t.key:null),onSubmit:s=>{t.mode==="edit"?e.onUpdate(t.key,s):e.onAdd(s),n(null)}})]})}function z9(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 M9({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:s}){const[o,c]=b.useState((n==null?void 0:n.transport)??"stdio"),[d,m]=b.useState((n==null?void 0:n.name)??""),[h,p]=b.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,x]=b.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[w,S]=b.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[k,C]=b.useState(null);b.useEffect(()=>{e&&(c((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),p((n==null?void 0:n.transport)==="stdio"?n.command:""),x((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),S(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),C(null))},[e,n]);function E(N){if(N.preventDefault(),!d.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){C("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(d.toLowerCase())){C(`Another MCP server is already named "${d}".`);return}let R;if(o==="stdio"){if(!h.trim()){C("stdio transport requires a command.");return}const z=g.trim().split(/\s+/).filter(L=>L.length>0);R={name:d,transport:"stdio",command:h.trim(),...z.length?{args:z}:{}}}else{const z=w.trim();try{new URL(z)}catch{C("URL is not valid.");return}R={name:d,transport:o,url:z}}s(R)}return l.jsx(Rn,{open:e,onOpenChange:t,children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:n?"Edit MCP server":"Add MCP server"})}),l.jsxs("form",{onSubmit:E,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"mcp-transport",children:"Transport"}),l.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:[l.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),l.jsx("option",{value:"http",children:"http"}),l.jsx("option",{value:"sse",children:"sse"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"mcp-name",children:"Name"}),l.jsx(Ut,{id:"mcp-name",value:d,onChange:N=>m(N.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"mcp-command",children:"Command"}),l.jsx(Ut,{id:"mcp-command",value:h,onChange:N=>p(N.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),l.jsx(Ut,{id:"mcp-args",value:g,onChange:N=>x(N.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"mcp-url",children:"URL"}),l.jsx(Ut,{id:"mcp-url",value:w,onChange:N=>S(N.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),k&&l.jsx("p",{className:"text-body text-destructive",children:k}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),l.jsx(ye,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const D9=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],I9=[{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"}],L9={"claude-code":D9,codex:I9},P9={"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."},U9={value:"",label:"(unset — inherits local)"};function B9({value:e,baseline:t,onChange:n,onRevert:a,disabled:s,provider:o="claude-code"}){const c=e!==t,d=L9[o],m=b.useMemo(()=>{const h=[U9,...d];return e!==""&&!d.some(p=>p.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[d,e]);return l.jsxs(kn,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[l.jsxs(ua,{children:[l.jsxs(ca,{children:["Model",c&&l.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&&l.jsx(ye,{size:"xs",variant:"ghost",onClick:a,disabled:s,children:"Revert"})]}),l.jsxs(Jn,{className:"space-y-2",children:[l.jsx($9,{items:m,value:e,onChange:n,disabled:s}),l.jsx("p",{className:"text-caption text-muted-foreground",children:P9[o]})]})]})}function $9({items:e,value:t,onChange:n,disabled:a}){const[s,o]=b.useState(!1),[c,d]=b.useState(null),m=b.useRef(null),h=b.useRef(null),p=e.find(x=>x.value===t)??e[0],g=b.useCallback(()=>{const x=m.current;if(!x)return;const w=x.getBoundingClientRect();d({top:w.bottom+4,left:w.left,width:w.width})},[]);return b.useLayoutEffect(()=>{s&&g()},[s,g]),b.useEffect(()=>{if(!s)return;const x=k=>{var E,N;const C=k.target;(E=m.current)!=null&&E.contains(C)||(N=h.current)!=null&&N.contains(C)||o(!1)},w=k=>{var C;k.key==="Escape"&&(o(!1),(C=m.current)==null||C.focus())},S=()=>g();return document.addEventListener("pointerdown",x),document.addEventListener("keydown",w),window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",w),window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[s,g]),l.jsxs("div",{className:"max-w-md",children:[l.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(x=>!x),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":s,children:[l.jsx("span",{className:"truncate",style:{color:(p==null?void 0:p.value)===""?"var(--fg-3)":void 0},children:(p==null?void 0:p.label)??t}),l.jsx(kv,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:s?"rotate(180deg)":void 0}})]}),s&&c&&Av.createPortal(l.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(x=>{const w=x.value===t;return l.jsxs("button",{type:"button",onClick:()=>{n(x.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:x.value===""?"var(--fg-3)":void 0},children:[l.jsx(cr,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:w?"visible":"hidden",color:"var(--state-idle)"}}),l.jsx("span",{className:"flex-1 truncate",children:x.label}),x.hint&&l.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:x.hint})]},x.value||"__unset")})}),document.body)]})}function F9(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const H9=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,q9=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Z9={};function Z1(e,t){return(Z9.jsx?q9:H9).test(e)}const G9=/[ \t\n\f\r]/g;function V9(e){return typeof e=="object"?e.type==="text"?G1(e.value):!1:G1(e)}function G1(e){return e.replace(G9,"")===""}class Lc{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Lc.prototype.normal={};Lc.prototype.property={};Lc.prototype.space=void 0;function GN(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Lc(n,a,t)}function Uy(e){return e.toLowerCase()}class Tr{constructor(t,n){this.attribute=n,this.property=t}}Tr.prototype.attribute="";Tr.prototype.booleanish=!1;Tr.prototype.boolean=!1;Tr.prototype.commaOrSpaceSeparated=!1;Tr.prototype.commaSeparated=!1;Tr.prototype.defined=!1;Tr.prototype.mustUseProperty=!1;Tr.prototype.number=!1;Tr.prototype.overloadedBoolean=!1;Tr.prototype.property="";Tr.prototype.spaceSeparated=!1;Tr.prototype.space=void 0;let Q9=0;const Je=rl(),wn=rl(),By=rl(),Se=rl(),Pt=rl(),ro=rl(),Pr=rl();function rl(){return 2**++Q9}const $y=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:wn,commaOrSpaceSeparated:Pr,commaSeparated:ro,number:Se,overloadedBoolean:By,spaceSeparated:Pt},Symbol.toStringTag,{value:"Module"})),gg=Object.keys($y);class tb extends Tr{constructor(t,n,a,s){let o=-1;if(super(t,n),V1(this,"space",s),typeof a=="number")for(;++o<gg.length;){const c=gg[o];V1(this,gg[o],(a&$y[c])===$y[c])}}}tb.prototype.defined=!0;function V1(e,t,n){n&&(e[t]=n)}function Ro(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const o=new tb(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Uy(a)]=a,n[Uy(o.attribute)]=a}return new Lc(t,n,e.space)}const VN=Ro({properties:{ariaActiveDescendant:null,ariaAtomic:wn,ariaAutoComplete:null,ariaBusy:wn,ariaChecked:wn,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:Pt,ariaCurrent:null,ariaDescribedBy:Pt,ariaDetails:null,ariaDisabled:wn,ariaDropEffect:Pt,ariaErrorMessage:null,ariaExpanded:wn,ariaFlowTo:Pt,ariaGrabbed:wn,ariaHasPopup:null,ariaHidden:wn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pt,ariaLevel:Se,ariaLive:null,ariaModal:wn,ariaMultiLine:wn,ariaMultiSelectable:wn,ariaOrientation:null,ariaOwns:Pt,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:wn,ariaReadOnly:wn,ariaRelevant:null,ariaRequired:wn,ariaRoleDescription:Pt,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:wn,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function QN(e,t){return t in e?e[t]:t}function KN(e,t){return QN(e,t.toLowerCase())}const K9=Ro({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ro,acceptCharset:Pt,accessKey:Pt,action:null,allow:null,allowFullScreen:Je,allowPaymentRequest:Je,allowUserMedia:Je,alt:null,as:null,async:Je,autoCapitalize:null,autoComplete:Pt,autoFocus:Je,autoPlay:Je,blocking:Pt,capture:null,charSet:null,checked:Je,cite:null,className:Pt,cols:Se,colSpan:null,content:null,contentEditable:wn,controls:Je,controlsList:Pt,coords:Se|ro,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Je,defer:Je,dir:null,dirName:null,disabled:Je,download:By,draggable:wn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Je,formTarget:null,headers:Pt,height:Se,hidden:By,high:Se,href:null,hrefLang:null,htmlFor:Pt,httpEquiv:Pt,id:null,imageSizes:null,imageSrcSet:null,inert:Je,inputMode:null,integrity:null,is:null,isMap:Je,itemId:null,itemProp:Pt,itemRef:Pt,itemScope:Je,itemType:Pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Je,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:Je,muted:Je,name:null,nonce:null,noModule:Je,noValidate:Je,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:Je,optimum:Se,pattern:null,ping:Pt,placeholder:null,playsInline:Je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Je,referrerPolicy:null,rel:Pt,required:Je,reversed:Je,rows:Se,rowSpan:Se,sandbox:Pt,scope:null,scoped:Je,seamless:Je,selected:Je,shadowRootClonable:Je,shadowRootDelegatesFocus:Je,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:wn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Se,step:null,style:null,tabIndex:Se,target:null,title:null,translate:null,type:null,typeMustMatch:Je,useMap:null,value:wn,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pt,axis:null,background:null,bgColor:null,border:Se,borderColor:null,bottomMargin:Se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Je,declare:Je,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:Je,noHref:Je,noShade:Je,noWrap:Je,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:wn,standby:null,summary:null,text:null,topMargin:Se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Je,disableRemotePlayback:Je,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:KN}),Y9=Ro({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:Pr,accentHeight:Se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Se,amplitude:Se,arabicForm:null,ascent:Se,attributeName:null,attributeType:null,azimuth:Se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Se,by:null,calcMode:null,capHeight:Se,className:Pt,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:Se,diffuseConstant:Se,direction:null,display:null,dur:null,divisor:Se,dominantBaseline:null,download:Je,dx:null,dy:null,edgeMode:null,editable:null,elevation:Se,enableBackground:null,end:null,event:null,exponent:Se,externalResourcesRequired:null,fill:null,fillOpacity:Se,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:ro,g2:ro,glyphName:ro,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Se,horizOriginX:Se,horizOriginY:Se,id:null,ideographic:Se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Se,k:Se,k1:Se,k2:Se,k3:Se,k4:Se,kernelMatrix:Pr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Se,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:Se,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:Se,overlineThickness:Se,paintOrder:null,panose1:null,path:null,pathLength:Se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pr,rev:Pr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pr,requiredFeatures:Pr,requiredFonts:Pr,requiredFormats:Pr,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:Se,specularExponent:Se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Se,strikethroughThickness:Se,string:null,stroke:null,strokeDashArray:Pr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Se,strokeOpacity:Se,strokeWidth:null,style:null,surfaceScale:Se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pr,tabIndex:Se,tableValues:null,target:null,targetX:Se,targetY:Se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Se,underlineThickness:Se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Se,values:null,vAlphabetic:Se,vMathematical:Se,vectorEffect:null,vHanging:Se,vIdeographic:Se,version:null,vertAdvY:Se,vertOriginX:Se,vertOriginY:Se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:QN}),YN=Ro({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()}}),XN=Ro({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:KN}),WN=Ro({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),X9={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"},W9=/[A-Z]/g,Q1=/-[a-z]/g,J9=/^data[-\w.:]+$/i;function e$(e,t){const n=Uy(t);let a=t,s=Tr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&J9.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Q1,n$);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Q1.test(o)){let c=o.replace(W9,t$);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}s=tb}return new s(a,t)}function t$(e){return"-"+e.toLowerCase()}function n$(e){return e.charAt(1).toUpperCase()}const r$=GN([VN,K9,YN,XN,WN],"html"),nb=GN([VN,Y9,YN,XN,WN],"svg");function a$(e){return e.join(" ").trim()}var Hl={},yg,K1;function i$(){if(K1)return yg;K1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,m=`
|
|
388
|
+
`,h="/",p="*",g="",x="comment",w="declaration";function S(C,E){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];E=E||{};var N=1,R=1;function z(W){var X=W.match(t);X&&(N+=X.length);var Z=W.lastIndexOf(m);R=~Z?W.length-Z:R+W.length}function L(){var W={line:N,column:R};return function(X){return X.position=new O(W),V(),X}}function O(W){this.start=W,this.end={line:N,column:R},this.source=E.source}O.prototype.content=C;function B(W){var X=new Error(E.source+":"+N+":"+R+": "+W);if(X.reason=W,X.filename=E.source,X.line=N,X.column=R,X.source=C,!E.silent)throw X}function I(W){var X=W.exec(C);if(X){var Z=X[0];return z(Z),C=C.slice(Z.length),X}}function V(){I(n)}function D(W){var X;for(W=W||[];X=K();)X!==!1&&W.push(X);return W}function K(){var W=L();if(!(h!=C.charAt(0)||p!=C.charAt(1))){for(var X=2;g!=C.charAt(X)&&(p!=C.charAt(X)||h!=C.charAt(X+1));)++X;if(X+=2,g===C.charAt(X-1))return B("End of comment missing");var Z=C.slice(2,X-2);return R+=2,z(Z),C=C.slice(X),R+=2,W({type:x,comment:Z})}}function ae(){var W=L(),X=I(a);if(X){if(K(),!I(s))return B("property missing ':'");var Z=I(o),te=W({type:w,property:k(X[0].replace(e,g)),value:Z?k(Z[0].replace(e,g)):g});return I(c),te}}function be(){var W=[];D(W);for(var X;X=ae();)X!==!1&&(W.push(X),D(W));return W}return V(),be()}function k(C){return C?C.replace(d,g):g}return yg=S,yg}var Y1;function s$(){if(Y1)return Hl;Y1=1;var e=Hl&&Hl.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.default=n;const t=e(i$());function n(a,s){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),d=typeof s=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:p}=m;d?s(h,p,m):p&&(o=o||{},o[h]=p)}),o}return Hl}var Lu={},X1;function l$(){if(X1)return Lu;X1=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,p){return p.toUpperCase()},d=function(h,p){return"".concat(p,"-")},m=function(h,p){return p===void 0&&(p={}),o(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(s,d):h=h.replace(a,d),h.replace(t,c))};return Lu.camelCase=m,Lu}var Pu,W1;function o$(){if(W1)return Pu;W1=1;var e=Pu&&Pu.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(s$()),n=l$();function a(s,o){var c={};return!s||typeof s!="string"||(0,t.default)(s,function(d,m){d&&m&&(c[(0,n.camelCase)(d,o)]=m)}),c}return a.default=a,Pu=a,Pu}var u$=o$();const c$=nh(u$),JN=e_("end"),rb=e_("start");function e_(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 d$(e){const t=rb(e),n=JN(e);if(t&&n)return{start:t,end:n}}function ec(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?J1(e.position):"start"in e||"end"in e?J1(e):"line"in e||"column"in e?Fy(e):""}function Fy(e){return ek(e&&e.line)+":"+ek(e&&e.column)}function J1(e){return Fy(e&&e.start)+"-"+Fy(e&&e.end)}function ek(e){return e&&typeof e=="number"?e:1}class er extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",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"?s=t:!o.cause&&t&&(c=!0,s=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 d=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=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=ec(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}}er.prototype.file="";er.prototype.name="";er.prototype.reason="";er.prototype.message="";er.prototype.stack="";er.prototype.column=void 0;er.prototype.line=void 0;er.prototype.ancestors=void 0;er.prototype.cause=void 0;er.prototype.fatal=void 0;er.prototype.place=void 0;er.prototype.ruleId=void 0;er.prototype.source=void 0;const ab={}.hasOwnProperty,f$=new Map,h$=/[A-Z]/g,m$=new Set(["table","tbody","thead","tfoot","tr"]),p$=new Set(["td","th"]),t_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function g$(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=j$(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=k$(n,t.jsx,t.jsxs)}const s={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"?nb:r$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=n_(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function n_(e,t,n){if(t.type==="element")return y$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return v$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return x$(e,t,n);if(t.type==="mdxjsEsm")return b$(e,t);if(t.type==="root")return w$(e,t,n);if(t.type==="text")return S$(e,t)}function y$(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=nb,e.schema=s),e.ancestors.push(t);const o=a_(e,t.tagName,!1),c=C$(e,t);let d=sb(e,t);return m$.has(t.tagName)&&(d=d.filter(function(m){return typeof m=="string"?!V9(m):!0})),r_(e,c,o,t),ib(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function v$(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)}pc(e,t.position)}function b$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pc(e,t.position)}function x$(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=nb,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:a_(e,t.name,!0),c=E$(e,t),d=sb(e,t);return r_(e,c,o,t),ib(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function w$(e,t,n){const a={};return ib(a,sb(e,t)),e.create(t,e.Fragment,a,n)}function S$(e,t){return t.value}function r_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function ib(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function k$(e,t,n){return a;function a(s,o,c,d){const h=Array.isArray(c.children)?n:t;return d?h(o,c,d):h(o,c)}}function j$(e,t){return n;function n(a,s,o,c){const d=Array.isArray(o.children),m=rb(a);return t(s,o,c,d,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function C$(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&ab.call(t.properties,s)){const o=N$(e,s,t.properties[s]);if(o){const[c,d]=o;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&p$.has(t.tagName)?a=d:n[c]=d}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function E$(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 d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else pc(e,t.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else pc(e,t.position);else o=a.value===null?!0:a.value;n[s]=o}return n}function sb(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:f$;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=s.get(m)||0;c=m+"-"+h,s.set(m,h+1)}}const d=n_(e,o,c);d!==void 0&&n.push(d)}return n}function N$(e,t,n){const a=e$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?F9(n):a$(n)),a.property==="style"){let s=typeof n=="object"?n:_$(e,String(n));return e.stylePropertyNameCase==="css"&&(s=T$(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?X9[a.property]||a.property:a.attribute,n]}}function _$(e,t){try{return c$(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=t_+"#cannot-parse-style-attribute",s}}function a_(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,c;for(;++o<s.length;){const d=Z1(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}a=c}else a=Z1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return ab.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);pc(e)}function pc(e,t){const n=new er("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=t_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function T$(e){const t={};let n;for(n in e)ab.call(e,n)&&(t[A$(n)]=e[n]);return t}function A$(e){let t=e.replace(h$,R$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function R$(e){return"-"+e.toLowerCase()}const vg={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"]},O$={};function lb(e,t){const n=O$,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return i_(e,a,s)}function i_(e,t,n){if(z$(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 tk(e.children,t,n)}return Array.isArray(e)?tk(e,t,n):""}function tk(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=i_(e[s],t,n);return a.join("")}function z$(e){return!!(e&&typeof e=="object")}const nk=document.createElement("i");function ob(e){const t="&"+e+";";nk.innerHTML=t;const n=nk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function $r(e,t,n,a){const s=e.length;let o=0,c;if(t<0?t=-t>s?0:s+t:t=t>s?s: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 ra(e,t){return e.length>0?($r(e,e.length,0,t),e):t}const rk={}.hasOwnProperty;function s_(e){const t={};let n=-1;for(;++n<e.length;)M$(t,e[n]);return t}function M$(e,t){let n;for(n in t){const s=(rk.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){rk.call(s,c)||(s[c]=[]);const d=o[c];D$(s[c],Array.isArray(d)?d:d?[d]:[])}}}function D$(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);$r(e,0,0,a)}function l_(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 ba(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ur=gs(/[A-Za-z]/),Wn=gs(/[\dA-Za-z]/),I$=gs(/[#-'*+\--9=?A-Z^-~]/);function Yf(e){return e!==null&&(e<32||e===127)}const Hy=gs(/\d/),L$=gs(/[\dA-Fa-f]/),P$=gs(/[!-/:-@[-`{-~]/);function He(e){return e!==null&&e<-2}function It(e){return e!==null&&(e<0||e===32)}function ot(e){return e===-2||e===-1||e===32}const _h=gs(new RegExp("\\p{P}|\\p{S}","u")),Xs=gs(/\s/);function gs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Oo(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&Wn(e.charCodeAt(n+1))&&Wn(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(c=String.fromCharCode(o,d),s=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+s+1,c=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function xt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return ot(m)?(e.enter(n),d(m)):t(m)}function d(m){return ot(m)&&o++<s?(e.consume(m),d):(e.exit(n),t(m))}}const U$={tokenize:B$};function B$(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),xt(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),o(d)}function o(d){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return He(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),c)}}const $$={tokenize:F$},ak={tokenize:H$};function F$(e){const t=this,n=[];let a=0,s,o,c;return d;function d(R){if(a<n.length){const z=n[a];return t.containerState=z[1],e.attempt(z[0].continuation,m,h)(R)}return h(R)}function m(R){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&N();const z=t.events.length;let L=z,O;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){O=t.events[L][1].end;break}E(a);let B=z;for(;B<t.events.length;)t.events[B][1].end={...O},B++;return $r(t.events,L+1,0,t.events.slice(z)),t.events.length=B,h(R)}return d(R)}function h(R){if(a===n.length){if(!s)return x(R);if(s.currentConstruct&&s.currentConstruct.concrete)return S(R);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ak,p,g)(R)}function p(R){return s&&N(),E(a),x(R)}function g(R){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,S(R)}function x(R){return t.containerState={},e.attempt(ak,w,S)(R)}function w(R){return a++,n.push([t.currentConstruct,t.containerState]),x(R)}function S(R){if(R===null){s&&N(),E(0),e.consume(R);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),k(R)}function k(R){if(R===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(R);return}return He(R)?(e.consume(R),C(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(R),k)}function C(R,z){const L=t.sliceStream(R);if(z&&L.push(null),R.previous=o,o&&(o.next=R),o=R,s.defineSkip(R.start),s.write(L),t.parser.lazy[R.start.line]){let O=s.events.length;for(;O--;)if(s.events[O][1].start.offset<c&&(!s.events[O][1].end||s.events[O][1].end.offset>c))return;const B=t.events.length;let I=B,V,D;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(V){D=t.events[I][1].end;break}V=!0}for(E(a),O=B;O<t.events.length;)t.events[O][1].end={...D},O++;$r(t.events,I+1,0,t.events.slice(B)),t.events.length=O}}function E(R){let z=n.length;for(;z-- >R;){const L=n[z];t.containerState=L[1],L[0].exit.call(t,e)}n.length=R}function N(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function H$(e,t,n){return xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function So(e){if(e===null||It(e)||Xs(e))return 1;if(_h(e))return 2}function Th(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const qy={name:"attention",resolveAll:q$,tokenize:Z$};function q$(e,t){let n=-1,a,s,o,c,d,m,h,p;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},x={...e[n][1].start};ik(g,-m),ik(x,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},d={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:m>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[n][1].start={...d.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=ra(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=ra(h,[["enter",s,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=ra(h,Th(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=ra(h,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=ra(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,$r(e,a-1,n-a+3,h),n=a+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Z$(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=So(a);let o;return c;function c(m){return o=m,e.enter("attentionSequence"),d(m)}function d(m){if(m===o)return e.consume(m),d;const h=e.exit("attentionSequence"),p=So(m),g=!p||p===2&&s||n.includes(m),x=!s||s===2&&p||n.includes(a);return h._open=!!(o===42?g:g&&(s||!x)),h._close=!!(o===42?x:x&&(p||!g)),t(m)}}function ik(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const G$={name:"autolink",tokenize:V$};function V$(e,t,n){let a=0;return s;function s(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(w){return ur(w)?(e.consume(w),c):w===64?n(w):h(w)}function c(w){return w===43||w===45||w===46||Wn(w)?(a=1,d(w)):h(w)}function d(w){return w===58?(e.consume(w),a=0,m):(w===43||w===45||w===46||Wn(w))&&a++<32?(e.consume(w),d):(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||Yf(w)?n(w):(e.consume(w),m)}function h(w){return w===64?(e.consume(w),p):I$(w)?(e.consume(w),h):n(w)}function p(w){return Wn(w)?g(w):n(w)}function g(w){return w===46?(e.consume(w),a=0,p):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):x(w)}function x(w){if((w===45||Wn(w))&&a++<63){const S=w===45?x:g;return e.consume(w),S}return n(w)}}const Pc={partial:!0,tokenize:Q$};function Q$(e,t,n){return a;function a(o){return ot(o)?xt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||He(o)?t(o):n(o)}}const o_={continuation:{tokenize:Y$},exit:X$,name:"blockQuote",tokenize:K$};function K$(e,t,n){const a=this;return s;function s(c){if(c===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return ot(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function Y$(e,t,n){const a=this;return s;function s(c){return ot(c)?xt(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(o_,t,n)(c)}}function X$(e){e.exit("blockQuote")}const u_={name:"characterEscape",tokenize:W$};function W$(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return P$(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const c_={name:"characterReference",tokenize:J$};function J$(e,t,n){const a=this;let s=0,o,c;return d;function d(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=Wn,p(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=L$,p):(e.enter("characterReferenceValue"),o=7,c=Hy,p(g))}function p(g){if(g===59&&s){const x=e.exit("characterReferenceValue");return c===Wn&&!ob(a.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&s++<o?(e.consume(g),p):n(g)}}const sk={partial:!0,tokenize:tF},lk={concrete:!0,name:"codeFenced",tokenize:eF};function eF(e,t,n){const a=this,s={partial:!0,tokenize:L};let o=0,c=0,d;return m;function m(O){return h(O)}function h(O){const B=a.events[a.events.length-1];return o=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,d=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===d?(c++,e.consume(O),p):c<3?n(O):(e.exit("codeFencedFenceSequence"),ot(O)?xt(e,g,"whitespace")(O):g(O))}function g(O){return O===null||He(O)?(e.exit("codeFencedFence"),a.interrupt?t(O):e.check(sk,k,z)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||He(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(O)):ot(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xt(e,w,"whitespace")(O)):O===96&&O===d?n(O):(e.consume(O),x)}function w(O){return O===null||He(O)?g(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(O))}function S(O){return O===null||He(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(O)):O===96&&O===d?n(O):(e.consume(O),S)}function k(O){return e.attempt(s,z,C)(O)}function C(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),E}function E(O){return o>0&&ot(O)?xt(e,N,"linePrefix",o+1)(O):N(O)}function N(O){return O===null||He(O)?e.check(sk,k,z)(O):(e.enter("codeFlowValue"),R(O))}function R(O){return O===null||He(O)?(e.exit("codeFlowValue"),N(O)):(e.consume(O),R)}function z(O){return e.exit("codeFenced"),t(O)}function L(O,B,I){let V=0;return D;function D(X){return O.enter("lineEnding"),O.consume(X),O.exit("lineEnding"),K}function K(X){return O.enter("codeFencedFence"),ot(X)?xt(O,ae,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):ae(X)}function ae(X){return X===d?(O.enter("codeFencedFenceSequence"),be(X)):I(X)}function be(X){return X===d?(V++,O.consume(X),be):V>=c?(O.exit("codeFencedFenceSequence"),ot(X)?xt(O,W,"whitespace")(X):W(X)):I(X)}function W(X){return X===null||He(X)?(O.exit("codeFencedFence"),B(X)):I(X)}}}function tF(e,t,n){const a=this;return s;function s(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 bg={name:"codeIndented",tokenize:rF},nF={partial:!0,tokenize:aF};function rF(e,t,n){const a=this;return s;function s(h){return e.enter("codeIndented"),xt(e,o,"linePrefix",5)(h)}function o(h){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):He(h)?e.attempt(nF,c,m)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||He(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),d)}function m(h){return e.exit("codeIndented"),t(h)}}function aF(e,t,n){const a=this;return s;function s(c){return a.parser.lazy[a.now().line]?n(c):He(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):xt(e,o,"linePrefix",5)(c)}function o(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):He(c)?s(c):n(c)}}const iF={name:"codeText",previous:lF,resolve:sF,tokenize:oF};function sF(e){let t=e.length-4,n=3,a,s;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;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function lF(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function oF(e,t,n){let a=0,s,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),a++,d):(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"),s=0,p(g)):He(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||He(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function p(g){return g===96?(e.consume(g),s++,p):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class uF{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 s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Uu(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),Uu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Uu(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);Uu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Uu(this.left,n.reverse())}}}function Uu(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 d_(e){const t={};let n=-1,a,s,o,c,d,m,h;const p=new uF(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(a=p.get(n),n&&a[1].type==="chunkFlow"&&p.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,cF(p,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,s=void 0;o--;)if(c=p.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),c[1].type="lineEnding",s=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;s&&(a[1].end={...p.get(s)[1].start},d=p.slice(s,n),d.unshift(a),p.splice(s,n-s+1,d))}}return $r(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function cF(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,m=[],h={};let p,g,x=-1,w=n,S=0,k=0;const C=[k];for(;w;){for(;e.get(++s)[1]!==w;);o.push(s),w._tokenizer||(p=a.sliceStream(w),w.next||p.push(null),g&&c.defineSkip(w.start),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=n;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(k=x+1,C.push(k),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(c.events=[],w?(w._tokenizer=void 0,w.previous=void 0):C.pop(),x=C.length;x--;){const E=d.slice(C[x],C[x+1]),N=o.pop();m.push([N,N+E.length-1]),e.splice(N,2,E)}for(m.reverse(),x=-1;++x<m.length;)h[S+m[x][0]]=S+m[x][1],S+=m[x][1]-m[x][0]-1;return h}const dF={resolve:hF,tokenize:mF},fF={partial:!0,tokenize:pF};function hF(e){return d_(e),e}function mF(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?o(d):He(d)?e.check(fF,c,o)(d):(e.consume(d),s)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function pF(e,t,n){const a=this;return s;function s(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),xt(e,o,"linePrefix")}function o(c){if(c===null||He(c))return n(c);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function f_(e,t,n,a,s,o,c,d,m){const h=m||Number.POSITIVE_INFINITY;let p=0;return g;function g(E){return E===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(E),e.exit(o),x):E===null||E===32||E===41||Yf(E)?n(E):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),k(E))}function x(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),w(E))}function w(E){return E===62?(e.exit("chunkString"),e.exit(d),x(E)):E===null||E===60||He(E)?n(E):(e.consume(E),E===92?S:w)}function S(E){return E===60||E===62||E===92?(e.consume(E),w):w(E)}function k(E){return!p&&(E===null||E===41||It(E))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),t(E)):p<h&&E===40?(e.consume(E),p++,k):E===41?(e.consume(E),p--,k):E===null||E===32||E===40||Yf(E)?n(E):(e.consume(E),E===92?C:k)}function C(E){return E===40||E===41||E===92?(e.consume(E),k):k(E)}}function h_(e,t,n,a,s,o){const c=this;let d=0,m;return h;function h(w){return e.enter(a),e.enter(s),e.consume(w),e.exit(s),e.enter(o),p}function p(w){return d>999||w===null||w===91||w===93&&!m||w===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(w):w===93?(e.exit(o),e.enter(s),e.consume(w),e.exit(s),e.exit(a),t):He(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||He(w)||d++>999?(e.exit("chunkString"),p(w)):(e.consume(w),m||(m=!ot(w)),w===92?x:g)}function x(w){return w===91||w===92||w===93?(e.consume(w),d++,g):g(w)}}function m_(e,t,n,a,s,o){let c;return d;function d(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),c=x===40?41:x,m):n(x)}function m(x){return x===c?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):(e.enter(o),h(x))}function h(x){return x===c?(e.exit(o),m(c)):x===null?n(x):He(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),xt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===c||x===null||He(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?g:p)}function g(x){return x===c||x===92?(e.consume(x),p):p(x)}}function tc(e,t){let n;return a;function a(s){return He(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):ot(s)?xt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const gF={name:"definition",tokenize:vF},yF={partial:!0,tokenize:bF};function vF(e,t,n){const a=this;let s;return o;function o(w){return e.enter("definition"),c(w)}function c(w){return h_.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function d(w){return s=ba(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 It(w)?tc(e,h)(w):h(w)}function h(w){return f_(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function p(w){return e.attempt(yF,g,g)(w)}function g(w){return ot(w)?xt(e,x,"whitespace")(w):x(w)}function x(w){return w===null||He(w)?(e.exit("definition"),a.parser.defined.push(s),t(w)):n(w)}}function bF(e,t,n){return a;function a(d){return It(d)?tc(e,s)(d):n(d)}function s(d){return m_(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return ot(d)?xt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||He(d)?t(d):n(d)}}const xF={name:"hardBreakEscape",tokenize:wF};function wF(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return He(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const SF={name:"headingAtx",resolve:kF,tokenize:jF};function kF(e,t){let n=e.length-2,a=3,s,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&&(s={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"},$r(e,a,n-a+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function jF(e,t,n){let a=0;return s;function s(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&a++<6?(e.consume(p),c):p===null||It(p)?(e.exit("atxHeadingSequence"),d(p)):n(p)}function d(p){return p===35?(e.enter("atxHeadingSequence"),m(p)):p===null||He(p)?(e.exit("atxHeading"),t(p)):ot(p)?xt(e,d,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function m(p){return p===35?(e.consume(p),m):(e.exit("atxHeadingSequence"),d(p))}function h(p){return p===null||p===35||It(p)?(e.exit("atxHeadingText"),d(p)):(e.consume(p),h)}}const CF=["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"],ok=["pre","script","style","textarea"],EF={concrete:!0,name:"htmlFlow",resolveTo:TF,tokenize:AF},NF={partial:!0,tokenize:OF},_F={partial:!0,tokenize:RF};function TF(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 AF(e,t,n){const a=this;let s,o,c,d,m;return h;function h(T){return p(T)}function p(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),x):T===47?(e.consume(T),o=!0,k):T===63?(e.consume(T),s=3,a.interrupt?t:M):ur(T)?(e.consume(T),c=String.fromCharCode(T),C):n(T)}function x(T){return T===45?(e.consume(T),s=2,w):T===91?(e.consume(T),s=5,d=0,S):ur(T)?(e.consume(T),s=4,a.interrupt?t:M):n(T)}function w(T){return T===45?(e.consume(T),a.interrupt?t:M):n(T)}function S(T){const G="CDATA[";return T===G.charCodeAt(d++)?(e.consume(T),d===G.length?a.interrupt?t:ae:S):n(T)}function k(T){return ur(T)?(e.consume(T),c=String.fromCharCode(T),C):n(T)}function C(T){if(T===null||T===47||T===62||It(T)){const G=T===47,q=c.toLowerCase();return!G&&!o&&ok.includes(q)?(s=1,a.interrupt?t(T):ae(T)):CF.includes(c.toLowerCase())?(s=6,G?(e.consume(T),E):a.interrupt?t(T):ae(T)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(T):o?N(T):R(T))}return T===45||Wn(T)?(e.consume(T),c+=String.fromCharCode(T),C):n(T)}function E(T){return T===62?(e.consume(T),a.interrupt?t:ae):n(T)}function N(T){return ot(T)?(e.consume(T),N):D(T)}function R(T){return T===47?(e.consume(T),D):T===58||T===95||ur(T)?(e.consume(T),z):ot(T)?(e.consume(T),R):D(T)}function z(T){return T===45||T===46||T===58||T===95||Wn(T)?(e.consume(T),z):L(T)}function L(T){return T===61?(e.consume(T),O):ot(T)?(e.consume(T),L):R(T)}function O(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),m=T,B):ot(T)?(e.consume(T),O):I(T)}function B(T){return T===m?(e.consume(T),m=null,V):T===null||He(T)?n(T):(e.consume(T),B)}function I(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||It(T)?L(T):(e.consume(T),I)}function V(T){return T===47||T===62||ot(T)?R(T):n(T)}function D(T){return T===62?(e.consume(T),K):n(T)}function K(T){return T===null||He(T)?ae(T):ot(T)?(e.consume(T),K):n(T)}function ae(T){return T===45&&s===2?(e.consume(T),Z):T===60&&s===1?(e.consume(T),te):T===62&&s===4?(e.consume(T),P):T===63&&s===3?(e.consume(T),M):T===93&&s===5?(e.consume(T),Ae):He(T)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(NF,$,be)(T)):T===null||He(T)?(e.exit("htmlFlowData"),be(T)):(e.consume(T),ae)}function be(T){return e.check(_F,W,$)(T)}function W(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),X}function X(T){return T===null||He(T)?be(T):(e.enter("htmlFlowData"),ae(T))}function Z(T){return T===45?(e.consume(T),M):ae(T)}function te(T){return T===47?(e.consume(T),c="",je):ae(T)}function je(T){if(T===62){const G=c.toLowerCase();return ok.includes(G)?(e.consume(T),P):ae(T)}return ur(T)&&c.length<8?(e.consume(T),c+=String.fromCharCode(T),je):ae(T)}function Ae(T){return T===93?(e.consume(T),M):ae(T)}function M(T){return T===62?(e.consume(T),P):T===45&&s===2?(e.consume(T),M):ae(T)}function P(T){return T===null||He(T)?(e.exit("htmlFlowData"),$(T)):(e.consume(T),P)}function $(T){return e.exit("htmlFlow"),t(T)}}function RF(e,t,n){const a=this;return s;function s(c){return He(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 OF(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Pc,t,n)}}const zF={name:"htmlText",tokenize:MF};function MF(e,t,n){const a=this;let s,o,c;return d;function d(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),m}function m(M){return M===33?(e.consume(M),h):M===47?(e.consume(M),L):M===63?(e.consume(M),R):ur(M)?(e.consume(M),I):n(M)}function h(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),o=0,S):ur(M)?(e.consume(M),N):n(M)}function p(M){return M===45?(e.consume(M),w):n(M)}function g(M){return M===null?n(M):M===45?(e.consume(M),x):He(M)?(c=g,te(M)):(e.consume(M),g)}function x(M){return M===45?(e.consume(M),w):g(M)}function w(M){return M===62?Z(M):M===45?x(M):g(M)}function S(M){const P="CDATA[";return M===P.charCodeAt(o++)?(e.consume(M),o===P.length?k:S):n(M)}function k(M){return M===null?n(M):M===93?(e.consume(M),C):He(M)?(c=k,te(M)):(e.consume(M),k)}function C(M){return M===93?(e.consume(M),E):k(M)}function E(M){return M===62?Z(M):M===93?(e.consume(M),E):k(M)}function N(M){return M===null||M===62?Z(M):He(M)?(c=N,te(M)):(e.consume(M),N)}function R(M){return M===null?n(M):M===63?(e.consume(M),z):He(M)?(c=R,te(M)):(e.consume(M),R)}function z(M){return M===62?Z(M):R(M)}function L(M){return ur(M)?(e.consume(M),O):n(M)}function O(M){return M===45||Wn(M)?(e.consume(M),O):B(M)}function B(M){return He(M)?(c=B,te(M)):ot(M)?(e.consume(M),B):Z(M)}function I(M){return M===45||Wn(M)?(e.consume(M),I):M===47||M===62||It(M)?V(M):n(M)}function V(M){return M===47?(e.consume(M),Z):M===58||M===95||ur(M)?(e.consume(M),D):He(M)?(c=V,te(M)):ot(M)?(e.consume(M),V):Z(M)}function D(M){return M===45||M===46||M===58||M===95||Wn(M)?(e.consume(M),D):K(M)}function K(M){return M===61?(e.consume(M),ae):He(M)?(c=K,te(M)):ot(M)?(e.consume(M),K):V(M)}function ae(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),s=M,be):He(M)?(c=ae,te(M)):ot(M)?(e.consume(M),ae):(e.consume(M),W)}function be(M){return M===s?(e.consume(M),s=void 0,X):M===null?n(M):He(M)?(c=be,te(M)):(e.consume(M),be)}function W(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||It(M)?V(M):(e.consume(M),W)}function X(M){return M===47||M===62||It(M)?V(M):n(M)}function Z(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function te(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),je}function je(M){return ot(M)?xt(e,Ae,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):Ae(M)}function Ae(M){return e.enter("htmlTextData"),c(M)}}const ub={name:"labelEnd",resolveAll:PF,resolveTo:UF,tokenize:BF},DF={tokenize:$F},IF={tokenize:FF},LF={tokenize:HF};function PF(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 s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&$r(e,0,e.length,n),e}function UF(e,t){let n=e.length,a=0,s,o,c,d;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){a=2;break}}else s.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}},p={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",m,t],["enter",h,t]],d=ra(d,e.slice(o+1,o+a+3)),d=ra(d,[["enter",p,t]]),d=ra(d,Th(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),d=ra(d,[["exit",p,t],e[c-2],e[c-1],["exit",h,t]]),d=ra(d,e.slice(c+1)),d=ra(d,[["exit",m,t]]),$r(e,o,e.length,d),e}function BF(e,t,n){const a=this;let s=a.events.length,o,c;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return d;function d(x){return o?o._inactive?g(x):(c=a.parser.defined.includes(ba(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),m):n(x)}function m(x){return x===40?e.attempt(DF,p,c?p:g)(x):x===91?e.attempt(IF,p,c?h:g)(x):c?p(x):g(x)}function h(x){return e.attempt(LF,p,g)(x)}function p(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function $F(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return It(g)?tc(e,o)(g):o(g)}function o(g){return g===41?p(g):f_(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return It(g)?tc(e,m)(g):p(g)}function d(g){return n(g)}function m(g){return g===34||g===39||g===40?m_(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function h(g){return It(g)?tc(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function FF(e,t,n){const a=this;return s;function s(d){return h_.call(a,e,o,c,"reference","referenceMarker","referenceString")(d)}function o(d){return a.parser.defined.includes(ba(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function HF(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const qF={name:"labelStartImage",resolveAll:ub.resolveAll,tokenize:ZF};function ZF(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const GF={name:"labelStartLink",resolveAll:ub.resolveAll,tokenize:VF};function VF(e,t,n){const a=this;return s;function s(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 xg={name:"lineEnding",tokenize:QF};function QF(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),xt(e,t,"linePrefix")}}const Mf={name:"thematicBreak",tokenize:KF};function KF(e,t,n){let a=0,s;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return s=h,d(h)}function d(h){return h===s?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||He(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===s?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),ot(h)?xt(e,d,"whitespace")(h):d(h))}}const xr={continuation:{tokenize:JF},exit:t8,name:"list",tokenize:WF},YF={partial:!0,tokenize:n8},XF={partial:!0,tokenize:e8};function WF(e,t,n){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,c=0;return d;function d(w){const S=a.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||w===a.containerState.marker:Hy(w)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Mf,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 Hy(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(Pc,a.interrupt?n:p,e.attempt(YF,x,g))}function p(w){return a.containerState.initialBlankLine=!0,o++,x(w)}function g(w){return ot(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),x):n(w)}function x(w){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function JF(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Pc,s,o);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,xt(e,t,"listItemIndent",a.containerState.size+1)(d)}function o(d){return a.containerState.furtherBlankLines||!ot(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(XF,t,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,xt(e,e.attempt(xr,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function e8(e,t,n){const a=this;return xt(e,s,"listItemIndent",a.containerState.size+1);function s(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 t8(e){e.exit(this.containerState.type)}function n8(e,t,n){const a=this;return xt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const c=a.events[a.events.length-1];return!ot(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const uk={name:"setextUnderline",resolveTo:r8,tokenize:a8};function r8(e,t){let n=e.length,a,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=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[s][1].type="setextHeadingText",o?(e.splice(s,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 a8(e,t,n){const a=this;let s;return o;function o(h){let p=a.events.length,g;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){g=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),s=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===s?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),ot(h)?xt(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||He(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const i8={tokenize:s8};function s8(e){const t=this,n=e.attempt(Pc,a,e.attempt(this.parser.constructs.flowInitial,s,xt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(dF,s)),"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 s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const l8={resolveAll:g_()},o8=p_("string"),u8=p_("text");function p_(e){return{resolveAll:g_(e==="text"?c8:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],o=n.attempt(s,c,d);return c;function c(p){return h(p)?o(p):d(p)}function d(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),m}function m(p){return h(p)?(n.exit("data"),o(p)):(n.consume(p),m)}function h(p){if(p===null)return!0;const g=s[p];let x=-1;if(g)for(;++x<g.length;){const w=g[x];if(!w.previous||w.previous.call(a,a.previous))return!0}return!1}}}function g_(e){return t;function t(n,a){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,a):n}}function c8(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],s=t.sliceStream(a);let o=s.length,c=-1,d=0,m;for(;o--;){const h=s[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(h===-2)m=!0,d++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const h={type:n===e.length||m||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},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 d8={42:xr,43:xr,45:xr,48:xr,49:xr,50:xr,51:xr,52:xr,53:xr,54:xr,55:xr,56:xr,57:xr,62:o_},f8={91:gF},h8={[-2]:bg,[-1]:bg,32:bg},m8={35:SF,42:Mf,45:[uk,Mf],60:EF,61:uk,95:Mf,96:lk,126:lk},p8={38:c_,92:u_},g8={[-5]:xg,[-4]:xg,[-3]:xg,33:qF,38:c_,42:qy,60:[G$,zF],91:GF,92:[xF,u_],93:ub,95:qy,96:iF},y8={null:[qy,l8]},v8={null:[42,95]},b8={null:[]},x8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:v8,contentInitial:f8,disable:b8,document:d8,flow:m8,flowInitial:h8,insideSpan:y8,string:p8,text:g8},Symbol.toStringTag,{value:"Module"}));function w8(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 s={},o=[];let c=[],d=[];const m={attempt:B(L),check:B(O),consume:N,enter:R,exit:z,interrupt:B(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:k,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:w,write:g};let p=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(K){return c=ra(c,K),C(),c[c.length-1]!==null?[]:(I(t,0),h.events=Th(o,h.events,h),h.events)}function x(K,ae){return k8(w(K),ae)}function w(K){return S8(c,K)}function S(){const{_bufferIndex:K,_index:ae,line:be,column:W,offset:X}=a;return{_bufferIndex:K,_index:ae,line:be,column:W,offset:X}}function k(K){s[K.line]=K.column,D()}function C(){let K;for(;a._index<c.length;){const ae=c[a._index];if(typeof ae=="string")for(K=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===K&&a._bufferIndex<ae.length;)E(ae.charCodeAt(a._bufferIndex));else E(ae)}}function E(K){p=p(K)}function N(K){He(K)?(a.line++,a.column=1,a.offset+=K===-3?2:1,D()):K!==-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=K}function R(K,ae){const be=ae||{};return be.type=K,be.start=S(),h.events.push(["enter",be,h]),d.push(be),be}function z(K){const ae=d.pop();return ae.end=S(),h.events.push(["exit",ae,h]),ae}function L(K,ae){I(K,ae.from)}function O(K,ae){ae.restore()}function B(K,ae){return be;function be(W,X,Z){let te,je,Ae,M;return Array.isArray(W)?$(W):"tokenize"in W?$([W]):P(W);function P(re){return xe;function xe(we){const me=we!==null&&re[we],Ie=we!==null&&re.null,Ue=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return $(Ue)(we)}}function $(re){return te=re,je=0,re.length===0?Z:T(re[je])}function T(re){return xe;function xe(we){return M=V(),Ae=re,re.partial||(h.currentConstruct=re),re.name&&h.parser.constructs.disable.null.includes(re.name)?q():re.tokenize.call(ae?Object.assign(Object.create(h),ae):h,m,G,q)(we)}}function G(re){return K(Ae,M),X}function q(re){return M.restore(),++je<te.length?T(te[je]):Z}}}function I(K,ae){K.resolveAll&&!o.includes(K)&&o.push(K),K.resolve&&$r(h.events,ae,h.events.length-ae,K.resolve(h.events.slice(ae),h)),K.resolveTo&&(h.events=K.resolveTo(h.events,h))}function V(){const K=S(),ae=h.previous,be=h.currentConstruct,W=h.events.length,X=Array.from(d);return{from:W,restore:Z};function Z(){a=K,h.previous=ae,h.currentConstruct=be,h.events.length=W,d=X,D()}}function D(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function S8(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let c;if(n===s)c=[e[n].slice(a,o)];else{if(c=e.slice(n,s),a>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}o>0&&c.push(e[s].slice(0,o))}return c}function k8(e,t){let n=-1;const a=[];let s;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=`
|
|
389
|
+
`;break}case-3:{c=`\r
|
|
390
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&s)continue;c=" ";break}default:c=String.fromCharCode(o)}s=o===-2,a.push(c)}return a.join("")}function j8(e){const a={constructs:s_([x8,...(e||{}).extensions||[]]),content:s(U$),defined:[],document:s($$),flow:s(i8),lazy:{},string:s(o8),text:s(u8)};return a;function s(o){return c;function c(d){return w8(a,o,d)}}}function C8(e){for(;!d_(e););return e}const ck=/[\0\t\n\r]/g;function E8(){let e=1,t="",n=!0,a;return s;function s(o,c,d){const m=[];let h,p,g,x,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(ck.lastIndex=g,h=ck.exec(o),x=h&&h.index!==void 0?h.index:o.length,w=o.charCodeAt(x),!h){t=o.slice(g);break}if(w===10&&g===x&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<x&&(m.push(o.slice(g,x)),e+=x-g),w){case 0:{m.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,m.push(-2);e++<p;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}g=x+1}return d&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const N8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _8(e){return e.replace(N8,T8)}function T8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return l_(n.slice(o?2:1),o?16:10)}return ob(n)||e}const y_={}.hasOwnProperty;function A8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),R8(n)(C8(j8(n).document().write(E8()(e,t,!0))))}function R8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ft),autolinkProtocol:V,autolinkEmail:V,atxHeading:o(le),blockQuote:o(Ie),characterEscape:V,characterReference:V,codeFenced:o(Ue),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Ue,c),codeText:o(ft,c),codeTextData:V,data:V,codeFlowValue:V,definition:o(ut),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(ie),hardBreakEscape:o(ve),hardBreakTrailing:o(ve),htmlFlow:o(Re,c),htmlFlowData:V,htmlText:o(Re,c),htmlTextData:V,image:o(St),label:c,link:o(Ft),listItem:o(hr),listItemValue:x,listOrdered:o(Pn,g),listUnordered:o(Pn),paragraph:o(pi),reference:T,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(le),strong:o(gi),thematicBreak:o(da)},exit:{atxHeading:m(),atxHeadingSequence:L,autolink:m(),autolinkEmail:me,autolinkProtocol:we,blockQuote:m(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:re,characterReference:xe,codeFenced:m(C),codeFencedFence:k,codeFencedFenceInfo:w,codeFencedFenceMeta:S,codeFlowValue:D,codeIndented:m(E),codeText:m(X),codeTextData:D,data:D,definition:m(),definitionDestinationString:z,definitionLabelString:N,definitionTitleString:R,emphasis:m(),hardBreakEscape:m(ae),hardBreakTrailing:m(ae),htmlFlow:m(be),htmlFlowData:D,htmlText:m(W),htmlTextData:D,image:m(te),label:Ae,labelText:je,lineEnding:K,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:G,resourceDestinationString:M,resourceTitleString:P,resource:$,setextHeading:m(I),setextHeadingLineSequence:B,setextHeadingText:O,strong:m(),thematicBreak:m()}};v_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ue){let ge={type:"root",children:[]};const $e={stack:[ge],tokenStack:[],config:t,enter:d,exit:h,buffer:c,resume:p,data:n},Ve=[];let at=-1;for(;++at<ue.length;)if(ue[at][1].type==="listOrdered"||ue[at][1].type==="listUnordered")if(ue[at][0]==="enter")Ve.push(at);else{const cn=Ve.pop();at=s(ue,cn,at)}for(at=-1;++at<ue.length;){const cn=t[ue[at][0]];y_.call(cn,ue[at][1].type)&&cn[ue[at][1].type].call(Object.assign({sliceSerialize:ue[at][2].sliceSerialize},$e),ue[at][1])}if($e.tokenStack.length>0){const cn=$e.tokenStack[$e.tokenStack.length-1];(cn[1]||dk).call($e,void 0,cn[0])}for(ge.position={start:qi(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:qi(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)ge=t.transforms[at](ge)||ge;return ge}function s(ue,ge,$e){let Ve=ge-1,at=-1,cn=!1,tr,Ht,Lt,At;for(;++Ve<=$e;){const it=ue[Ve];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?at++:at--,At=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(tr&&!At&&!at&&!Lt&&(Lt=Ve),At=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:At=void 0}if(!at&&it[0]==="enter"&&it[1].type==="listItemPrefix"||at===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(tr){let nr=Ve;for(Ht=void 0;nr--;){const zn=ue[nr];if(zn[1].type==="lineEnding"||zn[1].type==="lineEndingBlank"){if(zn[0]==="exit")continue;Ht&&(ue[Ht][1].type="lineEndingBlank",cn=!0),zn[1].type="lineEnding",Ht=nr}else if(!(zn[1].type==="linePrefix"||zn[1].type==="blockQuotePrefix"||zn[1].type==="blockQuotePrefixWhitespace"||zn[1].type==="blockQuoteMarker"||zn[1].type==="listItemIndent"))break}Lt&&(!Ht||Lt<Ht)&&(tr._spread=!0),tr.end=Object.assign({},Ht?ue[Ht][1].start:it[1].end),ue.splice(Ht||Ve,0,["exit",tr,it[2]]),Ve++,$e++}if(it[1].type==="listItemPrefix"){const nr={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};tr=nr,ue.splice(Ve,0,["enter",nr,it[2]]),Ve++,$e++,Lt=void 0,At=!0}}}return ue[ge][1]._spread=cn,$e}function o(ue,ge){return $e;function $e(Ve){d.call(this,ue(Ve),Ve),ge&&ge.call(this,Ve)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(ue,ge,$e){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([ge,$e||void 0]),ue.position={start:qi(ge.start),end:void 0}}function m(ue){return ge;function ge($e){ue&&ue.call(this,$e),h.call(this,$e)}}function h(ue,ge){const $e=this.stack.pop(),Ve=this.tokenStack.pop();if(Ve)Ve[0].type!==ue.type&&(ge?ge.call(this,ue,Ve[0]):(Ve[1]||dk).call(this,ue,Ve[0]));else throw new Error("Cannot close `"+ue.type+"` ("+ec({start:ue.start,end:ue.end})+"): it’s not open");$e.position.end=qi(ue.end)}function p(){return lb(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(ue){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=ue}function S(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=ue}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue.replace(/(\r?\n|\r)$/g,"")}function N(ue){const ge=this.resume(),$e=this.stack[this.stack.length-1];$e.label=ge,$e.identifier=ba(this.sliceSerialize(ue)).toLowerCase()}function R(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ue}function z(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ue}function L(ue){const ge=this.stack[this.stack.length-1];if(!ge.depth){const $e=this.sliceSerialize(ue).length;ge.depth=$e}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function B(ue){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function V(ue){const $e=this.stack[this.stack.length-1].children;let Ve=$e[$e.length-1];(!Ve||Ve.type!=="text")&&(Ve=un(),Ve.position={start:qi(ue.start),end:void 0},$e.push(Ve)),this.stack.push(Ve)}function D(ue){const ge=this.stack.pop();ge.value+=this.sliceSerialize(ue),ge.position.end=qi(ue.end)}function K(ue){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=ge.children[ge.children.length-1];$e.position.end=qi(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(V.call(this,ue),D.call(this,ue))}function ae(){this.data.atHardBreak=!0}function be(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue}function W(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue}function X(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ue}function Z(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ge,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function te(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ge,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function je(ue){const ge=this.sliceSerialize(ue),$e=this.stack[this.stack.length-2];$e.label=_8(ge),$e.identifier=ba(ge).toLowerCase()}function Ae(){const ue=this.stack[this.stack.length-1],ge=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const Ve=ue.children;$e.children=Ve}else $e.alt=ge}function M(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ue}function P(){const ue=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ue}function $(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function G(ue){const ge=this.resume(),$e=this.stack[this.stack.length-1];$e.label=ge,$e.identifier=ba(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function q(ue){this.data.characterReferenceType=ue.type}function re(ue){const ge=this.sliceSerialize(ue),$e=this.data.characterReferenceType;let Ve;$e?(Ve=l_(ge,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ve=ob(ge);const at=this.stack[this.stack.length-1];at.value+=Ve}function xe(ue){const ge=this.stack.pop();ge.position.end=qi(ue.end)}function we(ue){D.call(this,ue);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(ue)}function me(ue){D.call(this,ue);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(ue)}function Ie(){return{type:"blockquote",children:[]}}function Ue(){return{type:"code",lang:null,meta:null,value:""}}function ft(){return{type:"inlineCode",value:""}}function ut(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ie(){return{type:"emphasis",children:[]}}function le(){return{type:"heading",depth:0,children:[]}}function ve(){return{type:"break"}}function Re(){return{type:"html",value:""}}function St(){return{type:"image",title:null,url:"",alt:null}}function Ft(){return{type:"link",title:null,url:"",children:[]}}function Pn(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function hr(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function pi(){return{type:"paragraph",children:[]}}function gi(){return{type:"strong",children:[]}}function un(){return{type:"text",value:""}}function da(){return{type:"thematicBreak"}}}function qi(e){return{line:e.line,column:e.column,offset:e.offset}}function v_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?v_(e,a):O8(e,a)}}function O8(e,t){let n;for(n in t)if(y_.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 dk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ec({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ec({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ec({start:t.start,end:t.end})+") is still open")}function z8(e){const t=this;t.parser=n;function n(a){return A8(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function M8(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 D8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
391
|
+
`}]}function I8(e,t){const n=t.value?t.value+`
|
|
392
|
+
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[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 L8(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function P8(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function U8(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=Oo(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,d+=1,e.footnoteCounts.set(a,d);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(d>1?"-"+d:""),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 B8(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 $8(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function b_(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 s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const c=s[s.length-1];return c&&c.type==="text"?c.value+=a:s.push({type:"text",value:a}),s}function F8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return b_(e,t);const s={src:Oo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function H8(e,t){const n={src:Oo(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 q8(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 Z8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return b_(e,t);const s={href:Oo(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function G8(e,t){const n={href:Oo(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 V8(e,t,n){const a=e.all(t),s=n?Q8(n):x_(t),o={},c=[];if(typeof t.checked=="boolean"){const p=a[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(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 d=-1;for(;++d<a.length;){const p=a[d];(s||d!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
393
|
+
`}),p.type==="element"&&p.tagName==="p"&&!s?c.push(...p.children):c.push(p)}const m=a[a.length-1];m&&(s||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
394
|
+
`});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function Q8(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=x_(n[a])}return t}function x_(e){const t=e.spread;return t??e.children.length>1}function K8(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const c=a[s];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 Y8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function X8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function W8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J8(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),s.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=rb(t.children[1]),m=JN(t.children[t.children.length-1]);d&&m&&(c.position={start:d,end:m}),s.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function eH(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,d=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<d;){const g=t.children[m],x={},w=c?c[m]:void 0;w&&(x.align=w);let S={type:"element",tagName:o,properties:x,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),h.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function tH(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const fk=9,hk=32;function nH(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const o=[];for(;a;)o.push(mk(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return o.push(mk(t.slice(s),s>0,!1)),o.join("")}function mk(e,t,n){let a=0,s=e.length;if(t){let o=e.codePointAt(a);for(;o===fk||o===hk;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(s-1);for(;o===fk||o===hk;)s--,o=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function rH(e,t){const n={type:"text",value:nH(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function aH(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const iH={blockquote:M8,break:D8,code:I8,delete:L8,emphasis:P8,footnoteReference:U8,heading:B8,html:$8,imageReference:F8,image:H8,inlineCode:q8,linkReference:Z8,link:G8,listItem:V8,list:K8,paragraph:Y8,root:X8,strong:W8,table:J8,tableCell:tH,tableRow:eH,text:rH,thematicBreak:aH,toml:vf,yaml:vf,definition:vf,footnoteDefinition:vf};function vf(){}const w_=-1,Ah=0,nc=1,Xf=2,cb=3,db=4,fb=5,hb=6,S_=7,k_=8,pk=typeof self=="object"?self:globalThis,sH=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),a=s=>{if(e.has(s))return e.get(s);const[o,c]=t[s];switch(o){case Ah:case w_:return n(c,s);case nc:{const d=n([],s);for(const m of c)d.push(a(m));return d}case Xf:{const d=n({},s);for(const[m,h]of c)d[a(m)]=a(h);return d}case cb:return n(new Date(c),s);case db:{const{source:d,flags:m}=c;return n(new RegExp(d,m),s)}case fb:{const d=n(new Map,s);for(const[m,h]of c)d.set(a(m),a(h));return d}case hb:{const d=n(new Set,s);for(const m of c)d.add(a(m));return d}case S_:{const{name:d,message:m}=c;return n(new pk[d](m),s)}case k_:return n(BigInt(c),s);case"BigInt":return n(Object(BigInt(c)),s);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(new pk[o](c),s)};return a},gk=e=>sH(new Map,e)(0),ql="",{toString:lH}={},{keys:oH}=Object,Bu=e=>{const t=typeof e;if(t!=="object"||!e)return[Ah,t];const n=lH.call(e).slice(8,-1);switch(n){case"Array":return[nc,ql];case"Object":return[Xf,ql];case"Date":return[cb,ql];case"RegExp":return[db,ql];case"Map":return[fb,ql];case"Set":return[hb,ql];case"DataView":return[nc,n]}return n.includes("Array")?[nc,n]:n.includes("Error")?[S_,n]:[Xf,n]},bf=([e,t])=>e===Ah&&(t==="function"||t==="symbol"),uH=(e,t,n,a)=>{const s=(c,d)=>{const m=a.push(c)-1;return n.set(d,m),m},o=c=>{if(n.has(c))return n.get(c);let[d,m]=Bu(c);switch(d){case Ah:{let p=c;switch(m){case"bigint":d=k_,p=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);p=null;break;case"undefined":return s([w_],c)}return s([d,p],c)}case nc:{if(m){let x=c;return m==="DataView"?x=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(x=new Uint8Array(c)),s([m,[...x]],c)}const p=[],g=s([d,p],c);for(const x of c)p.push(o(x));return g}case Xf:{if(m)switch(m){case"BigInt":return s([m,c.toString()],c);case"Boolean":case"Number":case"String":return s([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const p=[],g=s([d,p],c);for(const x of oH(c))(e||!bf(Bu(c[x])))&&p.push([o(x),o(c[x])]);return g}case cb:return s([d,c.toISOString()],c);case db:{const{source:p,flags:g}=c;return s([d,{source:p,flags:g}],c)}case fb:{const p=[],g=s([d,p],c);for(const[x,w]of c)(e||!(bf(Bu(x))||bf(Bu(w))))&&p.push([o(x),o(w)]);return g}case hb:{const p=[],g=s([d,p],c);for(const x of c)(e||!bf(Bu(x)))&&p.push(o(x));return g}}const{message:h}=c;return s([d,{name:m,message:h}],c)};return o},yk=(e,{json:t,lossy:n}={})=>{const a=[];return uH(!(t||n),!!t,new Map,a)(e),a},Wf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?gk(yk(e,t)):structuredClone(e):(e,t)=>gk(yk(e,t));function cH(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 dH(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function fH(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||cH,a=e.options.footnoteBackLabel||dH,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const p=e.all(h),g=String(h.identifier).toUpperCase(),x=Oo(g.toLowerCase());let w=0;const S=[],k=e.footnoteCounts.get(g);for(;k!==void 0&&++w<=k;){S.length>0&&S.push({type:"text",value:" "});let N=typeof n=="string"?n:n(m,w);typeof N=="string"&&(N={type:"text",value:N}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,w),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const N=C.children[C.children.length-1];N&&N.type==="text"?N.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...S)}else p.push(...S);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(p,!0)};e.patch(h,E),d.push(E)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Wf(c),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
395
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
396
|
+
`}]}}const Rh=(function(e){if(e==null)return gH;if(typeof e=="function")return Oh(e);if(typeof e=="object")return Array.isArray(e)?hH(e):mH(e);if(typeof e=="string")return pH(e);throw new Error("Expected function, string, or object as test")});function hH(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Rh(e[n]);return Oh(a);function a(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function mH(e){const t=e;return Oh(n);function n(a){const s=a;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function pH(e){return Oh(t);function t(n){return n&&n.type===e}}function Oh(e){return t;function t(n,a,s){return!!(yH(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function gH(){return!0}function yH(e){return e!==null&&typeof e=="object"&&"type"in e}const j_=[],vH=!0,Zy=!1,bH="skip";function C_(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const o=Rh(s),c=a?-1:1;d(e,void 0,[])();function d(m,h,p){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(x,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return x;function x(){let w=j_,S,k,C;if((!t||o(m,h,p[p.length-1]||void 0))&&(w=xH(n(m,p)),w[0]===Zy))return w;if("children"in m&&m.children){const E=m;if(E.children&&w[0]!==bH)for(k=(a?E.children.length:-1)+c,C=p.concat(E);k>-1&&k<E.children.length;){const N=E.children[k];if(S=d(N,k,C)(),S[0]===Zy)return S;k=typeof S[1]=="number"?S[1]:k+c}}return w}}}function xH(e){return Array.isArray(e)?e:typeof e=="number"?[vH,e]:e==null?j_:[e]}function mb(e,t,n,a){let s,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,s=n):(o=t,c=n,s=a),C_(e,o,d,s);function d(m,h){const p=h[h.length-1],g=p?p.children.indexOf(m):void 0;return c(m,g,p)}}const Gy={}.hasOwnProperty,wH={};function SH(e,t){const n=t||wH,a=new Map,s=new Map,o=new Map,c={...iH,...n.handlers},d={all:h,applyData:jH,definitionById:a,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:kH,wrap:EH};return mb(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?a:s,x=String(p.identifier).toUpperCase();g.has(x)||g.set(x,p)}}),d;function m(p,g){const x=p.type,w=d.handlers[x];if(Gy.call(d.handlers,x)&&w)return w(d,p,g);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in p){const{children:k,...C}=p,E=Wf(C);return E.children=d.all(p),E}return Wf(p)}return(d.options.unknownHandler||CH)(d,p,g)}function h(p){const g=[];if("children"in p){const x=p.children;let w=-1;for(;++w<x.length;){const S=d.one(x[w],p);if(S){if(w&&x[w-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=vk(S.value)),!Array.isArray(S)&&S.type==="element")){const k=S.children[0];k&&k.type==="text"&&(k.value=vk(k.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function kH(e,t){e.position&&(t.position=d$(e))}function jH(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=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,Wf(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function CH(e,t){const n=t.data||{},a="value"in t&&!(Gy.call(n,"hProperties")||Gy.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 EH(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
397
|
+
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
398
|
+
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
399
|
+
`}),n}function vk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function bk(e,t){const n=SH(e,t),a=n.one(e,void 0),s=fH(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
400
|
+
`},s),o}function NH(e,t){return e&&"run"in e?async function(n,a){const s=bk(n,{file:a,...t});await e.run(s,a)}:function(n,a){return bk(n,{file:a,...e||t})}}function xk(e){if(e)throw e}var wg,wk;function _H(){if(wk)return wg;wk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=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 p=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!g)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},c=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},d=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(a)return a(h,p).value}else return;return h[p]};return wg=function m(){var h,p,g,x,w,S,k=arguments[0],C=1,E=arguments.length,N=!1;for(typeof k=="boolean"&&(N=k,k=arguments[1]||{},C=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});C<E;++C)if(h=arguments[C],h!=null)for(p in h)g=d(k,p),x=d(h,p),k!==x&&(N&&x&&(o(x)||(w=s(x)))?(w?(w=!1,S=g&&s(g)?g:[]):S=g&&o(g)?g:{},c(k,{name:p,newValue:m(N,S,x)})):typeof x<"u"&&c(k,{name:p,newValue:x}));return k},wg}var TH=_H();const Sg=nh(TH);function Vy(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 AH(){const e=[],t={run:n,use:a};return t;function n(...s){let o=-1;const c=s.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...s);function d(m,...h){const p=e[++o];let g=-1;if(m){c(m);return}for(;++g<s.length;)(h[g]===null||h[g]===void 0)&&(h[g]=s[g]);s=h,p?RH(p,d)(...h):c(null,...h)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function RH(e,t){let n;return a;function a(...c){const d=e.length>c.length;let m;d&&c.push(s);try{m=e.apply(this,c)}catch(h){const p=h;if(d&&n)throw p;return s(p)}d||(m&&m.then&&typeof m.then=="function"?m.then(o,s):m instanceof Error?s(m):o(m))}function s(c,...d){n||(n=!0,t(c,...d))}function o(c){s(null,c)}}const Na={basename:OH,dirname:zH,extname:MH,join:DH,sep:"/"};function OH(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Uc(e);let n=0,a=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else c<0&&(o=!0,c=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function zH(e){if(Uc(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 MH(e){Uc(e);let t=e.length,n=-1,a=0,s=-1,o=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function DH(...e){let t=-1,n;for(;++t<e.length;)Uc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":IH(n)}function IH(e){Uc(e);const t=e.codePointAt(0)===47;let n=LH(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function LH(e,t){let n="",a=0,s=-1,o=0,c=-1,d,m;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(s===c-1||o===1))if(s!==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("/")),s=c,o=0;continue}}else if(n.length>0){n="",a=0,s=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,c):n=e.slice(s+1,c),a=c-s-1;s=c,o=0}else d===46&&o>-1?o++:o=-1}return n}function Uc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const PH={cwd:UH};function UH(){return"/"}function Qy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function BH(e){if(typeof e=="string")e=new URL(e);else if(!Qy(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 $H(e)}function $H(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const kg=["history","path","basename","stem","extname","dirname"];class E_{constructor(t){let n;t?Qy(t)?n={path:t}:typeof t=="string"||FH(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":PH.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<kg.length;){const o=kg[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)kg.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Na.basename(this.path):void 0}set basename(t){Cg(t,"basename"),jg(t,"basename"),this.path=Na.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Na.dirname(this.path):void 0}set dirname(t){Sk(this.basename,"dirname"),this.path=Na.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Na.extname(this.path):void 0}set extname(t){if(jg(t,"extname"),Sk(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=Na.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Qy(t)&&(t=BH(t)),Cg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Na.basename(this.path,this.extname):void 0}set stem(t){Cg(t,"stem"),jg(t,"stem"),this.path=Na.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new er(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function jg(e,t){if(e&&e.includes(Na.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Na.sep+"`")}function Cg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Sk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function FH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HH=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),qH={}.hasOwnProperty;class pb extends HH{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=AH()}copy(){const t=new pb;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Sg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(_g("data",this.frozen),this.namespace[t]=n,this):qH.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_g("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 s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=xf(t),a=this.parser||this.Parser;return Eg("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Eg("process",this.parser||this.Parser),Ng("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,c){const d=xf(t),m=a.parse(d);a.run(m,d,function(p,g,x){if(p||!g||!x)return h(p);const w=g,S=a.stringify(w,x);VH(S)?x.value=S:x.result=S,h(p,x)});function h(p,g){p||!g?c(p):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),Eg("processSync",this.parser||this.Parser),Ng("processSync",this.compiler||this.Compiler),this.process(t,s),jk("processSync","process",n),a;function s(o,c){n=!0,xk(o),a=c}}run(t,n,a){kk(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,d){const m=xf(n);s.run(t,m,h);function h(p,g,x){const w=g||t;p?d(p):c?c(w):a(void 0,w,x)}}}runSync(t,n){let a=!1,s;return this.run(t,n,o),jk("runSync","run",a),s;function o(c,d){xk(c),s=d,a=!0}}stringify(t,n){this.freeze();const a=xf(n),s=this.compiler||this.Compiler;return Ng("stringify",s),kk(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(_g("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?d(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[p,...g]=h;m(p,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");d(h.plugins),h.settings&&(s.settings=Sg(!0,s.settings,h.settings))}function d(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const g=h[p];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,p){let g=-1,x=-1;for(;++g<a.length;)if(a[g][0]===h){x=g;break}if(x===-1)a.push([h,...p]);else if(p.length>0){let[w,...S]=p;const k=a[x][1];Vy(k)&&Vy(w)&&(w=Sg(!0,k,w)),a[x]=[h,w,...S]}}}}const ZH=new pb().freeze();function Eg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ng(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _g(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 kk(e){if(!Vy(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function jk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xf(e){return GH(e)?e:new E_(e)}function GH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function VH(e){return typeof e=="string"||QH(e)}function QH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const KH="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ck=[],Ek={allowDangerousHtml:!0},YH=/^(https?|ircs?|mailto|xmpp)$/i,XH=[{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 WH(e){const t=JH(e),n=eq(e);return tq(t.runSync(t.parse(n),n),e)}function JH(e){const t=e.rehypePlugins||Ck,n=e.remarkPlugins||Ck,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ek}:Ek;return ZH().use(z8).use(n).use(NH,a).use(t)}function eq(e){const t=e.children||"",n=new E_;return typeof t=="string"&&(n.value=t),n}function tq(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,o=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,m=t.urlTransform||nq;for(const p of XH)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+KH+p.id,void 0);return mb(e,h),g$(e,{Fragment:l.Fragment,components:s,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function h(p,g,x){if(p.type==="raw"&&x&&typeof g=="number")return c?x.children.splice(g,1):x.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let w;for(w in vg)if(Object.hasOwn(vg,w)&&Object.hasOwn(p.properties,w)){const S=p.properties[w],k=vg[w];(k===null||k.includes(p.tagName))&&(p.properties[w]=m(String(S||""),w,p))}}if(p.type==="element"){let w=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!w&&a&&typeof g=="number"&&(w=!a(p,g,x)),w&&x&&typeof g=="number")return d&&p.children?x.children.splice(g,1,...p.children):x.children.splice(g,1),g}}}function nq(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||YH.test(e.slice(0,t))?e:""}function rq(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function N_(e,t,n){const s=Rh((n||{}).ignore||[]),o=aq(t);let c=-1;for(;++c<o.length;)C_(e,"text",d);function d(h,p){let g=-1,x;for(;++g<p.length;){const w=p[g],S=x?x.children:void 0;if(s(w,S?S.indexOf(w):void 0,x))return;x=w}if(x)return m(h,p)}function m(h,p){const g=p[p.length-1],x=o[c][0],w=o[c][1];let S=0;const C=g.children.indexOf(h);let E=!1,N=[];x.lastIndex=0;let R=x.exec(h.value);for(;R;){const z=R.index,L={index:R.index,input:R.input,stack:[...p,h]};let O=w(...R,L);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?x.lastIndex=z+1:(S!==z&&N.push({type:"text",value:h.value.slice(S,z)}),Array.isArray(O)?N.push(...O):O&&N.push(O),S=z+R[0].length,E=!0),!x.global)break;R=x.exec(h.value)}return E?(S<h.value.length&&N.push({type:"text",value:h.value.slice(S)}),g.children.splice(C,1,...N)):N=[h],C+N.length}}function aq(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 s=n[a];t.push([iq(s[0]),sq(s[1])])}return t}function iq(e){return typeof e=="string"?new RegExp(rq(e),"g"):e}function sq(e){return typeof e=="function"?e:function(){return e}}function lq(e){N_(e,[/\r?\n|\r/g,oq])}function oq(){return{type:"break"}}function uq(){return function(e){lq(e)}}function Nk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}const Tg="phrasing",Ag=["autolink","link","image","label"];function cq(){return{transforms:[yq],enter:{literalAutolink:fq,literalAutolinkEmail:Rg,literalAutolinkHttp:Rg,literalAutolinkWww:Rg},exit:{literalAutolink:gq,literalAutolinkEmail:pq,literalAutolinkHttp:hq,literalAutolinkWww:mq}}}function dq(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Tg,notInConstruct:Ag},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Tg,notInConstruct:Ag},{character:":",before:"[ps]",after:"\\/",inConstruct:Tg,notInConstruct:Ag}]}}function fq(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Rg(e){this.config.enter.autolinkProtocol.call(this,e)}function hq(e){this.config.exit.autolinkProtocol.call(this,e)}function mq(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 pq(e){this.config.exit.autolinkEmail.call(this,e)}function gq(e){this.exit(e)}function yq(e){N_(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vq],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),bq]],{ignore:["link","linkReference"]})}function vq(e,t,n,a,s){let o="";if(!__(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!xq(n)))return!1;const c=wq(n+a);if(!c[0])return!1;const d={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function bq(e,t,n,a){return!__(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function xq(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 wq(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 s=Nk(e,"(");let o=Nk(e,")");for(;a!==-1&&s>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function __(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Xs(n)||_h(n))&&(!t||n!==47)}T_.peek=Aq;function Sq(){this.buffer()}function kq(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function jq(){this.buffer()}function Cq(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Eq(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ba(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Nq(e){this.exit(e)}function _q(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ba(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tq(e){this.exit(e)}function Aq(){return"["}function T_(e,t,n,a){const s=n.createTracker(a);let o=s.move("[^");const c=n.enter("footnoteReference"),d=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),c(),o+=s.move("]"),o}function Rq(){return{enter:{gfmFootnoteCallString:Sq,gfmFootnoteCall:kq,gfmFootnoteDefinitionLabelString:jq,gfmFootnoteDefinition:Cq},exit:{gfmFootnoteCallString:Eq,gfmFootnoteCall:Nq,gfmFootnoteDefinitionLabelString:_q,gfmFootnoteDefinition:Tq}}}function Oq(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:T_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,o,c){const d=o.createTracker(c);let m=d.move("[^");const h=o.enter("footnoteDefinition"),p=o.enter("label");return m+=d.move(o.safe(o.associationId(a),{before:m,after:"]"})),p(),m+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),m+=d.move((t?`
|
|
401
|
+
`:" ")+o.indentLines(o.containerFlow(a,d.current()),t?A_:zq))),h(),m}}function zq(e,t,n){return t===0?e:A_(e,t,n)}function A_(e,t,n){return(n?"":" ")+e}const Mq=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];R_.peek=Uq;function Dq(){return{canContainEols:["delete"],enter:{strikethrough:Lq},exit:{strikethrough:Pq}}}function Iq(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Mq}],handlers:{delete:R_}}}function Lq(e){this.enter({type:"delete",children:[]},e)}function Pq(e){this.exit(e)}function R_(e,t,n,a){const s=n.createTracker(a),o=n.enter("strikethrough");let c=s.move("~~");return c+=n.containerPhrasing(e,{...s.current(),before:c,after:"~"}),c+=s.move("~~"),o(),c}function Uq(){return"~"}function Bq(e){return e.length}function $q(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||Bq,o=[],c=[],d=[],m=[];let h=0,p=-1;for(;++p<e.length;){const k=[],C=[];let E=-1;for(e[p].length>h&&(h=e[p].length);++E<e[p].length;){const N=Fq(e[p][E]);if(n.alignDelimiters!==!1){const R=s(N);C[E]=R,(m[E]===void 0||R>m[E])&&(m[E]=R)}k.push(N)}c[p]=k,d[p]=C}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=_k(a[g]);else{const k=_k(a);for(;++g<h;)o[g]=k}g=-1;const x=[],w=[];for(;++g<h;){const k=o[g];let C="",E="";k===99?(C=":",E=":"):k===108?C=":":k===114&&(E=":");let N=n.alignDelimiters===!1?1:Math.max(1,m[g]-C.length-E.length);const R=C+"-".repeat(N)+E;n.alignDelimiters!==!1&&(N=C.length+N+E.length,N>m[g]&&(m[g]=N),w[g]=N),x[g]=R}c.splice(1,0,x),d.splice(1,0,w),p=-1;const S=[];for(;++p<c.length;){const k=c[p],C=d[p];g=-1;const E=[];for(;++g<h;){const N=k[g]||"";let R="",z="";if(n.alignDelimiters!==!1){const L=m[g]-(C[g]||0),O=o[g];O===114?R=" ".repeat(L):O===99?L%2?(R=" ".repeat(L/2+.5),z=" ".repeat(L/2-.5)):(R=" ".repeat(L/2),z=R):z=" ".repeat(L)}n.delimiterStart!==!1&&!g&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||g)&&E.push(" "),n.alignDelimiters!==!1&&E.push(R),E.push(N),n.alignDelimiters!==!1&&E.push(z),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&E.push("|")}S.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return S.join(`
|
|
402
|
+
`)}function Fq(e){return e==null?"":String(e)}function _k(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 Hq(e,t,n,a){const s=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),qq);return s(),c}function qq(e,t,n){return">"+(n?"":" ")+e}function Zq(e,t){return Tk(e,t.inConstruct,!0)&&!Tk(e,t.notInConstruct,!1)}function Tk(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 Ak(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
403
|
+
`&&Zq(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
404
|
+
`}function Gq(e,t){const n=String(e);let a=n.indexOf(t),s=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++o>c&&(c=o):o=1,s=a+t.length,a=n.indexOf(t,s);return c}function Vq(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 Qq(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 Kq(e,t,n,a){const s=Qq(n),o=e.value||"",c=s==="`"?"GraveAccent":"Tilde";if(Vq(e,n)){const g=n.enter("codeIndented"),x=n.indentLines(o,Yq);return g(),x}const d=n.createTracker(a),m=s.repeat(Math.max(Gq(o,s)+1,3)),h=n.enter("codeFenced");let p=d.move(m);if(e.lang){const g=n.enter(`codeFencedLang${c}`);p+=d.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...d.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);p+=d.move(" "),p+=d.move(n.safe(e.meta,{before:p,after:`
|
|
405
|
+
`,encode:["`"],...d.current()})),g()}return p+=d.move(`
|
|
406
|
+
`),o&&(p+=d.move(o+`
|
|
407
|
+
`)),p+=d.move(m),h(),p}function Yq(e,t,n){return(n?"":" ")+e}function gb(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 Xq(e,t,n,a){const s=gb(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("definition");let d=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("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(d=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
408
|
+
`,...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),h+=m.move(" "+s),h+=m.move(n.safe(e.title,{before:h,after:s,...m.current()})),h+=m.move(s),d()),c(),h}function Wq(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 gc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Jf(e,t,n){const a=So(e),s=So(t);return a===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}O_.peek=Jq;function O_(e,t,n,a){const s=Wq(n),o=n.enter("emphasis"),c=n.createTracker(a),d=c.move(s);let m=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const h=m.charCodeAt(0),p=Jf(a.before.charCodeAt(a.before.length-1),h,s);p.inside&&(m=gc(h)+m.slice(1));const g=m.charCodeAt(m.length-1),x=Jf(a.after.charCodeAt(0),g,s);x.inside&&(m=m.slice(0,-1)+gc(g));const w=c.move(s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},d+m+w}function Jq(e,t,n){return n.options.emphasis||"*"}function e7(e,t){let n=!1;return mb(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Zy}),!!((!e.depth||e.depth<3)&&lb(e)&&(t.options.setext||n))}function t7(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(e7(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(e,{...o.current(),before:`
|
|
409
|
+
`,after:`
|
|
410
|
+
`});return g(),p(),x+`
|
|
411
|
+
`+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
412
|
+
`))+1))}const c="#".repeat(s),d=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
413
|
+
`,...o.current()});return/^[\t ]/.test(h)&&(h=gc(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),d(),h}z_.peek=n7;function z_(e){return e.value||""}function n7(){return"<"}M_.peek=r7;function M_(e,t,n,a){const s=gb(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("image");let d=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("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(d=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),h+=m.move(" "+s),h+=m.move(n.safe(e.title,{before:h,after:s,...m.current()})),h+=m.move(s),d()),h+=m.move(")"),c(),h}function r7(){return"!"}D_.peek=a7;function D_(e,t,n,a){const s=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("![");const h=n.safe(e.alt,{before:m,after:"]",...d.current()});m+=d.move(h+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),s==="full"||!h||h!==g?m+=d.move(g+"]"):s==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function a7(){return"!"}I_.peek=i7;function I_(e,t,n){let a=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";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],d=n.compilePattern(c);let m;if(c.atBreak)for(;m=d.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 s+a+s}function i7(){return"`"}function L_(e,t){const n=lb(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))}P_.peek=s7;function P_(e,t,n,a){const s=gb(n),o=s==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let d,m;if(L_(e,n)){const p=n.stack;n.stack=[],d=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),d(),n.stack=p,g}d=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(" "+s),h+=c.move(n.safe(e.title,{before:h,after:s,...c.current()})),h+=c.move(s),m()),h+=c.move(")"),d(),h}function s7(e,t,n){return L_(e,n)?"<":"["}U_.peek=l7;function U_(e,t,n,a){const s=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...d.current()});m+=d.move(h+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),s==="full"||!h||h!==g?m+=d.move(g+"]"):s==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function l7(){return"["}function yb(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 o7(e){const t=yb(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 u7(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 B_(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 c7(e,t,n,a){const s=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?u7(n):yb(n);const d=e.ordered?c==="."?")":".":o7(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.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),B_(n)===c&&p){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=d),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,s(),h}function d7(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 f7(e,t,n,a){const s=d7(n);let o=n.bulletCurrent||yb(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;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=n.createTracker(a);d.move(o+" ".repeat(c-o.length)),d.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,d.current()),p);return m(),h;function p(g,x,w){return x?(w?"":" ".repeat(c))+g:(w?o:o+" ".repeat(c-o.length))+g}}function h7(e,t,n,a){const s=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),s(),c}const m7=Rh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function p7(e,t,n,a){return(e.children.some(function(c){return m7(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function g7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$_.peek=y7;function $_(e,t,n,a){const s=g7(n),o=n.enter("strong"),c=n.createTracker(a),d=c.move(s+s);let m=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const h=m.charCodeAt(0),p=Jf(a.before.charCodeAt(a.before.length-1),h,s);p.inside&&(m=gc(h)+m.slice(1));const g=m.charCodeAt(m.length-1),x=Jf(a.after.charCodeAt(0),g,s);x.inside&&(m=m.slice(0,-1)+gc(g));const w=c.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},d+m+w}function y7(e,t,n){return n.options.strong||"*"}function v7(e,t,n,a){return n.safe(e.value,a)}function b7(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 x7(e,t,n){const a=(B_(n)+(n.options.ruleSpaces?" ":"")).repeat(b7(n));return n.options.ruleSpaces?a.slice(0,-1):a}const F_={blockquote:Hq,break:Ak,code:Kq,definition:Xq,emphasis:O_,hardBreak:Ak,heading:t7,html:z_,image:M_,imageReference:D_,inlineCode:I_,link:P_,linkReference:U_,list:c7,listItem:f7,paragraph:h7,root:p7,strong:$_,text:v7,thematicBreak:x7};function w7(){return{enter:{table:S7,tableData:Rk,tableHeader:Rk,tableRow:j7},exit:{codeText:C7,table:k7,tableData:Og,tableHeader:Og,tableRow:Og}}}function S7(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 k7(e){this.exit(e),this.data.inTable=void 0}function j7(e){this.enter({type:"tableRow",children:[]},e)}function Og(e){this.exit(e)}function Rk(e){this.enter({type:"tableCell",children:[]},e)}function C7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,E7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function E7(e,t){return t==="|"?t:e}function N7(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
414
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:c,tableCell:m,tableRow:d}};function c(w,S,k,C){return h(p(w,k,C),w.align)}function d(w,S,k,C){const E=g(w,k,C),N=h([E]);return N.slice(0,N.indexOf(`
|
|
415
|
+
`))}function m(w,S,k,C){const E=k.enter("tableCell"),N=k.enter("phrasing"),R=k.containerPhrasing(w,{...C,before:o,after:o});return N(),E(),R}function h(w,S){return $q(w,{align:S,alignDelimiters:a,padding:n,stringLength:s})}function p(w,S,k){const C=w.children;let E=-1;const N=[],R=S.enter("table");for(;++E<C.length;)N[E]=g(C[E],S,k);return R(),N}function g(w,S,k){const C=w.children;let E=-1;const N=[],R=S.enter("tableRow");for(;++E<C.length;)N[E]=m(C[E],w,S,k);return R(),N}function x(w,S,k){let C=F_.inlineCode(w,S,k);return k.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function _7(){return{exit:{taskListCheckValueChecked:Ok,taskListCheckValueUnchecked:Ok,paragraph:A7}}}function T7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:R7}}}function Ok(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function A7(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 s=t.children;let o=-1,c;for(;++o<s.length;){const d=s[o];if(d.type==="paragraph"){c=d;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 R7(e,t,n,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);o&&d.move(c);let m=F_.listItem(e,t,n,{...a,...d.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(p){return p+c}}function O7(){return[cq(),Rq(),Dq(),w7(),_7()]}function z7(e){return{extensions:[dq(),Oq(e),Iq(),N7(e),T7()]}}const M7={tokenize:B7,partial:!0},H_={tokenize:$7,partial:!0},q_={tokenize:F7,partial:!0},Z_={tokenize:H7,partial:!0},D7={tokenize:q7,partial:!0},G_={name:"wwwAutolink",tokenize:P7,previous:Q_},V_={name:"protocolAutolink",tokenize:U7,previous:K_},mi={name:"emailAutolink",tokenize:L7,previous:Y_},za={};function I7(){return{text:za}}let Ds=48;for(;Ds<123;)za[Ds]=mi,Ds++,Ds===58?Ds=65:Ds===91&&(Ds=97);za[43]=mi;za[45]=mi;za[46]=mi;za[95]=mi;za[72]=[mi,V_];za[104]=[mi,V_];za[87]=[mi,G_];za[119]=[mi,G_];function L7(e,t,n){const a=this;let s,o;return c;function c(g){return!Ky(g)||!Y_.call(a,a.previous)||vb(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return Ky(g)?(e.consume(g),d):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(D7,p,h)(g):g===45||g===95||Wn(g)?(o=!0,e.consume(g),m):p(g)}function h(g){return e.consume(g),s=!0,m}function p(g){return o&&s&&ur(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function P7(e,t,n){const a=this;return s;function s(c){return c!==87&&c!==119||!Q_.call(a,a.previous)||vb(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(M7,e.attempt(H_,e.attempt(q_,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function U7(e,t,n){const a=this;let s="",o=!1;return c;function c(g){return(g===72||g===104)&&K_.call(a,a.previous)&&!vb(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),d):n(g)}function d(g){if(ur(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const x=s.toLowerCase();if(x==="http"||x==="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||Yf(g)||It(g)||Xs(g)||_h(g)?n(g):e.attempt(H_,e.attempt(q_,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function B7(e,t,n){let a=0;return s;function s(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),s):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function $7(e,t,n){let a,s,o;return c;function c(h){return h===46||h===95?e.check(Z_,m,d)(h):h===null||It(h)||Xs(h)||h!==45&&_h(h)?m(h):(o=!0,e.consume(h),c)}function d(h){return h===95?a=!0:(s=a,a=void 0),e.consume(h),c}function m(h){return s||a||!o?n(h):t(h)}}function F7(e,t){let n=0,a=0;return s;function s(c){return c===40?(n++,e.consume(c),s):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(Z_,t,o)(c):c===null||It(c)||Xs(c)?t(c):(e.consume(c),s)}function o(c){return c===41&&a++,e.consume(c),s}}function H7(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),o):d===93?(e.consume(d),s):d===60||d===null||It(d)||Xs(d)?t(d):n(d)}function s(d){return d===null||d===40||d===91||It(d)||Xs(d)?t(d):a(d)}function o(d){return ur(d)?c(d):n(d)}function c(d){return d===59?(e.consume(d),a):ur(d)?(e.consume(d),c):n(d)}}function q7(e,t,n){return a;function a(o){return e.consume(o),s}function s(o){return Wn(o)?n(o):t(o)}}function Q_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||It(e)}function K_(e){return!ur(e)}function Y_(e){return!(e===47||Ky(e))}function Ky(e){return e===43||e===45||e===46||e===95||Wn(e)}function vb(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 Z7={tokenize:J7,partial:!0};function G7(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Y7,continuation:{tokenize:X7},exit:W7}},text:{91:{name:"gfmFootnoteCall",tokenize:K7},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:V7,resolveTo:Q7}}}}function V7(e,t,n){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;s--;){const m=a.events[s][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 d;function d(m){if(!c||!c._balanced)return n(m);const h=ba(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 Q7(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)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.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)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,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,...d),e}function K7(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return d;function d(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||It(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(ba(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return It(g)||(c=!0),o++,e.consume(g),g===92?p:h}function p(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function Y7(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,d;return m;function m(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(S)}function p(S){if(c>999||S===93&&!d||S===null||S===91||It(S))return n(S);if(S===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=ba(a.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return It(S)||(d=!0),c++,e.consume(S),S===92?g:p}function g(S){return S===91||S===92||S===93?(e.consume(S),c++,p):p(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(o)||s.push(o),xt(e,w,"gfmFootnoteDefinitionWhitespace")):n(S)}function w(S){return t(S)}}function X7(e,t,n){return e.check(Pc,t,e.attempt(Z7,t,n))}function W7(e){e.exit("gfmFootnoteDefinition")}function J7(e,t,n){const a=this;return xt(e,s,"gfmFootnoteDefinitionIndent",5);function s(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 eZ(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(c,d){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 p={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)},x=[["enter",p,d],["enter",c[h][1],d],["exit",c[h][1],d],["enter",g,d]],w=d.parser.constructs.insideSpan.null;w&&$r(x,x.length,0,Th(w,c.slice(h+1,m),d)),$r(x,x.length,0,[["exit",g,d],["enter",c[m][1],d],["exit",c[m][1],d],["exit",p,d]]),$r(c,h-1,m-h+3,x),m=h+x.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,d,m){const h=this.previous,p=this.events;let g=0;return x;function x(S){return h===126&&p[p.length-1][1].type!=="characterEscape"?m(S):(c.enter("strikethroughSequenceTemporary"),w(S))}function w(S){const k=So(h);if(S===126)return g>1?m(S):(c.consume(S),g++,w);if(g<2&&!n)return m(S);const C=c.exit("strikethroughSequenceTemporary"),E=So(S);return C._open=!E||E===2&&!!k,C._close=!k||k===2&&!!E,d(S)}}}class tZ{constructor(){this.map=[]}add(t,n,a){nZ(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 s=a.pop();for(;s;){for(const o of s)t.push(o);s=a.pop()}this.map.length=0}}function nZ(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function rZ(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function aZ(){return{flow:{null:{name:"table",tokenize:iZ,resolveAll:sZ}}}}function iZ(e,t,n){const a=this;let s=0,o=0,c;return d;function d(D){let K=a.events.length-1;for(;K>-1;){const W=a.events[K][1].type;if(W==="lineEnding"||W==="linePrefix")K--;else break}const ae=K>-1?a.events[K][1].type:null,be=ae==="tableHead"||ae==="tableRow"?O:m;return be===O&&a.parser.lazy[a.now().line]?n(D):be(D)}function m(D){return e.enter("tableHead"),e.enter("tableRow"),h(D)}function h(D){return D===124||(c=!0,o+=1),p(D)}function p(D){return D===null?n(D):He(D)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),w):n(D):ot(D)?xt(e,p,"whitespace")(D):(o+=1,c&&(c=!1,s+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),c=!0,p):(e.enter("data"),g(D)))}function g(D){return D===null||D===124||It(D)?(e.exit("data"),p(D)):(e.consume(D),D===92?x:g)}function x(D){return D===92||D===124?(e.consume(D),g):g(D)}function w(D){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(D):(e.enter("tableDelimiterRow"),c=!1,ot(D)?xt(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):S(D))}function S(D){return D===45||D===58?C(D):D===124?(c=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),k):L(D)}function k(D){return ot(D)?xt(e,C,"whitespace")(D):C(D)}function C(D){return D===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),E):D===45?(o+=1,E(D)):D===null||He(D)?z(D):L(D)}function E(D){return D===45?(e.enter("tableDelimiterFiller"),N(D)):L(D)}function N(D){return D===45?(e.consume(D),N):D===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(D))}function R(D){return ot(D)?xt(e,z,"whitespace")(D):z(D)}function z(D){return D===124?S(D):D===null||He(D)?!c||s!==o?L(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):L(D)}function L(D){return n(D)}function O(D){return e.enter("tableRow"),B(D)}function B(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),B):D===null||He(D)?(e.exit("tableRow"),t(D)):ot(D)?xt(e,B,"whitespace")(D):(e.enter("data"),I(D))}function I(D){return D===null||D===124||It(D)?(e.exit("data"),B(D)):(e.consume(D),D===92?V:I)}function V(D){return D===92||D===124?(e.consume(D),I):I(D)}}function sZ(e,t){let n=-1,a=!0,s=0,o=[0,0,0,0],c=[0,0,0,0],d=!1,m=0,h,p,g;const x=new tZ;for(;++n<e.length;){const w=e[n],S=w[1];w[0]==="enter"?S.type==="tableHead"?(d=!1,m!==0&&(zk(x,t,m,h,p),p=void 0,m=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",h,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],c=[0,n+1,0,0],d&&(d=!1,p={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",p,t]])),s=S.type==="tableDelimiterRow"?2:p?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=wf(x,t,o,s,void 0,g),o=[0,0,0,0]),c[2]=n)):S.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=wf(x,t,o,s,void 0,g)),o=c,c=[o[1],n,0,0])):S.type==="tableHead"?(d=!0,m=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],g=wf(x,t,o,s,n,g)):c[1]!==0&&(g=wf(x,t,c,s,n,g)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&zk(x,t,m,h,p),x.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=rZ(t.events,n))}return e}function wf(e,t,n,a,s,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},Ql(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=Ql(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=Ql(t.events,n[2]),p=Ql(t.events,n[3]),g={type:d,start:Object.assign({},h),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const x=t.events[n[2]],w=t.events[n[3]];if(x[1].end=Object.assign({},w[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,k=n[3]-n[2]-1;e.add(S,k,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(o.end=Object.assign({},Ql(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function zk(e,t,n,a,s){const o=[],c=Ql(t.events,n);s&&(s.end=Object.assign({},c),o.push(["exit",s,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function Ql(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const lZ={name:"tasklistCheck",tokenize:uZ};function oZ(){return{text:{91:lZ}}}function uZ(e,t,n){const a=this;return s;function s(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 It(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"),d):n(m)}function d(m){return He(m)?t(m):ot(m)?e.check({tokenize:cZ},t,n)(m):n(m)}}function cZ(e,t,n){return xt(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function dZ(e){return s_([I7(),G7(),eZ(e),aZ(),oZ()])}const fZ={};function hZ(e){const t=this,n=e||fZ,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(dZ(n)),o.push(O7()),c.push(z7(n))}function zh({children:e,className:t}){return l.jsx("div",{className:Me("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:l.jsx(WH,{remarkPlugins:[hZ,uq],children:e})})}function mZ({value:e,baseline:t,onChange:n,onRevert:a,disabled:s}){const[o,c]=b.useState(!1),d=b.useRef(null),m=e!==t;return b.useEffect(()=>{var h;o&&((h=d.current)==null||h.focus())},[o]),l.jsxs(kn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[l.jsxs(ua,{children:[l.jsxs(ca,{children:["System prompt append",m&&l.jsx(pZ,{})]}),!o&&!s&&l.jsxs(ye,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[l.jsx(Nv,{className:"h-3 w-3"})," Edit"]})]}),l.jsx(Jn,{children:o?l.jsxs("div",{className:"space-y-2",children:[l.jsx("textarea",{ref:d,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}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(ye,{size:"xs",variant:"ghost",onClick:()=>{a(),c(!1)},disabled:!m,children:"Revert"}),l.jsx(ye,{size:"xs",onClick:()=>c(!1),children:"Done"})]}),l.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."})]}):l.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?l.jsx(zh,{children:e}):l.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function pZ(){return l.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 X_={"claude-code":"Claude Code",codex:"Codex"},gZ=[Qf.CLAUDE_CODE,Qf.CODEX];function yZ({open:e,onOpenChange:t,agent:n}){const a=Cn(),s=n.clientId,o=n.runtimeProvider,[c,d]=b.useState(s),[m,h]=b.useState(o),[p,g]=b.useState(!1),w=Ke({queryKey:["clients-rebind"],queryFn:ci,enabled:e}).data??[],S=ER({queries:w.map(I=>({queryKey:["client-capabilities",I.id],queryFn:()=>ch(I.id),enabled:e}))}),k=b.useMemo(()=>{const I=new Map;return S.forEach((V,D)=>{const K=w[D];if(!K)return;const ae=V.data;ae!=null&&ae.capabilities&&I.set(K.id,ae.capabilities)}),I},[S,w]);b.useEffect(()=>{e||(d(s),h(o),g(!1))},[e,s,o]);const C=c?k.get(c)??null:null,E=(C==null?void 0:C[m])??null,N=!E||E.state==="missing"||E.state==="error",R=!!c&&(c!==s||m!==o)&&(!N||p),z=m!==o,L=c!==s,O=bt({mutationFn:()=>{if(!c)throw new Error("clientId required");return JI(n.uuid,{clientId:c,runtimeProvider:m,force:N&&p?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),B=O.error instanceof Js||O.error instanceof Error?O.error.message:null;return l.jsx(Rn,{open:e,onOpenChange:t,children:l.jsxs(En,{className:"max-w-lg",children:[l.jsx(Ln,{children:l.jsx(On,{children:"Re-bind agent"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["Currently:"," ",l.jsx("span",{className:"mono",children:bZ(s,w,o)})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{children:"Computer"}),l.jsx("select",{value:c??"",onChange:I=>d(I.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:w.map(I=>l.jsx("option",{value:I.id,children:vZ(I)},I.id))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{children:"Runtime"}),l.jsx("div",{className:"space-y-2",children:gZ.map(I=>{const V=(C==null?void 0:C[I])??null,D=!!V&&V.state!=="missing",K=m===I;return l.jsxs("label",{className:K?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":D?"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:[l.jsx("input",{type:"radio",name:"rebind-runtime",checked:K,onChange:()=>h(I),className:"mt-1"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-body font-medium",children:X_[I]}),l.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:wZ(V,I)})]})]},I)})})]}),(L||z)&&l.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-caption space-y-1",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Heads up:"})," active sessions on the previous computer are suspended at re-bind. Chat history is preserved."]}),z&&l.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),N&&l.jsxs("label",{className:"flex items-start gap-2 text-caption",style:{color:"var(--fg-2)"},children:[l.jsx("input",{type:"checkbox",checked:p,onChange:I=>g(I.target.checked),className:"mt-0.5"}),l.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."})]}),B&&l.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:B})]}),l.jsxs(fr,{children:[l.jsx(ye,{variant:"outline",onClick:()=>t(!1),disabled:O.isPending,children:"Cancel"}),l.jsx(ye,{onClick:()=>O.mutate(),disabled:!R||O.isPending,children:O.isPending?"Re-binding…":"Re-bind"})]})]})})}function vZ(e){return`${e.hostname??e.id} · ${e.status}`}function bZ(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${X_[n]}`}const xZ={"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 wZ(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. ${xZ[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const SZ={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function kZ(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return l.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:l.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[l.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx(Ju,{state:"blocked",size:8}),l.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),l.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),l.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>l.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:SZ[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&l.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[l.jsx(cr,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&l.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&l.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&l.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),l.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&l.jsx(ye,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),l.jsx(ye,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(yC,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function rc(e){return`agent-cfg-${e}`}function $u({anchorId:e,title:t,caption:n,right:a,children:s,className:o,sectionProps:c}){return l.jsxs("section",{id:e,className:Me("space-y-3",o),...c,children:[l.jsxs("div",{className:"flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&l.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),l.jsx("div",{className:"space-y-3",children:s})]})}function jZ(){return l.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const CZ={"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 EZ(e){const t=CZ[e.runtimeProvider];return l.jsxs("div",{className:"space-y-3",children:[l.jsx(NZ,{name:t.name,caption:t.caption,locked:!0}),l.jsx(_Z,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function NZ({name:e,caption:t,locked:n}){return l.jsxs(kn,{children:[l.jsx(ua,{children:l.jsxs(ca,{children:["Where it runs",n&&l.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[l.jsx(oh,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),l.jsxs(Jn,{className:"space-y-1 text-body",children:[l.jsxs("div",{className:"inline-flex items-center gap-2",children:[l.jsx(vC,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),l.jsx("span",{className:"font-medium",children:e})]}),l.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function _Z(e){const t=!!e.computerLabel;return l.jsxs(kn,{children:[l.jsxs(ua,{children:[l.jsx(ca,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&l.jsxs(ye,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[l.jsx(ky,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&l.jsxs(ye,{size:"xs",variant:"outline",onClick:e.onRebind,children:[l.jsx(ky,{className:"h-3 w-3"}),"Re-bind"]})]}),l.jsx(Jn,{className:"text-body",children:t?l.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):l.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 TZ(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 AZ(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function RZ(e,t){return JSON.stringify(e)===JSON.stringify(t)}function zg(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function Mk(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:RZ(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Mg(e,t){const n=e;return{add:a=>t(s=>{const o=s[e],c=new Set(o.map(h=>h.key)),d=AZ(n,c),m=[...o,{key:d,value:a,baseline:null,status:"added"}];return{...s,[e]:Mk(m)}}),update:(a,s)=>t(o=>{const d=o[e].map(m=>m.key===a?{...m,value:s}:m);return{...o,[e]:Mk(d)}}),remove:a=>t(s=>{const c=s[e].map(d=>d.key!==a?d:d.baseline==null?null:{...d,status:"deleted"}).filter(d=>d!==null);return{...s,[e]:c}}),undo:a=>t(s=>{const c=s[e].map(d=>d.key!==a||d.baseline==null?d:{...d,value:d.baseline,status:"unchanged"});return{...s,[e]:c}})}}function OZ(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:zg(e.payload.mcpServers,"mcp"),env:zg(e.payload.env,"env"),git:zg(e.payload.gitRepos,"git")}}function zZ(e){const[t,n]=b.useState(null);b.useEffect(()=>{e&&t===null&&n(OZ(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},s=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",c=a.promptAppend!==s,d=a.model!==o,m=b.useMemo(()=>{const R=[],z=I=>I.reduce((V,D)=>D.status==="unchanged"?V:V+1,0),L=z(a.mcp),O=z(a.env),B=z(a.git);return c&&R.push("prompt"),d&&R.push("model"),L>0&&R.push("mcp"),O>0&&R.push("env"),B>0&&R.push("git"),{anyDirty:R.length>0,dirtySections:R,counts:{prompt:c?1:0,model:d?1:0,mcp:L,env:O,git:B}}},[a,c,d]),h=b.useCallback(R=>{n(z=>z&&R(z))},[]),p=b.useCallback(R=>h(z=>({...z,promptAppend:R})),[h]),g=b.useCallback(()=>h(R=>({...R,promptAppend:s})),[h,s]),x=b.useCallback(R=>h(z=>({...z,model:R})),[h]),w=b.useCallback(()=>h(R=>({...R,model:o})),[h,o]),S=b.useMemo(()=>Mg("mcp",h),[h]),k=b.useMemo(()=>Mg("env",h),[h]),C=b.useMemo(()=>Mg("git",h),[h]),E=b.useCallback(()=>{n(null)},[]),N=b.useCallback(()=>{if(!t||!e)return{};const R={};c&&(R.prompt={append:t.promptAppend}),d&&(R.model=t.model);const z=m.counts.mcp>0,L=m.counts.env>0,O=m.counts.git>0;return z&&(R.mcpServers=t.mcp.filter(B=>B.status!=="deleted").map(B=>B.value)),L&&(R.env=t.env.filter(B=>B.status!=="deleted").map(B=>{const I=B.value;return I.sensitive&&I.value===Gf?{key:I.key,value:Gf,sensitive:!0}:I})),O&&(R.gitRepos=t.git.filter(B=>B.status!=="deleted").map(B=>B.value)),R},[t,e,c,d,m]);return{draft:a,summary:m,promptDirty:c,modelDirty:d,setPromptAppend:p,revertPrompt:g,setModel:x,revertModel:w,addMcp:S.add,updateMcp:S.update,deleteMcp:S.remove,undoDeleteMcp:S.undo,addEnv:k.add,updateEnv:k.update,deleteEnv:k.remove,undoDeleteEnv:k.undo,addGit:C.add,updateGit:C.update,deleteGit:C.remove,undoDeleteGit:C.undo,resetAll:E,buildPayloadPatch:N}}const Yn={overview:"ad-overview",setup:"ad-setup",prompt:rc("prompt"),tools:rc("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function MZ(e){const t=[{key:"overview",label:"Profile",anchor:Yn.overview}];return e||t.push({key:"setup",label:"Setup",anchor:Yn.setup},{key:"prompt",label:"Prompt",anchor:Yn.prompt},{key:"tools",label:"Tools",anchor:Yn.tools},{key:"advanced",label:"Advanced",anchor:Yn.advanced}),t.push({key:"danger",label:"Danger zone",anchor:Yn.danger,divider:!0,danger:!0}),t}function DZ(){var At,it,nr,zn,il,fa,ha,Ma,Vn,Da,Sa,qt;const t=Kj().uuid??"",n=Tn(),a=Cn(),s=Ke({queryKey:["agent",t],queryFn:()=>YI(t),enabled:!!t}),o=Ke({queryKey:["agent-config",t],queryFn:()=>Eh(t),enabled:!!t&&((At=s.data)==null?void 0:At.type)!=="human"}),c=Ke({queryKey:["agent-client-status",t],queryFn:()=>u9(t),enabled:!!t&&((it=s.data)==null?void 0:it.type)!=="human"}),d=Ke({queryKey:["agent-sessions-active",t],queryFn:()=>PC(t,{state:"active"}),enabled:!!t&&((nr=s.data)==null?void 0:nr.type)!=="human"}),m=Ke({queryKey:["clients"],queryFn:ci,enabled:!!t&&((zn=s.data)==null?void 0:zn.type)!=="human",refetchInterval:3e4}),h=zZ(o.data),[p,g]=b.useState(null),[x,w]=b.useState(null),[S,k]=b.useState(!1),C=bt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const Ce=h.buildPayloadPatch();return Nh(t,{expectedVersion:o.data.version,payload:Ce})},onSuccess:Ce=>{a.setQueryData(["agent-config",t],Ce),g(null),w(null),k(!0)},onError:Ce=>{if(k(!1),Ce instanceof Js&&Ce.status===409){w("Someone else saved a newer version while you were editing."),g(null);return}g(Ce instanceof Error?Ce.message:String(Ce))}});b.useEffect(()=>{if(!S)return;const Ce=setTimeout(()=>k(!1),2500);return()=>clearTimeout(Ce)},[S]),b.useEffect(()=>{h.summary.anyDirty&&k(!1)},[h.summary.anyDirty]);const E=b.useCallback(()=>{w(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),N=b.useCallback(Ce=>{const tt=document.getElementById(Ce);tt&&tt.scrollIntoView({behavior:"smooth",block:"start"})},[]),R=bt({mutationFn:Ce=>Ay(t,Ce),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),z=bt({mutationFn:()=>IE(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),L=bt({mutationFn:()=>LE(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),O=bt({mutationFn:()=>DE(t),onSuccess:()=>n("/team")}),B=bt({mutationFn:()=>e4(t)}),[I,V]=b.useState(!1),[D,K]=b.useState(""),[ae,be]=b.useState(null),[W,X]=b.useState(!1),Z=Ke({queryKey:["clients"],queryFn:ci,enabled:I}),te=bt({mutationFn:Ce=>Ay(t,{clientId:Ce}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),V(!1),K(""),be(null)},onError:Ce=>be(Ce instanceof Error?Ce.message:String(Ce))}),[je,Ae]=b.useState(!1),[M,P]=b.useState(null),$=bt({mutationFn:()=>o9(t,h.buildPayloadPatch()),onSuccess:Ce=>{const tt=Ce.diff.length?Ce.diff.map(pn=>`${pn.op} ${pn.path}`).join(`
|
|
416
|
+
`):"(no changes)";P(tt)},onError:Ce=>P(`Dry run failed: ${Ce instanceof Error?Ce.message:String(Ce)}`)});b.useEffect(()=>{if(!h.summary.anyDirty)return;const Ce=tt=>{tt.preventDefault(),tt.returnValue=""};return window.addEventListener("beforeunload",Ce),()=>window.removeEventListener("beforeunload",Ce)},[h.summary.anyDirty]);const T=((il=s.data)==null?void 0:il.type)==="human",G=b.useMemo(()=>MZ(T),[T]),q=b.useRef(null),[re,xe]=b.useState(!1);b.useEffect(()=>{if(T)return;const Ce=q.current;if(!Ce||typeof IntersectionObserver>"u")return;const tt=new IntersectionObserver(pn=>{const Ar=pn[0];Ar&&xe(!Ar.isIntersecting&&Ar.boundingClientRect.top<0)},{threshold:0});return tt.observe(Ce),()=>tt.disconnect()},[T]);const[we,me]=b.useState(Yn.overview);b.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const Ce=[];for(const tt of G){const pn=document.getElementById(tt.anchor);if(!pn)continue;const Ar=new IntersectionObserver(yi=>{for(const ys of yi)ys.isIntersecting&&me(tt.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});Ar.observe(pn),Ce.push(Ar)}return()=>{for(const tt of Ce)tt.disconnect()}},[G]);const Ie=b.useMemo(()=>{const Ce=new Set;for(const tt of h.summary.dirtySections)tt==="prompt"&&Ce.add(Yn.prompt),tt==="model"&&Ce.add(Yn.setup),tt==="mcp"&&Ce.add(Yn.tools),(tt==="env"||tt==="git")&&Ce.add(Yn.advanced);return Ce},[h.summary.dirtySections]);if(s.isLoading)return l.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:l.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(s.error)return l.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",s.error instanceof Error?s.error.message:"Unknown error"]});const Ue=s.data;if(!Ue)return l.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const ft=Ue.type==="human",ut=c.data,ie=((fa=d.data)==null?void 0:fa.length)??0,le=!ft&&!(ut!=null&&ut.clientId),ve=!ft&&ut?!ut.online&&!!ut.clientId:!1,Re=Ue,St=Re.runtimeState??null,Ft=Re.runtimeType??null,Pn=Re.totalSessions??null,hr=Ue.uuid.slice(0,8),pi=TZ({activeSessions:ie,isUnclaimed:le,isOffline:ve}),gi=h.draft.mcp.filter(Ce=>Ce.status!=="deleted"),un=h.draft.env.filter(Ce=>Ce.status!=="deleted"),da=h.draft.git.filter(Ce=>Ce.status!=="deleted"),ue=Ce=>new Set(gi.filter(tt=>tt.key!==Ce).map(tt=>tt.value.name.toLowerCase())),ge=Ce=>new Set(un.filter(tt=>tt.key!==Ce).map(tt=>tt.value.key)),$e=Ce=>new Set(da.filter(tt=>tt.key!==Ce).map(tt=>{const{value:pn}=tt;return pn.localPath?pn.localPath:((pn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Ve={sessions:Pn??"—",active:ie,runtime:Ft??(ft?"human":"—"),model:((Ma=(ha=o.data)==null?void 0:ha.payload.model)==null?void 0:Ma.trim())||"—"},at=(ut==null?void 0:ut.clientId)??null,cn=at?((Vn=m.data)==null?void 0:Vn.find(Ce=>Ce.id===at))??null:null,tr=at?(cn==null?void 0:cn.hostname)??at:null,Ht=Ue.runtimeProvider??"claude-code",Lt=Ht==="codex"?"Codex":"Claude Code";return l.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[l.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:[l.jsx(Jv,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),G.map(Ce=>l.jsxs("div",{children:[Ce.divider&&l.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),l.jsx(IZ,{label:Ce.label,active:we===Ce.anchor,danger:Ce.danger??!1,dirty:Ie.has(Ce.anchor),onClick:()=>N(Ce.anchor)})]},Ce.key))]}),l.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[l.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[l.jsxs(c9,{style:{marginBottom:"var(--sp-2)"},children:[l.jsx(d9,{onClick:()=>n("/team"),children:"Agents"}),l.jsx(f9,{}),l.jsx(h9,{mono:!0,children:Ue.name??hr})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.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:l.jsx(Dc,{width:18,height:20,style:{color:"var(--accent)"}})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsx("span",{className:"text-title",title:`agt_${hr}`,children:Ue.displayName}),l.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",Ue.name??hr]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[l.jsx(Cr,{tone:Ue.type==="autonomous_agent"?"accent":"neutral",children:Ue.type}),Ue.visibility&&l.jsx(Cr,{tone:Ue.visibility==="organization"?"accent":"outline",children:Ue.visibility}),(ut==null?void 0:ut.offlineSince)&&l.jsxs("span",{className:"mono",children:["offline since ",oc(ut.offlineSince)]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(mc,{state:St}),l.jsxs(ye,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${Ue.uuid}`),children:[l.jsx(Ev,{className:"h-3 w-3"})," Open chat"]}),!ft&&Ue.status==="active"&&l.jsxs(ye,{variant:"outline",size:"xs",onClick:()=>{B.reset(),B.mutate()},disabled:B.isPending,children:[l.jsx(vC,{className:"h-3 w-3"}),B.isPending?"Testing…":"Test"]})]})]}),l.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[l.jsx(yf,{label:"sessions",value:Ve.sessions}),l.jsx(yf,{label:"active",value:Ve.active,accent:typeof Ve.active=="number"&&Ve.active>0?"var(--accent)":void 0}),l.jsx(yf,{label:"runtime",value:Ve.runtime}),l.jsx(yf,{label:"model",value:Ve.model})]})]}),l.jsx("div",{ref:q,"aria-hidden":!0,style:{height:0}}),!ft&&l.jsx(g9,{runtimeLabel:Lt,computerLabel:tr,visible:re}),l.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:[(B.data||B.error)&&l.jsx(FZ,{result:B.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>B.reset()}),l.jsx($u,{anchorId:Yn.overview,title:"Profile",right:l.jsxs(ye,{variant:"outline",size:"xs",onClick:()=>n(`/settings/integrations?agent=${Ue.uuid}`),title:"Manage platform bindings in Integrations",children:[l.jsx(ky,{className:"h-3 w-3"}),"Manage bindings"]}),children:l.jsx(T9,{agent:Ue,onSave:async Ce=>{await R.mutateAsync(Ce)}})}),!ft&&l.jsxs(l.Fragment,{children:[l.jsxs($u,{anchorId:Yn.setup,title:"Setup",caption:((Da=o.data)==null?void 0:Da.version)!=null?l.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&l.jsxs(l.Fragment,{children:[" · ",l.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&l.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&l.jsx(EZ,{runtimeProvider:Ht,computerLabel:tr,canBindComputer:le&&Ue.status==="active",bindComputerPending:te.isPending,onBindComputer:()=>V(!0),onRebind:Ue.clientId?()=>X(!0):void 0,modelSlot:l.jsx(B9,{value:h.draft.model,baseline:((Sa=o.data)==null?void 0:Sa.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:Ue.status!=="active",provider:Ht})})]}),l.jsx($u,{anchorId:Yn.prompt,title:"Prompt",children:o.data?l.jsx(mZ,{value:h.draft.promptAppend,baseline:((qt=o.data)==null?void 0:qt.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:Ue.status!=="active"}):null}),l.jsx($u,{anchorId:Yn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?l.jsx(O9,{items:h.draft.mcp,otherNames:ue,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:Ue.status!=="active"}):null}),l.jsx($u,{anchorId:Yn.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{id:rc("env"),children:l.jsx(k9,{items:h.draft.env,otherKeys:ge,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:Ue.status!=="active"})}),l.jsx("div",{id:rc("git"),children:l.jsx(C9,{items:h.draft.git,otherPaths:$e,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:Ue.status!=="active"})}),M&&l.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:M}),h.summary.anyDirty&&l.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:l.jsx("button",{type:"button",onClick:()=>$.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:$.isPending,children:$.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),l.jsx(jZ,{}),l.jsx(y9,{agent:Ue,suspendPending:z.isPending,reactivatePending:L.isPending,deletePending:O.isPending,onSuspend:()=>z.mutate(),onReactivate:()=>L.mutate(),onDelete:()=>O.mutate()})]}),!ft&&l.jsx(kZ,{summary:h.summary,saveHint:pi,conflictMessage:x,errorMessage:p,saving:C.isPending,justSaved:S,onSave:()=>C.mutate(),onDiscard:()=>{h.summary.anyDirty&&Ae(!0)},onReloadRemote:E,onJumpTo:Ce=>N(rc(Ce))})]}),l.jsx(LZ,{open:je,onOpenChange:Ae,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),Ae(!1)}}),l.jsx(Rn,{open:I,onOpenChange:Ce=>{V(Ce),Ce||(K(""),be(null),te.reset())},children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:"Bind computer"})}),l.jsxs("div",{className:"space-y-4",children:[l.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?l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):Z.error?l.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",Z.error instanceof Error?Z.error.message:"Unknown"]}):l.jsx(PZ,{clients:Z.data??[],selected:D,onSelect:K}),ae&&l.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:ae})]}),l.jsxs(fr,{children:[l.jsx(ye,{variant:"outline",onClick:()=>V(!1),children:"Cancel"}),l.jsx(ye,{disabled:!D||te.isPending,onClick:()=>{be(null),te.mutate(D)},children:te.isPending?"Binding…":"Bind"})]})]})}),l.jsx(yZ,{open:W,onOpenChange:X,agent:Ue})]})}function IZ({label:e,active:t,danger:n,dirty:a,onClick:s}){return l.jsx("button",{type:"button",onClick:s,className:Me("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:l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"flex-1 truncate",children:e}),a&&l.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&&l.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 LZ(e){return l.jsx(Rn,{open:e.open,onOpenChange:e.onOpenChange,children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:e.title})}),l.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),l.jsx(ye,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function PZ({clients:e,selected:t,onSelect:n}){const a=e.filter(s=>s.status==="connected");return a.length===0?l.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"," ",l.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."]}):l.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(s=>{const o=s.id===t,c=s.status==="online"||s.status==="active";return l.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:l.jsxs("button",{type:"button",onClick:()=>n(s.id),className:Me("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:[l.jsx("span",{className:Me("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:c?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),l.jsxs("span",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:"block text-body truncate font-medium",children:s.hostname??s.id}),l.jsxs("span",{className:"block mono truncate text-caption",style:{color:"var(--fg-4)"},children:[s.id,s.os?` · ${s.os}`:"",s.sdkVersion?` · SDK ${s.sdkVersion}`:""]})]}),l.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:s.status})]})},s.id)})})}const UZ={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},BZ={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},$Z={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function FZ({result:e,onDismiss:t}){const n=BZ[e.status],a=$Z[e.status],s=e.connection;return l.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:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Cr,{tone:a,children:UZ[e.status]}),e.responseTime!=null&&l.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&l.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),s&&l.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[l.jsx("div",{children:s.runtimeState&&l.jsxs("span",{className:"mono",children:["runtime: ",s.runtimeState]})}),s.client?l.jsxs("div",{children:["Computer: ",s.client.hostname??s.client.id,s.client.os&&` (${s.client.os})`,s.client.sdkVersion&&` · SDK ${s.client.sdkVersion}`]}):l.jsx("div",{children:"No computer bound"}),s.lastSeenAt&&l.jsxs("div",{children:["Last seen: ",new Date(s.lastSeenAt).toLocaleString()]})]}),e.responseContent&&l.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})]}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function HZ(e){var t=0,n=e.children,a=n&&n.length;if(!a)t=1;else for(;--a>=0;)t+=n[a].value;e.value=t}function qZ(){return this.eachAfter(HZ)}function ZZ(e,t){let n=-1;for(const a of this)e.call(t,a,++n,this);return this}function GZ(e,t){for(var n=this,a=[n],s,o,c=-1;n=a.pop();)if(e.call(t,n,++c,this),s=n.children)for(o=s.length-1;o>=0;--o)a.push(s[o]);return this}function VZ(e,t){for(var n=this,a=[n],s=[],o,c,d,m=-1;n=a.pop();)if(s.push(n),o=n.children)for(c=0,d=o.length;c<d;++c)a.push(o[c]);for(;n=s.pop();)e.call(t,n,++m,this);return this}function QZ(e,t){let n=-1;for(const a of this)if(e.call(t,a,++n,this))return a}function KZ(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,a=t.children,s=a&&a.length;--s>=0;)n+=a[s].value;t.value=n})}function YZ(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function XZ(e){for(var t=this,n=WZ(t,e),a=[t];t!==n;)t=t.parent,a.push(t);for(var s=a.length;e!==n;)a.splice(s,0,e),e=e.parent;return a}function WZ(e,t){if(e===t)return e;var n=e.ancestors(),a=t.ancestors(),s=null;for(e=n.pop(),t=a.pop();e===t;)s=e,e=n.pop(),t=a.pop();return s}function JZ(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function eG(){return Array.from(this)}function tG(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function nG(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*rG(){var e=this,t,n=[e],a,s,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,a=e.children)for(s=0,o=a.length;s<o;++s)n.push(a[s]);while(n.length)}function W_(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=sG)):t===void 0&&(t=iG);for(var n=new ko(e),a,s=[n],o,c,d,m;a=s.pop();)if((c=t(a.data))&&(m=(c=Array.from(c)).length))for(a.children=c,d=m-1;d>=0;--d)s.push(o=c[d]=new ko(c[d])),o.parent=a,o.depth=a.depth+1;return n.eachBefore(J_)}function aG(){return W_(this).eachBefore(lG)}function iG(e){return e.children}function sG(e){return Array.isArray(e)?e[1]:null}function lG(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function J_(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ko(e){this.data=e,this.depth=this.height=0,this.parent=null}ko.prototype=W_.prototype={constructor:ko,count:qZ,each:ZZ,eachAfter:VZ,eachBefore:GZ,find:QZ,sum:KZ,sort:YZ,path:XZ,ancestors:JZ,descendants:eG,leaves:tG,links:nG,copy:aG,[Symbol.iterator]:rG};function Dg(e){return e==null?null:oG(e)}function oG(e){if(typeof e!="function")throw new Error;return e}var uG={depth:-1},Dk={},Ig={};function cG(e){return e.id}function dG(e){return e.parentId}function fG(){var e=cG,t=dG,n;function a(s){var o=Array.from(s),c=e,d=t,m,h,p,g,x,w,S,k,C=new Map;if(n!=null){const E=o.map((z,L)=>hG(n(z,L,s))),N=E.map(Ik),R=new Set(E).add("");for(const z of N)R.has(z)||(R.add(z),E.push(z),N.push(Ik(z)),o.push(Ig));c=(z,L)=>E[L],d=(z,L)=>N[L]}for(p=0,m=o.length;p<m;++p)h=o[p],w=o[p]=new ko(h),(S=c(h,p,s))!=null&&(S+="")&&(k=w.id=S,C.set(k,C.has(k)?Dk:w)),(S=d(h,p,s))!=null&&(S+="")&&(w.parent=S);for(p=0;p<m;++p)if(w=o[p],S=w.parent){if(x=C.get(S),!x)throw new Error("missing: "+S);if(x===Dk)throw new Error("ambiguous: "+S);x.children?x.children.push(w):x.children=[w],w.parent=x}else{if(g)throw new Error("multiple roots");g=w}if(!g)throw new Error("no root");if(n!=null){for(;g.data===Ig&&g.children.length===1;)g=g.children[0],--m;for(let E=o.length-1;E>=0&&(w=o[E],w.data===Ig);--E)w.data=null}if(g.parent=uG,g.eachBefore(function(E){E.depth=E.parent.depth+1,--m}).eachBefore(J_),g.parent=null,m>0)throw new Error("cycle");return g}return a.id=function(s){return arguments.length?(e=Dg(s),a):e},a.parentId=function(s){return arguments.length?(t=Dg(s),a):t},a.path=function(s){return arguments.length?(n=Dg(s),a):n},a}function hG(e){e=`${e}`;let t=e.length;return Yy(e,t-1)&&!Yy(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function Ik(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Yy(e,t););return e.slice(0,t)}function Yy(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function mG(e,t){return e.parent===t.parent?1:2}function Lg(e){var t=e.children;return t?t[0]:e.t}function Pg(e){var t=e.children;return t?t[t.length-1]:e.t}function pG(e,t,n){var a=n/(t.i-e.i);t.c-=a,t.s+=n,e.c+=a,t.z+=n,t.m+=n}function gG(e){for(var t=0,n=0,a=e.children,s=a.length,o;--s>=0;)o=a[s],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function yG(e,t,n){return e.a.parent===t.parent?e.a:n}function Df(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Df.prototype=Object.create(ko.prototype);function vG(e){for(var t=new Df(e,0),n,a=[t],s,o,c,d;n=a.pop();)if(o=n._.children)for(n.children=new Array(d=o.length),c=d-1;c>=0;--c)a.push(s=n.children[c]=new Df(o[c],c)),s.parent=n;return(t.parent=new Df(null,0)).children=[t],t}function bG(){var e=mG,t=1,n=1,a=null;function s(h){var p=vG(h);if(p.eachAfter(o),p.parent.m=-p.z,p.eachBefore(c),a)h.eachBefore(m);else{var g=h,x=h,w=h;h.eachBefore(function(N){N.x<g.x&&(g=N),N.x>x.x&&(x=N),N.depth>w.depth&&(w=N)});var S=g===x?1:e(g,x)/2,k=S-g.x,C=t/(x.x+S+k),E=n/(w.depth||1);h.eachBefore(function(N){N.x=(N.x+k)*C,N.y=N.depth*E})}return h}function o(h){var p=h.children,g=h.parent.children,x=h.i?g[h.i-1]:null;if(p){gG(h);var w=(p[0].z+p[p.length-1].z)/2;x?(h.z=x.z+e(h._,x._),h.m=h.z-w):h.z=w}else x&&(h.z=x.z+e(h._,x._));h.parent.A=d(h,x,h.parent.A||g[0])}function c(h){h._.x=h.z+h.parent.m,h.m+=h.parent.m}function d(h,p,g){if(p){for(var x=h,w=h,S=p,k=x.parent.children[0],C=x.m,E=w.m,N=S.m,R=k.m,z;S=Pg(S),x=Lg(x),S&&x;)k=Lg(k),w=Pg(w),w.a=h,z=S.z+N-x.z-C+e(S._,x._),z>0&&(pG(yG(S,h,g),h,z),C+=z,E+=z),N+=S.m,C+=x.m,R+=k.m,E+=w.m;S&&!Pg(w)&&(w.t=S,w.m+=N-E),x&&!Lg(k)&&(k.t=x,k.m+=C-R,g=h)}return g}function m(h){h.x*=t,h.y=h.depth*n}return s.separation=function(h){return arguments.length?(e=h,s):e},s.size=function(h){return arguments.length?(a=!1,t=+h[0],n=+h[1],s):a?null:[t,n]},s.nodeSize=function(h){return arguments.length?(a=!0,t=+h[0],n=+h[1],s):a?[t,n]:null},s}function xG(e,t){const n=`?window=${encodeURIComponent(t)}`;return Ee.get(vy(e,`/context-tree/snapshot${n}`))}function al({title:e,subtitle:t,right:n,className:a,style:s,...o}){return l.jsxs("div",{className:Me("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-4) var(--sp-5) var(--sp-3)",...s},...o,children:[l.jsx("h1",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t&&l.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),l.jsx("div",{style:{flex:1}}),n]})}const eT=[{value:"1d",label:"1 day",summary:"last 1 day"},{value:"7d",label:"7 days",summary:"last 7 days"},{value:"30d",label:"30 days",summary:"last 30 days"}];function wG({previewSnapshot:e}={}){const{organizationId:t}=yt(),[n,a]=b.useState("7d"),[s,o]=b.useState(null),[c,d]=b.useState(null),m=e!==void 0,h=Ke({queryKey:["context-tree-snapshot",t,n,m],queryFn:()=>{if(!t)throw new Error("No organization selected");return xG(t,n)},enabled:!m&&!!t}),p=e??h.data,g=b.useMemo(()=>p?p.updates.find(S=>S.id===s)??p.updates[0]??null:null,[s,p]),x=b.useMemo(()=>p&&g!=null&&g.nodeId?p.nodes.find(S=>S.id===g.nodeId)??null:null,[g,p]),w=c??(g==null?void 0:g.nodeId)??(x==null?void 0:x.id)??null;return b.useEffect(()=>{var S;p&&(s&&p.updates.some(k=>k.id===s)||o(((S=p.updates[0])==null?void 0:S.id)??null))},[s,p]),l.jsxs("div",{className:"-m-6",children:[l.jsx(al,{title:"Context",subtitle:"Team context available to agents, and how it is changing"}),l.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[!m&&h.isLoading?l.jsx(AG,{}):null,!m&&h.error?l.jsx(RG,{message:h.error instanceof Error?h.error.message:"Failed to load"}):null,p&&(m||!h.isLoading)?l.jsx("div",{className:"flex flex-col",style:{gap:"var(--sp-4)"},children:p.snapshotStatus==="unavailable"?l.jsx(nT,{snapshot:p}):l.jsxs(l.Fragment,{children:[l.jsx(SG,{snapshot:p,window:n,onWindowChange:a}),l.jsx(kG,{snapshot:p,selectedUpdate:g,selectedUpdateNode:x,selectedOverviewNodeId:w,onSelectUpdate:S=>{o(S.id),d(S.nodeId)},onSelectOverviewNode:d})]})}):null]})]})}function SG({snapshot:e,window:t,onWindowChange:n}){const a=e.contextStatus.severity==="ok"?l.jsx(Gz,{size:18}):l.jsx(To,{size:18}),s=HG(t),o=e.contextStatus.label,c=ZG(e);return l.jsx(kn,{children:l.jsx(Jn,{style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:l.jsxs("div",{className:"flex flex-wrap items-center justify-between",style:{gap:"var(--sp-3)"},children:[l.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-2)",minWidth:0},children:[l.jsx("span",{style:{color:qG(e.contextStatus.severity),flex:"0 0 auto"},children:a}),l.jsxs("div",{style:{minWidth:0},children:[l.jsxs("div",{className:"flex flex-wrap items-baseline",style:{gap:"var(--sp-2)"},children:[l.jsx("div",{className:"text-subtitle font-semibold",style:{color:"var(--fg)"},children:o}),c?l.jsx("div",{className:"text-label font-medium",style:{color:"var(--fg-3)"},children:c}):null]}),l.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-0_5)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.contextStatus.detail??"Agents have a synced team context snapshot available."})]})]}),l.jsxs("div",{className:"flex flex-wrap items-center justify-end",style:{gap:"var(--sp-3)"},children:[l.jsxs("div",{className:"flex flex-wrap items-center",style:{gap:"var(--sp-2)"},children:[l.jsx(Sf,{value:e.summary.changedNodeCount,label:`updates in the ${s}`}),l.jsx(Sf,{value:e.summary.addedCount,label:"added",tone:"added"}),l.jsx(Sf,{value:e.summary.editedCount,label:"edited",tone:"edited"}),l.jsx(Sf,{value:e.summary.removedCount,label:"removed",tone:"removed"})]}),l.jsxs("fieldset",{className:"flex flex-wrap",style:{gap:"var(--sp-1)"},children:[l.jsx("legend",{className:"sr-only",children:"Context update window"}),eT.map(d=>l.jsx(ye,{variant:d.value===t?"default":"outline",size:"xs",onClick:()=>n(d.value),children:d.label},d.value))]})]})]})})})}function kG({snapshot:e,selectedUpdate:t,selectedUpdateNode:n,selectedOverviewNodeId:a,onSelectUpdate:s,onSelectOverviewNode:o}){const c=d=>{o(d);const m=e.updates.find(h=>h.nodeId===d);m&&s(m)};return l.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-4)"},children:[l.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-[minmax(26rem,1fr)_minmax(0,1fr)]",style:{gap:"var(--sp-4)",alignItems:"stretch"},children:[l.jsxs(kn,{className:"flex h-full flex-col",children:[l.jsx(ua,{children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx(ca,{children:"Context Updates"}),l.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:[e.updates.length," team context changes agents may use"]})]})}),l.jsx(Jn,{className:"flex-1",children:e.updates.length===0?l.jsx(rT,{}):l.jsx("div",{className:"flex flex-col",style:{gap:"var(--sp-1_5)",height:"min(52vh, 30rem)",overflow:"auto",paddingRight:"var(--sp-0_5)"},children:e.updates.map(d=>l.jsx(jG,{update:d,selected:d.id===(t==null?void 0:t.id),onClick:()=>s(d)},d.id))})})]}),l.jsx(CG,{update:t,node:n,snapshot:e},(t==null?void 0:t.id)??"empty")]}),l.jsx(EG,{snapshot:e,selectedNodeId:a,onSelectNode:c})]})}function jG({update:e,selected:t,onClick:n}){return l.jsxs("button",{type:"button",onClick:n,className:"w-full text-left transition-colors",style:{border:"var(--hairline) solid var(--border)",borderColor:t?"var(--accent)":"var(--border)",borderRadius:"var(--radius-panel)",background:t?"var(--bg-sunken)":"var(--bg)",padding:"var(--sp-2_5)"},children:[l.jsx("div",{className:"flex items-start justify-between",style:{gap:"var(--sp-2)"},children:l.jsxs("div",{style:{minWidth:0},children:[l.jsxs("div",{className:"flex flex-wrap items-center",style:{gap:"var(--sp-2)"},children:[l.jsx(tT,{type:e.changeType}),l.jsx("span",{className:"text-body font-semibold",style:{color:"var(--fg)",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden"},children:KG(e)})]}),l.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["In ",iT(e.path)]})]})}),l.jsxs("div",{className:"flex flex-wrap text-label",style:{color:"var(--fg-3)",gap:"var(--sp-2)",marginTop:"var(--sp-2)"},children:[l.jsx("span",{children:tV(e.owners)}),e.relatedNodeIds.length>0?l.jsx("span",{children:nV(e.relatedNodeIds.length)}):null]})]})}function CG({update:e,node:t,snapshot:n}){const[a,s]=b.useState(!1),o=t==null?void 0:t.relatedNodeIds.map(g=>n.nodes.find(x=>x.id===g)).filter(g=>!!g),c=(t==null?void 0:t.sourcePath)??(e==null?void 0:e.path)??null,d=e!=null&&e.sourceCommit?e.sourceCommit.slice(0,7):"no commit",m=e?eV(e.owners):"No owner",h=o&&o.length>0?o.map(g=>g.title||g.path||"root"):[],p=e?rV(e.path)||iT(e.path):"root";return l.jsxs(kn,{className:"flex h-full flex-col",children:[l.jsxs(ua,{children:[l.jsxs("div",{children:[l.jsx(ca,{children:"Selected Change"}),l.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:"Summary and source context"})]}),e?l.jsx(tT,{type:e.changeType}):null]}),l.jsx(Jn,{className:"flex-1",children:e?l.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-3)"},children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-title font-semibold",style:{color:"var(--fg)"},children:e.title}),l.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[YG(e)," · ",VG(e.changeType)," · ",p]}),l.jsx("div",{className:"text-label font-mono",style:{color:"var(--fg-4)",marginTop:"var(--sp-0_5)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.path})]}),l.jsx("div",{style:{borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:"var(--sp-3)"},children:l.jsx(_G,{value:XG(e),impact:QG(e)})}),l.jsx("div",{style:{borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:"var(--sp-3)"},children:l.jsx(TG,{commit:d,linkedContextItems:h,owner:m,path:c??e.path,preview:(t==null?void 0:t.preview)??null,sourceExpanded:a,onTogglePreview:()=>{s(g=>!g)}})})]}):l.jsx(rT,{})})]})}function EG({snapshot:e,selectedNodeId:t,onSelectNode:n}){const[a,s]=b.useState(()=>new Set),o=b.useMemo(()=>FG(e.nodes),[e.nodes]),c=b.useMemo(()=>DG(e.nodes,t,o,a),[t,e.nodes,o,a]),d=b.useCallback(k=>{k==null||k.scrollIntoView({block:"nearest",inline:"nearest"})},[]),m=b.useCallback(k=>{s(C=>{const E=new Set(C);return E.has(k)?E.delete(k):E.add(k),E})},[]),h=Math.max(760,...c.map(k=>k.x+280)),p=Math.max(280,...c.map(k=>k.y+48)),g=p+24,x=560,w=g>x,S=UG(e.nodes,t);return l.jsxs(kn,{children:[l.jsx(ua,{children:l.jsxs("div",{children:[l.jsxs(ca,{children:[l.jsx(rM,{size:17}),"Where Context Changed"]}),l.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:"Numbers = updated areas under each branch."})]})}),l.jsx(Jn,{children:c.length===0?l.jsx(nT,{snapshot:e}):l.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-3)"},children:[l.jsxs("div",{className:"flex flex-wrap items-center",style:{columnGap:"var(--sp-4)",rowGap:"var(--sp-1_5)"},children:[l.jsxs("div",{className:"flex flex-wrap items-center text-label",style:{color:"var(--fg-3)",gap:"var(--sp-1_5)"},children:[l.jsx("span",{className:"font-semibold",style:{color:"var(--fg-2)"},children:"Selected"}),l.jsx("span",{children:S??"No update selected"})]}),l.jsxs("div",{className:"flex flex-wrap items-center",style:{gap:"var(--sp-2)"},children:[l.jsx(Fu,{color:"var(--accent)",label:"Selected path"}),l.jsx(Fu,{color:"var(--ok)",label:"Added"}),l.jsx(Fu,{color:"var(--warn)",label:"Edited"}),l.jsx(Fu,{color:"var(--danger)",label:"Removed"}),l.jsx(Fu,{color:"var(--bg-raised)",label:"Quiet"})]})]}),l.jsx("div",{style:{overflow:w?"auto":"hidden",maxHeight:w?`${x}px`:void 0,minHeight:`${Math.min(g,x)}px`},children:l.jsxs("svg",{viewBox:`0 0 ${h} ${p}`,role:"img","aria-label":"Context Tree overview",preserveAspectRatio:"xMinYMin meet",style:{display:"block",width:"100%",height:`${g}px`},children:[c.map(k=>k.parent?l.jsx("line",{x1:k.parent.x,y1:k.parent.y,x2:k.x,y2:k.y,stroke:k.selectedPath&&k.parent.selectedPath?"var(--accent)":"var(--border)",strokeOpacity:k.muted?.34:k.selectedPath?.72:.56,strokeWidth:k.selectedPath&&k.parent.selectedPath?1.6:1},`edge:${k.id}`):null),c.map(k=>{const C=k.isSummary||k.sourceNodeId!==null,E=()=>{k.isSummary&&k.parentId?m(k.parentId):k.sourceNodeId&&n(k.sourceNodeId)};return l.jsx("foreignObject",{x:k.x-10,y:k.y-15,width:h-k.x-8,height:30,children:l.jsxs("button",{ref:k.selected?d:void 0,type:"button",disabled:!C,"aria-expanded":k.isSummary?k.isExpanded:void 0,onClick:E,className:"flex w-full items-center text-left text-label transition-colors",style:{background:"transparent",color:k.muted?"var(--fg-3)":"var(--fg)",cursor:C?"pointer":"default",gap:"var(--sp-2)",opacity:k.muted?.66:1,padding:"0 var(--sp-1)"},onMouseEnter:N=>{C&&(N.currentTarget.style.background="var(--bg-sunken)")},onMouseLeave:N=>{N.currentTarget.style.background="transparent"},children:[k.isSummary?l.jsx(mC,{size:12,style:{color:"var(--fg-4)",flex:"0 0 auto",transform:k.isExpanded?"rotate(90deg)":void 0,transition:"transform 120ms"}}):l.jsx("span",{"aria-hidden":"true",style:{width:k.selected?"var(--sp-4)":"var(--sp-3)",height:k.selected?"var(--sp-4)":"var(--sp-3)",borderRadius:"50%",background:aV(k),border:`${k.selected?"var(--hairline-bold)":"var(--hairline)"} solid ${k.selected?"var(--accent)":iV(k)}`,flex:"0 0 auto"}}),l.jsx("span",{className:k.selectedPath?"font-semibold":"font-medium",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k.title}),k.updateCount>0&&!k.isSummary?l.jsx("span",{className:"font-semibold",style:{background:"var(--accent-bg)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-chip)",color:"var(--fg-2)",flex:"0 0 auto",padding:"0 var(--sp-1)"},children:k.updateCount}):null]})},k.id)})]})})]})})]})}function Fu({color:e,label:t}){return l.jsxs("span",{className:"inline-flex items-center text-label",style:{color:"var(--fg-3)",gap:"var(--sp-1)"},children:[l.jsx("span",{"aria-hidden":"true",style:{background:e,border:"var(--hairline) solid var(--border-strong)",borderRadius:"50%",height:"var(--sp-2)",width:"var(--sp-2)"}}),l.jsx("span",{children:t})]})}function Sf({value:e,label:t,tone:n}){return l.jsxs("span",{className:"inline-flex items-baseline text-label",style:{color:"var(--fg-3)",gap:"var(--sp-1)"},children:[l.jsx("span",{className:"font-semibold",style:{color:n?Mh(n):"var(--fg)"},children:e}),l.jsx("span",{children:t})]})}function NG({label:e,tone:t,strong:n}){return l.jsx("span",{className:`text-label ${n?"font-semibold":"font-medium"}`,style:{color:t?Mh(t):"var(--fg)",background:t?"var(--accent-bg)":"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-chip)",padding:"var(--sp-0_5) var(--sp-1_5)"},children:e})}function tT({type:e}){return l.jsx(NG,{label:GG(e),tone:e})}function _G({value:e,impact:t}){return l.jsxs("div",{style:{color:"var(--fg-2)"},children:[l.jsx("div",{className:"text-label font-semibold",style:{color:"var(--fg)",marginBottom:"var(--sp-1)"},children:"Change summary"}),l.jsx("div",{className:"text-body",children:e}),l.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-2)"},children:["Impact: ",t]})]})}function TG({path:e,commit:t,linkedContextItems:n,owner:a,preview:s,sourceExpanded:o,onTogglePreview:c}){const d=[{label:"Owner",value:a},...n.length>0?[{label:"Linked",value:n.join(", ")}]:[],{label:"Source",value:e,mono:!0},{label:"Commit",value:t,mono:!0}];return l.jsxs("div",{children:[l.jsx("div",{className:"text-label font-semibold",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Reference"}),l.jsx("dl",{className:"grid grid-cols-1 md:grid-cols-2",style:{columnGap:"var(--sp-4)",rowGap:"var(--sp-2)"},children:d.map(m=>l.jsxs("div",{className:"grid",style:{gridTemplateColumns:"4rem minmax(0,1fr)",gap:"var(--sp-2)"},children:[l.jsx("dt",{className:"text-label font-semibold",style:{color:"var(--fg-3)"},children:m.label}),l.jsx("dd",{className:`text-label ${m.mono?"font-mono":"font-medium"}`,style:{color:"var(--fg-2)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.value})]},m.label))}),l.jsxs("div",{className:"flex flex-wrap",style:{gap:"var(--sp-1)",marginTop:"var(--sp-3)"},children:[l.jsx(ye,{variant:"outline",size:"xs",onClick:c,children:o?"Hide source":"Preview source"}),l.jsxs(ye,{variant:"ghost",size:"xs",onClick:()=>void navigator.clipboard.writeText(e),children:[l.jsx(jv,{size:14}),"Copy path"]})]}),o?l.jsx("div",{style:{borderTop:"var(--hairline) solid var(--border-faint)",marginTop:"var(--sp-3)",paddingTop:"var(--sp-3)"},children:s?l.jsx(zh,{children:s}):l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No source preview available."})}):null]})}function AG(){return l.jsx(kn,{children:l.jsx(Jn,{children:l.jsxs("div",{className:"flex items-center text-body",style:{color:"var(--fg-2)",gap:"var(--sp-2)"},children:[l.jsx(wM,{size:17}),"Loading team context..."]})})})}function RG({message:e}){return l.jsx(kn,{children:l.jsx(Jn,{children:l.jsxs("div",{className:"flex items-center text-body",style:{color:"var(--danger)",gap:"var(--sp-2)"},children:[l.jsx(To,{size:17}),e]})})})}function nT({snapshot:e}){const t=e.repo?"Context Tree sync unavailable":"Connect Context Tree",n=e.repo?"Hub cannot read the team Context Tree yet. Agents and users will see context here after the server can sync the configured repo.":"Connect a Context Tree repo to show the team knowledge agents can use.",a=e.contextStatus.detail,s=e.repo?OG(e.repo):null;return l.jsx(kn,{children:l.jsx(Jn,{children:l.jsxs("div",{className:"flex items-start text-body",style:{color:"var(--fg-2)",gap:"var(--sp-2)"},children:[l.jsx(To,{size:18,style:{color:"var(--warn)"}}),l.jsxs("div",{children:[l.jsx("div",{className:"font-semibold",style:{color:"var(--fg)"},children:t}),l.jsx("div",{style:{marginTop:"var(--sp-1)"},children:n}),a?l.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-2)"},children:a}):null,e.repo||e.branch?l.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-2)"},children:[s?`Repo: ${s}`:null,e.repo&&e.branch?" · ":null,e.branch?`Branch: ${e.branch}`:null]}):null]})]})})})}function OG(e){return e.replace(/(https?:\/\/)[^/@\s]+@/g,"$1[redacted]@")}function rT(){return l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No context updates in this time window."})}const zG=1,MG=3;function DG(e,t,n,a){const s=IG(e,t,n,a);if(s.length===0)return[];const o=fG().id(p=>p.id).parentId(p=>p.parentId)(s).sort((p,g)=>p.data.isSummary!==g.data.isSummary?p.data.isSummary?1:-1:p.data.path.localeCompare(g.data.path)),d=bG().nodeSize([30,170])(o).descendants(),m=Math.min(...d.map(p=>p.x));return d.map(p=>({...p.data,x:28+p.y,y:28+p.x-m,parent:null})).map((p,g,x)=>({...p,parent:p.parentId?x.find(w=>w.id===p.parentId)??null:null}))}function IG(e,t,n,a){const s=new Map(e.map(S=>[S.id,S])),o=e.filter(S=>!S.parentId||s.has(S.parentId)).sort((S,k)=>S.path.localeCompare(k.path));if(o.length===0)return[];const c=LG(o),d=PG(t,s),m=new Set,h=new Map;for(const S of o){const k=aT(S,s,h),C=n.get(S.id)??0;(k<=zG||d.has(S.id)||C>0&&k<=MG)&&BG(S.id,s,m)}const p=new Set(m);for(const S of a)if(p.has(S))for(const k of c.get(S)??[])p.add(k.id);const g=d.size>0,x=o.filter(S=>p.has(S.id)).map(S=>{const k=n.get(S.id)??0,C=d.has(S.id);return{id:S.id,parentId:S.parentId&&p.has(S.parentId)?S.parentId:null,sourceNodeId:S.id,title:S.title,path:S.path,changeType:S.changeType,updateCount:k,isSummary:!1,isExpanded:!1,selected:t===S.id,selectedPath:C,muted:g&&!C&&k===0}}),w=[];for(const S of o){if(!p.has(S.id))continue;const k=(c.get(S.id)??[]).filter(N=>!m.has(N.id));if(k.length===0)continue;const C=a.has(S.id),E=k.filter(N=>(n.get(N.id)??0)>0).length;w.push({id:`summary:${S.id}`,parentId:S.id,sourceNodeId:null,title:C?`Hide ${k.length} quiet area${k.length===1?"":"s"}`:$G(k.length,E),path:`${S.path}/~summary`,changeType:null,updateCount:E,isSummary:!0,isExpanded:C,selected:!1,selectedPath:d.has(S.id),muted:g&&!d.has(S.id)})}return[...x,...w]}function LG(e){const t=new Map;for(const n of e){if(!n.parentId)continue;const a=t.get(n.parentId)??[];a.push(n),t.set(n.parentId,a)}for(const n of t.values())n.sort((a,s)=>a.path.localeCompare(s.path));return t}function PG(e,t){const n=new Set;let a=e?t.get(e):void 0;for(;a;)n.add(a.id),a=a.parentId?t.get(a.parentId):void 0;return n}function UG(e,t){const n=new Map(e.map(o=>[o.id,o])),a=[];let s=t?n.get(t):void 0;for(;s;)a.unshift(s.title),s=s.parentId?n.get(s.parentId):void 0;return a.length>0?a.join(" / "):null}function BG(e,t,n){let a=t.get(e);for(;a;)n.add(a.id),a=a.parentId?t.get(a.parentId):void 0}function aT(e,t,n){const a=n.get(e.id);if(a!==void 0)return a;const s=e.parentId?t.get(e.parentId):void 0,o=s?aT(s,t,n)+1:0;return n.set(e.id,o),o}function $G(e,t){return t>0?`${e} hidden · ${t} updated`:`${e} hidden quiet area${e===1?"":"s"}`}function FG(e){const t=new Map(e.map(a=>[a.id,a])),n=new Map;for(const a of e){if(!a.changeType)continue;let s=a;for(;s;)n.set(s.id,(n.get(s.id)??0)+1),s=s.parentId?t.get(s.parentId):void 0}return n}function HG(e){var t;return((t=eT.find(n=>n.value===e))==null?void 0:t.summary)??"last 7 days"}function qG(e){return e==="ok"?"var(--ok)":e==="warning"?"var(--warn)":"var(--danger)"}function ZG(e){var n;const t=((n=e.headCommit)==null?void 0:n.slice(0,7))??null;return e.branch&&t?`Source: ${e.branch} @ ${t}`:e.branch?`Branch: ${e.branch}`:t?`Commit: ${t}`:null}function GG(e){return e==="added"?"New":e==="removed"?"Removed":"Updated"}function VG(e){return e==="added"?"New knowledge":e==="removed"?"Removed knowledge":"Updated knowledge"}function QG(e){return e.changeType==="added"?`Agents can use new team knowledge when working on ${e.affectedContextArea}.`:e.changeType==="removed"?`Agents should stop using the old team knowledge for ${e.affectedContextArea}.`:`Agents can use updated team knowledge when working on ${e.affectedContextArea}.`}function KG(e){const t=e.changedBy??"Someone",n=e.changeType==="added"?"added":e.changeType==="removed"?"removed":"updated";return`${t} ${n} ${e.title}`}function YG(e){const t=e.changedBy??"Someone";return`${e.changeType==="added"?"Added":e.changeType==="removed"?"Removed":"Updated"} by ${t}`}function XG(e){const t=e.changedBy??"Someone",n=e.changeType==="added"?"added":e.changeType==="removed"?"removed":"updated",a=JG(e);return a?`${t} ${n} ${e.title}: ${a}`:`${t} ${n} ${e.title}.`}function WG(e){return e.summary.replace(/^updated:\s*/i,"")}function JG(e){const t=WG(e);return new Set(["updated this team knowledge","added this team knowledge","removed this team knowledge"]).has(t.toLowerCase())||t.length<12||/[,;:]$/.test(t)?null:t}function eV(e){return e.length===0?"No owner":e.length===1?e[0]??"No owner":e.join(", ")}function tV(e){return e.length===0?"Owner not set":e.length===1?`Owner: ${e[0]??"Unknown"}`:`Owners: ${e.join(", ")}`}function nV(e){return`${e} linked context${e===1?"":"s"}`}function rV(e){const t=e.split("/").filter(Boolean);return t.length<=1?null:t.slice(0,-1).map(sT).join(" / ")}function iT(e){return e.split("/").filter(Boolean).map(sT).join(" / ")||"root"}function sT(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function Mh(e){return e==="added"?"var(--ok)":e==="edited"?"var(--warn)":"var(--danger)"}function aV(e){return e.isSummary?"var(--bg-sunken)":e.selected?"var(--accent)":e.changeType?Mh(e.changeType):e.updateCount>0?"var(--accent-bg)":"var(--bg-raised)"}function iV(e){return e.changeType?Mh(e.changeType):"var(--border-strong)"}const zo=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));zo.displayName="Card";const Mo=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Mo.displayName="CardHeader";const Bc=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("text-subtitle leading-none",e),...t}));Bc.displayName="CardTitle";const lT=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("text-body text-muted-foreground",e),...t}));lT.displayName="CardDescription";const Do=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Do.displayName="CardContent";const sV=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));sV.displayName="CardFooter";function lV(){const{token:e}=Kj(),t=Tn(),{isAuthenticated:n,adoptTokens:a}=yt(),[s,o]=b.useState(null),[c,d]=b.useState(null),[m,h]=b.useState(!1),[p,g]=b.useState(null);if(b.useEffect(()=>{e&&(async()=>{try{const C=await fetch(`/api/v1/invitations/${encodeURIComponent(e)}/preview`);if(!C.ok){d("This invitation is no longer valid");return}o(await C.json())}catch{d("Network error while loading invitation")}})()},[e]),b.useEffect(()=>{n&&(async()=>{try{const C=await Ee.get("/me/organizations"),E=await Ee.get("/me"),N=C.find(R=>R.id===E.member.organizationId);g((N==null?void 0:N.displayName)??null)}catch{}})()},[n]),!e)return l.jsx(Lk,{message:"Bad invitation URL"});if(c)return l.jsx(Lk,{message:"This invitation is no longer valid"});if(!s)return l.jsx(oV,{});const x=async()=>{h(!0);try{const C=await Ee.post("/me/organizations/join",{token:e});await a(C.tokens),lC("invite"),t("/",{replace:!0})}catch(C){d(C instanceof Error?C.message:"Failed to join team")}finally{h(!1)}},w=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,S=n&&p&&p!==s.organizationDisplayName,k=uV(s.expiresAt);return l.jsx(bb,{children:l.jsxs(zo,{className:"w-full max-w-sm",children:[l.jsx(Mo,{className:"text-center",children:l.jsxs(Bc,{className:"text-title",children:["You're invited to join",l.jsx("br",{}),s.organizationDisplayName]})}),l.jsxs(Do,{className:"space-y-4",children:[S&&l.jsxs("div",{className:"flex items-start gap-2 rounded-md p-3 text-label",style:{background:"var(--bg-sunken)",color:"var(--fg-2)"},children:[l.jsx(To,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsxs("span",{children:["You'll switch from ",l.jsx("span",{className:"font-medium",children:p})," to"," ",l.jsx("span",{className:"font-medium",children:s.organizationDisplayName}),"."]})]}),n?l.jsx(ye,{className:"w-full",disabled:m,onClick:x,children:m?"Joining…":`Join ${s.organizationDisplayName}`}):l.jsx(ye,{asChild:!0,className:"w-full",children:l.jsxs("a",{href:w,children:[l.jsx(gC,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),k&&l.jsx("p",{className:"text-center text-label",style:{color:k.urgent?"var(--destructive)":"var(--fg-3)"},children:k.text}),l.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",l.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",l.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]})]})]})})}function bb({children:e}){return l.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[l.jsx("header",{className:"px-4 py-3",children:l.jsxs(Rc,{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:[l.jsx(Sv,{className:"h-3.5 w-3.5"}),"Back to home"]})}),l.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:e})]})}function oV(){return l.jsx(bb,{children:l.jsxs(zo,{className:"w-full max-w-sm",children:[l.jsxs(Mo,{className:"text-center",children:[l.jsx("div",{className:"mx-auto h-5 w-2/3 rounded-md",style:{background:"var(--bg-sunken)"}}),l.jsx("div",{className:"mx-auto mt-2 h-5 w-1/2 rounded-md",style:{background:"var(--bg-sunken)"}})]}),l.jsxs(Do,{className:"space-y-4",children:[l.jsx("div",{className:"h-9 w-full rounded-md",style:{background:"var(--bg-sunken)"}}),l.jsx("div",{className:"mx-auto h-3 w-1/3 rounded-md",style:{background:"var(--bg-sunken)"}})]})]})})}function Lk({message:e}){return l.jsx(bb,{children:l.jsxs(zo,{className:"w-full max-w-sm",children:[l.jsxs(Mo,{className:"text-center",children:[l.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:l.jsx(To,{className:"h-6 w-6"})}),l.jsx(Bc,{className:"text-title",children:e})]}),l.jsxs(Do,{className:"space-y-4",children:[l.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."}),l.jsx(ye,{asChild:!0,variant:"outline",className:"w-full",children:l.jsxs(Rc,{to:"/",children:[l.jsx(Sv,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function uV(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),s=Math.floor(a/60),o=Math.floor(s/24);return o>7?null:o>=1?{text:`Expires in ${o} ${o===1?"day":"days"}`,urgent:!1}:s>=1?{text:`Expires in ${s} ${s===1?"hour":"hours"}`,urgent:!0}:{text:`Expires in ${Math.max(1,a)} ${a===1?"minute":"minutes"}`,urgent:!0}}function cV(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:"",s=`${t.pathname}${n}${a}`,o=vN(s);return o===F1&&s!==F1?null:o}function dV(){const{isAuthenticated:e}=yt(),t=Er(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=cV(t.state)??"/",s=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?l.jsx(or,{to:a,replace:!0}):l.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[l.jsx("header",{className:"px-4 py-3",children:l.jsxs(Rc,{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:[l.jsx(Sv,{className:"h-3.5 w-3.5"}),"Back to home"]})}),l.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:l.jsxs(zo,{className:"w-full max-w-sm",children:[l.jsxs(Mo,{className:"text-center",children:[l.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:l.jsx(Dc,{width:28,height:32})}),l.jsxs(Bc,{className:"text-title",children:["First Tree ",l.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),l.jsxs(Do,{className:"space-y-4",children:[l.jsx(ye,{asChild:!0,className:"w-full",children:l.jsxs("a",{href:s,children:[l.jsx(gC,{className:"h-4 w-4"}),"Continue with GitHub"]})}),l.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",l.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",l.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]}),n&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[l.jsx("span",{className:"relative z-10 bg-card px-2",children:"localhost only"}),l.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),l.jsx(ye,{asChild:!0,variant:"outline",className:"w-full",children:l.jsxs("a",{href:o,children:[l.jsx(DM,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function fV(){const e=Tn(),{adoptTokens:t}=yt(),[n,a]=b.useState(null);return b.useEffect(()=>{const s=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,o=new URLSearchParams(s),c=o.get("access"),d=o.get("refresh"),m=vN(o.get("next")),h=o.get("joinPath");if(!c||!d){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&lC(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:c,refreshToken:d}),e(m,{replace:!0})))()},[t,e]),l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}const yc=b.forwardRef(({className:e,style:t,...n},a)=>l.jsx("table",{ref:a,className:Me("w-full",e),style:{borderCollapse:"separate",borderSpacing:0,...t},...n}));yc.displayName="DenseTable";const vc=b.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:e,...t}));vc.displayName="DenseTableHeader";const bc=b.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:e,...t}));bc.displayName="DenseTableBody";const aa=b.forwardRef(({className:e,interactive:t,selected:n,style:a,...s},o)=>l.jsx("tr",{ref:o,className:Me("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},...s}));aa.displayName="DenseTableRow";const Wt=b.forwardRef(({className:e,style:t,...n},a)=>l.jsx("th",{ref:a,className:Me("text-left text-label whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3_5)",color:"var(--fg-3)",fontWeight:500,borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Wt.displayName="DenseTableHead";const rt=b.forwardRef(({className:e,style:t,...n},a)=>l.jsx("td",{ref:a,className:Me("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));rt.displayName="DenseTableCell";const hV=1500;function mV({command:e,expiresInSeconds:t,phase:n,copyLabel:a={idle:"Copy",done:"Copied"},waitingText:s="Waiting for your computer to connect…",successContent:o,errorContent:c,caption:d="Single-use · regenerates the previous one.",copyButtonPlacement:m="right"}){const[h,p]=b.useState(!1),g=async()=>{e&&(await navigator.clipboard.writeText(e),p(!0),setTimeout(()=>p(!1),hV))},x=t!==void 0?Math.max(1,Math.round(t/60)):null,w=l.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?l.jsxs(l.Fragment,{children:[e,x!==null&&l.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",x,"m"]})]}):"Generating token…"}),S=l.jsxs(ye,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:!e,style:{alignSelf:"flex-start"},children:[h?l.jsx(cr,{className:"h-3.5 w-3.5"}):l.jsx(jv,{className:"h-3.5 w-3.5"}),h?a.done:a.idle]});return l.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[m==="right"?l.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[w,S]}):l.jsxs(l.Fragment,{children:[w,S]}),d&&l.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:d}),n==="waiting"&&l.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:[l.jsx(pV,{}),s]}),n==="success"&&o&&l.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:[l.jsx(cr,{className:"h-3.5 w-3.5",style:{flexShrink:0}}),l.jsx("span",{style:{minWidth:0},children:o})]}),n==="error"&&c&&l.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 pV(){return l.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 gV=3e3,yV=1200;function vV({open:e,onOpenChange:t}){const n=Cn(),{user:a}=yt(),[s,o]=b.useState("loading"),[c,d]=b.useState(null),[m,h]=b.useState(null),[p,g]=b.useState(null),x=b.useRef(new Set);return b.useEffect(()=>{if(!e){o("loading"),d(null),h(null),g(null),x.current=new Set;return}let w=!1;const S=(n.getQueryData(["clients"])??[]).map(k=>k.id);return x.current=new Set(S),(async()=>{try{const k=await N3();if(w)return;d(k),o("waiting")}catch(k){if(w)return;h(k instanceof Error?k.message:"Failed to generate connect token"),o("error")}})(),()=>{w=!0}},[e,n]),b.useEffect(()=>{if(!e||s!=="waiting"||!a)return;const S=setInterval(async()=>{try{const k=await n.fetchQuery({queryKey:["clients"],queryFn:ci}),C=x.current,E=k.find(N=>!C.has(N.id)&&N.status==="connected"&&N.userId===a.id);E&&(g(E.hostname??null),o("success"))}catch{}},gV);return()=>clearInterval(S)},[e,s,n,a]),b.useEffect(()=>{if(s!=="success")return;const w=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},yV);return()=>clearTimeout(w)},[s,t,n]),l.jsx(Rn,{open:e,onOpenChange:t,children:l.jsxs(En,{children:[l.jsxs(Ln,{children:[l.jsx(On,{children:"Connect computer"}),l.jsx(Dv,{children:"Run this command on the machine you want to pair with this Hub."})]}),l.jsx(mV,{command:(c==null?void 0:c.command)??null,expiresInSeconds:c==null?void 0:c.expiresIn,phase:s,successContent:l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"font-semibold",children:p??"Computer"})," connected. Closing…"]}),errorContent:m}),l.jsx("div",{className:"flex justify-end",style:{gap:"var(--sp-2)"},children:l.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function bV({embedded:e=!1}={}){const t=Cn(),n=ph(),[a,s]=b.useState(()=>new Set),[o,c]=b.useState(null),[d,m]=b.useState(null),[h,p]=b.useState(null),[g,x]=b.useState(!1),{data:w}=Ke({queryKey:["clients"],queryFn:ci,refetchInterval:1e4}),{data:S}=Ke({queryKey:["activity"],queryFn:Oc,refetchInterval:1e4}),k=bt({mutationFn:E3,onSuccess:()=>{c(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})}}),C=bt({mutationFn:C3,onSuccess:()=>{m(null),p(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})},onError:O=>{O instanceof Js?p(O.message):p(O instanceof Error?O.message:String(O))}}),E=b.useMemo(()=>{const O=new Map;for(const B of(S==null?void 0:S.agents)??[]){if(!B.clientId)continue;const I=O.get(B.clientId)??[];I.push(B),O.set(B.clientId,I)}return O},[S==null?void 0:S.agents]),N=O=>E.get(O)??[],R=(w??[]).filter(O=>O.status==="connected").length,z=(w??[]).reduce((O,B)=>O+B.agentCount,0),L=(w??[]).filter(O=>O.authState!=="ok").length;return l.jsxs("div",{className:e?"":"-m-6",children:[l.jsx(al,{title:"Computers",subtitle:w&&w.length>0?l.jsxs(l.Fragment,{children:[w.length," total · ",R," connected · ",z," agents bound",L>0&&l.jsxs(l.Fragment,{children:[" · ",l.jsxs("span",{style:{color:"var(--state-error)"},children:[L," need re-auth"]})]})]}):null,right:l.jsx("div",{className:"flex items-center gap-1.5",children:l.jsxs(ye,{size:"xs",onClick:()=>x(!0),children:[l.jsx(xa,{className:"h-3 w-3"}),"Connect computer"]})})}),l.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[l.jsx(vV,{open:g,onOpenChange:x}),d&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:l.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:[l.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),l.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",l.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:d.hostname??d.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)."]}),N(d.id).length>0&&l.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:[l.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),l.jsx("ul",{className:"text-body space-y-0.5",children:N(d.id).map(O=>l.jsx("li",{className:"font-medium",children:n(O.agentId)},O.agentId))})]}),h&&l.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:h}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(ye,{variant:"outline",size:"sm",onClick:()=>{m(null),p(null)},children:"Cancel"}),l.jsx(ye,{variant:"destructive",size:"sm",onClick:()=>C.mutate(d.id),disabled:C.isPending,children:C.isPending?"Retiring…":"Retire"})]})]})}),o&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:l.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:[l.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),l.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",l.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:o.hostname??o.id.slice(0,8)})," ","and affect all bound agents:"]}),l.jsx("ul",{className:"mb-4 space-y-1",children:N(o.id).length===0?l.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):N(o.id).map(O=>l.jsxs("li",{className:"text-body flex items-center gap-2",children:[l.jsx("span",{className:"font-medium",children:n(O.agentId)}),l.jsx(mc,{state:O.runtimeState})]},O.agentId))}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(ye,{variant:"outline",size:"sm",onClick:()=>c(null),children:"Cancel"}),l.jsx(ye,{variant:"destructive",size:"sm",onClick:()=>k.mutate(o.id),disabled:k.isPending,children:k.isPending?"Disconnecting…":"Disconnect"})]})]})}),!w||w.length===0?l.jsx(kn,{children:l.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers connected. Use the button above to generate a connect command."})}):l.jsxs(kn,{children:[l.jsxs(Py,{children:["Registered · ",w.length]}),l.jsxs(yc,{children:[l.jsx(vc,{children:l.jsxs(aa,{children:[l.jsx(Wt,{style:{width:16}}),l.jsx(Wt,{children:"Hostname"}),l.jsx(Wt,{children:"OS"}),l.jsx(Wt,{children:"SDK"}),l.jsx(Wt,{children:"Agents"}),l.jsx(Wt,{children:"Connected"}),l.jsx(Wt,{children:"Status"}),l.jsx(Wt,{"aria-hidden":!0})]})}),l.jsx(bc,{children:w.map(O=>{const B=!a.has(O.id),I=N(O.id);return l.jsx(EV,{client:O,boundAgents:I,isExpanded:B,agentName:n,onToggle:()=>s(V=>{const D=new Set(V);return D.has(O.id)?D.delete(O.id):D.add(O.id),D}),onDisconnect:()=>c(O),onRetire:()=>{p(null),m(O)},onReconnect:()=>x(!0)},O.id)})})]})]})]})]})}const xV={"claude-code":"Claude Code",codex:"Codex"},wV=[Qf.CLAUDE_CODE,Qf.CODEX],Pk={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},SV={"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 kV({clientId:e,enabled:t}){const{data:n,isLoading:a}=Ke({queryKey:["client-capabilities",e],queryFn:()=>ch(e),enabled:t}),s=(n==null?void 0:n.capabilities)??null;return l.jsxs(l.Fragment,{children:[l.jsx(Jv,{style:{display:"block",marginBottom:6},children:"Runtimes"}),a&&!s?l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):s&&Object.keys(s).length===0?l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Capabilities not yet reported. Reconnect this computer to refresh."}):l.jsx("div",{className:"flex flex-col gap-1",children:wV.map(o=>l.jsx(jV,{provider:o,entry:s?s[o]??null:null},o))})]})}function jV({provider:e,entry:t}){const n=xV[e];if(!t)return l.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[l.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),l.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",Pk[e]]})]});switch(t.state){case"ok":return l.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[l.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),l.jsxs("span",{className:"text-caption",style:{color:"var(--state-idle)"},children:["✓ ",t.sdkVersion?`v${t.sdkVersion} · `:"","authenticated (",t.authMethod,")"]})]});case"unauthenticated":return l.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[l.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),l.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",SV[e]]})]});case"missing":return l.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[l.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),l.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",Pk[e]]})]});case"error":return l.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[l.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),l.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function CV(){return l.jsxs("span",{className:"mono inline-flex items-center gap-1.5 uppercase text-caption",style:{color:"var(--state-error)"},children:[l.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"var(--state-error)",display:"inline-block"}}),"AUTH EXPIRED"]})}function EV({client:e,boundAgents:t,isExpanded:n,agentName:a,onToggle:s,onDisconnect:o,onRetire:c,onReconnect:d}){const h=e.status!=="connected",p=e.authState!=="ok",g=e.status==="connected"?"idle":"offline";return l.jsxs(l.Fragment,{children:[l.jsxs(aa,{interactive:!0,selected:n,onClick:s,children:[l.jsx(rt,{style:{width:16},children:l.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?l.jsx(kv,{className:"h-3.5 w-3.5"}):l.jsx(mC,{className:"h-3.5 w-3.5"})})}),l.jsx(rt,{className:"font-medium",children:e.hostname??"—"}),l.jsx(rt,{style:{color:"var(--fg-3)"},children:e.os??"—"}),l.jsx(rt,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),l.jsx(rt,{children:l.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),l.jsx(rt,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?oc(e.connectedAt):"—"}),l.jsx(rt,{children:p?l.jsx(CV,{}):l.jsx(mc,{state:g})}),l.jsx(rt,{style:{width:1,whiteSpace:"nowrap"},children:l.jsxs("div",{className:"flex items-center justify-end text-label",style:{gap:"var(--sp-3_5)"},children:[h&&l.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:p?"var(--state-error)":"var(--fg-2)"},onClick:x=>{x.stopPropagation(),d()},children:"Reconnect"}),l.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:"var(--fg-2)"},onClick:x=>{x.stopPropagation(),o()},children:"Disconnect"}),l.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:"var(--fg-4)"},onClick:x=>{x.stopPropagation(),c()},children:"Retire"})]})})]}),n&&l.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[l.jsx(rt,{}),l.jsxs(rt,{colSpan:7,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[l.jsx(kV,{clientId:e.id,enabled:n}),t.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs(Jv,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),l.jsx("div",{className:"flex flex-col gap-1",children:t.map(x=>l.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[l.jsx("span",{className:"font-medium",style:{minWidth:140},children:a(x.agentId)}),l.jsx(mc,{state:x.runtimeState}),x.activeSessions!==null&&l.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[x.activeSessions," / ",x.totalSessions??0," sessions"]})]},x.agentId))})]})]})]})]})}function NV(){return l.jsx(bV,{embedded:!0})}async function _V(e){try{return await Ee.get(`/orgs/${e}/github-app-installation`)}catch(t){if(t instanceof Js&&t.status===404)return null;throw t}}async function TV(e){const{installUrl:t}=await Ee.get(`/orgs/${e}/github-app-installation/install-url`);return t}function $c({title:e,description:t,right:n,children:a,isFirst:s=!1}){return l.jsxs("section",{style:{padding:"var(--sp-6) 0",borderTop:s?void 0:"var(--hairline) solid var(--border-faint)"},children:[l.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:"var(--sp-3)"},children:[l.jsxs("div",{style:{minWidth:0},children:[l.jsx("h2",{className:"text-subtitle font-medium m-0",style:{color:"var(--fg)"},children:e}),t&&l.jsx("p",{className:"text-label m-0",style:{color:"var(--fg-3)",marginTop:"var(--sp-0_5)"},children:t})]}),n]}),l.jsx("div",{style:{marginTop:"var(--sp-4)"},children:a})]})}function AV({isFirst:e=!1}){const{organizationId:t}=yt(),n=Ke({queryKey:["github-app-installation",t],queryFn:()=>t?_V(t):Promise.reject(new Error("no org")),enabled:!!t});return l.jsx($c,{title:"GitHub App",description:"One installation unlocks user sign-in, webhook ingestion, and (later) server-side write access.",isFirst:e,children:n.isLoading?l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n.error?l.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:n.error instanceof Error?n.error.message:"Failed to load installation"}):n.data==null?l.jsx(RV,{organizationId:t}):l.jsx(OV,{data:n.data})})}function RV({organizationId:e}){const t=bt({mutationFn:()=>{if(!e)throw new Error("No organization selected");return TV(e)},onSuccess:o=>{window.location.assign(o)}}),n=t.error instanceof Js&&t.error.status===503,a=t.isPending,s=!e||a;return l.jsxs("div",{children:[l.jsx("p",{className:"text-body",style:{color:"var(--fg-2)",marginBottom:"var(--sp-3)"},children:"Install the GitHub App on your personal account or organization to start receiving issues, pull requests, and reviews as routed messages."}),n?l.jsxs("p",{className:"text-body",style:{color:"var(--state-error)"},children:["The GitHub App slug isn't configured on this hub. Ask your operator to set"," ",l.jsx("code",{className:"mono",children:"FIRST_TREE_HUB_GITHUB_APP_SLUG"}),"."]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",onClick:()=>t.mutate(),disabled:s,className:"inline-flex items-center justify-center font-medium",style:{gap:"var(--sp-1)",padding:"var(--sp-2) var(--sp-3)",background:"var(--accent)",color:"var(--accent-fg, white)",border:"none",borderRadius:"var(--radius-input)",cursor:s?"default":"pointer",opacity:s?.6:1},children:[a?"Opening GitHub…":"Install on GitHub",l.jsx(Cv,{className:"h-3 w-3"})]}),t.error&&!n&&l.jsx("p",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:t.error instanceof Error?t.error.message:"Failed to build the install URL"})]})]})}function OV({data:e}){const t=e.accountType==="Organization"?$z:xC,n=Object.entries(e.permissions);return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[e.suspended&&l.jsx(zV,{}),l.jsxs("div",{children:[l.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Connected as"}),l.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-2)"},children:[l.jsx(t,{className:"h-4 w-4",style:{color:"var(--fg-2)"}}),l.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.accountLogin}),l.jsx("span",{className:"text-label",style:{padding:"var(--sp-0_5) var(--sp-1_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",color:"var(--fg-3)"},children:e.accountType})]})]}),n.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Permissions granted"}),l.jsx("ul",{className:"text-body",style:{listStyle:"none",padding:0,margin:0,display:"grid",gridTemplateColumns:"1fr 1fr",gap:"var(--sp-1)",color:"var(--fg-2)"},children:n.map(([a,s])=>l.jsxs("li",{className:"mono",children:[a,": ",l.jsx("strong",{style:{color:"var(--fg)"},children:s})]},a))})]}),e.events.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Subscribed events"}),l.jsx("div",{className:"text-body mono",style:{color:"var(--fg-2)"},children:e.events.join(", ")})]}),l.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-2)"},children:[l.jsxs("a",{href:e.manageUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center text-body",style:{gap:"var(--sp-1)",padding:"var(--sp-1_5) var(--sp-2_5)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)",textDecoration:"none"},children:["Manage on GitHub",l.jsx(Cv,{className:"h-3 w-3"})]}),l.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)"},children:["Installation #",e.installationId]})]})]})}function zV(){return l.jsxs("div",{className:"flex items-start text-body",style:{gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",color:"var(--state-warning, var(--fg-3))"},children:[l.jsx(Qz,{className:"h-4 w-4 shrink-0",style:{marginTop:"var(--sp-0_5)"}}),l.jsx("span",{children:"This installation is suspended upstream. GitHub is not delivering webhooks and Hub can't act as the App on this account. Unsuspend it from the GitHub side to restore service."})]})}function MV(){const{role:e}=yt();return e===null?l.jsx("div",{className:"text-body",style:{padding:"var(--sp-5)",color:"var(--fg-3)"},children:"Loading..."}):e!=="admin"?l.jsx(or,{to:"/settings/computers",replace:!0}):l.jsxs(l.Fragment,{children:[l.jsx(al,{title:"GitHub",subtitle:"Connected GitHub App and granted permissions"}),l.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:l.jsx(AV,{isFirst:!0})})]})}function DV(){return Ee.get(An("/adapter-mappings"))}function IV(e){return Ee.post(An("/adapter-mappings"),e)}function LV(e){return Ee.delete(`/adapter-mappings/${e}`)}function PV(){return Ee.get(An("/adapters/status"))}function UV(){return Ee.get(An("/adapters"))}function BV(e){return Ee.post(An("/adapters"),e)}function $V(e,t){return Ee.patch(`/adapters/${e}`,t)}function FV(e){return Ee.delete(`/adapters/${e}`)}const HV=Object.values(w6),Uk={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function Bk(e){const[t,n]=b.useState(Uk),[a,s]=b.useState("");b.useEffect(()=>{e.open&&(n({...Uk,platform:e.initialPlatform??"feishu",status:e.initialStatus??"active"}),s(""))},[e.open,e.initialPlatform,e.initialStatus]);function o(d){if(d.preventDefault(),s(""),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)){s("App ID and App Secret are required");return}}else if(t.platform==="kael"){if(!e.editingId&&(!t.kaelUserId||!t.kaelProjectId)){s("User ID and Project ID are required");return}}else{const h=t.credentialsJson.trim();if(!e.editingId&&!h){s("Credentials are required");return}if(h)try{JSON.parse(h)}catch{s("Invalid JSON");return}}const m=qV(t);if(!e.editingId&&!m){s("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 l.jsx(Rn,{open:e.open,onOpenChange:e.onOpenChange,children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:c})}),l.jsxs("form",{onSubmit:o,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"binding-platform",children:"Platform"}),l.jsx("select",{id:"binding-platform",value:t.platform,onChange:d=>n({...t,platform:d.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:HV.map(d=>l.jsx("option",{value:d,children:d},d))})]}),e.kind==="user"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"binding-ext-id",children:"External user ID"}),l.jsx(Ut,{id:"binding-ext-id",value:t.externalUserId,onChange:d=>n({...t,externalUserId:d.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"binding-name",children:"Display name (optional)"}),l.jsx(Ut,{id:"binding-name",value:t.displayName,onChange:d=>n({...t,displayName:d.target.value})})]})]}):l.jsxs(l.Fragment,{children:[t.platform==="feishu"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs(vt,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),l.jsx(Ut,{id:"feishu-app-id",value:t.feishuAppId,onChange:d=>n({...t,feishuAppId:d.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(vt,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),l.jsx(Ut,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:d=>n({...t,feishuAppSecret:d.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs(vt,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),l.jsx(Ut,{id:"kael-user-id",value:t.kaelUserId,onChange:d=>n({...t,kaelUserId:d.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(vt,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),l.jsx(Ut,{id:"kael-project-id",value:t.kaelProjectId,onChange:d=>n({...t,kaelProjectId:d.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!e.editingId&&l.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsxs(vt,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),l.jsx("textarea",{id:"binding-creds",value:t.credentialsJson,onChange:d=>n({...t,credentialsJson:d.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&&l.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"binding-status",children:"Status"}),l.jsxs("select",{id:"binding-status",value:t.status,onChange:d=>n({...t,status: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 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[l.jsx("option",{value:"active",children:"active"}),l.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&l.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),l.jsx(ye,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function qV(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 ZV(){var T;const e=Tn(),t=Cn(),[n,a]=sh(),s=n.get("agent"),o=ph(),c=Ke({queryKey:["adapters"],queryFn:UV}),d=Ke({queryKey:["adapter-mappings"],queryFn:DV}),m=Ke({queryKey:["adapter-statuses"],queryFn:PV,refetchInterval:15e3}),p=((T=Ke({queryKey:["agents","name-map"],queryFn:()=>Mc({limit:100}),staleTime:3e4}).data)==null?void 0:T.items)??[],g=b.useMemo(()=>{const G=new Map;for(const q of m.data??[])G.set(q.configId,q);return G},[m.data]),x=b.useMemo(()=>{const G=c.data??[];return s?G.filter(q=>q.agentId===s):G},[c.data,s]),w=b.useMemo(()=>{const G=d.data??[];return s?G.filter(q=>q.agentId===s):G},[d.data,s]),S=x.reduce((G,q)=>{var re;return G+((re=g.get(q.id))!=null&&re.connected?1:0)},0),k=x.length-S,C=c.isLoading||d.isLoading,[E,N]=b.useState(null),[R,z]=b.useState(""),[L,O]=b.useState(null),[B,I]=b.useState(null),[V,D]=b.useState(null),[K,ae]=b.useState(null),be=bt({mutationFn:G=>BV({platform:G.platform,agentId:G.agentId,credentials:G.credentials,status:G.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),W=bt({mutationFn:G=>{const q={status:G.status};return G.credentials&&(q.credentials=G.credentials),$V(G.id,q)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),X=bt({mutationFn:FV,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),Z=bt({mutationFn:G=>IV({platform:G.platform,externalUserId:G.externalUserId,agentId:G.agentId,boundVia:"manual",displayName:G.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),I(null)}}),te=bt({mutationFn:LV,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function je(G){if(s){G==="bot"?O({agentId:s,editingId:null}):I({agentId:s});return}z(""),N({kind:G})}function Ae(){!E||!R||(E.kind==="bot"?O({agentId:R,editingId:null}):I({agentId:R}),N(null))}function M(G){if(L){if(G.kind==="bot-create")be.mutate({agentId:L.agentId,platform:G.draft.platform,status:G.draft.status,credentials:G.draft.credentials});else if(G.kind==="bot-update"){if(!L.editingId)return;W.mutate({id:L.editingId,status:G.status,credentials:G.credentials})}}}function P(G){!B||G.kind!=="user-create"||Z.mutate({agentId:B.agentId,platform:G.draft.platform,externalUserId:G.draft.externalUserId,displayName:G.draft.displayName})}const $=s?p.find(G=>G.uuid===s):null;return l.jsxs(l.Fragment,{children:[l.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."}),s&&l.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[l.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),l.jsxs("span",{className:"inline-flex items-center gap-1.5 mono text-caption",style:{padding:"var(--sp-0_5) var(--sp-2)",borderRadius:"var(--radius-chip)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border)"},children:[($==null?void 0:$.displayName)??s,l.jsx("button",{type:"button",onClick:()=>{const G=new URLSearchParams(n);G.delete("agent"),a(G,{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:l.jsx(os,{className:"h-3 w-3"})})]})]}),l.jsxs(kn,{className:"mb-3.5",children:[l.jsxs(Py,{right:l.jsxs("span",{className:"inline-flex items-center gap-2",children:[l.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[l.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[l.jsx(Ju,{state:"idle",size:6})," ",S," online"]}),l.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[l.jsx(Ju,{state:"offline",size:6})," ",k," offline"]})]}),l.jsxs(ye,{size:"xs",variant:"outline",onClick:()=>je("bot"),children:[l.jsx(xa,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",x.length]}),C?l.jsx(kf,{children:"Loading…"}):x.length?l.jsxs(yc,{children:[l.jsx(vc,{children:l.jsxs(aa,{children:[l.jsx(Wt,{children:"Agent"}),l.jsx(Wt,{children:"Platform"}),l.jsx(Wt,{children:"Status"}),l.jsx(Wt,{children:"Connection"}),l.jsx(Wt,{children:"Created"}),l.jsx(Wt,{style:{width:96,textAlign:"right"}})]})}),l.jsx(bc,{children:x.map(G=>{var re;const q=((re=g.get(G.id))==null?void 0:re.connected)??!1;return l.jsxs(aa,{interactive:!0,onClick:()=>e(`/agents/${G.agentId}`),children:[l.jsx(rt,{children:l.jsx("span",{className:"mono font-medium",children:o(G.agentId)})}),l.jsx(rt,{children:l.jsx(Cr,{children:G.platform})}),l.jsx(rt,{children:l.jsx(Cr,{tone:G.status==="active"?"accent":"outline",children:G.status})}),l.jsx(rt,{children:l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[l.jsx(Ju,{state:q?"idle":"offline",size:7}),l.jsx("span",{style:{color:"var(--fg-3)"},children:q?"Online":"Offline"})]})}),l.jsx(rt,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:oc(G.createdAt)}),l.jsxs(rt,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:xe=>xe.stopPropagation(),children:[l.jsx(ye,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>O({agentId:G.agentId,editingId:G.id,initialPlatform:GV(G.platform),initialStatus:VV(G.status)}),children:"Edit"}),l.jsx(ye,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>D(G.id),disabled:X.isPending,title:"Delete",children:l.jsx(Uf,{className:"h-3.5 w-3.5"})})]})]},G.id)})})]}):l.jsx(kf,{children:s?"No bot bindings for this agent yet.":"No bot bindings"})]}),l.jsxs(kn,{children:[l.jsxs(Py,{right:l.jsxs(ye,{size:"xs",variant:"outline",onClick:()=>je("user"),children:[l.jsx(xa,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",w.length]}),C?l.jsx(kf,{children:"Loading…"}):w.length?l.jsxs(yc,{children:[l.jsx(vc,{children:l.jsxs(aa,{children:[l.jsx(Wt,{children:"Agent"}),l.jsx(Wt,{children:"Platform"}),l.jsx(Wt,{children:"External user ID"}),l.jsx(Wt,{children:"Display name"}),l.jsx(Wt,{children:"Bound via"}),l.jsx(Wt,{children:"Created"}),l.jsx(Wt,{style:{width:32}})]})}),l.jsx(bc,{children:w.map(G=>l.jsxs(aa,{interactive:!0,onClick:()=>e(`/agents/${G.agentId}`),children:[l.jsx(rt,{children:l.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(G.agentId)})}),l.jsx(rt,{children:l.jsx(Cr,{children:G.platform})}),l.jsx(rt,{children:l.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:G.externalUserId})}),l.jsx(rt,{style:{color:"var(--fg-2)"},children:G.displayName??"—"}),l.jsx(rt,{children:l.jsx(Cr,{tone:"outline",children:G.boundVia??"—"})}),l.jsx(rt,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:oc(G.createdAt)}),l.jsx(rt,{onClick:q=>q.stopPropagation(),children:l.jsx(ye,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>ae(G.id),disabled:te.isPending,title:"Delete",children:l.jsx(Uf,{className:"h-3.5 w-3.5"})})})]},G.id))})]}):l.jsx(kf,{children:s?"No user bindings for this agent yet.":"No user bindings"})]}),l.jsx(QV,{open:E!=null,kind:(E==null?void 0:E.kind)??"bot",agents:p,agentId:R,onAgentChange:z,onCancel:()=>N(null),onConfirm:Ae}),l.jsx(Bk,{open:L!=null,kind:"bot",editingId:(L==null?void 0:L.editingId)??null,initialPlatform:L==null?void 0:L.initialPlatform,initialStatus:L==null?void 0:L.initialStatus,agentLabel:L?o(L.agentId):"",pending:be.isPending||W.isPending,errorMessage:(be.error??W.error)instanceof Error?(be.error??W.error).message:null,onOpenChange:G=>{G||(O(null),be.reset(),W.reset())},onSubmit:M}),l.jsx(Bk,{open:B!=null,kind:"user",editingId:null,agentLabel:B?o(B.agentId):"",pending:Z.isPending,errorMessage:Z.error instanceof Error?Z.error.message:null,onOpenChange:G=>{G||(I(null),Z.reset())},onSubmit:P}),l.jsx($k,{open:V!=null,onOpenChange:G=>!G&&D(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:X.isPending,onConfirm:()=>{V!=null&&(X.mutate(V),D(null))}}),l.jsx($k,{open:K!=null,onOpenChange:G=>!G&&ae(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:()=>{K!=null&&(te.mutate(K),ae(null))}})]})}function GV(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function VV(e){return e==="inactive"?"inactive":"active"}function kf({children:e}){return l.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function QV(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 l.jsx(Rn,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),l.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:[l.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>l.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),l.jsxs(fr,{children:[l.jsx(ye,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),l.jsx(ye,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function $k(e){return l.jsx(Rn,{open:e.open,onOpenChange:e.onOpenChange,children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:e.title})}),l.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),l.jsx(ye,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function KV({embedded:e=!1}={}){return l.jsxs("div",{className:e?"":"-m-6",children:[l.jsx(al,{title:"Messaging",subtitle:"Feishu / Slack bridges to your team's agents"}),l.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:l.jsx(ZV,{})})]})}function YV(){return l.jsx(KV,{embedded:!0})}function XV(){const{onboardingStep:e,onboardingDismissedAt:t,dismissOnboarding:n,restoreOnboarding:a}=yt(),s=!!t,o=e==="completed";return l.jsxs(l.Fragment,{children:[l.jsx(al,{title:"Onboarding",subtitle:"Guided setup controls"}),l.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:l.jsx($c,{title:"Onboarding guide",description:s?"The stepper is hidden. Bring it back if you want to walk through Step 3 (build your context-tree).":"The stepper is shown above your workspace. You can hide it any time once your agent is set up.",right:s?null:l.jsx(WV,{}),isFirst:!0,children:s?l.jsx(ye,{type:"button",size:"sm",onClick:()=>void a(),children:"Resume onboarding"}):l.jsx(ye,{type:"button",size:"sm",variant:"outline",onClick:()=>void n(),disabled:!o,title:o?void 0:"Finish setting up your agent first",children:"Hide onboarding guide"})})})]})}function WV(){return l.jsxs("span",{className:"text-label inline-flex items-center",style:{gap:"var(--sp-1)",color:"color-mix(in oklch, var(--accent) 35%, var(--fg))"},children:[l.jsx(cr,{className:"h-3 w-3"}),"Active"]})}function JV(){const{role:e}=yt(),t=e==="admin";return l.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[l.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:200,padding:"var(--sp-4) var(--sp-2)"},children:[l.jsx(Hu,{to:"/settings/team",label:"Team"}),l.jsx(Hu,{to:"/settings/computers",label:"Computers"}),t&&l.jsx(Hu,{to:"/settings/github",label:"GitHub"}),l.jsx(Hu,{to:"/settings/integrations",label:"Messaging"}),l.jsx(Hu,{to:"/settings/onboarding",label:"Onboarding"})]}),l.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:l.jsx(Pf,{})})]})}function Hu({to:e,label:t}){return l.jsx(vv,{to:e,className:({isActive:n})=>Me("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!n&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:n})=>l.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:n?"var(--bg-active)":"transparent",color:n?"var(--fg)":"var(--fg-3)",fontWeight:n?500:400,borderRadius:"var(--radius-input)"},children:l.jsx("span",{className:"flex-1 truncate",children:t})})})}function Xy(e){return e.normalize("NFKD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,Jl)}const Ug=200;function eQ(e){if(!e||e.length===0)return{};const t={},n=["name","displayName","clientId"];for(const a of e){const s=a.path[0];if(typeof s=="string"&&n.includes(s)){const o=s;t[o]||(t[o]=a.message)}else t._root=a.message}return t}function tQ(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,Jl)}function oT(e){return e==="claude-code"||e==="codex"?e:null}function nQ(e){var t,n;if(((t=e["claude-code"])==null?void 0:t.state)==="ok")return"claude-code";if(((n=e.codex)==null?void 0:n.state)==="ok")return"codex";for(const[a,s]of Object.entries(e))if(s.state==="ok"){const o=oT(a);if(o)return o}return null}function rQ(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function aQ(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 iQ({open:e,onOpenChange:t,onCreated:n}){const a=Cn(),{refreshMe:s,organizationId:o}=yt(),[c,d]=b.useState(""),[m,h]=b.useState(""),[p,g]=b.useState(!1),[x,w]=b.useState("private"),[S,k]=b.useState("claude-code"),[C,E]=b.useState(!1),[N,R]=b.useState([]),[z,L]=b.useState(!1),[O,B]=b.useState(null),[I,V]=b.useState(null),[D,K]=b.useState(null),[ae,be]=b.useState(null),[W,X]=b.useState(null),[Z,te]=b.useState(null),[je,Ae]=b.useState(!1),[M,P]=b.useState({}),[$,T]=b.useState({status:"idle"});b.useEffect(()=>{e&&(d(""),h(""),g(!1),w("private"),k("claude-code"),E(!1),R([]),L(!1),B(null),V(null),K(null),be(null),X(null),te(null),Ae(!1),P({}),T({status:"idle"}))},[e]),b.useEffect(()=>{p||h(Xy(c))},[c,p]);const G=b.useRef(0);b.useEffect(()=>{if(!e||!m){T({status:"idle"});return}if(!Dy.test(m)){T({status:"bad",reason:"invalid"});return}if(Iy(m)){T({status:"bad",reason:"reserved"});return}const le=++G.current;T({status:"checking"});const ve=window.setTimeout(()=>{WI(m).then(Re=>{le===G.current&&(Re.available?T({status:"ok"}):T({status:"bad",reason:Re.reason}))}).catch(()=>{le===G.current&&T({status:"idle"})})},300);return()=>window.clearTimeout(ve)},[m,e]),b.useEffect(()=>{if(!e)return;let le=!1;const ve=async()=>{try{const St=await ci();if(le)return;const Ft=St.filter(Pn=>Pn.status==="connected").sort((Pn,hr)=>hr.lastSeenAt.localeCompare(Pn.lastSeenAt));R(Ft),L(!0)}catch{le||L(!0)}};ve();const Re=window.setInterval(ve,3e3);return()=>{le=!0,window.clearInterval(Re)}},[e]),b.useEffect(()=>{if(N.length===0){B(null);return}B(le=>{var ve;return le&&N.some(Re=>Re.id===le)?le:((ve=N[0])==null?void 0:ve.id)??null})},[N]),b.useEffect(()=>{if(!O){V(null),K(null);return}let le=!1;const ve=async()=>{try{const St=await ch(O);if(le)return;V(St.capabilities),K(O)}catch{}};ve();const Re=window.setInterval(ve,3e3);return()=>{le=!0,window.clearInterval(Re)}},[O]),b.useEffect(()=>{if(!e||N.length>0)return;if(ae&&Z&&Z>Date.now()){const ve=Math.max(Z-Date.now(),0),Re=window.setTimeout(()=>{be(null),te(null)},ve);return()=>window.clearTimeout(Re)}ae&&(be(null),X(null),te(null));let le=!1;return(async()=>{try{const ve=await Ee.post("/me/connect-tokens",{});if(le)return;be(ve.token),X(ve.command),te(Date.now()+ve.expiresIn*1e3)}catch{}})(),()=>{le=!0}},[e,N.length,ae,Z]);const q=O&&D===O?I:null,re=b.useMemo(()=>{if(!q)return[];const le=[];for(const[ve,Re]of Object.entries(q)){if(Re.state!=="ok")continue;const St=oT(ve);St&&le.push(St)}return le},[q]);b.useEffect(()=>{q&&k(le=>{var ve;return((ve=q[le])==null?void 0:ve.state)==="ok"?le:nQ(q)??le})},[q]);const xe=bt({mutationFn:async le=>{const ve=c.trim()||m.trim()||"Untitled assistant";return XI({name:m||void 0,type:"personal_assistant",displayName:ve,clientId:le.clientId,runtimeProvider:S,visibility:x,...o?{organizationId:o}:{}})},onSuccess:le=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),s(),n(le,S)}}),we=b.useMemo(()=>{const le=xe.error;if(!le)return{};if(le instanceof Js){const ve=eQ(le.issues);return Object.keys(ve).length>0?ve:le.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:le.message}}return le instanceof Error?{_root:le.message}:{}},[xe.error]),me=$.status==="bad"?aQ($.reason):void 0,Ie={...me?{name:me}:{},...we,...M};function Ue(){const le={};return m?m.length>Jl?le.name=`Agent name must be at most ${Jl} characters (got ${m.length}).`:Dy.test(m)?Iy(m)&&(le.name="That agent name is reserved — pick a different one."):le.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":c.trim().length>0&&(le.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),c.length>Ug&&(le.displayName=`Display name must be at most ${Ug} characters (got ${c.length}).`),le}function ft(le){le.preventDefault();const ve=Ue();P(ve),!(Object.keys(ve).length>0)&&$.status!=="bad"&&O&&(re.length===0||!re.includes(S)||xe.mutate({clientId:O}))}const ut=$.status==="bad",ie=c.trim().length>0&&!ut&&!xe.isPending&&!!O&&re.length>0&&re.includes(S);return l.jsx(Rn,{open:e,onOpenChange:t,children:l.jsxs(En,{className:"max-w-lg",children:[l.jsx(Ln,{children:l.jsx(On,{children:"New Agent"})}),l.jsxs("form",{onSubmit:ft,className:"space-y-5 min-w-0",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"new-agent-display-name",children:"Display name"}),l.jsx(Ut,{id:"new-agent-display-name",value:c,onChange:le=>{d(le.target.value),M.displayName&&P(ve=>({...ve,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:Ug,"aria-invalid":Ie.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),l.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."}),Ie.displayName&&l.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:Ie.displayName}),!C&&(c.trim()||m)&&l.jsxs("div",{className:"flex items-baseline gap-2 text-caption text-muted-foreground",children:[m?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"font-mono",children:["@",m]}),l.jsx("span",{"aria-hidden":!0,children:"·"}),l.jsx("span",{children:"permanent"})]}):l.jsx("span",{className:"italic",children:"No @handle from this display name"}),l.jsx("span",{"aria-hidden":!0,children:"·"}),l.jsx("button",{type:"button",onClick:()=>E(!0),className:"text-foreground underline underline-offset-2 hover:text-primary focus:outline-none focus-visible:text-primary",children:"Edit"})]}),!C&&Ie.name&&l.jsx("p",{className:"text-caption text-destructive",children:Ie.name})]}),C&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[l.jsx(vt,{htmlFor:"new-agent-name",children:"Agent name"}),l.jsx("button",{type:"button",onClick:()=>E(!1),className:"text-caption text-muted-foreground underline underline-offset-2 hover:text-primary focus:outline-none focus-visible:text-primary",children:"Done"})]}),l.jsxs("div",{className:"flex items-stretch",children:[l.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:"@"}),l.jsx(Ut,{id:"new-agent-name",value:m,autoFocus:!0,onChange:le=>{const ve=tQ(le.target.value);h(ve),g(!0),M.name&&P(Re=>({...Re,name:void 0}))},onBlur:le=>{const ve=Xy(le.target.value);ve!==m&&h(ve)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:Jl,"aria-invalid":Ie.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),l.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"," ",Jl," characters. Permanent after creation."]}),m&&!Ie.name&&$.status!=="idle"&&l.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:$.status==="ok"?"var(--state-idle)":$.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[$.status==="checking"&&"Checking availability…",$.status==="ok"&&"Available."]}),Ie.name&&l.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:Ie.name})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{children:"Visibility"}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:x==="organization"?"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:[l.jsx("input",{type:"radio",name:"visibility",checked:x==="organization",onChange:()=>w("organization"),className:"mt-1"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-body font-medium",children:"Shared with team"}),l.jsx("div",{className:"text-caption text-muted-foreground",children:"Anyone in your org can @mention and chat with this agent."})]})]}),l.jsxs("label",{className:x==="private"?"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:[l.jsx("input",{type:"radio",name:"visibility",checked:x==="private",onChange:()=>w("private"),className:"mt-1"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-body font-medium",children:"Private to you"}),l.jsx("div",{className:"text-caption text-muted-foreground",children:"Only you can see this agent and chat with it. Others on the team won't see it listed. (default)"})]})]})]})]}),l.jsxs("div",{className:"space-y-3",style:{minHeight:168},children:[l.jsx(vt,{children:"Where it runs"}),z?N.length===0?l.jsx(sQ,{command:W,copied:je,onCopy:async()=>{W&&(await navigator.clipboard.writeText(W),Ae(!0),window.setTimeout(()=>Ae(!1),1500))}}):N.length===1?l.jsx(lQ,{client:N[0]}):l.jsx("div",{className:"space-y-2",children:N.map(le=>{const ve=O===le.id;return l.jsxs("label",{className:ve?"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:[l.jsx("input",{type:"radio",name:"picked-client",checked:ve,onChange:()=>B(le.id),className:"mt-1"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-body font-medium truncate",children:le.hostname??le.id}),l.jsxs("div",{className:"text-caption text-muted-foreground",children:[le.os??"unknown OS"," · last seen ",new Date(le.lastSeenAt).toLocaleString()]})]})]},le.id)})}):l.jsx(oQ,{label:"Detecting connected computers…"}),(O||!z)&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-caption text-muted-foreground",children:"Powered by"}),!O||q===null?l.jsx(uQ,{}):re.length===0?l.jsx("p",{className:"text-caption text-destructive",children:"No runtime ready on this computer. Install Claude Code or Codex on it (and sign in), then come back."}):l.jsx("div",{className:"flex flex-wrap gap-2",children:re.map(le=>{const ve=S===le;return l.jsxs("label",{className:ve?"inline-flex items-center gap-2 rounded-md border border-primary bg-primary/5 px-3 py-1.5 cursor-pointer":"inline-flex items-center gap-2 rounded-md border border-border px-3 py-1.5 cursor-pointer hover:bg-accent/30",children:[l.jsx("input",{type:"radio",name:"runtime",checked:ve,onChange:()=>k(le)}),l.jsx("span",{className:"text-body",children:rQ(le)})]},le)})})]}),Ie.clientId&&l.jsx("p",{className:"text-caption text-destructive",children:Ie.clientId})]}),Ie._root&&l.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:Ie._root}),l.jsx(fr,{children:l.jsx(ye,{type:"submit",disabled:!ie,children:xe.isPending?"Creating…":"Create"})})]})]})})}function sQ({command:e,copied:t,onCopy:n}){return l.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 space-y-2",children:[l.jsx("div",{className:"text-body font-medium",children:"No computer connected yet."}),l.jsx("div",{className:"text-caption text-muted-foreground",children:"Run this on the machine where this agent should live. We'll pick it up here automatically."}),l.jsxs("div",{className:"flex items-stretch gap-2 min-w-0",children:[l.jsx("code",{className:"block flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-caption px-2 py-1.5 bg-muted/50 border border-border rounded",title:e??void 0,children:e??"Generating token…"}),l.jsx("button",{type:"button",onClick:n,disabled:!e,className:"shrink-0 px-3 py-1.5 text-caption font-medium border border-border rounded hover:bg-accent/30 disabled:opacity-50",children:t?"Copied":"Copy"})]})]})}function lQ({client:e}){return e?l.jsxs("div",{className:"rounded-md border border-primary bg-primary/5 p-3",children:[l.jsx("div",{className:"text-body font-medium truncate",children:e.hostname??e.id}),l.jsxs("div",{className:"text-caption text-muted-foreground",children:[e.os??"unknown OS"," · last seen ",new Date(e.lastSeenAt).toLocaleString()]})]}):null}function oQ({label:e}){return l.jsxs("div",{className:"rounded-md border border-border bg-muted/20 p-3",role:"status","aria-live":"polite","aria-label":e,children:[l.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg-3)"},children:e}),l.jsx("div",{className:"text-caption text-muted-foreground",children:"Looking for a machine running the Hub client…"})]})}function uQ(){return l.jsx("div",{className:"flex flex-wrap gap-2",role:"status","aria-live":"polite","aria-label":"Detecting installed runtimes",children:l.jsx("span",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 px-3 py-1.5 text-body",style:{color:"var(--fg-4)"},children:"Detecting installed runtimes…"})})}function uT({active:e,count:t,warn:n,className:a,children:s,style:o,...c}){return l.jsxs("button",{type:"button",className:Me("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:[s,t!==void 0&&l.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}function cQ(e){const t=new Date(e),n=Date.now(),a=t.getTime()-n;if(a<=0)return`expired ${t.toLocaleDateString()}`;const s=Math.ceil(a/(1440*60*1e3));return`expires ${s===1?"in less than a day":`in ${s} days`} · ${t.toLocaleDateString()}`}function dQ(){const{organizationId:e}=yt(),[t,n]=b.useState(null),[a,s]=b.useState(null),[o,c]=b.useState(!1),[d,m]=b.useState(!1);b.useEffect(()=>{e&&(async()=>{try{const p=await Ee.get(vy(e,"/invitations"));n(p)}catch(p){s(p instanceof Error?p.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){c(!0),s(null);try{const p=await Ee.post(vy(e,"/invitations/rotate"));n(p)}catch(p){s(p instanceof Error?p.message:"Failed to rotate invite link")}finally{c(!1)}}};return l.jsxs(zo,{children:[l.jsxs(Mo,{children:[l.jsx(Bc,{children:"Invite link"}),l.jsxs(lT,{children:["Anyone with this link can join your team as a member. Links expire after ",wB," days; rotating revokes the old link instantly and resets the timer."]})]}),l.jsxs(Do,{className:"space-y-3",children:[a&&l.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),l.jsx(ye,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:d?"Copied!":"Copy"}),l.jsx(ye,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),l.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${cQ(t.expiresAt)}`:" · no expiry"]})]}):l.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}const xb=[{key:"name",label:"Name",width:220},{key:"delegate",label:"Delegate",width:180},{key:"manager",label:"Manager",width:180},{key:"runtime",label:"Runs on",width:220},{key:"status",label:"Status",width:160},{key:"created",label:"Created",width:160},{key:"actions",label:"",width:44}];function jr(e,t){return e?{...t,borderBottom:0}:t}function fQ({groups:e,runtimeMap:t,clientHostMap:n,onAgentClick:a,getHumanActions:s,getAgentActions:o}){return l.jsxs(yc,{className:"table-fixed",children:[l.jsx(vc,{children:l.jsx(aa,{children:xb.map(c=>l.jsx(Wt,{style:{width:c.width,...c.key==="name"?{paddingLeft:"var(--sp-6)"}:null},"aria-hidden":c.key==="actions",children:c.label},c.key))})}),e.map(c=>l.jsx(hQ,{group:c,runtimeMap:t,clientHostMap:n,onAgentClick:a,getHumanActions:s,getAgentActions:o},c.key))]})}function hQ({group:e,runtimeMap:t,clientHostMap:n,onAgentClick:a,getHumanActions:s,getAgentActions:o}){const[c,d]=b.useState(!e.collapsible);return l.jsxs(bc,{children:[l.jsx(pQ,{group:e,open:c,onToggle:()=>d(m=>!m)}),c&&e.rows.length===0&&e.emptyMessage&&l.jsx(aa,{children:l.jsx(rt,{colSpan:xb.length,style:{color:"var(--fg-4)",textAlign:"left",padding:"0 var(--sp-3_5) var(--sp-3) var(--sp-6)",borderBottom:0},children:e.emptyMessage})}),c&&e.rows.map((m,h)=>{const p=h===e.rows.length-1;return m.kind==="human"?l.jsx(gQ,{row:m,actions:s(m),isLast:p},`h:${m.id}`):l.jsx(vQ,{row:m,runtime:t.get(m.agent.uuid)??null,clientHost:m.agent.clientId?n.get(m.agent.clientId)??null:null,actions:o(m),onClick:()=>a(m.agent.uuid),isLast:p},`a:${m.agent.uuid}`)})]})}function mQ(e){switch(e){case"humans":return xC;case"yours":case"team":return hC;case"other-private":return oh;default:return null}}function pQ({group:e,open:t,onToggle:n}){const a=mQ(e.key),s=l.jsxs("span",{className:"inline-flex items-center relative",style:{gap:"var(--sp-2)"},children:[e.collapsible&&l.jsx("span",{"aria-hidden":!0,style:{position:"absolute",left:"calc(-1 * var(--sp-3))",top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)",lineHeight:1},children:t?"▾":"▸"}),a&&l.jsx(a,{className:"h-4 w-4","aria-hidden":!0,style:{color:"var(--fg-3)"}}),l.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.title}),l.jsx(Cr,{tone:"outline",children:e.count})]});return l.jsx(aa,{children:l.jsx("td",{colSpan:xb.length,style:{padding:"var(--sp-6) var(--sp-3_5) var(--sp-2) 0"},children:e.collapsible?l.jsx("button",{type:"button",onClick:n,"aria-expanded":t,style:{background:"transparent",border:0,cursor:"pointer",color:"inherit",padding:"0 0 0 var(--sp-3)",marginLeft:"calc(-1 * var(--sp-3))"},children:s}):s})})}function gQ({row:e,actions:t,isLast:n}){return l.jsxs(aa,{children:[l.jsx(rt,{style:jr(n,{paddingLeft:"var(--sp-6)"}),children:l.jsx(cT,{displayName:e.displayName,handle:`@${e.username}`,selfTag:e.isSelf})}),l.jsx(rt,{style:jr(n),children:l.jsx(yQ,{row:e})}),l.jsx(rt,{className:"text-label",style:jr(n,{color:"var(--fg-4)"}),children:"—"}),l.jsx(rt,{className:"text-label",style:jr(n,{color:"var(--fg-4)"}),children:"—"}),l.jsx(rt,{className:"text-label",style:jr(n,{color:"var(--fg-4)"}),children:"—"}),l.jsx(rt,{className:"mono text-caption",style:jr(n,{color:"var(--fg-4)"}),children:LC(e.createdAt)}),l.jsx(rt,{style:jr(n,{padding:0,textAlign:"right"}),children:l.jsx(dT,{actions:t,ariaLabel:`Actions for ${e.displayName}`})})]})}function yQ({row:e}){if(!e.delegate&&!e.canEditDelegate)return l.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"—"});const t=e.delegate?e.delegate.name?`${e.delegate.displayName} (@${e.delegate.name})`:e.delegate.displayName:"Set delegate",n=e.delegate?l.jsx("span",{className:"block max-w-full overflow-hidden text-ellipsis whitespace-nowrap",children:l.jsx(HN,{name:e.delegate.name,displayName:e.delegate.displayName})}):l.jsx("span",{style:{color:"var(--accent-dim)"},children:"Set delegate →"}),a=e.delegate?e.canEditDelegate?`Change delegate · ${t}`:t:"Set delegate";return e.canEditDelegate?l.jsx("button",{type:"button",onClick:e.onEditDelegate,className:"text-label hover:underline block max-w-full overflow-hidden",style:{background:"transparent",border:0,padding:0,cursor:"pointer",color:"inherit",textAlign:"left"},title:a,children:n}):l.jsx("span",{className:"text-label block max-w-full overflow-hidden",title:a,children:n})}function vQ({row:e,runtime:t,clientHost:n,actions:a,onClick:s,isLast:o}){const{agent:c,managerLabel:d,isOwnedBySelf:m,showVisibilityChip:h}=e;return l.jsxs(aa,{interactive:!0,onClick:s,children:[l.jsx(rt,{style:jr(o,{paddingLeft:"var(--sp-6)"}),children:l.jsx(cT,{displayName:c.displayName,handle:c.name?`@${c.name}`:null,visibility:h?c.visibility:null})}),l.jsx(rt,{className:"text-label",style:jr(o,{color:"var(--fg-4)"}),children:"—"}),l.jsx(rt,{className:"text-label",style:jr(o,{color:"var(--fg-2)"}),children:d?l.jsxs("span",{className:"truncate inline-block max-w-full",title:d,children:[d,m&&l.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}):l.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),l.jsx(rt,{className:"mono text-caption",style:jr(o,{color:"var(--fg-3)"}),children:l.jsxs("div",{className:"truncate",title:n?`${c.runtimeProvider} @ ${n}`:c.runtimeProvider,children:[c.runtimeProvider,n&&l.jsxs("span",{style:{color:"var(--fg-4)"},children:[" @ ",n]})]})}),l.jsx(rt,{style:jr(o),children:l.jsx(mc,{state:(t==null?void 0:t.runtimeState)??null})}),l.jsx(rt,{className:"mono text-caption",style:jr(o,{color:"var(--fg-4)"}),children:LC(c.createdAt)}),l.jsx(rt,{style:jr(o,{padding:0,textAlign:"right"}),onClick:p=>p.stopPropagation(),children:l.jsx(dT,{actions:a,ariaLabel:`Actions for ${c.displayName}`})})]})}function cT({displayName:e,handle:t,selfTag:n,visibility:a}){return l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-baseline gap-1.5 min-w-0",children:[l.jsx("span",{className:"font-medium text-body truncate",style:{color:"var(--fg)"},title:e,children:e}),n&&l.jsx("span",{className:"text-label italic shrink-0",style:{color:"var(--fg-3)"},children:"(you)"}),a&&l.jsx(bQ,{visibility:a})]}),t&&l.jsx("div",{className:"mono text-caption truncate",style:{color:"var(--fg-4)"},title:t,children:t})]})}function bQ({visibility:e}){return e==="private"?l.jsxs(Cr,{tone:"outline",title:"Private — only you can see this agent",className:"shrink-0",children:[l.jsx(oh,{className:"h-2.5 w-2.5","aria-hidden":!0,style:{marginRight:3}}),"Private"]}):l.jsxs(Cr,{tone:"accent",title:"Shared — anyone in the team can @mention this agent",className:"shrink-0",children:[l.jsx(OM,{className:"h-2.5 w-2.5","aria-hidden":!0,style:{marginRight:3}}),"Shared"]})}function dT({actions:e,ariaLabel:t}){const[n,a]=b.useState(!1),[s,o]=b.useState("down"),c=b.useRef(null),d=b.useRef(null);return b.useEffect(()=>{if(!n)return;const m=p=>{c.current&&!c.current.contains(p.target)&&a(!1)},h=p=>{p.key==="Escape"&&a(!1)};return window.addEventListener("mousedown",m),window.addEventListener("keydown",h),()=>{window.removeEventListener("mousedown",m),window.removeEventListener("keydown",h)}},[n]),b.useEffect(()=>{if(!n||!d.current)return;const m=32,h=8,p=d.current.getBoundingClientRect(),g=window.innerHeight-p.bottom,x=e.length*m+h;o(g>=x?"down":"up")},[n,e.length]),e.length===0?null:l.jsxs("div",{ref:c,className:"relative inline-flex",children:[l.jsx("button",{ref:d,type:"button","aria-label":t,"aria-haspopup":"menu","aria-expanded":n,onClick:m=>{m.stopPropagation(),a(h=>!h)},className:"inline-flex items-center justify-center",style:{width:28,height:28,borderRadius:4,background:"transparent",color:"var(--fg-3)",cursor:"pointer",border:0},children:l.jsx(Xz,{className:"h-3.5 w-3.5"})}),n&&l.jsx("div",{role:"menu",className:"absolute right-0 z-30 rounded-md border bg-popover shadow-md",style:{minWidth:180,borderColor:"var(--border)",...s==="up"?{bottom:"100%",marginBottom:4}:{top:"100%",marginTop:4}},children:e.map(m=>l.jsx("button",{type:"button",role:"menuitem",disabled:m.disabled,onClick:h=>{h.stopPropagation(),a(!1),m.onSelect()},className:"flex w-full items-center px-3 py-1.5 text-left text-body hover:bg-accent transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{color:m.destructive?"var(--state-error)":"var(--fg)",background:"transparent",border:0,cursor:m.disabled?"not-allowed":"pointer"},children:m.label},m.key))})]})}const Fk=100,Hk=100;async function xQ(e){const t=[];let n;for(let a=0;a<Hk;a++){const s=await e(n?{limit:Fk,cursor:n}:{limit:Fk});if(t.push(...s.items),!s.nextCursor)return t;n=s.nextCursor}throw new Error(`fetchAllAgents exceeded ${Hk} pages; server cursor pagination may be broken`)}function wQ(){const{role:e,memberId:t}=yt(),n=e==="admin",a=Tn(),s=Cn(),o=ZN(),[c,d]=b.useState(!1),[m,h]=b.useState(!1),[p,g]=b.useState(null),[x,w]=b.useState(null),[S,k]=b.useState("all"),[C,E]=b.useState(""),N=Ke({queryKey:["members"],queryFn:qN}),R=Ke({queryKey:["agents","team-page",n?"admin":"member"],queryFn:()=>xQ(q=>n?KI(q):Mc(q))}),{data:z}=Ke({queryKey:["activity"],queryFn:Oc,refetchInterval:1e4}),L=b.useMemo(()=>{const q=new Map;for(const re of(z==null?void 0:z.agents)??[])q.set(re.agentId,re);return q},[z==null?void 0:z.agents]),{data:O}=Ke({queryKey:["clients","team-page"],queryFn:ci,staleTime:3e4}),B=b.useMemo(()=>{const q=new Map;for(const re of O??[])re.hostname&&q.set(re.id,re.hostname);return q},[O]),I=b.useMemo(()=>N.data??[],[N.data]),V=b.useMemo(()=>R.data??[],[R.data]),D=b.useMemo(()=>{const q=new Map;for(const re of V)q.set(re.uuid,re);return q},[V]),K=b.useMemo(()=>V.filter(q=>q.type!=="human"),[V]),ae=b.useMemo(()=>K.filter(q=>q.managerId===t),[K,t]),be=b.useMemo(()=>K.filter(q=>q.visibility==="organization"&&q.managerId!==t),[K,t]),W=b.useMemo(()=>K.filter(q=>q.visibility==="private"&&q.managerId!==t),[K,t]),X=bt({mutationFn:async q=>N9(q.id,q.patch),onSuccess:()=>s.invalidateQueries({queryKey:["members"]})}),Z=bt({mutationFn:_9,onSuccess:()=>{s.invalidateQueries({queryKey:["members"]}),s.invalidateQueries({queryKey:["agents"]})}}),te=bt({mutationFn:DE,onSuccess:()=>{s.invalidateQueries({queryKey:["agents"]}),s.invalidateQueries({queryKey:["activity"]})}}),je=bt({mutationFn:IE,onSuccess:()=>s.invalidateQueries({queryKey:["agents"]})}),Ae=bt({mutationFn:LE,onSuccess:()=>s.invalidateQueries({queryKey:["agents"]})}),M=bt({mutationFn:async q=>Ay(q.humanAgentId,{delegateMention:q.delegateMention}),onSuccess:()=>s.invalidateQueries({queryKey:["agents"]})}),P=C.trim().toLowerCase(),$=b.useMemo(()=>jQ({filter:S,search:P,isAdmin:n,selfMemberId:t,members:I,yourAgents:ae,teamAgents:be,otherPrivateAgents:W,resolveMember:o,agentByUuid:D,openDelegate:(q,re)=>{var xe;return w({humanAgentId:q,humanDisplayName:re,currentDelegate:((xe=D.get(q))==null?void 0:xe.delegateMention)??null})}}),[S,P,n,t,I,ae,be,W,o,D]);function T(q){const re=[];return n&&re.push({key:"edit",label:"Edit profile",onSelect:()=>g({id:q.id,username:q.username,displayName:q.displayName,role:q.role})}),n&&!q.isSelf&&re.push({key:"remove",label:"Remove from org",destructive:!0,onSelect:()=>{window.confirm(`Remove ${q.displayName} from the org? The human agent will be deactivated.`)&&Z.mutate(q.id)}}),re}function G(q){const{agent:re,isOwnedBySelf:xe}=q,we=n||xe,me=[{key:"open",label:"Open",onSelect:()=>a(`/agents/${encodeURIComponent(re.uuid)}`)}];return we&&(re.status==="suspended"?me.push({key:"reactivate",label:"Reactivate",onSelect:()=>Ae.mutate(re.uuid)}):me.push({key:"suspend",label:"Suspend",onSelect:()=>je.mutate(re.uuid)}),me.push({key:"delete",label:"Delete",destructive:!0,onSelect:()=>{window.confirm(`Delete agent ${re.displayName}? This cannot be undone.`)&&te.mutate(re.uuid)}})),me}return l.jsxs(l.Fragment,{children:[l.jsx(al,{title:"Team",right:l.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-2)"},children:[l.jsxs(ye,{size:"xs",onClick:()=>h(!0),children:[l.jsx(xa,{className:"h-3 w-3"}),"New agent"]}),n&&l.jsxs(ye,{size:"xs",variant:"ghost",onClick:()=>d(!0),children:[l.jsx(bC,{className:"h-3 w-3"}),"Invite link"]})]})}),l.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)",display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[l.jsx(kQ,{filter:S,onFilter:k,query:C,onQuery:E,counts:{yours:ae.length,humans:I.length,team:be.length}}),R.isLoading||N.isLoading?l.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):R.error||N.error?l.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load: ",SQ(R.error??N.error)]}):l.jsx(fQ,{groups:$,runtimeMap:L,clientHostMap:B,onAgentClick:q=>a(`/agents/${encodeURIComponent(q)}`),getHumanActions:T,getAgentActions:G})]}),l.jsx(Rn,{open:c,onOpenChange:d,children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:"Invite link"})}),l.jsx(dQ,{})]})}),l.jsx(iQ,{open:m,onOpenChange:h,onCreated:(q,re)=>{h(!1),s.invalidateQueries({queryKey:["agents"]}),s.invalidateQueries({queryKey:["activity"]})}}),l.jsx(NQ,{target:p,isAdmin:n,isSaving:X.isPending,onClose:()=>g(null),onSave:async q=>{p&&(await X.mutateAsync({id:p.id,patch:q}),g(null))}}),l.jsx(_Q,{target:x,candidates:CQ(V),isSaving:M.isPending,onClose:()=>w(null),onSave:async q=>{x&&(await M.mutateAsync({humanAgentId:x.humanAgentId,delegateMention:q}),w(null))}})]})}function SQ(e){return e instanceof Error?e.message:String(e)}function kQ({filter:e,onFilter:t,query:n,onQuery:a,counts:s}){const o=[{key:"all",label:"All"},{key:"yours",label:"Your agents",count:s.yours},{key:"humans",label:"Humans",count:s.humans},{key:"team",label:"Team agents",count:s.team}];return l.jsxs("div",{className:"flex flex-wrap items-center",style:{gap:"var(--sp-2)"},children:[l.jsx("div",{className:"flex flex-wrap items-center",style:{gap:"var(--sp-1)"},children:o.map(c=>l.jsx(uT,{active:e===c.key,count:c.count,onClick:()=>t(c.key),children:c.label},c.key))}),l.jsxs("div",{className:"relative",style:{width:220},children:[l.jsx(uh,{"aria-hidden":!0,className:"h-3.5 w-3.5",style:{position:"absolute",left:"var(--sp-1_5)",top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),l.jsx(Ut,{value:n,onChange:c=>a(c.target.value),placeholder:"Search name or @handle","aria-label":"Search team",className:"h-7 text-caption",style:{paddingLeft:"var(--sp-5)",borderRadius:3}})]})]})}function jQ(e){const{filter:t,search:n,isAdmin:a,selfMemberId:s,members:o,yourAgents:c,teamAgents:d,otherPrivateAgents:m,agentByUuid:h,openDelegate:p}=e,g=I=>{const V=h.get(I);if(!(V!=null&&V.delegateMention))return null;const D=h.get(V.delegateMention);return D?{name:D.name,displayName:D.displayName}:null},x=I=>!n||I.displayName.toLowerCase().includes(n)||I.username.toLowerCase().includes(n),w=I=>!n||I.displayName.toLowerCase().includes(n)||(I.name??"").toLowerCase().includes(n),S=t==="all"||t==="yours",k=t==="all"||t==="humans",C=t==="all"||t==="team",E=a&&t==="all",N=o.filter(x).map(I=>{const V=s===I.id;return{kind:"human",id:I.id,agentId:I.agentId,username:I.username,displayName:I.displayName,role:I.role,createdAt:I.createdAt,isSelf:V,delegate:g(I.agentId),canEditDelegate:V||a,onEditDelegate:()=>p(I.agentId,I.displayName)}}).sort((I,V)=>Number(V.isSelf)-Number(I.isSelf)),R=(I,V)=>({kind:"agent",agent:I,managerLabel:I.managerId?e.resolveMember(I.managerId):null,isOwnedBySelf:I.managerId===s,showVisibilityChip:(V==null?void 0:V.showVisibilityChip)??!1}),z=c.filter(w).map(I=>R(I,{showVisibilityChip:!0})).sort((I,V)=>{const D=I.agent.visibility==="private"?0:1,K=V.agent.visibility==="private"?0:1;return D!==K?D-K:I.agent.displayName.localeCompare(V.agent.displayName,void 0,{sensitivity:"base"})}),L=d.filter(w).map(I=>R(I)),O=m.filter(w).map(I=>R(I)),B=[];return S&&B.push({key:"yours",title:"Your agents",count:z.length,rows:z,emptyMessage:n?"No agents match this search.":"You haven't created any agents yet. Click New agent above to add one."}),k&&B.push({key:"humans",title:"Humans",count:N.length,rows:N,emptyMessage:n?"No humans match this search.":void 0}),C&&B.push({key:"team",title:"Team agents",count:L.length,rows:L,emptyMessage:n?"No team agents match this search.":"No shared agents from other team members yet."}),E&&O.length>0&&B.push({key:"other-private",title:"Other members' private agents",count:O.length,rows:O,collapsible:!0}),B}function CQ(e){return e.filter(t=>t.type==="personal_assistant"&&t.status==="active")}const EQ=Object.values(NB);function NQ({target:e,isAdmin:t,isSaving:n,onClose:a,onSave:s}){const[o,c]=b.useState(""),[d,m]=b.useState("member"),[h,p]=b.useState(null);b.useEffect(()=>{e&&(c(e.displayName),m(e.role),p(null))},[e]);async function g(w){if(w.preventDefault(),!e)return;const S={};if(o.trim()&&o!==e.displayName&&(S.displayName=o.trim()),t&&d!==e.role&&(S.role=d),Object.keys(S).length===0){a();return}try{await s(S)}catch(k){p(k instanceof Error?k.message:String(k))}}const x=e!==null;return l.jsx(Rn,{open:x,onOpenChange:w=>w?void 0:a(),children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:"Edit profile"})}),e&&l.jsxs("form",{onSubmit:g,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{children:"Username"}),l.jsx(Ut,{value:e.username,disabled:!0,className:"font-mono"}),l.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"edit-member-display",children:"Display name"}),l.jsx(Ut,{id:"edit-member-display",value:o,onChange:w=>c(w.target.value),required:!0,maxLength:200})]}),t&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"edit-member-role",children:"Role"}),l.jsx("select",{id:"edit-member-role",value:d,onChange:w=>m(w.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:EQ.map(w=>l.jsx("option",{value:w,children:w},w))}),l.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."})]}),h&&l.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:h}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:a,disabled:n,children:"Cancel"}),l.jsx(ye,{type:"submit",disabled:n,children:n?"Saving…":"Save"})]})]})]})})}function _Q({target:e,candidates:t,isSaving:n,onClose:a,onSave:s}){const[o,c]=b.useState(""),[d,m]=b.useState(null);b.useEffect(()=>{e&&(c(e.currentDelegate??""),m(null))},[e]);async function h(g){if(g.preventDefault(),!!e){m(null);try{await s(o||null)}catch(x){m(x instanceof Error?x.message:String(x))}}}const p=e!==null;return l.jsx(Rn,{open:p,onOpenChange:g=>g?void 0:a(),children:l.jsxs(En,{children:[l.jsx(Ln,{children:l.jsx(On,{children:"Set delegate"})}),e&&l.jsxs("form",{onSubmit:h,className:"space-y-4",children:[l.jsxs("p",{className:"text-body",style:{color:"var(--fg-2)"},children:["Pick a personal assistant to act on behalf of ",l.jsx("strong",{children:e.humanDisplayName}),". When teammates @mention this human, the assistant receives the message and can reply in their place."]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(vt,{htmlFor:"set-delegate-pick",children:"Delegate"}),l.jsxs("select",{id:"set-delegate-pick",value:o,onChange:g=>c(g.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:[l.jsx("option",{value:"",children:"None — no delegate"}),t.map(g=>l.jsx("option",{value:g.uuid,children:g.displayName?`${g.displayName} (@${g.name??g.uuid})`:g.name?`@${g.name}`:g.uuid},g.uuid))]}),t.length===0&&l.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["No personal assistants available. Create one from the ",l.jsx("em",{children:"New agent"})," button above first."]})]}),d&&l.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:d}),l.jsxs(fr,{children:[l.jsx(ye,{type:"button",variant:"ghost",onClick:a,disabled:n,children:"Cancel"}),l.jsx(ye,{type:"submit",disabled:n,children:n?"Saving…":"Save"})]})]})]})})}function Dh(e,t){return`/orgs/${encodeURIComponent(e)}/settings/${encodeURIComponent(t)}`}function wb(e){return Ee.get(Dh(e,"context_tree"))}function fT(e,t){return Ee.put(Dh(e,"context_tree"),t)}function hT(e){return Ee.get(Dh(e,"source_repos"))}function mT(e,t){return Ee.put(Dh(e,"source_repos"),t)}function Wy({label:e,hint:t,value:n,onChange:a,saved:s=!1,mono:o=!1,type:c="text",placeholder:d,rightSlot:m,readOnly:h=!1,pattern:p}){const g=b.useId(),x=`flex-1 min-w-0 outline-none text-body focus-visible:ring-1 focus-visible:ring-ring ${o?"mono":""}`,w={padding:"var(--sp-1_5) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid transparent",borderRadius:"var(--radius-input)",color:"var(--fg)"};return l.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[l.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:"var(--sp-2)"},children:[l.jsx("label",{htmlFor:g,className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),s&&l.jsx(TQ,{})]}),t&&l.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",margin:"var(--sp-0_5) 0 var(--sp-2)"},children:t}),l.jsxs("div",{className:"flex items-stretch",style:{gap:"var(--sp-2)"},children:[h?l.jsx("input",{id:g,value:n,readOnly:!0,className:x,style:{...w,color:"var(--fg-2)"}}):l.jsx("input",{id:g,value:n,onChange:S=>a==null?void 0:a(S.target.value),type:c,placeholder:d,pattern:p,className:x,style:w}),m]})]})}function TQ(){return l.jsxs("span",{className:"text-label inline-flex items-center fade-in",style:{gap:"var(--sp-1)",color:"color-mix(in oklch, var(--accent) 35%, var(--fg))"},children:[l.jsx(cr,{className:"h-3 w-3"}),"Saved"]})}function pT({pending:e,disabled:t=!1}){const n=e||t;return l.jsx("button",{type:"submit",disabled:n,"aria-label":"Save",title:"Save",className:"settings-save-button",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:"var(--sp-8)",background:"transparent",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:0,cursor:n?"default":"pointer",color:"var(--fg-3)",opacity:n?.5:1,transition:"color 0.15s, background 0.15s, border-color 0.15s"},children:e?l.jsx(yC,{className:"h-4 w-4 animate-spin"}):l.jsx(cr,{className:"h-4 w-4"})})}function AQ({isFirst:e=!1}){const{organizationId:t}=yt(),n=Cn(),a=Ke({queryKey:["org-setting",t,"context_tree"],queryFn:()=>t?wb(t):Promise.reject(new Error("no org")),enabled:!!t}),[s,o]=b.useState(""),[c,d]=b.useState(""),[m,h]=b.useState(!1);b.useEffect(()=>{a.data&&(o(a.data.repo??""),d(a.data.branch??"main"))},[a.data]);const p=bt({mutationFn:()=>{if(!t)throw new Error("organization not loaded");return fT(t,{repo:s.trim()?s.trim():null,branch:c.trim()?c.trim():null})},onSuccess:x=>{n.setQueryData(["org-setting",t,"context_tree"],x),h(!0),setTimeout(()=>h(!1),2e3)}}),g=x=>{x.preventDefault(),p.mutate()};return l.jsx($c,{title:"Context tree",description:"Changes apply to new agent sessions. Members should restart agents to pick up updated tree contents.",isFirst:e,children:a.isLoading?l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):a.error?l.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:a.error instanceof Error?a.error.message:"Failed to load setting"}):l.jsxs("form",{onSubmit:g,children:[l.jsx(Wy,{label:"Repo URL",hint:"HTTPS URL of the Context Tree git repository for this team.",value:s,onChange:o,mono:!0,placeholder:"https://github.com/your-org/first-tree-context"}),l.jsx(Wy,{label:"Branch",hint:"Branch checked out by client agents on startup.",value:c,onChange:d,mono:!0,placeholder:"main",saved:m,rightSlot:l.jsx(pT,{pending:p.isPending,disabled:!a.data})}),p.error instanceof Error&&l.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:p.error.message})]})})}function RQ({isFirst:e=!1}){var h;const{organizationId:t,role:n}=yt(),a=n==="admin",s=Cn(),o=Ke({queryKey:["org-setting",t,"source_repos"],queryFn:()=>t?hT(t):Promise.reject(new Error("no org")),enabled:!!t}),c=bt({mutationFn:async p=>{var w;if(!t)throw new Error("organization not loaded");const x=(((w=o.data)==null?void 0:w.repos)??[]).filter(S=>S.url!==p);return mT(t,{repos:x})},onSuccess:p=>{s.setQueryData(["org-setting",t,"source_repos"],p)}}),d=((h=o.data)==null?void 0:h.repos)??[],m=d.length>0?l.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:d.length}):null;return l.jsxs($c,{title:"Source repos",description:a?"Repos your team's agents are bound to. New repos are added during agent onboarding.":"Repos your team's agents are bound to. Read-only — only admins can edit.",right:m,isFirst:e,children:[o.isLoading?l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):o.error?l.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:o.error instanceof Error?o.error.message:"Failed to load setting"}):d.length===0?l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:"No source repos bound yet."}):l.jsx("ul",{style:{listStyle:"none",margin:0,padding:0},children:d.map(p=>l.jsx(OQ,{url:p.url,defaultBranch:p.defaultBranch,isAdmin:a,isRemoving:c.isPending,onRemove:()=>c.mutate(p.url)},p.url))}),c.error instanceof Error&&l.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:c.error.message})]})}function OQ({url:e,defaultBranch:t,isAdmin:n,isRemoving:a,onRemove:s}){return l.jsxs("li",{className:"group flex items-center",style:{gap:"var(--sp-3)",padding:"var(--sp-2) var(--sp-2_5)",borderRadius:"var(--radius-input)"},children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-body mono",style:{color:"var(--fg)",overflowWrap:"anywhere"},children:e}),t&&l.jsxs("div",{className:"text-label",style:{color:"var(--fg-4)",marginTop:"var(--sp-0_5)"},children:["branch: ",t]})]}),n&&l.jsx("button",{type:"button","aria-label":`Remove ${e}`,disabled:a,onClick:s,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,border:0,borderRadius:"var(--radius-input)",background:"transparent",color:"var(--fg-3)",cursor:a?"not-allowed":"pointer",flexShrink:0},onMouseEnter:o=>{o.currentTarget.style.background="var(--surface-2)",o.currentTarget.style.color="var(--fg)"},onMouseLeave:o=>{o.currentTarget.style.background="transparent",o.currentTarget.style.color="var(--fg-3)"},children:l.jsx(os,{className:"h-3.5 w-3.5"})})]})}function zQ(e){return Ee.get(`/orgs/${encodeURIComponent(e)}`)}function MQ(e,t){return Ee.patch(`/orgs/${encodeURIComponent(e)}`,t)}function DQ({isFirst:e=!1}){const{organizationId:t}=yt(),n=Cn(),a=Ke({queryKey:["organization",t],queryFn:()=>t?zQ(t):Promise.reject(new Error("no org")),enabled:!!t}),[s,o]=b.useState(""),[c,d]=b.useState(!1);b.useEffect(()=>{a.data&&o(a.data.displayName)},[a.data]);const m=bt({mutationFn:()=>{if(!t||!a.data)throw new Error("organization not loaded");const p=s.trim();return!p||p===a.data.displayName?Promise.resolve(a.data):MQ(t,{displayName:p})},onSuccess:p=>{n.setQueryData(["organization",t],p),n.invalidateQueries({queryKey:["me-organizations"]}),d(!0),setTimeout(()=>d(!1),2e3)}}),h=p=>{p.preventDefault(),m.mutate()};return l.jsx($c,{title:"Identity",isFirst:e,children:a.isLoading?l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):a.error?l.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:a.error instanceof Error?a.error.message:"Failed to load team"}):l.jsxs("form",{onSubmit:h,children:[l.jsx(Wy,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:s,onChange:o,saved:c,rightSlot:l.jsx(pT,{pending:m.isPending,disabled:!a.data})}),m.error instanceof Error&&l.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:m.error.message})]})})}function IQ(){const{role:e}=yt(),t=e==="admin";return l.jsxs("div",{children:[t&&l.jsx(DQ,{isFirst:!0}),t&&l.jsx(AQ,{}),l.jsx(RQ,{isFirst:!t})]})}function LQ(){const{role:e}=yt();if(e===null)return l.jsx("div",{className:"text-body",style:{padding:"var(--sp-5)",color:"var(--fg-3)"},children:"Loading..."});const t=e==="admin"?"Identity, Context Tree, source repos":"Repos your team's agents are bound to";return l.jsxs(l.Fragment,{children:[l.jsx(al,{title:"Team settings",subtitle:t}),l.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:l.jsx(IQ,{})})]})}function eh(e){const t=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.filter&&t.set("filter",e.filter);const n=t.toString();return Ee.get(An(`/chats${n?`?${n}`:""}`))}function PQ(e){return Ee.post(An("/chats"),e)}function UQ(e){return Ee.post(`/chats/${encodeURIComponent(e)}/read`)}function gT(e,t){return Ee.post(`/chats/${encodeURIComponent(e)}/participants`,t)}function BQ(e){return Ee.post(`/chats/${encodeURIComponent(e)}/workspace-join`)}const th="draft";function $Q(e){if(!e)return"";const t=new Date(e),a=Date.now()-t.getTime();if(a<6e4)return"now";if(a<60*6e4)return`${Math.round(a/6e4)}m`;if(a<1440*6e4)return`${Math.round(a/36e5)}h`;const s=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),o=c=>{var d;return((d=s.find(m=>m.type===c))==null?void 0:d.value)??""};return`${o("month")}/${o("day")} ${o("hour")}:${o("minute")}`}function FQ(e){return e.membershipKind==="watching"?e.lastMessagePreview?`Watching · ${e.lastMessagePreview}`:"Watching":e.lastMessagePreview??""}function HQ({selectedChatId:e,onSelectChat:t,onNewChat:n}){const[a,s]=b.useState("all"),[o,c]=b.useState(""),[d,m]=b.useState([]),[h,p]=b.useState(!1),[g,x]=b.useState(null),{data:w,isLoading:S}=Ke({queryKey:["me","chats",a],queryFn:()=>eh({filter:a}),refetchInterval:15e3}),k=()=>{d.length>0&&m([]),x(null)},C=(w==null?void 0:w.rows)??[],E=b.useMemo(()=>[...C,...d],[C,d]),N=b.useMemo(()=>{const I=o.trim().toLowerCase();return I?E.filter(V=>V.title.toLowerCase().includes(I)||(V.lastMessagePreview??"").toLowerCase().includes(I)?!0:V.participants.map(be=>be.displayName.toLowerCase()).join(" ").includes(I)):E},[E,o]),R=async()=>{if(h)return;const I=w==null?void 0:w.nextCursor;if(I){p(!0),x(null);try{const V=await eh({filter:a,cursor:I});m(D=>[...D,...V.rows]),L(V.nextCursor)}catch(V){x(V instanceof Error?V.message:"Failed to load more")}finally{p(!1)}}},[z,L]=b.useState(null),O=(w==null?void 0:w.nextCursor)??null;b.useEffect(()=>{L(O)},[O]);const B=b.useMemo(()=>E.reduce((I,V)=>I+(V.unreadMentionCount>0?1:0),0),[E]);return l.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:320,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[l.jsxs("div",{className:"shrink-0 flex flex-col",style:{gap:6,padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[l.jsxs("button",{type:"button",onClick:n,className:"w-full inline-flex items-center transition-colors text-body hover:bg-[var(--bg-hover)]",style:{gap:6,padding:"var(--sp-1_25) var(--sp-2)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:e===th?"var(--bg-active)":"transparent",color:e===th?"var(--accent)":"var(--fg)",cursor:"pointer",fontWeight:500},title:"New chat",children:[l.jsx(xa,{className:"h-3.5 w-3.5",strokeWidth:2}),"New chat"]}),l.jsxs("div",{className:"flex items-center",style:{gap:8},children:[l.jsx("div",{className:"flex gap-1 shrink-0",children:B>0&&l.jsx(uT,{active:a==="unread",count:B,onClick:()=>{s(a==="unread"?"all":"unread"),k()},children:"unread"})}),l.jsxs("div",{className:"relative",style:{flex:1,minWidth:0},children:[l.jsx(uh,{className:"h-3 w-3 absolute pointer-events-none",style:{left:4,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),l.jsx("input",{value:o,onChange:I=>c(I.target.value),placeholder:"Search…",className:"w-full outline-none text-caption",style:{padding:"var(--sp-0_5) var(--sp-1) var(--sp-0_5) var(--sp-5)",background:"transparent",border:"none",color:"var(--fg-2)"}})]})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[S&&N.length===0&&l.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:"Loading…"}),!S&&N.length===0&&l.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:o?"No matches":l.jsxs(l.Fragment,{children:[l.jsx("p",{style:{margin:0},children:"No conversations yet."}),l.jsx("p",{className:"text-label",style:{margin:"var(--sp-1) 0 0",color:"var(--fg-4)"},children:"Start with New chat."})]})}),N.map(I=>{const V=e===I.chatId,D=FQ(I),K=D&&D!==I.title?D:"",ae=I.unreadMentionCount>0;return l.jsx("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:l.jsxs("button",{type:"button",onClick:()=>t(I.chatId),className:Me("w-full text-left transition-colors flex flex-col","hover:bg-[var(--bg-hover)]"),style:{padding:"var(--sp-2) var(--sp-3)",background:V?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${V?"var(--accent)":"transparent"}`},children:[l.jsxs("div",{className:"flex items-baseline",style:{gap:6},children:[ae&&l.jsx("span",{"aria-label":`${I.unreadMentionCount} unread mentions`,role:"status",style:{width:6,height:6,borderRadius:"50%",background:"var(--state-error)",flexShrink:0,alignSelf:"center"}}),l.jsx("span",{className:"truncate text-subtitle",style:{color:ae?"var(--fg)":"var(--fg-2)",fontWeight:ae?700:500,flex:1,minWidth:0},children:I.title}),I.lastMessageAt&&l.jsx("span",{className:"mono text-caption shrink-0",style:{color:"var(--fg-4)"},children:$Q(I.lastMessageAt)})]}),l.jsx("div",{className:"truncate text-body",style:{color:ae?"var(--fg-2)":"var(--fg-3)",marginTop:2},children:K||"—"})]})},I.chatId)}),z&&N.length>0&&l.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3)"},children:[l.jsx("button",{type:"button",onClick:R,disabled:h,className:"w-full text-body mono",style:{padding:"var(--sp-1_25) var(--sp-2)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",color:"var(--fg-2)",cursor:h?"default":"pointer",opacity:h?.6:1},children:h?"Loading…":"Load more"}),g&&l.jsx("p",{className:"mono text-caption",style:{color:"var(--state-error)",marginTop:4},children:g})]})]})]})}function yT(e){return Ee.get(`/chats/${encodeURIComponent(e)}`)}function qQ(e,t){return Ee.patch(`/chats/${encodeURIComponent(e)}`,{topic:t})}function jo(e,t){return Ee.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function ZQ(e,t){return Ee.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function GQ(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const s=a.result;if(typeof s!="string"){n(new Error("Unexpected FileReader result"));return}const o=s.indexOf(",");t(o>=0?s.slice(o+1):s)},a.onerror=()=>n(a.error??new Error("FileReader error")),a.readAsDataURL(e)})}function Sb(e){return Ee.post(`/agents/${encodeURIComponent(e)}/chats`,{})}function VQ(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 Ee.get(`/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}function kb(e){const t=new Map;for(const a of e)a.displayName&&t.set(a.displayName,(t.get(a.displayName)??0)+1);const n=new Set;for(const[a,s]of t)s>1&&n.add(a);return n}function QQ(e,t){return!e.name||!e.displayName?!1:e.displayName!==e.name?!0:t.has(e.displayName)}function jb({candidate:e,ambiguous:t}){const n=e.name?`@${e.name}`:"—";return l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"font-medium",children:e.displayName??n}),QQ(e,t)&&l.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",e.name]})]})}function KQ(e,t){if(t<=0||t>e.length)return null;let n=t-1;for(;n>=0;){const s=e[n];if(s===void 0)return null;if(s==="@")break;if(!/[A-Za-z0-9_-]/.test(s))return null;n--}if(n<0||e[n]!=="@")return null;if(n>0){const s=e[n-1];if(s!==void 0&&/[A-Za-z0-9_.@-]/.test(s))return null}const a=e.slice(n+1,t).toLowerCase();return{triggerIndex:n,query:a}}function qk(e,t){return(e.displayName??e.name??"").localeCompare(t.displayName??t.name??"")}function Cb(e){const t=e.filter(a=>a.managedByMe).sort(qk),n=e.filter(a=>!a.managedByMe).sort(qk);return t.length>0&&n.length>0?[...t,{divider:!0},...n]:[...t,...n]}function YQ(e,t){if(!t)return Cb(e).filter(a=>!("divider"in a)).slice(0,8);const n=[];for(const a of e){const s=(a.name??"").toLowerCase(),o=(a.displayName??"").toLowerCase();let c=1/0;s.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,s)=>a.score-s.score||(a.c.displayName??"").localeCompare(s.c.displayName??"")),n.slice(0,8).map(a=>a.c)}function XQ(e,t,n,a){if(!a.name)return null;const s=e.slice(0,t.triggerIndex),o=e.slice(n),c=`@${a.name}`,d=o.length===0||!/\s/.test(o[0]??""),m=d?` ${o}`:o,h=`${s}${c}${m}`,p=s.length+c.length+(d?1:0);return{text:h,cursor:p}}function vT({value:e,cursor:t,candidates:n,onSelect:a,disabled:s}){const[o,c]=b.useState(0),[d,m]=b.useState(null),h=b.useMemo(()=>s?null:KQ(e,t),[e,t,s]),p=b.useMemo(()=>h?YQ(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";b.useEffect(()=>{c(0)},[g]),b.useEffect(()=>{h===null&&d!==null&&m(null)},[h,d]);const x=d!==null&&h!==null&&d===h.triggerIndex,w=h!==null&&p.length>0&&!x;function S(){m((h==null?void 0:h.triggerIndex)??null)}function k(E){if(!h)return;const N=XQ(e,h,t,E);N&&a(N)}return{trigger:w?h:null,results:w?p:[],highlightIndex:o,handleKey:E=>{if(!w||!h)return!1;if(E.key==="ArrowDown")return E.preventDefault(),c(N=>p.length===0?0:(N+1)%p.length),!0;if(E.key==="ArrowUp")return E.preventDefault(),c(N=>p.length===0?0:(N-1+p.length)%p.length),!0;if(E.key==="Enter"||E.key==="Tab"){const N=p[o]??p[0];return N?(E.preventDefault(),k(N),!0):!1}return E.key==="Escape"?(E.preventDefault(),S(),!0):!1},pick:k,dismiss:S}}function bT({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:s}){const o=b.useRef(null);return b.useEffect(()=>{var m;const d=(m=o.current)==null?void 0:m.querySelector(`[data-mention-index="${n}"]`);d==null||d.scrollIntoView({block:"nearest"})},[n]),!e||t.length===0||!s.current?null:l.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:Me("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,minWidth:240,maxWidth:360,background:"var(--bg-raised)",borderColor:"var(--border)"},children:(()=>{const d=kb(t);return t.map((m,h)=>{const p=h===n;return l.jsx("button",{type:"button",role:"option","aria-selected":p,"data-mention-index":h,title:m.name?`@${m.name}`:void 0,onMouseDown:g=>{g.preventDefault(),a(m)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:p?"var(--bg-hover)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:l.jsx(jb,{candidate:m,ambiguous:d})},m.agentId)})})()})}function xT(e,t){b.useLayoutEffect(()=>{const n=e.current;n&&(n.style.height="auto",n.style.height=`${n.scrollHeight}px`)},[e,t])}function WQ({onCreated:e}){const t=Cn(),{agentId:n}=yt(),a=Lv(),[s,o]=b.useState([]),[c,d]=b.useState(""),[m,h]=b.useState(0),[p,g]=b.useState(null),[x,w]=b.useState(!1),[S,k]=b.useState(!1),C=b.useRef(null),E=b.useRef(!1),N=b.useRef(null);xT(C,c);const{data:R}=Ke({queryKey:["activity"],queryFn:Oc,refetchInterval:15e3}),z=b.useMemo(()=>{const W=(R==null?void 0:R.agents)??[],X=[];for(const Z of W){if(n&&Z.agentId===n)continue;const te=a(Z.agentId);!te||!te.name||X.push({agentId:Z.agentId,name:te.name,displayName:te.displayName,managedByMe:Z.managedByMe})}return X},[R,a,n]);b.useEffect(()=>{if(E.current||s.length>0||z.length===0)return;const W=eK(z,(R==null?void 0:R.agents)??[]);W&&(o([W]),E.current=!0)},[z,R,s.length]);const L=b.useMemo(()=>{const W=z.map(X=>({agentId:X.agentId,name:X.name}));return yN(c,W)},[c,z]),O=vT({value:c,cursor:m,candidates:z,disabled:x,onSelect:W=>{d(W.text),h(W.cursor),requestAnimationFrame(()=>{const X=C.current;X&&(X.focus(),X.setSelectionRange(W.cursor,W.cursor))})}});b.useEffect(()=>{L.length!==0&&o(W=>{const X=new Set(W);let Z=!1;for(const te of L)X.has(te)||(X.add(te),Z=!0);return Z?[...X]:W})},[L]),b.useEffect(()=>{if(!S)return;const W=X=>{N.current&&(N.current.contains(X.target)||k(!1))};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[S]);const B=bt({mutationFn:async({participantIds:W,text:X})=>{const Z=await PQ({participantIds:W}),te=X.trim();return te.length>0&&await jo(Z.chatId,te),Z.chatId},onSuccess:W=>{d(""),o([]),E.current=!1,t.invalidateQueries({queryKey:["me","chats"]}),e(W)},onError:W=>{g(W instanceof Error?W.message:"Failed to create chat")}}),I=b.useMemo(()=>!(x||B.isPending||s.length===0||c.trim().length===0||s.length>=2&&L.length===0),[x,B.isPending,s.length,c,L.length]),V=b.useMemo(()=>s.length===0?"Add at least one participant":c.trim().length===0?null:s.length>=2&&L.length===0?"Group chats need an @ to wake at least one participant":null,[s.length,c,L.length]),D=async()=>{if(!I)return;const W=Array.from(new Set([...s,...L]));g(null),w(!0);try{await B.mutateAsync({participantIds:W,text:c})}finally{w(!1)}},K=W=>{o(X=>X.filter(Z=>Z!==W))},ae=W=>{o(X=>X.includes(W)?X:[...X,W]),k(!1)},be=b.useMemo(()=>z.filter(W=>!s.includes(W.agentId)),[z,s]);return l.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",style:{background:"var(--bg-base)"},children:l.jsx("div",{className:"flex-1 flex flex-col items-center justify-center",style:{padding:"var(--sp-6)"},children:l.jsxs("div",{style:{width:"100%",maxWidth:"clamp(55rem, 75%, 70rem)"},children:[l.jsx("p",{className:"text-title",style:{color:"var(--fg)",textAlign:"center",marginBottom:"var(--sp-5)"},children:"What's the task?"}),l.jsxs("div",{style:{borderRadius:10,background:"var(--bg-raised)",boxShadow:"var(--shadow-md)",overflow:"visible"},children:[l.jsx(JQ,{chips:s,candidates:z,chipCandidates:be,pickerOpen:S,setPickerOpen:k,pickerContainerRef:N,onAdd:ae,onRemove:K}),l.jsxs("div",{style:{position:"relative"},children:[l.jsx(bT,{trigger:O.trigger,results:O.results,highlightIndex:O.highlightIndex,anchorRef:C,onPick:O.pick}),l.jsx("textarea",{ref:C,value:c,onChange:W=>{d(W.target.value),h(W.target.selectionStart??W.target.value.length)},onSelect:W=>{h(W.currentTarget.selectionStart??c.length)},placeholder:s.length>=2?"Describe the task. Use @ to address one or more.":"Describe the task…",rows:1,onKeyDown:W=>{O.handleKey(W)||W.key==="Enter"&&!W.shiftKey&&(W.preventDefault(),D())},disabled:x||B.isPending,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2) var(--sp-3)",background:"transparent",border:"none",maxHeight:"10.5rem",overflowY:"auto",resize:"none",color:"var(--fg)"}}),s.length>=2&&L.length===0&&c.trim().length>0&&l.jsxs("div",{"aria-hidden":"true",className:"text-subtitle font-normal",style:{position:"absolute",inset:0,padding:"var(--sp-2) var(--sp-3)",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",pointerEvents:"none",color:"transparent",overflow:"hidden"},children:[c,l.jsx("span",{style:{color:"var(--fg-4)"},children:" ← @ a group member to send"})]})]}),l.jsx("div",{className:"flex items-center justify-end",style:{padding:"var(--sp-1_5) var(--sp-2_5)"},children:l.jsx("button",{type:"button",onClick:()=>void D(),disabled:!I,title:V??"Send (Enter)","aria-label":"Send",className:Me("inline-flex items-center justify-center transition-opacity",!I&&"opacity-40 cursor-not-allowed"),style:{width:28,height:28,borderRadius:"var(--radius-input)",background:"var(--fg)",color:"var(--bg-raised)",border:"none"},children:l.jsx(fC,{className:"h-3.5 w-3.5",strokeWidth:2.5})})})]}),p&&l.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:8},children:p})]})})})}function JQ({chips:e,candidates:t,chipCandidates:n,pickerOpen:a,setPickerOpen:s,pickerContainerRef:o,onAdd:c,onRemove:d}){return l.jsxs("div",{className:"flex items-center flex-wrap",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) var(--sp-1)"},children:[e.map(m=>{const h=t.find(g=>g.agentId===m),p=(h==null?void 0:h.displayName)??(h==null?void 0:h.name)??m;return l.jsxs("span",{className:"group inline-flex items-center text-label",style:{gap:2,padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-sunken)",color:"var(--fg)"},children:[l.jsx("span",{children:p}),l.jsx("button",{type:"button",onClick:()=>d(m),title:"Remove participant",className:"opacity-0 group-hover:opacity-100 transition-opacity",style:{background:"none",border:"none",padding:0,marginLeft:2,cursor:"pointer",color:"var(--fg-3)",display:"inline-flex",alignItems:"center"},children:l.jsx(os,{className:"h-3 w-3"})})]},m)}),l.jsxs("div",{ref:o,style:{position:"relative"},children:[l.jsx("button",{type:"button",onClick:()=>s(!a),title:"Add participant","aria-label":"Add participant",disabled:n.length===0,className:"inline-flex items-center transition-colors hover:bg-[var(--bg-sunken)]",style:{padding:"var(--sp-0_5) var(--sp-1)",borderRadius:"var(--radius-chip)",border:"var(--hairline) solid var(--border)",background:"transparent",color:n.length===0?"var(--fg-4)":"var(--fg-3)",cursor:n.length===0?"not-allowed":"pointer"},children:l.jsx(xa,{className:"h-3 w-3"})}),a&&n.length>0&&l.jsx("div",{role:"listbox","aria-label":"Add participant",className:"absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg",style:{top:"calc(100% + var(--sp-1))",left:0,minWidth:280,background:"var(--bg-raised)",borderColor:"var(--border)"},children:(()=>{const m=kb(n);return Cb(n).map(h=>"divider"in h?l.jsx("div",{role:"presentation",style:{height:"var(--hairline)",background:"var(--border-faint)",margin:"var(--sp-0_5) var(--sp-3)"}},"__divider"):l.jsx("button",{type:"button",role:"option","aria-selected":"false",title:h.name?`@${h.name}`:void 0,onClick:()=>c(h.agentId),className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:l.jsx(jb,{candidate:h,ambiguous:m})},h.agentId))})()})]})]})}function eK(e,t){var c;const n=new Set(e.map(d=>d.agentId)),a=t.filter(d=>n.has(d.agentId)&&d.managedByMe);if(a.length===0)return null;const s=[...a].filter(d=>d.runtimeUpdatedAt).sort((d,m)=>(m.runtimeUpdatedAt??"").localeCompare(d.runtimeUpdatedAt??""))[0];if(s)return s.agentId;const o=a.find(d=>d.type==="personal_assistant");return o?o.agentId:((c=a[0])==null?void 0:c.agentId)??null}const tK="first-tree-hub-images",nK=1,Co="images";let jf=null;function wT(){return jf||(jf=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(tK,nK);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Co)||n.createObjectStore(Co,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),jf)}async function rK(e){const t=await wT();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const s=t.transaction(Co,"readwrite"),o=s.objectStore(Co),c={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(c),s.oncomplete=()=>n(),s.onerror=()=>a(s.error??new Error("Image storage write failed")),s.onabort=()=>a(s.error??new Error("Image storage write aborted"))})}async function aK(e){const t=await wT();return t?new Promise(n=>{const o=t.transaction(Co,"readonly").objectStore(Co).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 iK(e,t,n){return Ee.post(`/chats/${encodeURIComponent(e)}/questions/${encodeURIComponent(t)}/answer`,{answers:n})}/*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */const{entries:ST,setPrototypeOf:Zk,isFrozen:sK,getPrototypeOf:lK,getOwnPropertyDescriptor:oK}=Object;let{freeze:dr,seal:sa,create:Kl}=Object,{apply:Jy,construct:ev}=typeof Reflect<"u"&&Reflect;dr||(dr=function(t){return t});sa||(sa=function(t){return t});Jy||(Jy=function(t,n){for(var a=arguments.length,s=new Array(a>2?a-2:0),o=2;o<a;o++)s[o-2]=arguments[o];return t.apply(n,s)});ev||(ev=function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),s=1;s<n;s++)a[s-1]=arguments[s];return new t(...a)});const qu=jn(Array.prototype.forEach),uK=jn(Array.prototype.lastIndexOf),Gk=jn(Array.prototype.pop),Zu=jn(Array.prototype.push),cK=jn(Array.prototype.splice),sr=Array.isArray,Xu=jn(String.prototype.toLowerCase),Bg=jn(String.prototype.toString),Vk=jn(String.prototype.match),Zl=jn(String.prototype.replace),Qk=jn(String.prototype.indexOf),dK=jn(String.prototype.trim),fK=jn(Number.prototype.toString),hK=jn(Boolean.prototype.toString),Kk=typeof BigInt>"u"?null:jn(BigInt.prototype.toString),Yk=typeof Symbol>"u"?null:jn(Symbol.prototype.toString),rn=jn(Object.prototype.hasOwnProperty),Gu=jn(Object.prototype.toString),qn=jn(RegExp.prototype.test),Cf=mK(TypeError);function jn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),s=1;s<n;s++)a[s-1]=arguments[s];return Jy(e,t,a)}}function mK(e){return function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return ev(e,n)}}function We(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xu;if(Zk&&Zk(e,null),!sr(t))return e;let a=t.length;for(;a--;){let s=t[a];if(typeof s=="string"){const o=n(s);o!==s&&(sK(t)||(t[a]=o),s=o)}e[s]=!0}return e}function pK(e){for(let t=0;t<e.length;t++)rn(e,t)||(e[t]=null);return e}function wr(e){const t=Kl(null);for(const[n,a]of ST(e))rn(e,n)&&(sr(a)?t[n]=pK(a):a&&typeof a=="object"&&a.constructor===Object?t[n]=wr(a):t[n]=a);return t}function gK(e){switch(typeof e){case"string":return e;case"number":return fK(e);case"boolean":return hK(e);case"bigint":return Kk?Kk(e):"0";case"symbol":return Yk?Yk(e):"Symbol()";case"undefined":return Gu(e);case"function":case"object":{if(e===null)return Gu(e);const t=e,n=Yl(t,"toString");if(typeof n=="function"){const a=n(t);return typeof a=="string"?a:Gu(a)}return Gu(e)}default:return Gu(e)}}function Yl(e,t){for(;e!==null;){const a=oK(e,t);if(a){if(a.get)return jn(a.get);if(typeof a.value=="function")return jn(a.value)}e=lK(e)}function n(){return null}return n}function yK(e){try{return qn(e,""),!0}catch{return!1}}const Xk=dr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$g=dr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Fg=dr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vK=dr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hg=dr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),bK=dr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wk=dr(["#text"]),Jk=dr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),qg=dr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ej=dr(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ef=dr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xK=sa(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wK=sa(/<%[\w\W]*|[\w\W]*%>/gm),SK=sa(/\$\{[\w\W]*/gm),kK=sa(/^data-[\-\w.\u00B7-\uFFFF]+$/),jK=sa(/^aria-[\-\w]+$/),kT=sa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),CK=sa(/^(?:\w+script|data):/i),EK=sa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jT=sa(/^html$/i),NK=sa(/^[a-z][.\w]*(-[.\w]+)+$/i);var tj=Object.freeze({__proto__:null,ARIA_ATTR:jK,ATTR_WHITESPACE:EK,CUSTOM_ELEMENT:NK,DATA_ATTR:kK,DOCTYPE_NAME:jT,ERB_EXPR:wK,IS_ALLOWED_URI:kT,IS_SCRIPT_OR_DATA:CK,MUSTACHE_EXPR:xK,TMPLIT_EXPR:SK});const Vu={element:1,text:3,progressingInstruction:7,comment:8,document:9},_K=function(){return typeof window>"u"?null:window},TK=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let a=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(a=n.getAttribute(s));const o="dompurify"+(a?"#"+a:"");try{return t.createPolicy(o,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},nj=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function CT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_K();const t=Pe=>CT(Pe);if(t.version="3.4.2",t.removed=[],!e||!e.document||e.document.nodeType!==Vu.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const a=n,s=a.currentScript,{DocumentFragment:o,HTMLTemplateElement:c,Node:d,Element:m,NodeFilter:h,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:x,trustedTypes:w}=e,S=m.prototype,k=Yl(S,"cloneNode"),C=Yl(S,"remove"),E=Yl(S,"nextSibling"),N=Yl(S,"childNodes"),R=Yl(S,"parentNode");if(typeof c=="function"){const Pe=n.createElement("template");Pe.content&&Pe.content.ownerDocument&&(n=Pe.content.ownerDocument)}let z,L="";const{implementation:O,createNodeIterator:B,createDocumentFragment:I,getElementsByTagName:V}=n,{importNode:D}=a;let K=nj();t.isSupported=typeof ST=="function"&&typeof R=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ae,ERB_EXPR:be,TMPLIT_EXPR:W,DATA_ATTR:X,ARIA_ATTR:Z,IS_SCRIPT_OR_DATA:te,ATTR_WHITESPACE:je,CUSTOM_ELEMENT:Ae}=tj;let{IS_ALLOWED_URI:M}=tj,P=null;const $=We({},[...Xk,...$g,...Fg,...Hg,...Wk]);let T=null;const G=We({},[...Jk,...qg,...ej,...Ef]);let q=Object.seal(Kl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),re=null,xe=null;const we=Object.seal(Kl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let me=!0,Ie=!0,Ue=!1,ft=!0,ut=!1,ie=!0,le=!1,ve=!1,Re=!1,St=!1,Ft=!1,Pn=!1,hr=!0,pi=!1;const gi="user-content-";let un=!0,da=!1,ue={},ge=null;const $e=We({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const at=We({},["audio","video","img","source","image","track"]);let cn=null;const tr=We({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ht="http://www.w3.org/1998/Math/MathML",Lt="http://www.w3.org/2000/svg",At="http://www.w3.org/1999/xhtml";let it=At,nr=!1,zn=null;const il=We({},[Ht,Lt,At],Bg);let fa=We({},["mi","mo","mn","ms","mtext"]),ha=We({},["annotation-xml"]);const Ma=We({},["title","style","font","a","script"]);let Vn=null;const Da=["application/xhtml+xml","text/html"],Sa="text/html";let qt=null,Ce=null;const tt=n.createElement("form"),pn=function(F){return F instanceof RegExp||F instanceof Function},Ar=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ce&&Ce===F)return;(!F||typeof F!="object")&&(F={}),F=wr(F),Vn=Da.indexOf(F.PARSER_MEDIA_TYPE)===-1?Sa:F.PARSER_MEDIA_TYPE,qt=Vn==="application/xhtml+xml"?Bg:Xu,P=rn(F,"ALLOWED_TAGS")&&sr(F.ALLOWED_TAGS)?We({},F.ALLOWED_TAGS,qt):$,T=rn(F,"ALLOWED_ATTR")&&sr(F.ALLOWED_ATTR)?We({},F.ALLOWED_ATTR,qt):G,zn=rn(F,"ALLOWED_NAMESPACES")&&sr(F.ALLOWED_NAMESPACES)?We({},F.ALLOWED_NAMESPACES,Bg):il,cn=rn(F,"ADD_URI_SAFE_ATTR")&&sr(F.ADD_URI_SAFE_ATTR)?We(wr(tr),F.ADD_URI_SAFE_ATTR,qt):tr,Ve=rn(F,"ADD_DATA_URI_TAGS")&&sr(F.ADD_DATA_URI_TAGS)?We(wr(at),F.ADD_DATA_URI_TAGS,qt):at,ge=rn(F,"FORBID_CONTENTS")&&sr(F.FORBID_CONTENTS)?We({},F.FORBID_CONTENTS,qt):$e,re=rn(F,"FORBID_TAGS")&&sr(F.FORBID_TAGS)?We({},F.FORBID_TAGS,qt):wr({}),xe=rn(F,"FORBID_ATTR")&&sr(F.FORBID_ATTR)?We({},F.FORBID_ATTR,qt):wr({}),ue=rn(F,"USE_PROFILES")?F.USE_PROFILES&&typeof F.USE_PROFILES=="object"?wr(F.USE_PROFILES):F.USE_PROFILES:!1,me=F.ALLOW_ARIA_ATTR!==!1,Ie=F.ALLOW_DATA_ATTR!==!1,Ue=F.ALLOW_UNKNOWN_PROTOCOLS||!1,ft=F.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ut=F.SAFE_FOR_TEMPLATES||!1,ie=F.SAFE_FOR_XML!==!1,le=F.WHOLE_DOCUMENT||!1,St=F.RETURN_DOM||!1,Ft=F.RETURN_DOM_FRAGMENT||!1,Pn=F.RETURN_TRUSTED_TYPE||!1,Re=F.FORCE_BODY||!1,hr=F.SANITIZE_DOM!==!1,pi=F.SANITIZE_NAMED_PROPS||!1,un=F.KEEP_CONTENT!==!1,da=F.IN_PLACE||!1,M=yK(F.ALLOWED_URI_REGEXP)?F.ALLOWED_URI_REGEXP:kT,it=typeof F.NAMESPACE=="string"?F.NAMESPACE:At,fa=rn(F,"MATHML_TEXT_INTEGRATION_POINTS")&&F.MATHML_TEXT_INTEGRATION_POINTS&&typeof F.MATHML_TEXT_INTEGRATION_POINTS=="object"?wr(F.MATHML_TEXT_INTEGRATION_POINTS):We({},["mi","mo","mn","ms","mtext"]),ha=rn(F,"HTML_INTEGRATION_POINTS")&&F.HTML_INTEGRATION_POINTS&&typeof F.HTML_INTEGRATION_POINTS=="object"?wr(F.HTML_INTEGRATION_POINTS):We({},["annotation-xml"]);const pe=rn(F,"CUSTOM_ELEMENT_HANDLING")&&F.CUSTOM_ELEMENT_HANDLING&&typeof F.CUSTOM_ELEMENT_HANDLING=="object"?wr(F.CUSTOM_ELEMENT_HANDLING):Kl(null);if(q=Kl(null),rn(pe,"tagNameCheck")&&pn(pe.tagNameCheck)&&(q.tagNameCheck=pe.tagNameCheck),rn(pe,"attributeNameCheck")&&pn(pe.attributeNameCheck)&&(q.attributeNameCheck=pe.attributeNameCheck),rn(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(q.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),ut&&(Ie=!1),Ft&&(St=!0),ue&&(P=We({},Wk),T=Kl(null),ue.html===!0&&(We(P,Xk),We(T,Jk)),ue.svg===!0&&(We(P,$g),We(T,qg),We(T,Ef)),ue.svgFilters===!0&&(We(P,Fg),We(T,qg),We(T,Ef)),ue.mathMl===!0&&(We(P,Hg),We(T,ej),We(T,Ef))),we.tagCheck=null,we.attributeCheck=null,rn(F,"ADD_TAGS")&&(typeof F.ADD_TAGS=="function"?we.tagCheck=F.ADD_TAGS:sr(F.ADD_TAGS)&&(P===$&&(P=wr(P)),We(P,F.ADD_TAGS,qt))),rn(F,"ADD_ATTR")&&(typeof F.ADD_ATTR=="function"?we.attributeCheck=F.ADD_ATTR:sr(F.ADD_ATTR)&&(T===G&&(T=wr(T)),We(T,F.ADD_ATTR,qt))),rn(F,"ADD_URI_SAFE_ATTR")&&sr(F.ADD_URI_SAFE_ATTR)&&We(cn,F.ADD_URI_SAFE_ATTR,qt),rn(F,"FORBID_CONTENTS")&&sr(F.FORBID_CONTENTS)&&(ge===$e&&(ge=wr(ge)),We(ge,F.FORBID_CONTENTS,qt)),rn(F,"ADD_FORBID_CONTENTS")&&sr(F.ADD_FORBID_CONTENTS)&&(ge===$e&&(ge=wr(ge)),We(ge,F.ADD_FORBID_CONTENTS,qt)),un&&(P["#text"]=!0),le&&We(P,["html","head","body"]),P.table&&(We(P,["tbody"]),delete re.tbody),F.TRUSTED_TYPES_POLICY){if(typeof F.TRUSTED_TYPES_POLICY.createHTML!="function")throw Cf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof F.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Cf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');z=F.TRUSTED_TYPES_POLICY,L=z.createHTML("")}else z===void 0&&(z=TK(w,s)),z!==null&&typeof L=="string"&&(L=z.createHTML(""));dr&&dr(F),Ce=F},yi=We({},[...$g,...Fg,...vK]),ys=We({},[...Hg,...bK]),Fc=function(F){let pe=R(F);(!pe||!pe.tagName)&&(pe={namespaceURI:it,tagName:"template"});const Ne=Xu(F.tagName),wt=Xu(pe.tagName);return zn[F.namespaceURI]?F.namespaceURI===Lt?pe.namespaceURI===At?Ne==="svg":pe.namespaceURI===Ht?Ne==="svg"&&(wt==="annotation-xml"||fa[wt]):!!yi[Ne]:F.namespaceURI===Ht?pe.namespaceURI===At?Ne==="math":pe.namespaceURI===Lt?Ne==="math"&&ha[wt]:!!ys[Ne]:F.namespaceURI===At?pe.namespaceURI===Lt&&!ha[wt]||pe.namespaceURI===Ht&&!fa[wt]?!1:!ys[Ne]&&(Ma[Ne]||!yi[Ne]):!!(Vn==="application/xhtml+xml"&&zn[F.namespaceURI]):!1},rr=function(F){Zu(t.removed,{element:F});try{R(F).removeChild(F)}catch{C(F)}},ma=function(F,pe){try{Zu(t.removed,{attribute:pe.getAttributeNode(F),from:pe})}catch{Zu(t.removed,{attribute:null,from:pe})}if(pe.removeAttribute(F),F==="is")if(St||Ft)try{rr(pe)}catch{}else try{pe.setAttribute(F,"")}catch{}},Lo=function(F){let pe=null,Ne=null;if(Re)F="<remove></remove>"+F;else{const Xt=Vk(F,/^[\r\n\t ]+/);Ne=Xt&&Xt[0]}Vn==="application/xhtml+xml"&&it===At&&(F='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+F+"</body></html>");const wt=z?z.createHTML(F):F;if(it===At)try{pe=new x().parseFromString(wt,Vn)}catch{}if(!pe||!pe.documentElement){pe=O.createDocument(it,"template",null);try{pe.documentElement.innerHTML=nr?L:wt}catch{}}const ht=pe.body||pe.documentElement;return F&&Ne&&ht.insertBefore(n.createTextNode(Ne),ht.childNodes[0]||null),it===At?V.call(pe,le?"html":"body")[0]:le?pe.documentElement:ht},Po=function(F){return B.call(F.ownerDocument||F,F,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Hr=function(F){return F instanceof g&&(typeof F.nodeName!="string"||typeof F.textContent!="string"||typeof F.removeChild!="function"||!(F.attributes instanceof p)||typeof F.removeAttribute!="function"||typeof F.setAttribute!="function"||typeof F.namespaceURI!="string"||typeof F.insertBefore!="function"||typeof F.hasChildNodes!="function")},dn=function(F){return typeof d=="function"&&F instanceof d};function Zt(Pe,F,pe){qu(Pe,Ne=>{Ne.call(t,F,pe,Ce)})}const Ia=function(F){let pe=null;if(Zt(K.beforeSanitizeElements,F,null),Hr(F))return rr(F),!0;const Ne=qt(F.nodeName);if(Zt(K.uponSanitizeElement,F,{tagName:Ne,allowedTags:P}),ie&&F.hasChildNodes()&&!dn(F.firstElementChild)&&qn(/<[/\w!]/g,F.innerHTML)&&qn(/<[/\w!]/g,F.textContent)||ie&&F.namespaceURI===At&&Ne==="style"&&dn(F.firstElementChild)||F.nodeType===Vu.progressingInstruction||ie&&F.nodeType===Vu.comment&&qn(/<[/\w]/g,F.data))return rr(F),!0;if(re[Ne]||!(we.tagCheck instanceof Function&&we.tagCheck(Ne))&&!P[Ne]){if(!re[Ne]&&Hc(Ne)&&(q.tagNameCheck instanceof RegExp&&qn(q.tagNameCheck,Ne)||q.tagNameCheck instanceof Function&&q.tagNameCheck(Ne)))return!1;if(un&&!ge[Ne]){const wt=R(F)||F.parentNode,ht=N(F)||F.childNodes;if(ht&&wt){const Xt=ht.length;for(let Un=Xt-1;Un>=0;--Un){const gn=k(ht[Un],!0);wt.insertBefore(gn,E(F))}}}return rr(F),!0}return F instanceof m&&!Fc(F)||(Ne==="noscript"||Ne==="noembed"||Ne==="noframes")&&qn(/<\/no(script|embed|frames)/i,F.innerHTML)?(rr(F),!0):(ut&&F.nodeType===Vu.text&&(pe=F.textContent,qu([ae,be,W],wt=>{pe=Zl(pe,wt," ")}),F.textContent!==pe&&(Zu(t.removed,{element:F.cloneNode()}),F.textContent=pe)),Zt(K.afterSanitizeElements,F,null),!1)},sl=function(F,pe,Ne){if(xe[pe]||hr&&(pe==="id"||pe==="name")&&(Ne in n||Ne in tt))return!1;const wt=T[pe]||we.attributeCheck instanceof Function&&we.attributeCheck(pe,F);if(!(Ie&&!xe[pe]&&qn(X,pe))){if(!(me&&qn(Z,pe))){if(!wt||xe[pe]){if(!(Hc(F)&&(q.tagNameCheck instanceof RegExp&&qn(q.tagNameCheck,F)||q.tagNameCheck instanceof Function&&q.tagNameCheck(F))&&(q.attributeNameCheck instanceof RegExp&&qn(q.attributeNameCheck,pe)||q.attributeNameCheck instanceof Function&&q.attributeNameCheck(pe,F))||pe==="is"&&q.allowCustomizedBuiltInElements&&(q.tagNameCheck instanceof RegExp&&qn(q.tagNameCheck,Ne)||q.tagNameCheck instanceof Function&&q.tagNameCheck(Ne))))return!1}else if(!cn[pe]){if(!qn(M,Zl(Ne,je,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&F!=="script"&&Qk(Ne,"data:")===0&&Ve[F])){if(!(Ue&&!qn(te,Zl(Ne,je,"")))){if(Ne)return!1}}}}}}return!0},Lh=We({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Hc=function(F){return!Lh[Xu(F)]&&qn(Ae,F)},Uo=function(F){Zt(K.beforeSanitizeAttributes,F,null);const{attributes:pe}=F;if(!pe||Hr(F))return;const Ne={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:T,forceKeepAttr:void 0};let wt=pe.length;for(;wt--;){const ht=pe[wt],{name:Xt,namespaceURI:Un,value:gn}=ht,Mn=qt(Xt),Bo=gn;let fn=Xt==="value"?Bo:dK(Bo);if(Ne.attrName=Mn,Ne.attrValue=fn,Ne.keepAttr=!0,Ne.forceKeepAttr=void 0,Zt(K.uponSanitizeAttribute,F,Ne),fn=Ne.attrValue,pi&&(Mn==="id"||Mn==="name")&&Qk(fn,gi)!==0&&(ma(Xt,F),fn=gi+fn),ie&&qn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,fn)){ma(Xt,F);continue}if(Mn==="attributename"&&Vk(fn,"href")){ma(Xt,F);continue}if(Ne.forceKeepAttr)continue;if(!Ne.keepAttr){ma(Xt,F);continue}if(!ft&&qn(/\/>/i,fn)){ma(Xt,F);continue}ut&&qu([ae,be,W],qc=>{fn=Zl(fn,qc," ")});const $o=qt(F.nodeName);if(!sl($o,Mn,fn)){ma(Xt,F);continue}if(z&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Un)switch(w.getAttributeType($o,Mn)){case"TrustedHTML":{fn=z.createHTML(fn);break}case"TrustedScriptURL":{fn=z.createScriptURL(fn);break}}if(fn!==Bo)try{Un?F.setAttributeNS(Un,Xt,fn):F.setAttribute(Xt,fn),Hr(F)?rr(F):Gk(t.removed)}catch{ma(Xt,F)}}Zt(K.afterSanitizeAttributes,F,null)},vi=function(F){let pe=null;const Ne=Po(F);for(Zt(K.beforeSanitizeShadowDOM,F,null);pe=Ne.nextNode();)Zt(K.uponSanitizeShadowNode,pe,null),Ia(pe),Uo(pe),pe.content instanceof o&&vi(pe.content);Zt(K.afterSanitizeShadowDOM,F,null)};return t.sanitize=function(Pe){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,Ne=null,wt=null,ht=null;if(nr=!Pe,nr&&(Pe="<!-->"),typeof Pe!="string"&&!dn(Pe)&&(Pe=gK(Pe),typeof Pe!="string"))throw Cf("dirty is not a string, aborting");if(!t.isSupported)return Pe;if(ve||Ar(F),t.removed=[],typeof Pe=="string"&&(da=!1),da){const gn=Pe.nodeName;if(typeof gn=="string"){const Mn=qt(gn);if(!P[Mn]||re[Mn])throw Cf("root node is forbidden and cannot be sanitized in-place")}}else if(Pe instanceof d)pe=Lo("<!---->"),Ne=pe.ownerDocument.importNode(Pe,!0),Ne.nodeType===Vu.element&&Ne.nodeName==="BODY"||Ne.nodeName==="HTML"?pe=Ne:pe.appendChild(Ne);else{if(!St&&!ut&&!le&&Pe.indexOf("<")===-1)return z&&Pn?z.createHTML(Pe):Pe;if(pe=Lo(Pe),!pe)return St?null:Pn?L:""}pe&&Re&&rr(pe.firstChild);const Xt=Po(da?Pe:pe);for(;wt=Xt.nextNode();)Ia(wt),Uo(wt),wt.content instanceof o&&vi(wt.content);if(da)return Pe;if(St){if(ut){pe.normalize();let gn=pe.innerHTML;qu([ae,be,W],Mn=>{gn=Zl(gn,Mn," ")}),pe.innerHTML=gn}if(Ft)for(ht=I.call(pe.ownerDocument);pe.firstChild;)ht.appendChild(pe.firstChild);else ht=pe;return(T.shadowroot||T.shadowrootmode)&&(ht=D.call(a,ht,!0)),ht}let Un=le?pe.outerHTML:pe.innerHTML;return le&&P["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&qn(jT,pe.ownerDocument.doctype.name)&&(Un="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
|
|
417
|
+
`+Un),ut&&qu([ae,be,W],gn=>{Un=Zl(Un,gn," ")}),z&&Pn?z.createHTML(Un):Un},t.setConfig=function(){let Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ar(Pe),ve=!0},t.clearConfig=function(){Ce=null,ve=!1},t.isValidAttribute=function(Pe,F,pe){Ce||Ar({});const Ne=qt(Pe),wt=qt(F);return sl(Ne,wt,pe)},t.addHook=function(Pe,F){typeof F=="function"&&Zu(K[Pe],F)},t.removeHook=function(Pe,F){if(F!==void 0){const pe=uK(K[Pe],F);return pe===-1?void 0:cK(K[Pe],pe,1)[0]}return Gk(K[Pe])},t.removeHooks=function(Pe){K[Pe]=[]},t.removeAllHooks=function(){K=nj()},t}var AK=CT();function RK({option:e,previewFormat:t,selected:n,disabled:a,showCheckmark:s,onToggle:o}){const c=b.useMemo(()=>!e.preview||t!=="html"?null:AK.sanitize(e.preview,{USE_PROFILES:{html:!0}}),[e.preview,t]);return l.jsxs("button",{type:"button",disabled:a,onClick:a?void 0:o,className:Me("w-full text-left rounded-[var(--radius-input)] border transition-colors","flex flex-col",a?"cursor-default opacity-70":"cursor-pointer hover:bg-[color:var(--bg-hover)]"),style:{padding:"var(--sp-2_5) var(--sp-3)",gap:"var(--sp-1_5)",borderColor:n?"var(--accent)":"var(--border)",background:n?"var(--bg-active)":"var(--bg-raised)"},children:[e.preview?t==="html"&&c?l.jsx("div",{dangerouslySetInnerHTML:{__html:c},className:"max-h-[20rem] overflow-auto rounded-[var(--radius-input)] border",style:{padding:"var(--sp-2)",borderColor:"var(--border)",background:"var(--bg-sunken)"}}):t==="markdown"?l.jsx("div",{className:"max-h-[20rem] overflow-auto rounded-[var(--radius-input)] border",style:{padding:"var(--sp-2)",borderColor:"var(--border)",background:"var(--bg-sunken)"},children:l.jsx(zh,{children:e.preview})}):null:null,l.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)"},children:[l.jsx("span",{className:"mono text-body font-semibold",style:{color:n?"var(--accent)":"var(--fg)"},children:e.label}),s&&n?l.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Selected",children:"✓"}):null]}),e.description?l.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.description}):null]})}const eo="__free_text__";function Qu(){return{picked:[],freeText:""}}function rj(e,t){if(t.picked.includes(eo)){const n=t.freeText.trim();return n.length===0?null:n}return t.picked.length===0?null:e.multiSelect?t.picked.join(", "):t.picked[0]??null}function OK({chatId:e,questionMessageId:t,content:n,answer:a,status:s}){const o=s==="pending",c=s==="answered",d=s==="superseded",[m,h]=b.useState(()=>{const C={};for(const E of n.questions)C[E.question]=Qu();return C});b.useEffect(()=>{if(!a)return;const C={};for(const E of n.questions){const N=a.answers[E.question];if(!N){C[E.question]=Qu();continue}const R=new Set(E.options.map(O=>O.label)),z=E.multiSelect?N.split(/,\s*/u):[N],L=z.filter(O=>R.has(O));L.length===z.length&&L.length>0?C[E.question]={picked:L,freeText:""}:C[E.question]={picked:[eo],freeText:N}}h(C)},[a,n.questions]);const p=Cn(),[g,x]=b.useState(null),w=bt({mutationFn:async C=>iK(e,n.correlationId,C),onSuccess:()=>{x(null),p.invalidateQueries({queryKey:["chat-messages",e]})},onError:C=>{x(C instanceof Error?C.message:String(C))}}),S=b.useCallback(()=>{x(null);const C={};for(const E of n.questions){const N=m[E.question]??Qu(),R=rj(E,N);if(R===null){x(`Please answer "${E.question}" before submitting.`);return}C[E.question]=R}w.mutate(C)},[n.questions,m,w]),k=b.useMemo(()=>n.questions.every(C=>{const E=m[C.question]??Qu();return rj(C,E)!==null}),[n.questions,m]);return l.jsxs("div",{className:Me("rounded-[var(--radius-panel)] border flex flex-col",o?"":"opacity-80"),style:{padding:"var(--sp-3)",gap:"var(--sp-3)",borderColor:o?"var(--accent)":"var(--border)",background:"var(--bg-raised)"},children:[l.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)"},children:[l.jsx("span",{className:"mono text-eyebrow font-semibold",style:{color:o?"var(--accent)":"var(--fg-3)"},children:"AGENT QUESTION"}),c?l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:"• Answered"}):null,d?l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"• Superseded"}):null]}),l.jsx("div",{className:"flex flex-col",style:{gap:"var(--sp-4)"},children:n.questions.map(C=>l.jsx(zK,{question:C,previewFormat:n.previewFormat,selection:m[C.question]??Qu(),allowFreeText:n.allowFreeText,disabled:!o,showAnsweredCheck:c||d,onChange:E=>h(N=>({...N,[C.question]:E}))},C.question))}),o?l.jsxs("div",{className:"flex items-center justify-end",style:{gap:"var(--sp-2)"},children:[g?l.jsx("span",{className:"text-caption",style:{color:"var(--state-danger)"},children:g}):null,l.jsx(ye,{type:"button",disabled:!k||w.isPending,onClick:S,children:w.isPending?"Submitting…":"Submit answer"})]}):null]})}function zK({question:e,previewFormat:t,selection:n,allowFreeText:a,disabled:s,showAnsweredCheck:o,onChange:c}){const d=b.useRef(null),m=n.picked.includes(eo);b.useEffect(()=>{var p;m&&!s&&((p=d.current)==null||p.focus())},[m,s]);const h=b.useCallback(p=>{const g=n.picked.includes(p);let x;e.multiSelect?x=g?n.picked.filter(w=>w!==p):[...n.picked,p]:x=g?[]:[p],c({...n,picked:x})},[e.multiSelect,n,c]);return l.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[l.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)"},children:[l.jsx("span",{className:"mono text-eyebrow font-semibold",style:{color:"var(--fg-2)"},children:e.header}),e.multiSelect?l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"(pick any)"}):null]}),l.jsx("div",{className:"text-body",style:{color:"var(--fg)"},children:e.question}),l.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-1_5)"},children:[e.options.map(p=>l.jsx(RK,{option:p,previewFormat:t,selected:n.picked.includes(p.label),disabled:s,showCheckmark:o,onToggle:()=>h(p.label)},p.label)),a?l.jsxs("button",{type:"button",disabled:s,onClick:s?void 0:()=>c({picked:e.multiSelect?m?n.picked.filter(p=>p!==eo):[...n.picked,eo]:m?[]:[eo],freeText:n.freeText}),className:Me("w-full text-left rounded-[var(--radius-input)] border transition-colors","flex flex-col",s?"cursor-default opacity-70":"cursor-pointer hover:bg-[color:var(--bg-hover)]"),style:{padding:"var(--sp-2_5) var(--sp-3)",gap:"var(--sp-1_5)",borderColor:m?"var(--accent)":"var(--border)",background:m?"var(--bg-active)":"var(--bg-raised)"},children:[l.jsx("span",{className:"mono text-body font-semibold",style:{color:m?"var(--accent)":"var(--fg-3)"},children:"Other…"}),l.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:"Type a free-text answer."}),m?l.jsx("textarea",{ref:d,value:n.freeText,disabled:s,onChange:p=>c({...n,freeText:p.target.value}),onClick:p=>p.stopPropagation(),onKeyDown:p=>{p.key==="Enter"&&!p.metaKey&&!p.ctrlKey&&p.stopPropagation()},rows:2,className:"rounded-[var(--radius-input)] border text-body",style:{padding:"var(--sp-2)",borderColor:"var(--border)",background:"var(--bg-sunken)",color:"var(--fg)",resize:"vertical"}}):null]}):null]})]})}function MK(e){return QB.safeParse(e).success}function ET(e){return KB.safeParse(e).success}function DK(e){let t=-1;for(const s of e)s.kind==="turn_end"&&s.seq>t&&(t=s.seq);const n=e.filter(s=>s.kind==="turn_end"?!1:s.kind==="error"?!0:s.seq>t),a=new Map;for(const s of n){if(s.kind!=="tool_call")continue;const o=aj(s.payload);if(!o)continue;const c=a.get(o)??-1;s.seq>c&&a.set(o,s.seq)}return n.filter(s=>{if(s.kind!=="tool_call")return!0;const o=aj(s.payload);return o?a.get(o)===s.seq:!0})}function aj(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Io(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=s=>{var o;return((o=n.find(c=>c.type===s))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function IK(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function ij(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function LK({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?l.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function PK({event:e}){const t=_3(e.payload);if(!t)return null;const n=t.status==="error",a=t.status==="pending",s=n?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":a?"using":"used";return l.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?l.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:s,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):l.jsx("span",{"aria-hidden":!0,style:{color:s,flexShrink:0},children:n?"⚠":"↳"}),l.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?ij(t.args):void 0,children:[l.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",l.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?l.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",ij(t.args),")"]}):null,t.durationMs!==void 0&&!a?l.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",IK(t.durationMs)]}):null]})]})}function UK({event:e,agentNameFn:t,agentId:n}){const a=A3(e.payload);if(!a||a.text.length===0)return null;const s=t(n);return l.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[l.jsx(Ih,{name:s,isSelf:!1}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[l.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:s}),l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Io(e.createdAt)}),l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),l.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function BK({event:e}){return l.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:[l.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}}),l.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Io(e.createdAt)})]})}function $K({event:e}){const t=T3(e.payload),n=Io(e.createdAt);return l.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:[l.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),l.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 Ih({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return l.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:l.jsx(Dc,{width:9,height:10,style:{color:"var(--accent)"}})})}function FK({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),s=t===e.senderId;return l.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[l.jsx(Ih,{name:a,isSelf:s}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[l.jsx("span",{className:"mono text-body font-semibold",style:{color:s?"var(--fg)":"var(--accent)"},children:a}),l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Io(e.createdAt)}),l.jsx("span",{style:{marginLeft:"auto"},children:l.jsx(LK,{msg:e,myAgentId:t})})]}),l.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&HK(e.content)?l.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"&&qK(e.content)?l.jsx(ZK,{content:e.content}):e.format==="text"?l.jsx(zh,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):l.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 HK(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 qK(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 ZK({content:e}){const[t,n]=b.useState({kind:"loading"});return b.useEffect(()=>{let a=!1;return aK(e.imageId).then(s=>{a||n(s?{kind:"hit",src:`data:${s.mimeType};base64,${s.base64}`}:{kind:"miss"})}),()=>{a=!0}},[e.imageId]),t.kind==="hit"?l.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?l.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):l.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function GK({msg:e,chatId:t,content:n,answer:a,status:s,agentNameFn:o}){const c=o(e.senderId);return l.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[l.jsx(Ih,{name:c,isSelf:!1}),l.jsxs("div",{className:"min-w-0 flex flex-col",style:{gap:"var(--sp-1)"},children:[l.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[l.jsx("span",{className:"mono text-body font-semibold",style:{color:"var(--accent)"},children:c}),l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Io(e.createdAt)})]}),l.jsx(OK,{chatId:t,questionMessageId:e.id,content:n,answer:a,status:s})]})]})}function VK({msg:e,agentNameFn:t}){const n=ET(e.content)?e.content:null,a=t(e.senderId),s=n?Object.entries(n.answers).map(([o,c])=>`${o.replace(/\s+\?$/u,"?")}: ${c}`).join(" · "):"(answer)";return l.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[l.jsx(Ih,{name:a,isSelf:!0}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[l.jsx("span",{className:"mono text-body font-semibold",style:{color:"var(--fg)"},children:a}),l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Io(e.createdAt)}),l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:"answered question"})]}),l.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",marginTop:2},children:s})]})]})}function QK({metadata:e}){if(!e||e.source!=="github")return null;const t=typeof e.entityUrl=="string"?e.entityUrl:null;return t?l.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",title:"View on GitHub",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:"0 var(--sp-1)",textDecoration:"none"},children:l.jsx(Cv,{className:"h-3.5 w-3.5"})}):null}function sj({agentId:e,chatId:t,readOnly:n=!1,titleFallback:a,joinAction:s}){var ut;const o=Cn(),c=ph(),d=Lv(),{agentId:m}=yt(),[h,p]=b.useState(""),[g,x]=b.useState(0),[w,S]=b.useState([]),[k,C]=b.useState(!1),[E,N]=b.useState(null),R=b.useRef(null),z=b.useRef(null),L=b.useRef(null);xT(z,h);const O=b.useRef(!1),B=b.useRef(new Set);b.useEffect(()=>{O.current=!1},[t]);const{data:I}=Ke({queryKey:["chat-messages",t],queryFn:()=>VQ(t,{limit:50}),refetchInterval:5e3}),{data:V}=Ke({queryKey:["session-events",e,t],queryFn:()=>R3(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:D}=Ke({queryKey:["chat-detail",t],queryFn:()=>yT(t),enabled:!!t}),{data:K}=Ke({queryKey:["activity"],queryFn:Oc,refetchInterval:15e3}),ae=bt({mutationFn:ie=>jo(t,ie),onSuccess:()=>{p(""),o.invalidateQueries({queryKey:["chat-messages",t]}),o.invalidateQueries({queryKey:e1(e)})}}),be=b.useCallback(ie=>{const ve=ie.filter(Ft=>Ft.type.startsWith("image/"));if(ve.length===0)return;const Re=ve.find(Ft=>Ft.size>5242880);if(Re){N(`Image too large (${(Re.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const St=ve.map(Ft=>({id:crypto.randomUUID(),file:Ft,previewUrl:URL.createObjectURL(Ft)}));S(Ft=>[...Ft,...St]),N(null)},[]),W=b.useCallback(ie=>{S(le=>{const ve=le.find(Re=>Re.id===ie);return ve&&URL.revokeObjectURL(ve.previewUrl),le.filter(Re=>Re.id!==ie)})},[]),X=async()=>{const ie=h.trim(),le=w;if(!(!ie&&le.length===0)&&!k&&!(me&&Ie.length===0)){if(Ue.length>0)try{await gT(t,{participantIds:Ue}),await o.invalidateQueries({queryKey:["chat-detail",t]})}catch(ve){N(ve instanceof Error?ve.message:"Failed to add participants");return}if(le.length>0){C(!0),N(null);try{for(const ve of le){const Re=await GQ(ve.file),St=crypto.randomUUID();await rK({imageId:St,base64:Re,mimeType:ve.file.type}),await ZQ(t,{data:Re,mimeType:ve.file.type,filename:ve.file.name,size:ve.file.size,imageId:St}),URL.revokeObjectURL(ve.previewUrl)}S([]),ie&&await jo(t,ie),p(""),o.invalidateQueries({queryKey:["chat-messages",t]}),o.invalidateQueries({queryKey:e1(e)})}catch(ve){N(ve instanceof Error?ve.message:"Failed to send image")}finally{C(!1)}return}ae.mutate(ie)}},[Z,te]=b.useState(!1),[je,Ae]=b.useState(""),M=b.useRef(null);b.useEffect(()=>{var ie;Z&&((ie=M.current)==null||ie.focus())},[Z]);const P=bt({mutationFn:ie=>qQ(t,ie),onSuccess:()=>{te(!1),o.invalidateQueries({queryKey:["chat-detail",t]}),o.invalidateQueries({queryKey:["agent-sessions",e]}),o.invalidateQueries({queryKey:["session",e,t]})}}),$=()=>{const ie=je.trim();P.mutate(ie.length>0?ie:null)},T=b.useMemo(()=>{const ie=(I==null?void 0:I.items)??[],le=DK((V==null?void 0:V.items)??[]),ve=[...ie.map(Re=>({kind:"message",at:Re.createdAt,key:`m-${Re.id}`,data:Re})),...le.map(Re=>({kind:"event",at:Re.createdAt,key:`e-${Re.id}`,data:Re}))];return ve.sort((Re,St)=>Re.at.localeCompare(St.at)),ve},[I,V]),G=b.useMemo(()=>{const ie=new Map;for(const le of(I==null?void 0:I.items)??[])le.format==="question_answer"&&ET(le.content)&&ie.set(le.content.correlationId,le.content);return ie},[I]),q=T.length;b.useEffect(()=>{var ie;q>0&&((ie=L.current)==null||ie.scrollIntoView({behavior:"smooth"}))},[q]);const re=c(e),xe=b.useMemo(()=>{var ie;return new Set(((ie=D==null?void 0:D.participants)==null?void 0:ie.map(le=>le.agentId))??[])},[D==null?void 0:D.participants]),we=b.useMemo(()=>{const ie=new Set;for(const Re of(D==null?void 0:D.participants)??[])ie.add(Re.agentId);for(const Re of(K==null?void 0:K.agents)??[])ie.add(Re.agentId);ie.size===0&&ie.add(e);const le=new Map;for(const Re of(K==null?void 0:K.agents)??[])le.set(Re.agentId,Re.managedByMe);const ve=[];for(const Re of ie){if(Re===m)continue;const St=d(Re);!St||!St.name||ve.push({agentId:Re,name:St.name,displayName:St.displayName,managedByMe:le.get(Re)??!1})}return ve},[D==null?void 0:D.participants,K==null?void 0:K.agents,e,d,m]),me=b.useMemo(()=>{if(!D)return!1;if(D.type==="group")return!0;const ie=D.participants.some(le=>le.agentId===m);return D.type==="direct"&&!ie&&D.participants.length>=2},[D,m]);b.useEffect(()=>{if(n||B.current.has(t)||!I||!V||!D||T.length>0||h.length>0||me||re===e)return;const ie=`Hi ${re}! What can you help with?`;p(ie),x(ie.length),B.current.add(t),requestAnimationFrame(()=>{const le=z.current;le&&(le.focus(),le.setSelectionRange(ie.length,ie.length))})},[t,e,I,V,D,T.length,h.length,re,me,n]);const Ie=b.useMemo(()=>{const ie=we.map(le=>({agentId:le.agentId,name:le.name}));return yN(h,ie)},[h,we]),Ue=b.useMemo(()=>xe.size===0?[]:Ie.filter(ie=>!xe.has(ie)),[Ie,xe]),ft=vT({value:h,cursor:g,candidates:we,disabled:ae.isPending||k,onSelect:ie=>{p(ie.text),x(ie.cursor),requestAnimationFrame(()=>{const le=z.current;le&&(le.focus(),le.setSelectionRange(ie.cursor,ie.cursor))})}});return l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6)",borderBottom:"var(--hairline) solid var(--border)"},children:l.jsxs("div",{className:"flex items-center",style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%",gap:10},children:[l.jsxs("div",{className:"flex items-center min-w-0",style:{gap:8,flex:1},children:[n?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"truncate text-subtitle min-w-0",style:{color:"var(--fg)"},children:(D==null?void 0:D.title)??a??"…"}),l.jsx("span",{className:"mono uppercase text-eyebrow shrink-0",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--fg-3)",background:"var(--bg-sunken)"},children:"watching"})]}):Z?l.jsxs(l.Fragment,{children:[l.jsx("input",{ref:M,value:je,onChange:ie=>Ae(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"?(ie.preventDefault(),$()):ie.key==="Escape"&&(ie.preventDefault(),te(!1))},disabled:P.isPending,maxLength:500,placeholder:(D==null?void 0:D.title)??"Chat name",className:"outline-none text-subtitle",style:{fieldSizing:"content",minWidth:200,maxWidth:480,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)"}}),l.jsx("button",{type:"button",onClick:$,disabled:P.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:l.jsx(cr,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>te(!1),disabled:P.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:l.jsx(os,{className:"h-3.5 w-3.5"})})]}):l.jsx("button",{type:"button",onClick:()=>{Ae((D==null?void 0:D.topic)??""),te(!0)},title:"Click to rename",className:"truncate text-subtitle text-left min-w-0",style:{color:"var(--fg)",background:"transparent",border:"none",padding:0,cursor:"pointer"},children:(D==null?void 0:D.title)??"…"}),l.jsx(QK,{metadata:D==null?void 0:D.metadata})]}),l.jsx(KK,{chatId:t,participantIds:((ut=D==null?void 0:D.participants)==null?void 0:ut.map(ie=>ie.agentId))??[e],candidates:we,agentIdentity:d,onAdded:()=>o.invalidateQueries({queryKey:["chat-detail",t]}),readOnly:n})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-6)"},children:l.jsxs("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:[q===0&&l.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[l.jsx(Ev,{className:"h-8 w-8",style:{opacity:.3}}),n?"No messages yet":"Send a message to start the conversation"]}),l.jsx("div",{className:"flex flex-col",style:{gap:4},children:T.map(ie=>{if(ie.kind==="event"){const ve=ie.data;switch(ve.kind){case"tool_call":return l.jsx(PK,{event:ve},ie.key);case"assistant_text":return l.jsx(UK,{event:ve,agentId:e,agentNameFn:c},ie.key);case"thinking":return l.jsx(BK,{event:ve},ie.key);case"error":return l.jsx($K,{event:ve},ie.key);default:return null}}const le=ie.data;if(le.format==="question"&&MK(le.content)){const ve=G.get(le.content.correlationId)??null,Re=ve?"answered":"pending";return l.jsx(GK,{msg:le,chatId:t,content:le.content,answer:ve,status:Re,agentNameFn:c},ie.key)}return le.format==="question_answer"?l.jsx(VK,{msg:le,agentNameFn:c},ie.key):l.jsx(FK,{msg:le,myAgentId:m,agentNameFn:c},ie.key)})}),l.jsx("div",{ref:L})]})}),l.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6) var(--sp-3)"},children:l.jsx("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:n?l.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3)",padding:"var(--sp-2) var(--sp-3)",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},children:[l.jsx(pC,{className:"h-4 w-4 shrink-0",style:{color:"var(--fg-3)"}}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-body",style:{color:"var(--fg-2)"},children:"You're watching this chat — read-only."}),(s==null?void 0:s.error)&&l.jsx("div",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:2},children:s.error})]}),s&&l.jsx(ye,{type:"button",variant:"secondary",size:"sm",className:"shrink-0",onClick:s.onJoin,disabled:s.joining,children:s.joining?"Joining…":"Join to reply"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:ie=>ie.preventDefault(),onDrop:ie=>{ie.preventDefault(),be(Array.from(ie.dataTransfer.files))},children:[w.length>0&&l.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:w.map(ie=>l.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[l.jsx("img",{src:ie.previewUrl,alt:ie.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),l.jsx("button",{type:"button",onClick:()=>W(ie.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:l.jsx(os,{className:"h-2 w-2"})})]},ie.id))}),l.jsxs("div",{style:{position:"relative"},children:[l.jsx(bT,{trigger:ft.trigger,results:ft.results,highlightIndex:ft.highlightIndex,anchorRef:z,onPick:ft.pick}),l.jsx("textarea",{ref:z,value:h,onChange:ie=>{p(ie.target.value),x(ie.target.selectionStart??ie.target.value.length)},onSelect:ie=>{x(ie.currentTarget.selectionStart??h.length)},onFocus:()=>{me&&(O.current||h.length>0||we.length===0||(O.current=!0,p("@"),x(1),requestAnimationFrame(()=>{const ie=z.current;ie&&ie.setSelectionRange(1,1)})))},onPaste:ie=>{const le=Array.from(ie.clipboardData.files);le.length>0&&(ie.preventDefault(),be(le))},placeholder:me?"Type @ to pick a recipient, then your message":`Message @${re} · / for commands · @ to mention`,rows:2,onKeyDown:ie=>{ft.handleKey(ie)||ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),X())},disabled:ae.isPending||k,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",minHeight:"calc(2lh + var(--sp-2_25) + var(--sp-7_5))",maxHeight:"10.5rem",overflowY:"auto",resize:"none",color:"var(--fg)"}})]}),l.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[l.jsxs("span",{className:"mono flex items-center",style:{gap:10},children:[l.jsx("button",{type:"button",onClick:()=>{const ie=z.current;if(!ie)return;const le=ie.selectionStart??h.length,ve=ie.selectionEnd??le,Re=`${h.slice(0,le)}@${h.slice(ve)}`;p(Re),x(le+1),requestAnimationFrame(()=>{ie.focus(),ie.setSelectionRange(le+1,le+1)})},title:"Mention an agent (or type @)",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:l.jsx(Iz,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>{var ie;return(ie=R.current)==null?void 0:ie.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:l.jsx(gM,{className:"h-3.5 w-3.5"})}),l.jsx("input",{ref:R,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ie=>{ie.target.files&&(be(Array.from(ie.target.files)),ie.target.value="")}})]}),l.jsxs("span",{className:"flex items-center",style:{gap:8},children:[k&&l.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),l.jsx("button",{type:"button",onClick:X,disabled:ae.isPending||k||!h.trim()&&w.length===0||me&&Ie.length===0,title:me&&Ie.length===0?"Pick at least one recipient with @ before sending in a group chat":"Send (Enter)","aria-label":"Send",className:Me("inline-flex items-center justify-center transition-opacity",(ae.isPending||k||!h.trim()&&w.length===0||me&&Ie.length===0)&&"opacity-40 cursor-not-allowed"),style:{width:28,height:28,borderRadius:"var(--radius-input)",background:"var(--fg)",color:"var(--bg-raised)",border:"none"},children:l.jsx(fC,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]})]}),(ae.isError||E)&&l.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:E??(ae.error instanceof Error?ae.error.message:"Failed to send")})]})})})]})}function KK({chatId:e,participantIds:t,candidates:n,agentIdentity:a,onAdded:s,readOnly:o=!1}){const[c,d]=b.useState(!1),m=b.useRef(null);b.useEffect(()=>{if(!c)return;const g=x=>{m.current&&(m.current.contains(x.target)||d(!1))};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[c]);const h=bt({mutationFn:g=>gT(e,{participantIds:[g]}),onSuccess:()=>{d(!1),s()}}),p=b.useMemo(()=>n.filter(g=>!t.includes(g.agentId)),[n,t]);return l.jsxs("div",{className:"inline-flex items-center flex-wrap",style:{gap:4},children:[t.map(g=>{const x=a(g),w=(x==null?void 0:x.displayName)??(x==null?void 0:x.name)??g.slice(0,8);return l.jsx("span",{className:"inline-flex items-center text-label",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-sunken)",color:"var(--fg-2)"},children:w},g)}),!o&&l.jsxs("div",{ref:m,style:{position:"relative"},children:[l.jsx("button",{type:"button",onClick:()=>d(!c),disabled:p.length===0||h.isPending,title:p.length===0?"All available agents are already in this chat":"Add participant","aria-label":"Add participant",className:"inline-flex items-center transition-colors hover:bg-[var(--bg-sunken)]",style:{padding:"var(--sp-0_5) var(--sp-1)",borderRadius:"var(--radius-chip)",border:"var(--hairline) solid var(--border)",background:"transparent",color:p.length===0?"var(--fg-4)":"var(--fg-3)",cursor:p.length===0?"not-allowed":"pointer"},children:l.jsx(xa,{className:"h-3 w-3"})}),c&&p.length>0&&l.jsx("div",{role:"listbox","aria-label":"Add participant",className:"absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg",style:{top:"calc(100% + var(--sp-1))",right:0,minWidth:280,background:"var(--bg-raised)",borderColor:"var(--border)"},children:(()=>{const g=kb(p);return Cb(p).map(x=>"divider"in x?l.jsx("div",{role:"presentation",style:{height:"var(--hairline)",background:"var(--border-faint)",margin:"var(--sp-0_5) var(--sp-3)"}},"__divider"):l.jsx("button",{type:"button",role:"option","aria-selected":"false",title:x.name?`@${x.name}`:void 0,onClick:()=>h.mutate(x.agentId),disabled:h.isPending,className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:l.jsx(jb,{candidate:x,ambiguous:g})},x.agentId))})()})]})]})}function lj(e,t){return e?e.find(n=>n.chatId===t)??null:null}function YK(e,t){var s;const n=e.filter(o=>o.agentId!==t),a=n.find(o=>o.type!==void 0&&o.type!=="human");return a?a.agentId:((s=n[0])==null?void 0:s.agentId)??null}function XK({chatId:e}){const t=Cn(),{agentId:n}=yt(),a=b.useRef(new Map),{data:s}=Ke({queryKey:["chat-detail",e],queryFn:()=>yT(e),enabled:!!e}),{data:o}=Ke({queryKey:["me","chats","all"],queryFn:()=>eh({filter:"all"}),refetchInterval:3e4}),{data:c}=Ke({queryKey:["me","chats","watching"],queryFn:()=>eh({filter:"watching"}),refetchInterval:3e4}),d=b.useMemo(()=>lj(o==null?void 0:o.rows,e)??lj(c==null?void 0:c.rows,e)??null,[o,c,e]),m=b.useMemo(()=>d?d.participants.map(k=>({agentId:k.agentId,type:k.type})):s?s.participants.map(k=>({agentId:k.agentId,type:void 0})):[],[d,s]),h=b.useMemo(()=>YK(m,n),[m,n]),g=bt({mutationFn:()=>UQ(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]})}}).mutate,x=(d==null?void 0:d.lastMessageAt)??"";b.useEffect(()=>{!d||a.current.get(e)===x||(a.current.set(e,x),g())},[e,d,x,g]);const w=bt({mutationFn:()=>BQ(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]}),t.invalidateQueries({queryKey:["chat-detail",e]})}}),S=(d==null?void 0:d.membershipKind)==="watching";return h?S?l.jsx(sj,{agentId:h,chatId:e,readOnly:!0,titleFallback:(d==null?void 0:d.title)??null,joinAction:{onJoin:()=>w.mutate(),joining:w.isPending,error:w.isError?w.error instanceof Error?w.error.message:"Failed to join":null}}):l.jsx(sj,{agentId:h,chatId:e}):l.jsx("div",{className:"flex-1 flex items-center justify-center",style:{padding:"var(--sp-8)"},children:l.jsxs("div",{className:"text-center",style:{color:"var(--fg-3)"},children:[l.jsx("div",{className:"text-subtitle",style:{color:"var(--fg-2)",marginBottom:6},children:"Loading chat…"}),l.jsx("div",{className:"text-body",children:"Resolving participants."})]})})}function WK(){return l.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:l.jsxs("div",{className:"text-center max-w-sm",children:[l.jsx(Dc,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),l.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),l.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."})]})})}async function di(e,t){try{await Ee.post("/me/onboarding/events",{event:e,attrs:t})}catch{}}function JK({organizationId:e,onContinue:t}){const[n,a]=b.useState([]),[s,o]=b.useState(""),[c,d]=b.useState(""),[m,h]=b.useState(!1),[p,g]=b.useState(null),[x,w]=b.useState(!1),[S,k]=b.useState(null),C=b.useRef(null);b.useEffect(()=>{(async()=>{try{const z=await Ee.get("/me/organizations");a(z)}catch(z){k(z instanceof Error?z.message:"Failed to load your team")}finally{w(!0)}})()},[]),b.useEffect(()=>{var L;const z=((L=n.find(O=>O.id===e))==null?void 0:L.displayName)??"";o(z),d(z)},[n,e]),b.useEffect(()=>{const z=C.current;if(!z||!c)return;z.focus();const L=z.value.length;z.setSelectionRange(L,L)},[c]);const E=s.trim(),N=E.length>0&&!m&&x&&!S,R=b.useCallback(async z=>{if(z==null||z.preventDefault(),!(!N||!e)){g(null);try{E!==c.trim()&&(h(!0),await Ee.patch(`/orgs/${encodeURIComponent(e)}`,{displayName:E}),di("team_renamed")),t()}catch(L){g(L instanceof Error?L.message:"Failed to rename team")}finally{h(!1)}}},[N,e,E,c,t]);return l.jsxs("form",{onSubmit:R,className:"flex flex-col",style:{gap:"var(--sp-5)"},children:[l.jsxs("p",{className:"text-body",style:{margin:0,color:"var(--fg-3)"},children:["Name your ",l.jsx("span",{style:{color:"var(--fg-2)"},children:"agent team"})," — where humans and AIs collaborate."]}),l.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[l.jsx("label",{htmlFor:"onboarding-team-name",className:"text-label",style:{color:"var(--fg-3)"},children:"Team name"}),l.jsx("input",{ref:C,id:"onboarding-team-name","aria-label":"Team display name",value:s,onChange:z=>o(z.target.value),maxLength:200,disabled:m,className:"text-body",style:{padding:"var(--sp-2) var(--sp-3)",background:"var(--bg)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)",outline:"none",caretColor:"var(--accent)"},onFocus:z=>{z.currentTarget.style.borderColor="var(--accent)"},onBlur:z=>{z.currentTarget.style.borderColor="var(--border)"}})]}),p||S?l.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:p??`Couldn't load your team — ${S}. Refresh the page and try again.`}):null,l.jsx("div",{className:"flex justify-end",children:l.jsxs(ye,{type:"submit",disabled:!N,children:[l.jsx("span",{children:"Continue"}),l.jsx(dC,{className:"h-4 w-4"})]})})]})}function Eb(){return l.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 ls({number:e,state:t,children:n}){const a=t==="active",s=t==="complete";return l.jsxs("section",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:"var(--sp-3)",marginTop:e==="01"?0:"var(--sp-5)",position:"relative"},children:[l.jsx("div",{className:"mono text-caption flex items-center justify-center",style:{width:"var(--sp-5)",height:"var(--sp-5)",borderRadius:999,background:a||s?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:a||s?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",color:a||s?"var(--accent)":"var(--fg-4)",zIndex:1},children:s?l.jsx(cr,{className:"h-3 w-3"}):e}),l.jsx("div",{style:{minHeight:"var(--sp-6)",paddingBottom:"var(--sp-1)"},children:n})]})}const eY=3e4,tY=1e3,nY=3e3;function rY(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function aY({organizationId:e,memberId:t,joinPath:n,refreshMe:a}){var xe;const s=Tn(),o=mz(e,t),c=gz(o),d=c!=null&&c.connectToken&&c.connectTokenExpiresAt&&c.connectTokenExpiresAt>Date.now()?c.connectToken:null,m=d?(c==null?void 0:c.connectTokenExpiresAt)??null:null,[h,p]=b.useState(()=>(c==null?void 0:c.displayName)??"Assistant"),[g,x]=b.useState(()=>(c==null?void 0:c.selectedRuntime)??null),[w,S]=b.useState(null),[k,C]=b.useState(null),[E,N]=b.useState(null),[R,z]=b.useState(()=>d),[L,O]=b.useState(()=>m),[B,I]=b.useState([]),[V,D]=b.useState("form"),[K,ae]=b.useState(null),be=b.useRef(null),W=b.useRef(null),X=b.useRef(null),Z=b.useRef(0);b.useEffect(()=>()=>{W.current&&(W.current.cancelled=!0)},[]),b.useEffect(()=>{yz(o,{displayName:h,selectedRuntime:g,connectToken:R,connectTokenExpiresAt:L})},[o,h,g,R,L]),b.useEffect(()=>{(async()=>{try{const we=await Ee.get("/me/organizations");I(we)}catch{}})()},[]),b.useEffect(()=>{if(V!=="form")return;let we=!1;const me=async()=>{const Ue=++Z.current;try{const ft=await ci();if(we||Ue!==Z.current)return;const ie=ft.filter(le=>le.status==="connected").sort((le,ve)=>ve.lastSeenAt.localeCompare(le.lastSeenAt))[0]??null;if(S(le=>(le==null?void 0:le.id)===(ie==null?void 0:ie.id)?le:ie),ie){X.current!==ie.id&&(X.current=null,N(null),C(null));try{const le=await ch(ie.id);if(we||Ue!==Z.current)return;X.current=ie.id,N(ie.id),C(le.capabilities)}catch{}}else X.current=null,N(null),C(null)}catch{}};me();const Ie=setInterval(me,nY);return()=>{we=!0,clearInterval(Ie)}},[V]),b.useEffect(()=>{if(w)return;if(R&&L&&L>Date.now()){const me=Math.max(L-Date.now(),0),Ie=window.setTimeout(()=>{z(null),O(null)},me);return()=>window.clearTimeout(Ie)}R&&(z(null),O(null));let we=!1;return(async()=>{try{const me=await Ee.post("/me/connect-tokens",{});we||(z(me.token),O(Date.now()+me.expiresIn*1e3))}catch(me){we||ae(me instanceof Error?me.message:"Failed to generate connect token")}})(),()=>{we=!0}},[w,R,L]);const te=w&&E===w.id?k:null;b.useEffect(()=>{x(we=>{var Ie;if(!te)return we;const me=iY(te);return we&&me&&Object.keys(te).includes(we)&&((Ie=te[we])==null?void 0:Ie.state)==="ok"?we:me})},[te]);const je=te?Object.entries(te).filter(([,we])=>we.state==="ok").map(([we])=>we):[],Ae=((xe=B.find(we=>we.id===e))==null?void 0:xe.displayName)??"",M=h.trim(),P=M||"your agent",$=R?`npm install -g @agent-team-foundation/first-tree-hub
|
|
418
|
+
first-tree-hub connect ${R}`:null,T=b.useCallback(async we=>{W.current&&(W.current.cancelled=!0);const me={cancelled:!1};W.current=me;const Ie=Date.now();for(;!me.cancelled;){let Ue=!1;try{const ft=await Ee.get(`/agents/${encodeURIComponent(we)}/client-status`);if(me.cancelled)return;Ue=ft.online===!0}catch{if(me.cancelled)return}if(Ue){vz(o);try{await a()}catch{}if(me.cancelled)return;s("/",{replace:!0});return}if(Date.now()-Ie>eY){me.cancelled||D("timeout");return}await new Promise(ft=>setTimeout(ft,tY))}},[o,a,s]),G=!!(M&&w&&g&&je.includes(g)&&V==="form"),q=b.useCallback(async()=>{if(!w||!g||!M)return;ae(null),D("creating");const we=Xy(M);let me;try{me=(await Ee.post(An("/agents"),{type:"personal_assistant",displayName:M,...we?{name:we}:{},clientId:w.id,runtimeProvider:g,...e?{organizationId:e}:{}})).uuid,be.current=me,fz(me),di("agent_created",{runtimeProvider:g})}catch(Ie){ae(Ie instanceof Error?Ie.message:"Failed to create agent"),D("form");return}await T(me)},[M,w,g,T,e]),re=b.useCallback(async()=>{const we=be.current;we&&(ae(null),D("creating"),await T(we))},[T]);return V==="creating"?l.jsx(fY,{nameOrFallback:P}):V==="timeout"?l.jsx(hY,{nameOrFallback:P,hostname:(w==null?void 0:w.hostname)??null,error:K,onRetry:re}):l.jsx(sY,{joinPath:n,teamName:Ae,displayName:h,setDisplayName:p,trimmedName:M,connectedClient:w,cliCommand:$,capabilitiesLoaded:te!==null,okRuntimes:je,selectedRuntime:g,setSelectedRuntime:x,error:K,canCreate:G,onCreate:q})}function iY(e){const t=a=>{var s;return((s=e[a])==null?void 0:s.state)==="ok"};if(t("claude-code"))return"claude-code";if(t("codex"))return"codex";const n=Object.entries(e).find(([,a])=>a.state==="ok");return n?n[0]:null}function sY({joinPath:e,teamName:t,displayName:n,setDisplayName:a,trimmedName:s,connectedClient:o,cliCommand:c,capabilitiesLoaded:d,okRuntimes:m,selectedRuntime:h,setSelectedRuntime:p,error:g,canCreate:x,onCreate:w}){const S=b.useRef(null),k=e==="invite"&&t,C=d&&m.length===0&&!!o,E=s?o?C?"Install Claude Code (or Codex) on that computer, then sign in.":h?"Ready to create.":"Detecting installed runtimes…":"Next: connect the computer where they'll work.":"Next: name your agent.";return b.useEffect(()=>{var N;s||(N=S.current)==null||N.focus()},[s]),l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-body",style:{margin:0,color:"var(--fg-3)",maxWidth:720},children:k?l.jsxs(l.Fragment,{children:["You've joined"," ",l.jsx("span",{className:"font-semibold",style:{color:"var(--fg-2)"},children:t}),". Set up your first agent — it'll run on a computer you connect."]}):l.jsx(l.Fragment,{children:"Set up your first agent — it'll run on a computer you connect."})}),l.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[l.jsx(Eb,{}),l.jsx(ls,{number:"01",state:s?"complete":"active",children:l.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)",flexWrap:"wrap"},children:[l.jsx("label",{htmlFor:"onboarding-name",className:"text-body font-normal",style:{color:"var(--fg-2)",whiteSpace:"nowrap"},children:"Name your agent"}),l.jsx("input",{ref:S,id:"onboarding-name","aria-label":"Agent display name",value:n,onChange:N=>a(N.target.value),placeholder:"e.g. Buddy, Helper",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)"}})]})}),l.jsx(ls,{number:"02",state:x?"complete":s?"active":"idle",children:l.jsxs("div",{style:{animation:s?"subtle-fade 200ms ease-out":void 0},children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{color:s?"var(--fg)":"var(--fg-4)",fontWeight:s?600:500},children:"Connect a computer"}),s?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:o?`${s} will run on this computer and stay connected to Hub.`:`${s} needs a computer to run on. Connect one with the command below.`}),!o&&l.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?l.jsxs(l.Fragment,{children:[l.jsx(cY,{hostname:o.hostname??o.id}),l.jsx(uY,{runtimes:m,selected:h,onSelect:p,capabilitiesLoaded:d})]}):l.jsxs(l.Fragment,{children:[l.jsx(lY,{command:c}),l.jsx(oY,{})]})]}):null]})})]}),g&&l.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}),s&&l.jsxs("div",{style:{marginTop:x?"var(--sp-4)":"var(--sp-5)",marginLeft:"calc(var(--sp-5) + var(--sp-3))",animation:"subtle-fade 180ms ease-out"},children:[!x&&l.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-4)"},children:E}),x&&l.jsxs(ye,{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:[l.jsxs("span",{children:["Create ",s]}),l.jsx(dC,{className:"h-4 w-4"})]}),l.jsx("p",{className:"text-caption",style:{margin:x?"var(--sp-2) 0 0":"var(--sp-0_5) 0 0",color:"var(--fg-4)"},children:"You can customize this agent after setup."})]})]})}function lY({command:e}){const[t,n]=b.useState(!1),s=(e?e.split(`
|
|
419
|
+
`):[]).find(m=>m.startsWith("first-tree-hub"))??"",o="first-tree-hub connect ",c=s.startsWith(o)?`${o}${s.slice(o.length,o.length+22)}…`:s.length>52?`${s.slice(0,52)}…`:s,d=async()=>{e&&(await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500))};return l.jsx("div",{style:{marginTop:"var(--sp-2)"},children:l.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[l.jsx("pre",{className:"mono text-label",title:s,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…"}),l.jsxs(ye,{type:"button",variant:"outline",size:"sm",onClick:d,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?l.jsx(cr,{className:"h-3.5 w-3.5"}):l.jsx(jv,{className:"h-3.5 w-3.5"}),t?"Copied":"Copy"]})]})})}function oY(){return l.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:[l.jsx(dY,{}),l.jsx("span",{children:"Waiting for your computer…"})]})}function uY({runtimes:e,selected:t,onSelect:n,capabilitiesLoaded:a}){return e.length===0?l.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…"}):l.jsxs("div",{style:{marginTop:"var(--sp-3)"},children:[l.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Powered by"}),l.jsxs("fieldset",{className:"flex",style:{gap:"var(--sp-4)",flexWrap:"wrap",margin:0,padding:0,border:0},children:[l.jsx("legend",{className:"sr-only",children:"Runtime provider"}),e.map((s,o)=>{const c=t===s;return l.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:[l.jsx("input",{type:"radio",name:"onboarding-runtime",value:s,checked:c,onChange:()=>n(s),className:"sr-only"}),l.jsx("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center",style:{width:"var(--sp-3_5)",height:"var(--sp-3_5)",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&&l.jsx("span",{style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--accent)"}})}),rY(s)]},s)})]})]})}function cY({hostname:e}){return l.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:[l.jsx(cr,{className:"h-3.5 w-3.5"}),l.jsxs("span",{children:[l.jsx("span",{className:"mono font-semibold",children:e})," connected"]})]})}function dY(){return l.jsxs("span",{"aria-hidden":"true",style:{position:"relative",display:"inline-block",width:8,height:8,flexShrink:0},children:[l.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--accent)"}}),l.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--accent)",animation:"ring-pulse 1.8s infinite",opacity:.55}})]})}function fY({nameOrFallback:e}){return l.jsxs("div",{className:"flex flex-col items-center text-center",style:{paddingTop:"var(--sp-12)",gap:"var(--sp-4)"},children:[l.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:["Creating ",e,"…"]}),l.jsx(mY,{}),l.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Usually takes ~10 seconds"})]})}function hY({nameOrFallback:e,hostname:t,error:n,onRetry:a}){const s=t??"your computer";return l.jsxs("div",{className:"flex flex-col",style:{paddingTop:"var(--sp-8)",gap:"var(--sp-4)"},children:[l.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:[e," is taking longer than expected."]}),n?l.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}):l.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)"},children:[l.jsx("p",{children:"This usually means:"}),l.jsxs("ul",{style:{paddingLeft:"var(--sp-4)",listStyle:"disc",marginTop:"var(--sp-1_5)"},children:[l.jsxs("li",{children:["The runtime can't start on ",s," (missing API key, etc.)"]}),l.jsxs("li",{children:["The connection to ",s," dropped"]})]}),l.jsxs("p",{style:{marginTop:"var(--sp-2)"},children:["Fix it on ",s,", then click ",l.jsx("span",{className:"font-semibold",children:"Try again"}),"."]})]}),l.jsx("div",{className:"flex",style:{gap:"var(--sp-2)"},children:l.jsx(ye,{onClick:a,children:"Try again"})})]})}function mY(){return l.jsxs("span",{className:"flex items-center",style:{gap:6},children:[l.jsx(Zg,{delayMs:0}),l.jsx(Zg,{delayMs:160}),l.jsx(Zg,{delayMs:320})]})}function Zg({delayMs:e}){return l.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"}})}async function NT(){return(await Ee.get("/me/github/repos")).repos}const _T="https://github.com/agent-team-foundation/first-tree";function TT(e){return e.length===1?[`Source repo: ${e[0]}`]:["Source repos:",...e.map(t=>`- ${t}`)]}function Nb(e,t){const n=TT(e),a=e.length===1?"Bind my source repo to an existing context-tree.":"Bind my source repos to an existing context-tree.",s=e.length===1?"Your workspace already has the source repo cloned in a subdirectory; the first-tree skill will locate it. Use the first-tree CLI to install the skill in the source repo and write the binding metadata pointing at the existing tree, then open a PR back to the source with those changes. Walk me through the PR when it's up.":"Your workspace already has each source repo cloned in its own subdirectory; the first-tree skill will locate them. For every source repo, use the first-tree CLI to install the skill and write the binding metadata pointing at the existing tree, then open a PR back to that source repo. Walk me through each PR as it goes up.";return[a,"",...n,`Existing tree: ${t}`,"",s,"",`Reference: ${_T}`].join(`
|
|
420
|
+
`)}function pY(e){const t=TT(e),n=e.length===1?"Create a brand-new context-tree for my source repo.":"Create a brand-new context-tree for my source repos.",a=e.length===1?"Your workspace already has the source repo cloned in a subdirectory; the first-tree skill will locate it. Use the first-tree CLI to install the skill in the source, scaffold a sibling tree directory, and write the binding metadata. Then push that new tree directory up to GitHub as a sibling repo under the same owner as the source, and open a PR back to the source with the skill + binding files.":"Your workspace already has each source repo cloned in its own subdirectory; the first-tree skill will locate them. Scaffold ONE shared tree directory that all the source repos bind to. For every source repo, install the first-tree skill and write the binding metadata pointing at that shared tree. Push the new tree directory up to GitHub as its own repo — if all the source repos share a single GitHub owner, host the tree under that owner; otherwise ask me which owner to use before pushing. Then open a PR back to each source repo with its skill + binding files.";return[n,"",...t,"",a,"","Once you know the URL of the new tree repo, use the first-tree-hub CLI's `org bind-tree` command to record it on the Hub so future agents in this team can find it.","","When everything is up, walk me through what was created — which directory, which repo, which PRs.","",`Reference: ${_T}`].join(`
|
|
421
|
+
`)}function gY(){const{role:e}=yt();return e==="admin"?l.jsx(kY,{}):l.jsx(yY,{})}function yY(){var d,m;const{organizationId:e}=yt(),[t,n]=b.useState({kind:"loading"}),[a,s]=b.useState(0);if(b.useEffect(()=>{if(!e){n({kind:"loaded",tree:null,repos:null});return}let h=!1;return n({kind:"loading"}),(async()=>{try{const[p,g]=await Promise.all([wb(e),hT(e)]);if(h)return;n({kind:"loaded",tree:p,repos:g})}catch(p){if(h)return;n({kind:"error",message:p instanceof Error?p.message:"Failed to load team setup"})}})(),()=>{h=!0}},[e,a]),t.kind==="loading")return l.jsx(bY,{});if(t.kind==="error")return l.jsx(vY,{message:t.message,onRetry:()=>s(h=>h+1)});const o=((d=t.tree)==null?void 0:d.repo)??"",c=((m=t.repos)==null?void 0:m.repos)??[];return o&&c.length>0?l.jsx(xY,{treeUrl:o,teamRepos:c}):o?l.jsx(wY,{treeUrl:o}):l.jsx(SY,{})}function vY({message:e,onRetry:t}){return l.jsxs("div",{style:{padding:"var(--sp-5) var(--sp-4)",background:"var(--surface-1)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-card)"},children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{margin:0,color:"var(--fg)"},children:"Couldn't load your team's setup"}),l.jsxs("p",{className:"text-body",style:{marginTop:"var(--sp-2)",color:"var(--fg-3)"},children:[e,". This is usually a transient network issue."]}),l.jsx("div",{style:{marginTop:"var(--sp-3)"},children:l.jsx(ye,{type:"button",onClick:t,children:"Try again"})})]})}function bY(){return l.jsx("p",{className:"text-body",style:{margin:0,color:"var(--fg-3)"},children:"Checking your team's setup…"})}function xY({treeUrl:e,teamRepos:t}){var k;const n=Tn(),{dismissOnboarding:a}=yt(),{addToast:s}=Ic(),[o,c]=b.useState(!1),[d,m]=b.useState(null),[h,p]=b.useState(()=>t.map(C=>C.url)),g=h.length>0,x=b.useCallback(C=>{p(E=>E.includes(C)?E.filter(N=>N!==C):[...E,C])},[]),w=b.useCallback(async()=>{if(h.length!==0){c(!0),m(null);try{const C=await _b(),E=await Eh(C.uuid);await Nh(C.uuid,{expectedVersion:E.version,payload:{gitRepos:h.map(z=>({url:z}))}});const N=await Sb(C.uuid),R=Nb(h,e);try{await jo(N.id,R)}catch{}di("tree_chat_started",{agentUuid:C.uuid,chatId:N.id,treeMode:"existing",joinPath:"invite"}),a(),n(`/?c=${encodeURIComponent(N.id)}`,{replace:!1})}catch(C){m(C instanceof Error?C.message:"Failed to start the chat"),c(!1)}}},[h,e,n,a]),S=b.useCallback(()=>{di("tree_intro_dismissed",{joinPath:"invite"}),a(),s(Tb(n))},[a,s,n]);return l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-body",style:{margin:0,color:"var(--fg-3)",maxWidth:720},children:["Your team has already set up its ",l.jsx("span",{style:{color:"var(--fg-2)"},children:"context-tree"}),". Confirm to bind your agent."]}),l.jsxs("div",{style:{marginTop:"var(--sp-5)",display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[l.jsx(tv,{label:"Tree",value:e}),t.length===1?l.jsx(tv,{label:"Source repo",value:((k=t[0])==null?void 0:k.url)??""}):l.jsxs("fieldset",{disabled:o,style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)",margin:0,padding:0,border:0},children:[l.jsx("legend",{className:"text-label",style:{color:"var(--fg-3)",padding:0,marginBottom:"var(--sp-1)"},children:"Pick the source repos to bind your agent to"}),t.map(C=>{const E=h.includes(C.url);return l.jsxs("label",{className:"text-body",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-3)",background:E?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:E?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",cursor:o?"not-allowed":"pointer",color:E?"var(--fg)":"var(--fg-2)",fontWeight:E?600:400},children:[l.jsx("input",{type:"checkbox",value:C.url,checked:E,onChange:()=>x(C.url),className:"sr-only"}),l.jsx("span",{"aria-hidden":"true",style:{width:"var(--sp-3_5)",height:"var(--sp-3_5)",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:E?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)",background:E?"var(--accent)":"transparent",color:"var(--bg)",transition:"background 120ms ease, border-color 120ms ease"},children:E?l.jsx(cr,{className:"h-3 w-3",strokeWidth:3}):null}),l.jsx("span",{className:"mono truncate",style:{minWidth:0,flex:1},children:C.url})]},C.url)})]}),d?l.jsx(Ab,{children:d}):null,l.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)"},children:[l.jsx(ye,{type:"button",disabled:!g||o,onClick:()=>void w(),children:o?"Starting…":"Confirm"}),l.jsx(ye,{type:"button",variant:"outline",onClick:S,disabled:o,children:"I'll do it later"})]})]})]})}function wY({treeUrl:e}){const t=Tn(),{dismissOnboarding:n}=yt(),{addToast:a}=Ic(),[s,o]=b.useState(!1),[c,d]=b.useState(null),[m,h]=b.useState(null),[p,g]=b.useState(null),[x,w]=b.useState([]),S=x.length>0,k=b.useCallback(N=>{w(R=>R.includes(N)?R.filter(z=>z!==N):[...R,N])},[]);b.useEffect(()=>{let N=!1;return(async()=>{try{const R=await NT();if(N)return;h(R)}catch(R){N||g(R instanceof Error?R.message:"Failed to list GitHub repositories")}})(),()=>{N=!0}},[]);const C=b.useCallback(async()=>{if(x.length!==0){o(!0),d(null);try{const N=await _b(),R=await Eh(N.uuid);await Nh(N.uuid,{expectedVersion:R.version,payload:{gitRepos:x.map(O=>({url:O}))}});const z=await Sb(N.uuid),L=Nb(x,e);try{await jo(z.id,L)}catch{}di("tree_chat_started",{agentUuid:N.uuid,chatId:z.id,treeMode:"existing",joinPath:"invite"}),n(),t(`/?c=${encodeURIComponent(z.id)}`,{replace:!1})}catch(N){d(N instanceof Error?N.message:"Failed to start the chat"),o(!1)}}},[x,e,t,n]),E=b.useCallback(()=>{di("tree_intro_dismissed",{joinPath:"invite"}),n(),a(Tb(t))},[n,a,t]);return l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-body",style:{margin:0,color:"var(--fg-3)",maxWidth:720},children:["Joining your team's ",l.jsx("span",{style:{color:"var(--fg-2)"},children:"context-tree"}),". Pick the source repos you'll work with."]}),l.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[l.jsx(Eb,{}),l.jsx(ls,{number:"01",state:"complete",children:l.jsx(tv,{label:"Tree",value:e})}),l.jsx(ls,{number:"02",state:S?"complete":"active",children:l.jsx(AT,{disabled:s,repos:m,error:p,selectedRepoUrls:x,onToggle:k})}),l.jsxs(ls,{number:"03",state:S?"active":"idle",children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{margin:0,color:S?"var(--fg)":"var(--fg-4)",fontWeight:S?600:500},children:"Let your agent join the tree"}),S?l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:["It'll install the skill and bind"," ",x.length>1?"each source repo":"your source repo"," to the existing team tree."]}),c?l.jsx(Ab,{style:{marginTop:"var(--sp-3)"},children:c}):null,l.jsxs("div",{className:"flex",style:{marginTop:"var(--sp-3)",gap:"var(--sp-2)"},children:[l.jsx(ye,{type:"button",disabled:!S||s,onClick:()=>void C(),children:s?"Starting…":"Continue"}),l.jsx(ye,{type:"button",variant:"outline",onClick:E,disabled:s,children:"I'll do it later"})]})]}):null]})]})]})}function SY(){const{dismissOnboarding:e}=yt(),{addToast:t}=Ic(),n=b.useRef(!1);return b.useEffect(()=>{n.current||(n.current=!0,di("tree_intro_dismissed",{joinPath:"invite",reason:"team_unconfigured"}),e(),t({title:"Your team admin hasn't finished setup",description:"Ask your admin to bind a context-tree and source repo. You can keep using your agent for general chat in the meantime."}))},[e,t]),l.jsxs("div",{style:{padding:"var(--sp-5) var(--sp-4)",background:"var(--surface-1)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-card)"},children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{margin:0,color:"var(--fg)"},children:"Your team admin hasn't finished setup yet"}),l.jsx("p",{className:"text-body",style:{marginTop:"var(--sp-2)",color:"var(--fg-3)"},children:"Once they finish setup, this view will guide your agent to join. For now, your agent can help with anything that doesn't depend on your team's shared knowledge."})]})}function kY(){const e=Tn(),{dismissOnboarding:t,organizationId:n}=yt(),{addToast:a}=Ic(),[s,o]=b.useState(!1),[c,d]=b.useState(null),[m,h]=b.useState(null),[p,g]=b.useState(""),[x,w]=b.useState([]),[S,k]=b.useState(null),[C,E]=b.useState(null),N=b.useCallback(D=>{w(K=>K.includes(D)?K.filter(ae=>ae!==D):[...K,D])},[]);b.useEffect(()=>{let D=!1;return(async()=>{try{const K=await NT();if(D)return;k(K)}catch(K){D||E(K instanceof Error?K.message:"Failed to list GitHub repositories")}})(),()=>{D=!0}},[]),b.useEffect(()=>{if(!n)return;let D=!1;return(async()=>{try{const K=await wb(n);if(D)return;K.repo&&(g(K.repo),h(ae=>ae??"existing"))}catch{}})(),()=>{D=!0}},[n]);const R=p.trim(),z=(()=>{if(m!=="existing")return!0;if(!R)return!1;try{return new URL(R).protocol==="https:"}catch{return!1}})(),L=b.useCallback(()=>{di("tree_intro_dismissed"),t(),a(Tb(e))},[t,a,e]),O=b.useCallback(async()=>{if(x.length!==0&&m&&!(m==="existing"&&!z)){d(null),o(!0);try{const D=await _b(),K=await Eh(D.uuid),ae=x.map(X=>({url:X}));if(await Nh(D.uuid,{expectedVersion:K.version,payload:{gitRepos:ae}}),n)try{await mT(n,{repos:ae})}catch(X){console.warn("Step 3: PUT source_repos failed; agent gitRepos already saved",X)}if(m==="existing"&&n)try{await fT(n,{repo:R})}catch(X){console.warn("Step 3: PUT context_tree settings failed; agent will still proceed",X),a({title:"Tree binding wasn't saved to Hub yet",description:"Your agent will still proceed. You can re-bind from Team Settings later."})}const be=await Sb(D.uuid),W=m==="existing"?Nb(x,R):pY(x);try{await jo(be.id,W)}catch{}di("tree_chat_started",{agentUuid:D.uuid,chatId:be.id,treeMode:m}),t(),e(`/?c=${encodeURIComponent(be.id)}`,{replace:!1})}catch(D){d(D instanceof Error?D.message:"Failed to start the tree-init chat"),o(!1)}}},[x,m,z,R,n,e,t,a]),B=x.length>0,I=B&&m!==null&&!s&&(m==="new"||z),V=!!m&&(m==="new"||z);return l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-body",style:{margin:0,color:"var(--fg-3)",maxWidth:720},children:["Build the ",l.jsx("span",{style:{color:"var(--fg-2)"},children:"context-tree"})," — your team's shared knowledge that grows with your code."]}),l.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[l.jsx(Eb,{}),l.jsx(ls,{number:"01",state:B?"complete":"active",children:l.jsx(AT,{disabled:s,repos:S,error:C,selectedRepoUrls:x,onToggle:N})}),l.jsxs(ls,{number:"02",state:V?"complete":B?"active":"idle",children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{margin:0,color:B?"var(--fg)":"var(--fg-4)",fontWeight:B?600:500},children:"Bind or create the tree"}),B?l.jsxs("div",{style:{marginTop:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[l.jsxs("fieldset",{"aria-label":"Bind or create the tree",disabled:s,style:{display:"inline-flex",alignSelf:"flex-start",padding:"var(--sp-0_5)",margin:0,background:"var(--surface-2)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",gap:"var(--sp-0_5)"},children:[l.jsx("legend",{className:"sr-only",children:"Bind or create the tree"}),[{value:"existing",label:"Bind to an existing tree"},{value:"new",label:"Create a new tree"}].map(D=>{const K=m===D.value;return l.jsxs("label",{className:"text-body transition-colors",style:{padding:"var(--sp-1_5) var(--sp-3)",background:K?"var(--bg)":"transparent",borderRadius:"calc(var(--radius-input) - var(--sp-0_5))",color:K?"var(--fg)":"var(--fg-3)",fontWeight:K?600:400,boxShadow:K?"var(--shadow-sm)":"none",cursor:s?"not-allowed":"pointer",userSelect:"none"},children:[l.jsx("input",{type:"radio",name:"tree-mode",value:D.value,checked:K,onChange:()=>h(D.value),className:"sr-only"}),D.label]},D.value)})]}),m==="existing"?l.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-1)"},children:[l.jsx("label",{htmlFor:"onboarding-existing-tree-url",className:"text-label",style:{color:"var(--fg-3)"},children:"Tree GitHub URL"}),l.jsx("input",{id:"onboarding-existing-tree-url",type:"url",value:p,onChange:D=>g(D.target.value),placeholder:"https://github.com/your-org/your-tree",disabled:s,className:"text-body",style:{padding:"var(--sp-2) var(--sp-3)",background:"var(--bg)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)",outline:"none",fontFamily:"var(--font-mono)"}})]}):null,m==="new"?l.jsxs("p",{className:"text-label",style:{margin:0,color:"var(--fg-3)"},children:["Your agent will scaffold a new GitHub repo for the tree and bind"," ",x.length>1?"each selected source repo":"the source repo"," to it."]}):null]}):null]}),l.jsxs(ls,{number:"03",state:V?"active":"idle",children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{margin:0,color:V?"var(--fg)":"var(--fg-4)",fontWeight:V?600:500},children:"Let your agent build it"}),V?l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:["It'll install the skill, set up the tree, and open a PR back to"," ",x.length>1?"each source repo":"your source repo","."]}),c?l.jsx(Ab,{style:{marginTop:"var(--sp-3)"},children:c}):null,l.jsxs("div",{className:"flex",style:{marginTop:"var(--sp-3)",gap:"var(--sp-2)"},children:[l.jsx(ye,{type:"button",disabled:!I,onClick:()=>void O(),children:s?"Starting…":"Continue"}),l.jsx(ye,{type:"button",variant:"outline",onClick:L,disabled:s,children:"I'll do it later"})]})]}):null]})]})]})}async function _b(){const e=dz(),t=await Iv(),n=t.filter(s=>s.type!=="human"),a=(e?t.find(s=>s.uuid===e):void 0)??n.slice().sort((s,o)=>o.uuid.localeCompare(s.uuid))[0]??t[0];if(!a)throw new Error("No agent available to chat with — finish Step 2 first.");return a}function Tb(e){return{title:"Setup hidden",description:"Resume any time in Settings → Onboarding. Your agent isn't bound to a source repo yet — add one in Agent settings when ready.",action:{label:"Open settings",onClick:()=>e("/settings/onboarding")}}}function tv({label:e,value:t}){return l.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-1)"},children:[l.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:e}),l.jsx("span",{className:"mono text-body truncate",style:{padding:"var(--sp-2) var(--sp-3)",background:"var(--surface-1)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",minWidth:0},title:t,children:t})]})}function Ab({children:e,style:t}){return l.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)",...t},children:e})}function AT({disabled:e,repos:t,error:n,selectedRepoUrls:a,onToggle:s}){const o=l.jsx("h2",{className:"text-subtitle font-semibold",style:{color:e?"var(--fg-4)":"var(--fg)",fontWeight:e?500:600},children:"Pick source repos"});return e?l.jsx("div",{children:o}):n?l.jsxs("div",{style:{animation:"subtle-fade 200ms ease-out"},children:[o,l.jsxs("p",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-2)"},children:[n,". Reconnect your GitHub account to grant repo access."]}),l.jsx("div",{style:{marginTop:"var(--sp-2)"},children:l.jsx(ye,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx("a",{href:"/api/v1/auth/github/start?next=/",children:"Reconnect GitHub"})})})]}):t===null?l.jsxs("div",{style:{animation:"subtle-fade 200ms ease-out"},children:[o,l.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-2)"},children:"Loading your GitHub repositories…"})]}):t.length===0?l.jsxs("div",{style:{animation:"subtle-fade 200ms ease-out"},children:[o,l.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-2)"},children:"No repositories found on your GitHub account. Create one and refresh this page."})]}):l.jsxs("div",{style:{animation:"subtle-fade 200ms ease-out"},children:[o,l.jsx("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:"The code your tree will organize knowledge about. Pick one or more."}),l.jsx(jY,{repos:t,selectedRepoUrls:a,onToggle:s})]})}function jY({repos:e,selectedRepoUrls:t,onToggle:n}){const[a,s]=b.useState(!1),o=b.useRef(null);b.useEffect(()=>{if(!a)return;const p=x=>{o.current&&!o.current.contains(x.target)&&s(!1)},g=x=>{x.key==="Escape"&&s(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",g),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",g)}},[a]);const c=b.useMemo(()=>{const p=new Map;for(const g of e){const x=g.fullName.split("/")[0]??"",w=p.get(x);w?w.push(g):p.set(x,[g])}return[...p.entries()].sort(([g],[x])=>g.localeCompare(x))},[e]),d=b.useMemo(()=>new Set(t),[t]),m=b.useMemo(()=>e.filter(p=>d.has(p.cloneUrl)),[e,d]),h=m.length===0?"Select repositories…":"Add another repository";return l.jsxs("div",{ref:o,className:"relative",style:{marginTop:"var(--sp-2)"},children:[m.length>0&&l.jsx("div",{style:{marginBottom:"var(--sp-2)",display:"flex",flexWrap:"wrap",gap:"var(--sp-1_5)"},children:m.map(p=>l.jsx(CY,{fullName:p.fullName,onRemove:()=>n(p.cloneUrl)},p.cloneUrl))}),l.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-expanded":a,onClick:()=>s(p=>!p),className:"text-body",style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg-3)",outline:"none",cursor:"pointer",textAlign:"left"},children:[l.jsx("span",{className:"truncate",style:{minWidth:0,flex:1},children:h}),l.jsx(kv,{className:"h-4 w-4",style:{color:"var(--fg-3)",transition:"transform 120ms ease",transform:a?"rotate(180deg)":"none",flexShrink:0}})]}),a&&l.jsx("div",{role:"listbox","aria-label":"GitHub repositories","aria-multiselectable":"true",className:"absolute z-30 rounded-md border bg-popover shadow-md",style:{top:"calc(100% + var(--sp-1))",left:0,right:0,maxHeight:"min(56vh, 30rem)",overflowY:"auto",padding:"var(--sp-1) 0"},children:c.map(([p,g],x)=>l.jsxs("div",{children:[l.jsx("div",{className:"text-eyebrow",style:{paddingTop:x>0?"var(--sp-3)":"var(--sp-1)",paddingBottom:"var(--sp-1)",paddingLeft:"calc(var(--sp-3) + var(--sp-3_5) + var(--sp-2))",paddingRight:"var(--sp-3)",color:"var(--fg-2)"},children:p}),g.map(w=>{const S=d.has(w.cloneUrl),k=w.fullName.slice(p.length+1);return l.jsxs("button",{type:"button",role:"option","aria-selected":S,onClick:()=>n(w.cloneUrl),className:"text-body transition-colors w-full",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"var(--sp-1) var(--sp-3)",background:S?"var(--accent-bg)":"transparent",color:S?"var(--accent)":"var(--fg)",border:"none",cursor:"pointer",textAlign:"left"},onMouseEnter:C=>{S||(C.currentTarget.style.background="var(--surface-1)")},onMouseLeave:C=>{S||(C.currentTarget.style.background="transparent")},children:[l.jsx("span",{"aria-hidden":"true",style:{width:"var(--sp-3_5)",height:"var(--sp-3_5)",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:S?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)",background:S?"var(--accent)":"transparent",color:"var(--bg)",transition:"background 120ms ease, border-color 120ms ease"},children:S?l.jsx(cr,{className:"h-3 w-3",strokeWidth:3}):null}),l.jsx("span",{className:"truncate",style:{minWidth:0,flex:1},children:k}),w.private&&l.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",color:"var(--fg-4)",border:"var(--hairline) solid var(--border-faint)",background:"var(--bg-sunken)",flexShrink:0},children:"private"})]},w.cloneUrl)})]},p))})]})}function CY({fullName:e,onRemove:t}){return l.jsxs("span",{className:"text-label inline-flex items-center",style:{gap:"var(--sp-1)",paddingLeft:"var(--sp-2)",paddingRight:"var(--sp-0_5)",paddingTop:"var(--sp-0_5)",paddingBottom:"var(--sp-0_5)",background:"var(--surface-1)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-chip)",color:"var(--fg-2)",maxWidth:"20rem"},children:[l.jsx("span",{className:"mono truncate",style:{minWidth:0},children:e}),l.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:t,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--sp-4)",height:"var(--sp-4)",border:0,padding:0,background:"transparent",color:"var(--fg-3)",cursor:"pointer",borderRadius:"var(--radius-chip)",flexShrink:0,transition:"background 120ms ease, color 120ms ease"},onMouseEnter:n=>{n.currentTarget.style.background="var(--surface-2)",n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.background="transparent",n.currentTarget.style.color="var(--fg-3)"},children:l.jsx(os,{className:"h-3 w-3"})})]})}function EY(){const{onboardingStep:e,refreshMe:t,organizationId:n,memberId:a,role:s}=yt(),[o,c]=sh(),d=o.get("step"),[m]=b.useState(()=>oC()),[h,p]=b.useState(()=>sC()),g=b.useCallback(k=>{cz(k),p(k)},[]),x=s==="admin",w=b.useMemo(()=>d==="team"&&x?"step1":d==="agent"?"step2":d==="tree"||e==="completed"?"step3-intro":e==="connect"&&!h&&m!=="invite"&&x?"step1":"step2",[d,e,h,m,x]),S=b.useCallback(()=>{g(!0);const k=new URLSearchParams(o);k.delete("step"),c(k,{replace:!0})},[g,o,c]);return l.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:l.jsx("div",{style:{width:"100%",maxWidth:720},children:w==="step1"?l.jsx(JK,{organizationId:n,onContinue:S}):w==="step2"?l.jsx(aY,{organizationId:n,memberId:a,joinPath:m,refreshMe:t}):l.jsx(gY,{})})})}function NY({selectedChatId:e,onSelectChat:t}){const{onboardingStep:n,onboardingDismissedAt:a}=yt();return e===th?l.jsx(WQ,{onCreated:t}):e?l.jsx(XK,{chatId:e}):n!==null&&!a?l.jsx(EY,{}):l.jsx(WK,{})}const _Y={1:"Name your team",2:"Set up your agent",3:"Build your context-tree"};function TY(){const{onboardingStep:e,onboardingDismissedAt:t,dismissOnboarding:n}=yt(),{addToast:a}=Ic(),s=Tn(),[o,c]=sh(),d=o.get("c"),m=o.get("step"),h=sC(),g=oC()==="invite",x=b.useMemo(()=>m==="team"?1:m==="agent"?2:m==="tree"||d||e==="completed"?3:e==="create_agent"?2:e==="connect"&&!h&&!g?1:2,[m,d,e,h,g]);if(e===null||t)return null;const w=e==="completed",S=()=>{n(),a({title:"Setup hidden",description:"Resume any time in Settings → Onboarding.",action:{label:"Open settings",onClick:()=>s("/settings/onboarding")}})},k={1:Gg(1,x,e),2:Gg(2,x,e),3:Gg(3,x,e)},C=E=>{if(E!==3)return;const N=new URLSearchParams(o);N.delete("c"),N.set("step","tree"),c(N,{replace:!1})};return l.jsxs("nav",{"aria-label":"Onboarding progress",className:"flex items-center",style:{gap:"var(--sp-3)",padding:"var(--sp-3) var(--sp-4)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg)"},children:[l.jsx("ol",{className:"flex items-center justify-center flex-1 min-w-0",style:{gap:0,listStyle:"none",margin:0,padding:0},children:[1,2,3].map((E,N)=>{const R=k[E],z=[1,2,3][N+1],L=z?oj(R)&&oj(k[z]):!1;return l.jsxs("li",{className:"flex items-center",style:{minWidth:0},children:[l.jsx(AY,{index:E,state:R,label:_Y[E],onClick:E===3&&R==="active"?()=>C(E):void 0}),z?l.jsx(OY,{solid:L}):null]},E)})}),l.jsx("button",{type:"button",onClick:S,disabled:!w,title:w?"Hide setup steps":"Finish setting up your agent first","aria-label":"Hide setup steps",className:w?"cursor-pointer":"cursor-not-allowed",style:{flexShrink:0,width:24,height:24,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",border:0,borderRadius:"var(--rd-1)",color:w?"var(--fg-2)":"var(--fg-4)",fontSize:14,lineHeight:1,opacity:w?1:.5},onMouseEnter:E=>{w&&(E.currentTarget.style.background="var(--surface-2)")},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:"✕"})]})}function Gg(e,t,n){return e===t?"active":e===1||e===2&&n==="completed"?"completed":"pending"}function oj(e){return e==="active"||e==="completed"}function AY({index:e,state:t,label:n,onClick:a}){const s=!!a,o=RY(t,e);return l.jsxs("button",{type:"button",onClick:s?a:void 0,disabled:!s,"aria-current":t==="active"?"step":void 0,className:`flex items-center ${s?"cursor-pointer":"cursor-default"}`,style:{gap:"var(--sp-2)",background:"transparent",border:0,padding:0,font:"inherit",color:t==="active"?"var(--fg)":t==="completed"?"var(--fg-2)":"var(--fg-3)",fontWeight:t==="active"?600:500},children:[o,l.jsxs("span",{className:"text-label whitespace-nowrap",style:{textDecoration:s?"none":void 0},children:["Step ",e," · ",n]})]})}function RY(e,t){return e==="completed"?l.jsx("span",{"aria-hidden":"true",style:{width:22,height:22,borderRadius:"50%",background:"var(--accent)",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:12,lineHeight:1,flexShrink:0},children:"✓"}):e==="active"?l.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:22,height:22,flexShrink:0,display:"inline-block"},children:[l.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--accent)",animation:"ring-pulse 1.8s infinite",opacity:.5}}),l.jsx("span",{className:"mono",style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--accent)",border:"var(--hairline-bold) solid var(--accent)",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:12,fontWeight:600,lineHeight:1},children:t})]}):e==="error"?l.jsx("span",{"aria-hidden":"true",style:{width:22,height:22,borderRadius:"50%",background:"var(--state-error)",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:13,lineHeight:1,flexShrink:0},children:"⊗"}):l.jsx("span",{"aria-hidden":"true",style:{width:22,height:22,borderRadius:"50%",background:"transparent",border:"var(--hairline) solid var(--fg-3)",flexShrink:0,display:"inline-block"}})}function OY({solid:e}){return l.jsx("span",{"aria-hidden":"true",style:{flex:"0 1 var(--sp-15)",minWidth:24,height:0,margin:"0 var(--sp-2)",borderTop:e?"var(--hairline-bold) solid var(--accent)":"var(--hairline) dashed var(--fg-3)"}})}function zY(){const[e,t]=sh(),n=e.get("c"),a=e.get("a");$N(),b.useEffect(()=>{if(a&&n){t({c:n},{replace:!0});return}a&&!n&&t({},{replace:!0})},[a,n,t]);const s=b.useCallback(c=>{t({c})},[t]),o=b.useCallback(()=>{t({c:th})},[t]);return l.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[l.jsx(HQ,{selectedChatId:n,onSelectChat:s,onNewChat:o}),l.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:[l.jsx(TY,{}),l.jsx(NY,{selectedChatId:n,onSelectChat:s})]})]})}const MY=new wR({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function DY(){return l.jsx(SR,{client:MY,children:l.jsx(wz,{children:l.jsx(N4,{children:l.jsx(XO,{children:l.jsxs(EO,{children:[l.jsx(Dt,{path:"/login",element:l.jsx(dV,{})}),l.jsx(Dt,{path:"/signup",element:l.jsx(or,{to:"/login",replace:!0})}),l.jsx(Dt,{path:"/auth/github/complete",element:l.jsx(fV,{})}),l.jsx(Dt,{path:"/invite/:token",element:l.jsx(lV,{})}),null,l.jsx(Dt,{element:l.jsx(Ez,{}),children:l.jsxs(Dt,{element:l.jsx(l9,{children:l.jsx(C4,{})}),children:[l.jsx(Dt,{index:!0,element:l.jsx(zY,{})}),l.jsx(Dt,{path:"context",element:l.jsx(wG,{})}),l.jsx(Dt,{path:"agents/:uuid",element:l.jsx(DZ,{})}),l.jsx(Dt,{path:"team",element:l.jsx(wQ,{})}),l.jsxs(Dt,{path:"settings",element:l.jsx(JV,{}),children:[l.jsx(Dt,{index:!0,element:l.jsx(or,{to:"computers",replace:!0})}),l.jsx(Dt,{path:"team",element:l.jsx(LQ,{})}),l.jsx(Dt,{path:"computers",element:l.jsx(NV,{})}),l.jsx(Dt,{path:"github",element:l.jsx(MV,{})}),l.jsx(Dt,{path:"integrations",element:l.jsx(YV,{})}),l.jsx(Dt,{path:"onboarding",element:l.jsx(XV,{})}),l.jsx(Dt,{path:"setup",element:l.jsx(or,{to:"/settings/onboarding",replace:!0})})]}),l.jsx(Dt,{path:"agents",element:l.jsx(or,{to:"/team",replace:!0})}),l.jsx(Dt,{path:"clients",element:l.jsx(or,{to:"/settings/computers",replace:!0})}),l.jsx(Dt,{path:"integrations",element:l.jsx(or,{to:"/settings/integrations",replace:!0})}),l.jsx(Dt,{path:"team/members",element:l.jsx(or,{to:"/team",replace:!0})}),l.jsx(Dt,{path:"team/agents",element:l.jsx(or,{to:"/team",replace:!0})}),l.jsx(Dt,{path:"team/invite",element:l.jsx(or,{to:"/team",replace:!0})}),l.jsx(Dt,{path:"team/settings",element:l.jsx(or,{to:"/settings/team",replace:!0})}),l.jsx(Dt,{path:"admin",element:l.jsx(IY,{})})]})})]})})})})})}function IY(){const e=Er();return e.hash==="#bindings"?l.jsx(or,{to:`/settings/integrations${e.search}`,replace:!0}):l.jsx(or,{to:`/team${e.hash}`,replace:!0})}const RT=document.getElementById("root");if(!RT)throw new Error("Root element not found");K2.createRoot(RT).render(l.jsx(b.StrictMode,{children:l.jsx(DY,{})}));export{dC as A,Dc as F,Rc as L,OM as U,et as c,l as j,b as r};
|