@agent-team-foundation/first-tree-hub 0.12.10 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bootstrap-CW73oEYn.mjs → bootstrap-C15ZBOCC.mjs} +7 -6
- package/dist/cli/index.mjs +268 -480
- package/dist/{client-BViGcaUC-CZb2Svgh.mjs → client-RM_03B_l-DiEIa9xe.mjs} +53 -6
- package/dist/{client-DNiLcPEq-db3YS57z.mjs → client-gSnsRu5W-v_mC1sRY.mjs} +3 -3
- package/dist/{dist-B1GHzMLc.mjs → dist-1XGLJMOq.mjs} +163 -11
- package/dist/drizzle/0043_onboarding_completed_at.sql +32 -0
- package/dist/drizzle/0044_agent_avatar_color.sql +11 -0
- package/dist/drizzle/0045_agent_avatar_image.sql +17 -0
- package/dist/drizzle/meta/_journal.json +21 -0
- package/dist/{errors-CF5evtJt-B0NTIVPt.mjs → errors-LPcARA4K-Dbrptiyz.mjs} +2 -1
- package/dist/{feishu-30vUx69l.mjs → feishu-BGx71p5s.mjs} +1 -1
- package/dist/index.mjs +7 -7
- package/dist/invitation-CNv7gfFF-DOFZ75wb.mjs +4 -0
- package/dist/{invitation-Bg0TRiyx-BsZH4GCS.mjs → invitation-DZO4NX3P-BPxTeHf-.mjs} +2 -2
- package/dist/{saas-connect-Fgnnnola.mjs → saas-connect-DX3-nDs9.mjs} +830 -108
- package/dist/web/assets/index-BOK7e_td.css +1 -0
- package/dist/web/assets/{index-B7FIVwrn.js → index-BppGbmdT.js} +1 -1
- package/dist/web/assets/index-Is-7_y6O.js +416 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/invitation-C299fxkP-CZgGbsN_.mjs +0 -4
- package/dist/web/assets/index-DJbUySaH.css +0 -1
- package/dist/web/assets/index-DiDfVdIH.js +0 -421
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
var NS=e=>{throw TypeError(e)};var Vp=(e,t,n)=>t.has(e)||NS("Cannot "+n);var $=(e,t,n)=>(Vp(e,t,"read from private field"),n?n.call(e):t.get(e)),Te=(e,t,n)=>t.has(e)?NS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ke=(e,t,n,a)=>(Vp(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Qe=(e,t,n)=>(Vp(e,t,"access private method"),n);var cf=(e,t,n,a)=>({set _(s){ke(e,t,s,n)},get _(){return $(e,t,a)}});function uR(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 uh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qp={exports:{}},Mu={};/**
|
|
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 _S;function cR(){if(_S)return Mu;_S=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 f in s)f!=="key"&&(o[f]=s[f])}else o=s;return s=o.ref,{$$typeof:e,type:a,key:c,ref:s!==void 0?s:null,props:o}}return Mu.Fragment=t,Mu.jsx=n,Mu.jsxs=n,Mu}var TS;function dR(){return TS||(TS=1,Qp.exports=cR()),Qp.exports}var l=dR(),Kp={exports:{}},We={};/**
|
|
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 AS;function fR(){if(AS)return We;AS=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"),f=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"),w=Symbol.iterator;function x(U){return U===null||typeof U!="object"?null:(U=w&&U[w]||U["@@iterator"],typeof U=="function"?U:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(U,B,_){this.props=U,this.context=B,this.refs=E,this.updater=_||k}C.prototype.isReactComponent={},C.prototype.setState=function(U,B){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,B,"setState")},C.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function A(){}A.prototype=C.prototype;function O(U,B,_){this.props=U,this.context=B,this.refs=E,this.updater=_||k}var D=O.prototype=new A;D.constructor=O,j(D,C.prototype),D.isPureReactComponent=!0;var I=Array.isArray;function R(){}var F={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function te(U,B,_){var V=_.ref;return{$$typeof:e,type:U,key:B,ref:V!==void 0?V:null,props:_}}function z(U,B){return te(U.type,B,U.props)}function L(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function Q(U){var B={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(_){return B[_]})}var ce=/\/+/g;function X(U,B){return typeof U=="object"&&U!==null&&U.key!=null?Q(""+U.key):B.toString(36)}function W(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(R,R):(U.status="pending",U.then(function(B){U.status==="pending"&&(U.status="fulfilled",U.value=B)},function(B){U.status==="pending"&&(U.status="rejected",U.reason=B)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function G(U,B,_,V,Z){var re=typeof U;(re==="undefined"||re==="boolean")&&(U=null);var xe=!1;if(U===null)xe=!0;else switch(re){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(U.$$typeof){case e:case t:xe=!0;break;case p:return xe=U._init,G(xe(U._payload),B,_,V,Z)}}if(xe)return Z=Z(U),xe=V===""?"."+X(U,0):V,I(Z)?(_="",xe!=null&&(_=xe.replace(ce,"$&/")+"/"),G(Z,B,_,"",function(He){return He})):Z!=null&&(L(Z)&&(Z=z(Z,_+(Z.key==null||U&&U.key===Z.key?"":(""+Z.key).replace(ce,"$&/")+"/")+xe)),B.push(Z)),1;xe=0;var Re=V===""?".":V+":";if(I(U))for(var Ee=0;Ee<U.length;Ee++)V=U[Ee],re=Re+X(V,Ee),xe+=G(V,B,_,re,Z);else if(Ee=x(U),typeof Ee=="function")for(U=Ee.call(U),Ee=0;!(V=U.next()).done;)V=V.value,re=Re+X(V,Ee++),xe+=G(V,B,_,re,Z);else if(re==="object"){if(typeof U.then=="function")return G(W(U),B,_,V,Z);throw B=String(U),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return xe}function se(U,B,_){if(U==null)return U;var V=[],Z=0;return G(U,V,"","",function(re){return B.call(_,re,Z++)}),V}function ee(U){if(U._status===-1){var B=U._result;B=B(),B.then(function(_){(U._status===0||U._status===-1)&&(U._status=1,U._result=_)},function(_){(U._status===0||U._status===-1)&&(U._status=2,U._result=_)}),U._status===-1&&(U._status=0,U._result=B)}if(U._status===1)return U._result.default;throw U._result}var ve=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},M={map:se,forEach:function(U,B,_){se(U,function(){B.apply(this,arguments)},_)},count:function(U){var B=0;return se(U,function(){B++}),B},toArray:function(U){return se(U,function(B){return B})||[]},only:function(U){if(!L(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return We.Activity=g,We.Children=M,We.Component=C,We.Fragment=n,We.Profiler=s,We.PureComponent=O,We.StrictMode=a,We.Suspense=m,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,We.__COMPILER_RUNTIME={__proto__:null,c:function(U){return F.H.useMemoCache(U)}},We.cache=function(U){return function(){return U.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(U,B,_){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var V=j({},U.props),Z=U.key;if(B!=null)for(re in B.key!==void 0&&(Z=""+B.key),B)!P.call(B,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&B.ref===void 0||(V[re]=B[re]);var re=arguments.length-2;if(re===1)V.children=_;else if(1<re){for(var xe=Array(re),Re=0;Re<re;Re++)xe[Re]=arguments[Re+2];V.children=xe}return te(U.type,Z,V)},We.createContext=function(U){return U={$$typeof:c,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:o,_context:U},U},We.createElement=function(U,B,_){var V,Z={},re=null;if(B!=null)for(V in B.key!==void 0&&(re=""+B.key),B)P.call(B,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(Z[V]=B[V]);var xe=arguments.length-2;if(xe===1)Z.children=_;else if(1<xe){for(var Re=Array(xe),Ee=0;Ee<xe;Ee++)Re[Ee]=arguments[Ee+2];Z.children=Re}if(U&&U.defaultProps)for(V in xe=U.defaultProps,xe)Z[V]===void 0&&(Z[V]=xe[V]);return te(U,re,Z)},We.createRef=function(){return{current:null}},We.forwardRef=function(U){return{$$typeof:f,render:U}},We.isValidElement=L,We.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:ee}},We.memo=function(U,B){return{$$typeof:h,type:U,compare:B===void 0?null:B}},We.startTransition=function(U){var B=F.T,_={};F.T=_;try{var V=U(),Z=F.S;Z!==null&&Z(_,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(R,ve)}catch(re){ve(re)}finally{B!==null&&_.types!==null&&(B.types=_.types),F.T=B}},We.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},We.use=function(U){return F.H.use(U)},We.useActionState=function(U,B,_){return F.H.useActionState(U,B,_)},We.useCallback=function(U,B){return F.H.useCallback(U,B)},We.useContext=function(U){return F.H.useContext(U)},We.useDebugValue=function(){},We.useDeferredValue=function(U,B){return F.H.useDeferredValue(U,B)},We.useEffect=function(U,B){return F.H.useEffect(U,B)},We.useEffectEvent=function(U){return F.H.useEffectEvent(U)},We.useId=function(){return F.H.useId()},We.useImperativeHandle=function(U,B,_){return F.H.useImperativeHandle(U,B,_)},We.useInsertionEffect=function(U,B){return F.H.useInsertionEffect(U,B)},We.useLayoutEffect=function(U,B){return F.H.useLayoutEffect(U,B)},We.useMemo=function(U,B){return F.H.useMemo(U,B)},We.useOptimistic=function(U,B){return F.H.useOptimistic(U,B)},We.useReducer=function(U,B,_){return F.H.useReducer(U,B,_)},We.useRef=function(U){return F.H.useRef(U)},We.useState=function(U){return F.H.useState(U)},We.useSyncExternalStore=function(U,B,_){return F.H.useSyncExternalStore(U,B,_)},We.useTransition=function(){return F.H.useTransition()},We.version="19.2.4",We}var RS;function ov(){return RS||(RS=1,Kp.exports=fR()),Kp.exports}var b=ov();const hR=uh(b),uv=uR({__proto__:null,default:hR},[b]);var Yp={exports:{}},Du={},Xp={exports:{}},Wp={};/**
|
|
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 OS;function mR(){return OS||(OS=1,(function(e){function t(G,se){var ee=G.length;G.push(se);e:for(;0<ee;){var ve=ee-1>>>1,M=G[ve];if(0<s(M,se))G[ve]=se,G[ee]=M,ee=ve;else break e}}function n(G){return G.length===0?null:G[0]}function a(G){if(G.length===0)return null;var se=G[0],ee=G.pop();if(ee!==se){G[0]=ee;e:for(var ve=0,M=G.length,U=M>>>1;ve<U;){var B=2*(ve+1)-1,_=G[B],V=B+1,Z=G[V];if(0>s(_,ee))V<M&&0>s(Z,_)?(G[ve]=Z,G[V]=ee,ve=V):(G[ve]=_,G[B]=ee,ve=B);else if(V<M&&0>s(Z,ee))G[ve]=Z,G[V]=ee,ve=V;else break e}}return se}function s(G,se){var ee=G.sortIndex-se.sortIndex;return ee!==0?ee:G.id-se.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],p=1,g=null,w=3,x=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function D(G){for(var se=n(h);se!==null;){if(se.callback===null)a(h);else if(se.startTime<=G)a(h),se.sortIndex=se.expirationTime,t(m,se);else break;se=n(h)}}function I(G){if(j=!1,D(G),!k)if(n(m)!==null)k=!0,R||(R=!0,Q());else{var se=n(h);se!==null&&W(I,se.startTime-G)}}var R=!1,F=-1,P=5,te=-1;function z(){return E?!0:!(e.unstable_now()-te<P)}function L(){if(E=!1,R){var G=e.unstable_now();te=G;var se=!0;try{e:{k=!1,j&&(j=!1,A(F),F=-1),x=!0;var ee=w;try{t:{for(D(G),g=n(m);g!==null&&!(g.expirationTime>G&&z());){var ve=g.callback;if(typeof ve=="function"){g.callback=null,w=g.priorityLevel;var M=ve(g.expirationTime<=G);if(G=e.unstable_now(),typeof M=="function"){g.callback=M,D(G),se=!0;break t}g===n(m)&&a(m),D(G)}else a(m);g=n(m)}if(g!==null)se=!0;else{var U=n(h);U!==null&&W(I,U.startTime-G),se=!1}}break e}finally{g=null,w=ee,x=!1}se=void 0}}finally{se?Q():R=!1}}}var Q;if(typeof O=="function")Q=function(){O(L)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,X=ce.port2;ce.port1.onmessage=L,Q=function(){X.postMessage(null)}}else Q=function(){C(L,0)};function W(G,se){F=C(function(){G(e.unstable_now())},se)}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(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(G){switch(w){case 1:case 2:case 3:var se=3;break;default:se=w}var ee=w;w=se;try{return G()}finally{w=ee}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(G,se){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ee=w;w=G;try{return se()}finally{w=ee}},e.unstable_scheduleCallback=function(G,se,ee){var ve=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ve+ee:ve):ee=ve,G){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=ee+M,G={id:p++,callback:se,priorityLevel:G,startTime:ee,expirationTime:M,sortIndex:-1},ee>ve?(G.sortIndex=ee,t(h,G),n(m)===null&&G===n(h)&&(j?(A(F),F=-1):j=!0,W(I,ee-ve))):(G.sortIndex=M,t(m,G),k||x||(k=!0,R||(R=!0,Q()))),G},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(G){var se=w;return function(){var ee=w;w=se;try{return G.apply(this,arguments)}finally{w=ee}}}})(Wp)),Wp}var MS;function pR(){return MS||(MS=1,Xp.exports=mR()),Xp.exports}var Jp={exports:{}},Xn={};/**
|
|
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 DS;function gR(){if(DS)return Xn;DS=1;var e=ov();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 f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Xn.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)},Xn.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()}},Xn.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))},Xn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Xn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var p=h.as,g=f(p,h.crossOrigin),w=typeof h.integrity=="string"?h.integrity:void 0,x=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:w,fetchPriority:x}):p==="script"&&a.d.X(m,{crossOrigin:g,integrity:w,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Xn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=f(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)},Xn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,g=f(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})}},Xn.preloadModule=function(m,h){if(typeof m=="string")if(h){var p=f(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)},Xn.requestFormReset=function(m){a.d.r(m)},Xn.unstable_batchedUpdates=function(m,h){return m(h)},Xn.useFormState=function(m,h,p){return c.H.useFormState(m,h,p)},Xn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Xn.version="19.2.4",Xn}var zS;function Yj(){if(zS)return Jp.exports;zS=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(),Jp.exports=gR(),Jp.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 IS;function yR(){if(IS)return Du;IS=1;var e=pR(),t=ov(),n=Yj();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 f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var u=r,d=i;;){var y=u.return;if(y===null)break;var v=y.alternate;if(v===null){if(d=y.return,d!==null){u=d;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===u)return m(y),r;if(v===d)return m(y),i;v=v.sibling}throw Error(a(188))}if(u.return!==d.return)u=y,d=v;else{for(var S=!1,T=y.child;T;){if(T===u){S=!0,u=y,d=v;break}if(T===d){S=!0,d=y,u=v;break}T=T.sibling}if(!S){for(T=v.child;T;){if(T===u){S=!0,u=v,d=y;break}if(T===d){S=!0,d=v,u=y;break}T=T.sibling}if(!S)throw Error(a(189))}}if(u.alternate!==d)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,w=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function Q(r){return r===null||typeof r!="object"?null:(r=L&&r[L]||r["@@iterator"],typeof r=="function"?r:null)}var ce=Symbol.for("react.client.reference");function X(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ce?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case I:return"Suspense";case R:return"SuspenseList";case te:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case D:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case F:return i=r.displayName||null,i!==null?i:X(r.type)||"Memo";case P:i=r._payload,r=r._init;try{return X(r(i))}catch{}}return null}var W=Array.isArray,G=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},ve=[],M=-1;function U(r){return{current:r}}function B(r){0>M||(r.current=ve[M],ve[M]=null,M--)}function _(r,i){M++,ve[M]=r.current,r.current=i}var V=U(null),Z=U(null),re=U(null),xe=U(null);function Re(r,i){switch(_(re,i),_(Z,r),_(V,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Yw(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Yw(i),r=Xw(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}B(V),_(V,r)}function Ee(){B(V),B(Z),B(re)}function He(r){r.memoizedState!==null&&_(xe,r);var i=V.current,u=Xw(i,r.type);i!==u&&(_(Z,r),_(V,u))}function Le(r){Z.current===r&&(B(V),B(Z)),xe.current===r&&(B(xe),Tu._currentValue=ee)}var Ke,et;function St(r){if(Ke===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);Ke=i&&i[1]||"",et=-1<u.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Ke+r+et}var Y=!1;function ge(r,i){if(!r||Y)return"";Y=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(oe){var le=oe}Reflect.construct(r,[],me)}else{try{me.call()}catch(oe){le=oe}r.call(me.prototype)}}else{try{throw Error()}catch(oe){le=oe}(me=r())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(oe){if(oe&&le&&typeof oe.stack=="string")return[oe.stack,le.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),S=v[0],T=v[1];if(S&&T){var q=S.split(`
|
|
44
|
+
`),ie=T.split(`
|
|
45
|
+
`);for(y=d=0;d<q.length&&!q[d].includes("DetermineComponentFrameRoot");)d++;for(;y<ie.length&&!ie[y].includes("DetermineComponentFrameRoot");)y++;if(d===q.length||y===ie.length)for(d=q.length-1,y=ie.length-1;1<=d&&0<=y&&q[d]!==ie[y];)y--;for(;1<=d&&0<=y;d--,y--)if(q[d]!==ie[y]){if(d!==1||y!==1)do if(d--,y--,0>y||q[d]!==ie[y]){var de=`
|
|
46
|
+
`+q[d].replace(" at new "," at ");return r.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",r.displayName)),de}while(1<=d&&0<=y);break}}}finally{Y=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?St(u):""}function Ce(r,i){switch(r.tag){case 26:case 27:case 5:return St(r.type);case 16:return St("Lazy");case 13:return r.child!==i&&i!==null?St("Suspense Fallback"):St("Suspense");case 19:return St("SuspenseList");case 0:case 15:return ge(r.type,!1);case 11:return ge(r.type.render,!1);case 1:return ge(r.type,!0);case 31:return St("Activity");default:return""}}function _e(r){try{var i="",u=null;do i+=Ce(r,u),u=r,r=r.return;while(r);return i}catch(d){return`
|
|
47
|
+
Error generating stack: `+d.message+`
|
|
48
|
+
`+d.stack}}var At=Object.prototype.hasOwnProperty,qe=e.unstable_scheduleCallback,Mn=e.unstable_cancelCallback,rn=e.unstable_shouldYield,La=e.unstable_requestPaint,an=e.unstable_now,fa=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,we=e.unstable_UserBlockingPriority,Fe=e.unstable_NormalPriority,Xe=e.unstable_LowPriority,vt=e.unstable_IdlePriority,_n=e.log,mr=e.unstable_setDisableYieldValue,Gt=null,Ft=null;function Lt(r){if(typeof _n=="function"&&mr(r),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(Gt,r)}catch{}}var ht=Math.clz32?Math.clz32:Fo,pr=Math.log,Un=Math.LN2;function Fo(r){return r>>>=0,r===0?32:31-(pr(r)/Un|0)|0}var ka=256,ir=262144,ha=4194304;function Bn(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 Pa(r,i,u){var d=r.pendingLanes;if(d===0)return 0;var y=0,v=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var T=d&134217727;return T!==0?(d=T&~v,d!==0?y=Bn(d):(S&=T,S!==0?y=Bn(S):u||(u=T&~r,u!==0&&(y=Bn(u))))):(T=d&~v,T!==0?y=Bn(T):S!==0?y=Bn(S):u||(u=d&~r,u!==0&&(y=Bn(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 ma(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Jt(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 Gr(){var r=ha;return ha<<=1,(ha&62914560)===0&&(ha=4194304),r}function wi(r){for(var i=[],u=0;31>u;u++)i.push(r);return i}function pa(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Si(r,i,u,d,y,v){var S=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 T=r.entanglements,q=r.expirationTimes,ie=r.hiddenUpdates;for(u=S&~u;0<u;){var de=31-ht(u),me=1<<de;T[de]=0,q[de]=-1;var le=ie[de];if(le!==null)for(ie[de]=null,de=0;de<le.length;de++){var oe=le[de];oe!==null&&(oe.lane&=-536870913)}u&=~me}d!==0&&ki(r,d,0),v!==0&&y===0&&r.tag!==0&&(r.suspendedLanes|=v&~(S&~i))}function ki(r,i,u){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-ht(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|u&261930}function ji(r,i){var u=r.entangledLanes|=i;for(r=r.entanglements;u;){var d=31-ht(u),y=1<<d;y&i|r[d]&i&&(r[d]|=i),u&=~y}}function js(r,i){var u=i&-i;return u=(u&42)!==0?1:Dn(u),(u&(r.suspendedLanes|i))!==0?0:u}function Dn(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 gr(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Ei(){var r=se.p;return r!==0?r:(r=window.event,r===void 0?32:xS(r.type))}function Ci(r,i){var u=se.p;try{return se.p=r,i()}finally{se.p=u}}var ye=Math.random().toString(36).slice(2),Ge="__reactFiber$"+ye,mt="__reactProps$"+ye,Fn="__reactContainer$"+ye,Ua="__reactEvents$"+ye,$o="__reactListeners$"+ye,Kc="__reactHandles$"+ye,Ho="__reactResources$"+ye,Ni="__reactMarker$"+ye;function Be(r){delete r[Ge],delete r[mt],delete r[Ua],delete r[$o],delete r[Kc]}function H(r){var i=r[Ge];if(i)return i;for(var u=r.parentNode;u;){if(i=u[Fn]||u[Ge]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(r=aS(r);r!==null;){if(u=r[Ge])return u;r=aS(r)}return i}r=u,u=r.parentNode}return null}function pe(r){if(r=r[Ge]||r[Fn]){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 jt(r){var i=r[Ho];return i||(i=r[Ho]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function bt(r){r[Ni]=!0}var en=new Set,$n={};function vn(r,i){zn(r,i),zn(r+"Capture",i)}function zn(r,i){for($n[r]=i,r=0;r<i.length;r++)en.add(i[r])}var qo=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]*$"),hn={},Zo={};function Yc(r){return At.call(Zo,r)?!0:At.call(hn,r)?!1:qo.test(r)?Zo[r]=!0:(hn[r]=!0,!1)}function Xc(r,i,u){if(Yc(i))if(u===null)r.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+u)}}function Wc(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 Ba(r,i,u,d){if(d===null)r.removeAttribute(u);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(i,u,""+d)}}function Vr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function $b(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function nA(r,i,u){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,v=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return y.call(this)},set:function(S){u=""+S,v.call(this,S)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return u},setValue:function(S){u=""+S},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Bh(r){if(!r._valueTracker){var i=$b(r)?"checked":"value";r._valueTracker=nA(r,i,""+r[i])}}function Hb(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var u=i.getValue(),d="";return r&&(d=$b(r)?r.checked?"true":"false":r.value),r=d,r!==u?(i.setValue(r),!0):!1}function Jc(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 rA=/[\n"\\]/g;function Qr(r){return r.replace(rA,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Fh(r,i,u,d,y,v,S,T){r.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?r.type=S:r.removeAttribute("type"),i!=null?S==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Vr(i)):r.value!==""+Vr(i)&&(r.value=""+Vr(i)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),i!=null?$h(r,S,Vr(i)):u!=null?$h(r,S,Vr(u)):d!=null&&r.removeAttribute("value"),y==null&&v!=null&&(r.defaultChecked=!!v),y!=null&&(r.checked=y&&typeof y!="function"&&typeof y!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?r.name=""+Vr(T):r.removeAttribute("name")}function qb(r,i,u,d,y,v,S,T){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)){Bh(r);return}u=u!=null?""+Vr(u):"",i=i!=null?""+Vr(i):u,T||i===r.value||(r.value=i),r.defaultValue=i}d=d??y,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=T?r.checked:!!d,r.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),Bh(r)}function $h(r,i,u){i==="number"&&Jc(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function cl(r,i,u,d){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&&d&&(r[u].defaultSelected=!0)}else{for(u=""+Vr(u),i=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,d&&(r[y].defaultSelected=!0);return}i!==null||r[y].disabled||(i=r[y])}i!==null&&(i.selected=!0)}}function Zb(r,i,u){if(i!=null&&(i=""+Vr(i),i!==r.value&&(r.value=i),u==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=u!=null?""+Vr(u):""}function Gb(r,i,u,d){if(i==null){if(d!=null){if(u!=null)throw Error(a(92));if(W(d)){if(1<d.length)throw Error(a(93));d=d[0]}u=d}u==null&&(u=""),i=u}u=Vr(i),r.defaultValue=u,d=r.textContent,d===u&&d!==""&&d!==null&&(r.value=d),Bh(r)}function dl(r,i){if(i){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=i;return}}r.textContent=i}var aA=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 Vb(r,i,u){var d=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,u):typeof u!="number"||u===0||aA.has(i)?i==="float"?r.cssFloat=u:r[i]=(""+u).trim():r[i]=u+"px"}function Qb(r,i,u){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,u!=null){for(var d in u)!u.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var y in i)d=i[y],i.hasOwnProperty(y)&&u[y]!==d&&Vb(r,y,d)}else for(var v in i)i.hasOwnProperty(v)&&Vb(r,v,i[v])}function Hh(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 iA=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"]]),sA=/^[\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 ed(r){return sA.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Fa(){}var qh=null;function Zh(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var fl=null,hl=null;function Kb(r){var i=pe(r);if(i&&(r=i.stateNode)){var u=r[mt]||null;e:switch(r=i.stateNode,i.type){case"input":if(Fh(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="'+Qr(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var d=u[i];if(d!==r&&d.form===r.form){var y=d[mt]||null;if(!y)throw Error(a(90));Fh(d,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(i=0;i<u.length;i++)d=u[i],d.form===r.form&&Hb(d)}break e;case"textarea":Zb(r,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&cl(r,!!u.multiple,i,!1)}}}var Gh=!1;function Yb(r,i,u){if(Gh)return r(i,u);Gh=!0;try{var d=r(i);return d}finally{if(Gh=!1,(fl!==null||hl!==null)&&(Fd(),fl&&(i=fl,r=hl,hl=fl=null,Kb(i),r)))for(i=0;i<r.length;i++)Kb(r[i])}}function Go(r,i){var u=r.stateNode;if(u===null)return null;var d=u[mt]||null;if(d===null)return null;u=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(a(231,i,typeof u));return u}var $a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vh=!1;if($a)try{var Vo={};Object.defineProperty(Vo,"passive",{get:function(){Vh=!0}}),window.addEventListener("test",Vo,Vo),window.removeEventListener("test",Vo,Vo)}catch{Vh=!1}var _i=null,Qh=null,td=null;function Xb(){if(td)return td;var r,i=Qh,u=i.length,d,y="value"in _i?_i.value:_i.textContent,v=y.length;for(r=0;r<u&&i[r]===y[r];r++);var S=u-r;for(d=1;d<=S&&i[u-d]===y[v-d];d++);return td=y.slice(r,1<d?1-d:void 0)}function nd(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 rd(){return!0}function Wb(){return!1}function yr(r){function i(u,d,y,v,S){this._reactName=u,this._targetInst=y,this.type=d,this.nativeEvent=v,this.target=S,this.currentTarget=null;for(var T in r)r.hasOwnProperty(T)&&(u=r[T],this[T]=u?u(v):v[T]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?rd:Wb,this.isPropagationStopped=Wb,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=rd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=rd)},persist:function(){},isPersistent:rd}),i}var Es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ad=yr(Es),Qo=g({},Es,{view:0,detail:0}),lA=yr(Qo),Kh,Yh,Ko,id=g({},Qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wh,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!==Ko&&(Ko&&r.type==="mousemove"?(Kh=r.screenX-Ko.screenX,Yh=r.screenY-Ko.screenY):Yh=Kh=0,Ko=r),Kh)},movementY:function(r){return"movementY"in r?r.movementY:Yh}}),Jb=yr(id),oA=g({},id,{dataTransfer:0}),uA=yr(oA),cA=g({},Qo,{relatedTarget:0}),Xh=yr(cA),dA=g({},Es,{animationName:0,elapsedTime:0,pseudoElement:0}),fA=yr(dA),hA=g({},Es,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),mA=yr(hA),pA=g({},Es,{data:0}),ex=yr(pA),gA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yA={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"},vA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bA(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=vA[r])?!!i[r]:!1}function Wh(){return bA}var xA=g({},Qo,{key:function(r){if(r.key){var i=gA[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=nd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?yA[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wh,charCode:function(r){return r.type==="keypress"?nd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?nd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),wA=yr(xA),SA=g({},id,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tx=yr(SA),kA=g({},Qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wh}),jA=yr(kA),EA=g({},Es,{propertyName:0,elapsedTime:0,pseudoElement:0}),CA=yr(EA),NA=g({},id,{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}),_A=yr(NA),TA=g({},Es,{newState:0,oldState:0}),AA=yr(TA),RA=[9,13,27,32],Jh=$a&&"CompositionEvent"in window,Yo=null;$a&&"documentMode"in document&&(Yo=document.documentMode);var OA=$a&&"TextEvent"in window&&!Yo,nx=$a&&(!Jh||Yo&&8<Yo&&11>=Yo),rx=" ",ax=!1;function ix(r,i){switch(r){case"keyup":return RA.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ml=!1;function MA(r,i){switch(r){case"compositionend":return sx(i);case"keypress":return i.which!==32?null:(ax=!0,rx);case"textInput":return r=i.data,r===rx&&ax?null:r;default:return null}}function DA(r,i){if(ml)return r==="compositionend"||!Jh&&ix(r,i)?(r=Xb(),td=Qh=_i=null,ml=!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 nx&&i.locale!=="ko"?null:i.data;default:return null}}var zA={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 lx(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!zA[r.type]:i==="textarea"}function ox(r,i,u,d){fl?hl?hl.push(d):hl=[d]:fl=d,i=Qd(i,"onChange"),0<i.length&&(u=new ad("onChange","change",null,u,d),r.push({event:u,listeners:i}))}var Xo=null,Wo=null;function IA(r){qw(r,0)}function sd(r){var i=Ne(r);if(Hb(i))return r}function ux(r,i){if(r==="change")return i}var cx=!1;if($a){var em;if($a){var tm="oninput"in document;if(!tm){var dx=document.createElement("div");dx.setAttribute("oninput","return;"),tm=typeof dx.oninput=="function"}em=tm}else em=!1;cx=em&&(!document.documentMode||9<document.documentMode)}function fx(){Xo&&(Xo.detachEvent("onpropertychange",hx),Wo=Xo=null)}function hx(r){if(r.propertyName==="value"&&sd(Wo)){var i=[];ox(i,Wo,r,Zh(r)),Yb(IA,i)}}function LA(r,i,u){r==="focusin"?(fx(),Xo=i,Wo=u,Xo.attachEvent("onpropertychange",hx)):r==="focusout"&&fx()}function PA(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return sd(Wo)}function UA(r,i){if(r==="click")return sd(i)}function BA(r,i){if(r==="input"||r==="change")return sd(i)}function FA(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Mr=typeof Object.is=="function"?Object.is:FA;function Jo(r,i){if(Mr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var u=Object.keys(r),d=Object.keys(i);if(u.length!==d.length)return!1;for(d=0;d<u.length;d++){var y=u[d];if(!At.call(i,y)||!Mr(r[y],i[y]))return!1}return!0}function mx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function px(r,i){var u=mx(r);r=0;for(var d;u;){if(u.nodeType===3){if(d=r+u.textContent.length,r<=i&&d>=i)return{node:u,offset:i-r};r=d}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=mx(u)}}function gx(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?gx(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function yx(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Jc(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=Jc(r.document)}return i}function nm(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 $A=$a&&"documentMode"in document&&11>=document.documentMode,pl=null,rm=null,eu=null,am=!1;function vx(r,i,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;am||pl==null||pl!==Jc(d)||(d=pl,"selectionStart"in d&&nm(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),eu&&Jo(eu,d)||(eu=d,d=Qd(rm,"onSelect"),0<d.length&&(i=new ad("onSelect","select",null,i,u),r.push({event:i,listeners:d}),i.target=pl)))}function Cs(r,i){var u={};return u[r.toLowerCase()]=i.toLowerCase(),u["Webkit"+r]="webkit"+i,u["Moz"+r]="moz"+i,u}var gl={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionrun:Cs("Transition","TransitionRun"),transitionstart:Cs("Transition","TransitionStart"),transitioncancel:Cs("Transition","TransitionCancel"),transitionend:Cs("Transition","TransitionEnd")},im={},bx={};$a&&(bx=document.createElement("div").style,"AnimationEvent"in window||(delete gl.animationend.animation,delete gl.animationiteration.animation,delete gl.animationstart.animation),"TransitionEvent"in window||delete gl.transitionend.transition);function Ns(r){if(im[r])return im[r];if(!gl[r])return r;var i=gl[r],u;for(u in i)if(i.hasOwnProperty(u)&&u in bx)return im[r]=i[u];return r}var xx=Ns("animationend"),wx=Ns("animationiteration"),Sx=Ns("animationstart"),HA=Ns("transitionrun"),qA=Ns("transitionstart"),ZA=Ns("transitioncancel"),kx=Ns("transitionend"),jx=new Map,sm="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(" ");sm.push("scrollEnd");function ga(r,i){jx.set(r,i),vn(i,[r])}var ld=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)},Kr=[],yl=0,lm=0;function od(){for(var r=yl,i=lm=yl=0;i<r;){var u=Kr[i];Kr[i++]=null;var d=Kr[i];Kr[i++]=null;var y=Kr[i];Kr[i++]=null;var v=Kr[i];if(Kr[i++]=null,d!==null&&y!==null){var S=d.pending;S===null?y.next=y:(y.next=S.next,S.next=y),d.pending=y}v!==0&&Ex(u,y,v)}}function ud(r,i,u,d){Kr[yl++]=r,Kr[yl++]=i,Kr[yl++]=u,Kr[yl++]=d,lm|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function om(r,i,u,d){return ud(r,i,u,d),cd(r)}function _s(r,i){return ud(r,null,null,i),cd(r)}function Ex(r,i,u){r.lanes|=u;var d=r.alternate;d!==null&&(d.lanes|=u);for(var y=!1,v=r.return;v!==null;)v.childLanes|=u,d=v.alternate,d!==null&&(d.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-ht(u),r=v.hiddenUpdates,d=r[y],d===null?r[y]=[i]:d.push(i),i.lane=u|536870912),v):null}function cd(r){if(50<Su)throw Su=0,yp=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var vl={};function GA(r,i,u,d){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=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dr(r,i,u,d){return new GA(r,i,u,d)}function um(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ha(r,i){var u=r.alternate;return u===null?(u=Dr(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 Cx(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 dd(r,i,u,d,y,v){var S=0;if(d=r,typeof r=="function")um(r)&&(S=1);else if(typeof r=="string")S=X2(r,u,V.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case te:return r=Dr(31,u,i,y),r.elementType=te,r.lanes=v,r;case j:return Ts(u.children,y,v,i);case E:S=8,y|=24;break;case C:return r=Dr(12,u,i,y|2),r.elementType=C,r.lanes=v,r;case I:return r=Dr(13,u,i,y),r.elementType=I,r.lanes=v,r;case R:return r=Dr(19,u,i,y),r.elementType=R,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:S=10;break e;case A:S=9;break e;case D:S=11;break e;case F:S=14;break e;case P:S=16,d=null;break e}S=29,u=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Dr(S,u,i,y),i.elementType=r,i.type=d,i.lanes=v,i}function Ts(r,i,u,d){return r=Dr(7,r,d,i),r.lanes=u,r}function cm(r,i,u){return r=Dr(6,r,null,i),r.lanes=u,r}function Nx(r){var i=Dr(18,null,null,0);return i.stateNode=r,i}function dm(r,i,u){return i=Dr(4,r.children!==null?r.children:[],r.key,i),i.lanes=u,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var _x=new WeakMap;function Yr(r,i){if(typeof r=="object"&&r!==null){var u=_x.get(r);return u!==void 0?u:(i={value:r,source:i,stack:_e(i)},_x.set(r,i),i)}return{value:r,source:i,stack:_e(i)}}var bl=[],xl=0,fd=null,tu=0,Xr=[],Wr=0,Ti=null,ja=1,Ea="";function qa(r,i){bl[xl++]=tu,bl[xl++]=fd,fd=r,tu=i}function Tx(r,i,u){Xr[Wr++]=ja,Xr[Wr++]=Ea,Xr[Wr++]=Ti,Ti=r;var d=ja;r=Ea;var y=32-ht(d)-1;d&=~(1<<y),u+=1;var v=32-ht(i)+y;if(30<v){var S=y-y%5;v=(d&(1<<S)-1).toString(32),d>>=S,y-=S,ja=1<<32-ht(i)+y|u<<y|d,Ea=v+r}else ja=1<<v|u<<y|d,Ea=r}function fm(r){r.return!==null&&(qa(r,1),Tx(r,1,0))}function hm(r){for(;r===fd;)fd=bl[--xl],bl[xl]=null,tu=bl[--xl],bl[xl]=null;for(;r===Ti;)Ti=Xr[--Wr],Xr[Wr]=null,Ea=Xr[--Wr],Xr[Wr]=null,ja=Xr[--Wr],Xr[Wr]=null}function Ax(r,i){Xr[Wr++]=ja,Xr[Wr++]=Ea,Xr[Wr++]=Ti,ja=i.id,Ea=i.overflow,Ti=r}var Hn=null,Ht=null,xt=!1,Ai=null,Jr=!1,mm=Error(a(519));function Ri(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nu(Yr(i,r)),mm}function Rx(r){var i=r.stateNode,u=r.type,d=r.memoizedProps;switch(i[Ge]=r,i[mt]=d,u){case"dialog":ct("cancel",i),ct("close",i);break;case"iframe":case"object":case"embed":ct("load",i);break;case"video":case"audio":for(u=0;u<ju.length;u++)ct(ju[u],i);break;case"source":ct("error",i);break;case"img":case"image":case"link":ct("error",i),ct("load",i);break;case"details":ct("toggle",i);break;case"input":ct("invalid",i),qb(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":ct("invalid",i);break;case"textarea":ct("invalid",i),Gb(i,d.value,d.defaultValue,d.children)}u=d.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||d.suppressHydrationWarning===!0||Qw(i.textContent,u)?(d.popover!=null&&(ct("beforetoggle",i),ct("toggle",i)),d.onScroll!=null&&ct("scroll",i),d.onScrollEnd!=null&&ct("scrollend",i),d.onClick!=null&&(i.onclick=Fa),i=!0):i=!1,i||Ri(r,!0)}function Ox(r){for(Hn=r.return;Hn;)switch(Hn.tag){case 5:case 31:case 13:Jr=!1;return;case 27:case 3:Jr=!0;return;default:Hn=Hn.return}}function wl(r){if(r!==Hn)return!1;if(!xt)return Ox(r),xt=!0,!1;var i=r.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||Op(r.type,r.memoizedProps)),u=!u),u&&Ht&&Ri(r),Ox(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Ht=rS(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Ht=rS(r)}else i===27?(i=Ht,Zi(r.type)?(r=Lp,Lp=null,Ht=r):Ht=i):Ht=Hn?ta(r.stateNode.nextSibling):null;return!0}function As(){Ht=Hn=null,xt=!1}function pm(){var r=Ai;return r!==null&&(wr===null?wr=r:wr.push.apply(wr,r),Ai=null),r}function nu(r){Ai===null?Ai=[r]:Ai.push(r)}var gm=U(null),Rs=null,Za=null;function Oi(r,i,u){_(gm,i._currentValue),i._currentValue=u}function Ga(r){r._currentValue=gm.current,B(gm)}function ym(r,i,u){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===u)break;r=r.return}}function vm(r,i,u,d){var y=r.child;for(y!==null&&(y.return=r);y!==null;){var v=y.dependencies;if(v!==null){var S=y.child;v=v.firstContext;e:for(;v!==null;){var T=v;v=y;for(var q=0;q<i.length;q++)if(T.context===i[q]){v.lanes|=u,T=v.alternate,T!==null&&(T.lanes|=u),ym(v.return,u,r),d||(S=null);break e}v=T.next}}else if(y.tag===18){if(S=y.return,S===null)throw Error(a(341));S.lanes|=u,v=S.alternate,v!==null&&(v.lanes|=u),ym(S,u,r),S=null}else S=y.child;if(S!==null)S.return=y;else for(S=y;S!==null;){if(S===r){S=null;break}if(y=S.sibling,y!==null){y.return=S.return,S=y;break}S=S.return}y=S}}function Sl(r,i,u,d){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 S=y.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var T=y.type;Mr(y.pendingProps.value,S.value)||(r!==null?r.push(T):r=[T])}}else if(y===xe.current){if(S=y.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(r!==null?r.push(Tu):r=[Tu])}y=y.return}r!==null&&vm(i,r,u,d),i.flags|=262144}function hd(r){for(r=r.firstContext;r!==null;){if(!Mr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Os(r){Rs=r,Za=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function qn(r){return Mx(Rs,r)}function md(r,i){return Rs===null&&Os(r),Mx(r,i)}function Mx(r,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},Za===null){if(r===null)throw Error(a(308));Za=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Za=Za.next=i;return u}var VA=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(u,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(u){return u()})}},QA=e.unstable_scheduleCallback,KA=e.unstable_NormalPriority,bn={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bm(){return{controller:new VA,data:new Map,refCount:0}}function ru(r){r.refCount--,r.refCount===0&&QA(KA,function(){r.controller.abort()})}var au=null,xm=0,kl=0,jl=null;function YA(r,i){if(au===null){var u=au=[];xm=0,kl=kp(),jl={status:"pending",value:void 0,then:function(d){u.push(d)}}}return xm++,i.then(Dx,Dx),i}function Dx(){if(--xm===0&&au!==null){jl!==null&&(jl.status="fulfilled");var r=au;au=null,kl=0,jl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function XA(r,i){var u=[],d={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var y=0;y<u.length;y++)(0,u[y])(i)},function(y){for(d.status="rejected",d.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),d}var zx=G.S;G.S=function(r,i){vw=an(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&YA(r,i),zx!==null&&zx(r,i)};var Ms=U(null);function wm(){var r=Ms.current;return r!==null?r:Pt.pooledCache}function pd(r,i){i===null?_(Ms,Ms.current):_(Ms,i.pool)}function Ix(){var r=wm();return r===null?null:{parent:bn._currentValue,pool:r}}var El=Error(a(460)),Sm=Error(a(474)),gd=Error(a(542)),yd={then:function(){}};function Lx(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Px(r,i,u){switch(u=r[u],u===void 0?r.push(i):u!==i&&(i.then(Fa,Fa),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Bx(r),r;default:if(typeof i.status=="string")i.then(Fa,Fa);else{if(r=Pt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var y=i;y.status="fulfilled",y.value=d}},function(d){if(i.status==="pending"){var y=i;y.status="rejected",y.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Bx(r),r}throw zs=i,El}}function Ds(r){try{var i=r._init;return i(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(zs=u,El):u}}var zs=null;function Ux(){if(zs===null)throw Error(a(459));var r=zs;return zs=null,r}function Bx(r){if(r===El||r===gd)throw Error(a(483))}var Cl=null,iu=0;function vd(r){var i=iu;return iu+=1,Cl===null&&(Cl=[]),Px(Cl,r,i)}function su(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function bd(r,i){throw i.$$typeof===w?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function Fx(r){function i(J,K){if(r){var ae=J.deletions;ae===null?(J.deletions=[K],J.flags|=16):ae.push(K)}}function u(J,K){if(!r)return null;for(;K!==null;)i(J,K),K=K.sibling;return null}function d(J){for(var K=new Map;J!==null;)J.key!==null?K.set(J.key,J):K.set(J.index,J),J=J.sibling;return K}function y(J,K){return J=Ha(J,K),J.index=0,J.sibling=null,J}function v(J,K,ae){return J.index=ae,r?(ae=J.alternate,ae!==null?(ae=ae.index,ae<K?(J.flags|=67108866,K):ae):(J.flags|=67108866,K)):(J.flags|=1048576,K)}function S(J){return r&&J.alternate===null&&(J.flags|=67108866),J}function T(J,K,ae,he){return K===null||K.tag!==6?(K=cm(ae,J.mode,he),K.return=J,K):(K=y(K,ae),K.return=J,K)}function q(J,K,ae,he){var $e=ae.type;return $e===j?de(J,K,ae.props.children,he,ae.key):K!==null&&(K.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===P&&Ds($e)===K.type)?(K=y(K,ae.props),su(K,ae),K.return=J,K):(K=dd(ae.type,ae.key,ae.props,null,J.mode,he),su(K,ae),K.return=J,K)}function ie(J,K,ae,he){return K===null||K.tag!==4||K.stateNode.containerInfo!==ae.containerInfo||K.stateNode.implementation!==ae.implementation?(K=dm(ae,J.mode,he),K.return=J,K):(K=y(K,ae.children||[]),K.return=J,K)}function de(J,K,ae,he,$e){return K===null||K.tag!==7?(K=Ts(ae,J.mode,he,$e),K.return=J,K):(K=y(K,ae),K.return=J,K)}function me(J,K,ae){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=cm(""+K,J.mode,ae),K.return=J,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case x:return ae=dd(K.type,K.key,K.props,null,J.mode,ae),su(ae,K),ae.return=J,ae;case k:return K=dm(K,J.mode,ae),K.return=J,K;case P:return K=Ds(K),me(J,K,ae)}if(W(K)||Q(K))return K=Ts(K,J.mode,ae,null),K.return=J,K;if(typeof K.then=="function")return me(J,vd(K),ae);if(K.$$typeof===O)return me(J,md(J,K),ae);bd(J,K)}return null}function le(J,K,ae,he){var $e=K!==null?K.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return $e!==null?null:T(J,K,""+ae,he);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:return ae.key===$e?q(J,K,ae,he):null;case k:return ae.key===$e?ie(J,K,ae,he):null;case P:return ae=Ds(ae),le(J,K,ae,he)}if(W(ae)||Q(ae))return $e!==null?null:de(J,K,ae,he,null);if(typeof ae.then=="function")return le(J,K,vd(ae),he);if(ae.$$typeof===O)return le(J,K,md(J,ae),he);bd(J,ae)}return null}function oe(J,K,ae,he,$e){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return J=J.get(ae)||null,T(K,J,""+he,$e);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case x:return J=J.get(he.key===null?ae:he.key)||null,q(K,J,he,$e);case k:return J=J.get(he.key===null?ae:he.key)||null,ie(K,J,he,$e);case P:return he=Ds(he),oe(J,K,ae,he,$e)}if(W(he)||Q(he))return J=J.get(ae)||null,de(K,J,he,$e,null);if(typeof he.then=="function")return oe(J,K,ae,vd(he),$e);if(he.$$typeof===O)return oe(J,K,ae,md(K,he),$e);bd(K,he)}return null}function Ae(J,K,ae,he){for(var $e=null,Et=null,Ie=K,tt=K=0,gt=null;Ie!==null&&tt<ae.length;tt++){Ie.index>tt?(gt=Ie,Ie=null):gt=Ie.sibling;var Ct=le(J,Ie,ae[tt],he);if(Ct===null){Ie===null&&(Ie=gt);break}r&&Ie&&Ct.alternate===null&&i(J,Ie),K=v(Ct,K,tt),Et===null?$e=Ct:Et.sibling=Ct,Et=Ct,Ie=gt}if(tt===ae.length)return u(J,Ie),xt&&qa(J,tt),$e;if(Ie===null){for(;tt<ae.length;tt++)Ie=me(J,ae[tt],he),Ie!==null&&(K=v(Ie,K,tt),Et===null?$e=Ie:Et.sibling=Ie,Et=Ie);return xt&&qa(J,tt),$e}for(Ie=d(Ie);tt<ae.length;tt++)gt=oe(Ie,J,tt,ae[tt],he),gt!==null&&(r&>.alternate!==null&&Ie.delete(gt.key===null?tt:gt.key),K=v(gt,K,tt),Et===null?$e=gt:Et.sibling=gt,Et=gt);return r&&Ie.forEach(function(Yi){return i(J,Yi)}),xt&&qa(J,tt),$e}function Ve(J,K,ae,he){if(ae==null)throw Error(a(151));for(var $e=null,Et=null,Ie=K,tt=K=0,gt=null,Ct=ae.next();Ie!==null&&!Ct.done;tt++,Ct=ae.next()){Ie.index>tt?(gt=Ie,Ie=null):gt=Ie.sibling;var Yi=le(J,Ie,Ct.value,he);if(Yi===null){Ie===null&&(Ie=gt);break}r&&Ie&&Yi.alternate===null&&i(J,Ie),K=v(Yi,K,tt),Et===null?$e=Yi:Et.sibling=Yi,Et=Yi,Ie=gt}if(Ct.done)return u(J,Ie),xt&&qa(J,tt),$e;if(Ie===null){for(;!Ct.done;tt++,Ct=ae.next())Ct=me(J,Ct.value,he),Ct!==null&&(K=v(Ct,K,tt),Et===null?$e=Ct:Et.sibling=Ct,Et=Ct);return xt&&qa(J,tt),$e}for(Ie=d(Ie);!Ct.done;tt++,Ct=ae.next())Ct=oe(Ie,J,tt,Ct.value,he),Ct!==null&&(r&&Ct.alternate!==null&&Ie.delete(Ct.key===null?tt:Ct.key),K=v(Ct,K,tt),Et===null?$e=Ct:Et.sibling=Ct,Et=Ct);return r&&Ie.forEach(function(oR){return i(J,oR)}),xt&&qa(J,tt),$e}function zt(J,K,ae,he){if(typeof ae=="object"&&ae!==null&&ae.type===j&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:e:{for(var $e=ae.key;K!==null;){if(K.key===$e){if($e=ae.type,$e===j){if(K.tag===7){u(J,K.sibling),he=y(K,ae.props.children),he.return=J,J=he;break e}}else if(K.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===P&&Ds($e)===K.type){u(J,K.sibling),he=y(K,ae.props),su(he,ae),he.return=J,J=he;break e}u(J,K);break}else i(J,K);K=K.sibling}ae.type===j?(he=Ts(ae.props.children,J.mode,he,ae.key),he.return=J,J=he):(he=dd(ae.type,ae.key,ae.props,null,J.mode,he),su(he,ae),he.return=J,J=he)}return S(J);case k:e:{for($e=ae.key;K!==null;){if(K.key===$e)if(K.tag===4&&K.stateNode.containerInfo===ae.containerInfo&&K.stateNode.implementation===ae.implementation){u(J,K.sibling),he=y(K,ae.children||[]),he.return=J,J=he;break e}else{u(J,K);break}else i(J,K);K=K.sibling}he=dm(ae,J.mode,he),he.return=J,J=he}return S(J);case P:return ae=Ds(ae),zt(J,K,ae,he)}if(W(ae))return Ae(J,K,ae,he);if(Q(ae)){if($e=Q(ae),typeof $e!="function")throw Error(a(150));return ae=$e.call(ae),Ve(J,K,ae,he)}if(typeof ae.then=="function")return zt(J,K,vd(ae),he);if(ae.$$typeof===O)return zt(J,K,md(J,ae),he);bd(J,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,K!==null&&K.tag===6?(u(J,K.sibling),he=y(K,ae),he.return=J,J=he):(u(J,K),he=cm(ae,J.mode,he),he.return=J,J=he),S(J)):u(J,K)}return function(J,K,ae,he){try{iu=0;var $e=zt(J,K,ae,he);return Cl=null,$e}catch(Ie){if(Ie===El||Ie===gd)throw Ie;var Et=Dr(29,Ie,null,J.mode);return Et.lanes=he,Et.return=J,Et}finally{}}}var Is=Fx(!0),$x=Fx(!1),Mi=!1;function km(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jm(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 Di(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function zi(r,i,u){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(Nt&2)!==0){var y=d.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),d.pending=i,i=cd(r),Ex(r,null,u),i}return ud(r,d,i,u),cd(r)}function lu(r,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,u|=d,i.lanes=u,ji(r,u)}}function Em(r,i){var u=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,u===d)){var y=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var S={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?y=v=S:v=v.next=S,u=u.next}while(u!==null);v===null?y=v=i:v=v.next=i}else y=v=i;u={baseState:d.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=i:r.next=i,u.lastBaseUpdate=i}var Cm=!1;function ou(){if(Cm){var r=jl;if(r!==null)throw r}}function uu(r,i,u,d){Cm=!1;var y=r.updateQueue;Mi=!1;var v=y.firstBaseUpdate,S=y.lastBaseUpdate,T=y.shared.pending;if(T!==null){y.shared.pending=null;var q=T,ie=q.next;q.next=null,S===null?v=ie:S.next=ie,S=q;var de=r.alternate;de!==null&&(de=de.updateQueue,T=de.lastBaseUpdate,T!==S&&(T===null?de.firstBaseUpdate=ie:T.next=ie,de.lastBaseUpdate=q))}if(v!==null){var me=y.baseState;S=0,de=ie=q=null,T=v;do{var le=T.lane&-536870913,oe=le!==T.lane;if(oe?(pt&le)===le:(d&le)===le){le!==0&&le===kl&&(Cm=!0),de!==null&&(de=de.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var Ae=r,Ve=T;le=i;var zt=u;switch(Ve.tag){case 1:if(Ae=Ve.payload,typeof Ae=="function"){me=Ae.call(zt,me,le);break e}me=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Ve.payload,le=typeof Ae=="function"?Ae.call(zt,me,le):Ae,le==null)break e;me=g({},me,le);break e;case 2:Mi=!0}}le=T.callback,le!==null&&(r.flags|=64,oe&&(r.flags|=8192),oe=y.callbacks,oe===null?y.callbacks=[le]:oe.push(le))}else oe={lane:le,tag:T.tag,payload:T.payload,callback:T.callback,next:null},de===null?(ie=de=oe,q=me):de=de.next=oe,S|=le;if(T=T.next,T===null){if(T=y.shared.pending,T===null)break;oe=T,T=oe.next,oe.next=null,y.lastBaseUpdate=oe,y.shared.pending=null}}while(!0);de===null&&(q=me),y.baseState=q,y.firstBaseUpdate=ie,y.lastBaseUpdate=de,v===null&&(y.shared.lanes=0),Bi|=S,r.lanes=S,r.memoizedState=me}}function Hx(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function qx(r,i){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)Hx(u[r],i)}var Nl=U(null),xd=U(0);function Zx(r,i){r=ti,_(xd,r),_(Nl,i),ti=r|i.baseLanes}function Nm(){_(xd,ti),_(Nl,Nl.current)}function _m(){ti=xd.current,B(Nl),B(xd)}var zr=U(null),ea=null;function Ii(r){var i=r.alternate;_(mn,mn.current&1),_(zr,r),ea===null&&(i===null||Nl.current!==null||i.memoizedState!==null)&&(ea=r)}function Tm(r){_(mn,mn.current),_(zr,r),ea===null&&(ea=r)}function Gx(r){r.tag===22?(_(mn,mn.current),_(zr,r),ea===null&&(ea=r)):Li()}function Li(){_(mn,mn.current),_(zr,zr.current)}function Ir(r){B(zr),ea===r&&(ea=null),B(mn)}var mn=U(0);function wd(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)||Ip(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 Va=0,Je=null,Mt=null,xn=null,Sd=!1,_l=!1,Ls=!1,kd=0,cu=0,Tl=null,WA=0;function sn(){throw Error(a(321))}function Am(r,i){if(i===null)return!1;for(var u=0;u<i.length&&u<r.length;u++)if(!Mr(r[u],i[u]))return!1;return!0}function Rm(r,i,u,d,y,v){return Va=v,Je=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,G.H=r===null||r.memoizedState===null?T0:Gm,Ls=!1,v=u(d,y),Ls=!1,_l&&(v=Qx(i,u,d,y)),Vx(r),v}function Vx(r){G.H=hu;var i=Mt!==null&&Mt.next!==null;if(Va=0,xn=Mt=Je=null,Sd=!1,cu=0,Tl=null,i)throw Error(a(300));r===null||wn||(r=r.dependencies,r!==null&&hd(r)&&(wn=!0))}function Qx(r,i,u,d){Je=r;var y=0;do{if(_l&&(Tl=null),cu=0,_l=!1,25<=y)throw Error(a(301));if(y+=1,xn=Mt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}G.H=A0,v=i(u,d)}while(_l);return v}function JA(){var r=G.H,i=r.useState()[0];return i=typeof i.then=="function"?du(i):i,r=r.useState()[0],(Mt!==null?Mt.memoizedState:null)!==r&&(Je.flags|=1024),i}function Om(){var r=kd!==0;return kd=0,r}function Mm(r,i,u){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~u}function Dm(r){if(Sd){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Sd=!1}Va=0,xn=Mt=Je=null,_l=!1,cu=kd=0,Tl=null}function sr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xn===null?Je.memoizedState=xn=r:xn=xn.next=r,xn}function pn(){if(Mt===null){var r=Je.alternate;r=r!==null?r.memoizedState:null}else r=Mt.next;var i=xn===null?Je.memoizedState:xn.next;if(i!==null)xn=i,Mt=r;else{if(r===null)throw Je.alternate===null?Error(a(467)):Error(a(310));Mt=r,r={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},xn===null?Je.memoizedState=xn=r:xn=xn.next=r}return xn}function jd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function du(r){var i=cu;return cu+=1,Tl===null&&(Tl=[]),r=Px(Tl,r,i),i=Je,(xn===null?i.memoizedState:xn.next)===null&&(i=i.alternate,G.H=i===null||i.memoizedState===null?T0:Gm),r}function Ed(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return du(r);if(r.$$typeof===O)return qn(r)}throw Error(a(438,String(r)))}function zm(r){var i=null,u=Je.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var d=Je.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(y){return y.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=jd(),Je.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(r),d=0;d<r;d++)u[d]=z;return i.index++,u}function Qa(r,i){return typeof i=="function"?i(r):i}function Cd(r){var i=pn();return Im(i,Mt,r)}function Im(r,i,u){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=u;var y=r.baseQueue,v=d.pending;if(v!==null){if(y!==null){var S=y.next;y.next=v.next,v.next=S}i.baseQueue=y=v,d.pending=null}if(v=r.baseState,y===null)r.memoizedState=v;else{i=y.next;var T=S=null,q=null,ie=i,de=!1;do{var me=ie.lane&-536870913;if(me!==ie.lane?(pt&me)===me:(Va&me)===me){var le=ie.revertLane;if(le===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),me===kl&&(de=!0);else if((Va&le)===le){ie=ie.next,le===kl&&(de=!0);continue}else me={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(T=q=me,S=v):q=q.next=me,Je.lanes|=le,Bi|=le;me=ie.action,Ls&&u(v,me),v=ie.hasEagerState?ie.eagerState:u(v,me)}else le={lane:me,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(T=q=le,S=v):q=q.next=le,Je.lanes|=me,Bi|=me;ie=ie.next}while(ie!==null&&ie!==i);if(q===null?S=v:q.next=T,!Mr(v,r.memoizedState)&&(wn=!0,de&&(u=jl,u!==null)))throw u;r.memoizedState=v,r.baseState=S,r.baseQueue=q,d.lastRenderedState=v}return y===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Lm(r){var i=pn(),u=i.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=r;var d=u.dispatch,y=u.pending,v=i.memoizedState;if(y!==null){u.pending=null;var S=y=y.next;do v=r(v,S.action),S=S.next;while(S!==y);Mr(v,i.memoizedState)||(wn=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),u.lastRenderedState=v}return[v,d]}function Kx(r,i,u){var d=Je,y=pn(),v=xt;if(v){if(u===void 0)throw Error(a(407));u=u()}else u=i();var S=!Mr((Mt||y).memoizedState,u);if(S&&(y.memoizedState=u,wn=!0),y=y.queue,Bm(Wx.bind(null,d,y,r),[r]),y.getSnapshot!==i||S||xn!==null&&xn.memoizedState.tag&1){if(d.flags|=2048,Al(9,{destroy:void 0},Xx.bind(null,d,y,u,i),null),Pt===null)throw Error(a(349));v||(Va&127)!==0||Yx(d,i,u)}return u}function Yx(r,i,u){r.flags|=16384,r={getSnapshot:i,value:u},i=Je.updateQueue,i===null?(i=jd(),Je.updateQueue=i,i.stores=[r]):(u=i.stores,u===null?i.stores=[r]:u.push(r))}function Xx(r,i,u,d){i.value=u,i.getSnapshot=d,Jx(i)&&e0(r)}function Wx(r,i,u){return u(function(){Jx(i)&&e0(r)})}function Jx(r){var i=r.getSnapshot;r=r.value;try{var u=i();return!Mr(r,u)}catch{return!0}}function e0(r){var i=_s(r,2);i!==null&&Sr(i,r,2)}function Pm(r){var i=sr();if(typeof r=="function"){var u=r;if(r=u(),Ls){Lt(!0);try{u()}finally{Lt(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:r},i}function t0(r,i,u,d){return r.baseState=u,Im(r,Mt,typeof d=="function"?d:Qa)}function e2(r,i,u,d,y){if(Td(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(S){v.listeners.push(S)}};G.T!==null?u(!0):v.isTransition=!1,d(v),u=i.pending,u===null?(v.next=i.pending=v,n0(i,v)):(v.next=u.next,i.pending=u.next=v)}}function n0(r,i){var u=i.action,d=i.payload,y=r.state;if(i.isTransition){var v=G.T,S={};G.T=S;try{var T=u(y,d),q=G.S;q!==null&&q(S,T),r0(r,i,T)}catch(ie){Um(r,i,ie)}finally{v!==null&&S.types!==null&&(v.types=S.types),G.T=v}}else try{v=u(y,d),r0(r,i,v)}catch(ie){Um(r,i,ie)}}function r0(r,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(d){a0(r,i,d)},function(d){return Um(r,i,d)}):a0(r,i,u)}function a0(r,i,u){i.status="fulfilled",i.value=u,i0(i),r.state=u,i=r.pending,i!==null&&(u=i.next,u===i?r.pending=null:(u=u.next,i.next=u,n0(r,u)))}function Um(r,i,u){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=u,i0(i),i=i.next;while(i!==d)}r.action=null}function i0(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function s0(r,i){return i}function l0(r,i){if(xt){var u=Pt.formState;if(u!==null){e:{var d=Je;if(xt){if(Ht){t:{for(var y=Ht,v=Jr;y.nodeType!==8;){if(!v){y=null;break t}if(y=ta(y.nextSibling),y===null){y=null;break t}}v=y.data,y=v==="F!"||v==="F"?y:null}if(y){Ht=ta(y.nextSibling),d=y.data==="F!";break e}}Ri(d)}d=!1}d&&(i=u[0])}}return u=sr(),u.memoizedState=u.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s0,lastRenderedState:i},u.queue=d,u=C0.bind(null,Je,d),d.dispatch=u,d=Pm(!1),v=Zm.bind(null,Je,!1,d.queue),d=sr(),y={state:i,dispatch:null,action:r,pending:null},d.queue=y,u=e2.bind(null,Je,y,v,u),y.dispatch=u,d.memoizedState=r,[i,u,!1]}function o0(r){var i=pn();return u0(i,Mt,r)}function u0(r,i,u){if(i=Im(r,i,s0)[0],r=Cd(Qa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=du(i)}catch(S){throw S===El?gd:S}else d=i;i=pn();var y=i.queue,v=y.dispatch;return u!==i.memoizedState&&(Je.flags|=2048,Al(9,{destroy:void 0},t2.bind(null,y,u),null)),[d,v,r]}function t2(r,i){r.action=i}function c0(r){var i=pn(),u=Mt;if(u!==null)return u0(i,u,r);pn(),i=i.memoizedState,u=pn();var d=u.queue.dispatch;return u.memoizedState=r,[i,d,!1]}function Al(r,i,u,d){return r={tag:r,create:u,deps:d,inst:i,next:null},i=Je.updateQueue,i===null&&(i=jd(),Je.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=r.next=r:(d=u.next,u.next=r,r.next=d,i.lastEffect=r),r}function d0(){return pn().memoizedState}function Nd(r,i,u,d){var y=sr();Je.flags|=r,y.memoizedState=Al(1|i,{destroy:void 0},u,d===void 0?null:d)}function _d(r,i,u,d){var y=pn();d=d===void 0?null:d;var v=y.memoizedState.inst;Mt!==null&&d!==null&&Am(d,Mt.memoizedState.deps)?y.memoizedState=Al(i,v,u,d):(Je.flags|=r,y.memoizedState=Al(1|i,v,u,d))}function f0(r,i){Nd(8390656,8,r,i)}function Bm(r,i){_d(2048,8,r,i)}function n2(r){Je.flags|=4;var i=Je.updateQueue;if(i===null)i=jd(),Je.updateQueue=i,i.events=[r];else{var u=i.events;u===null?i.events=[r]:u.push(r)}}function h0(r){var i=pn().memoizedState;return n2({ref:i,nextImpl:r}),function(){if((Nt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function m0(r,i){return _d(4,2,r,i)}function p0(r,i){return _d(4,4,r,i)}function g0(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 y0(r,i,u){u=u!=null?u.concat([r]):null,_d(4,4,g0.bind(null,i,r),u)}function Fm(){}function v0(r,i){var u=pn();i=i===void 0?null:i;var d=u.memoizedState;return i!==null&&Am(i,d[1])?d[0]:(u.memoizedState=[r,i],r)}function b0(r,i){var u=pn();i=i===void 0?null:i;var d=u.memoizedState;if(i!==null&&Am(i,d[1]))return d[0];if(d=r(),Ls){Lt(!0);try{r()}finally{Lt(!1)}}return u.memoizedState=[d,i],d}function $m(r,i,u){return u===void 0||(Va&1073741824)!==0&&(pt&261930)===0?r.memoizedState=i:(r.memoizedState=u,r=xw(),Je.lanes|=r,Bi|=r,u)}function x0(r,i,u,d){return Mr(u,i)?u:Nl.current!==null?(r=$m(r,u,d),Mr(r,i)||(wn=!0),r):(Va&42)===0||(Va&1073741824)!==0&&(pt&261930)===0?(wn=!0,r.memoizedState=u):(r=xw(),Je.lanes|=r,Bi|=r,i)}function w0(r,i,u,d,y){var v=se.p;se.p=v!==0&&8>v?v:8;var S=G.T,T={};G.T=T,Zm(r,!1,i,u);try{var q=y(),ie=G.S;if(ie!==null&&ie(T,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var de=XA(q,d);fu(r,i,de,Ur(r))}else fu(r,i,d,Ur(r))}catch(me){fu(r,i,{then:function(){},status:"rejected",reason:me},Ur())}finally{se.p=v,S!==null&&T.types!==null&&(S.types=T.types),G.T=S}}function r2(){}function Hm(r,i,u,d){if(r.tag!==5)throw Error(a(476));var y=S0(r).queue;w0(r,y,i,ee,u===null?r2:function(){return k0(r),u(d)})}function S0(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:ee},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:u},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function k0(r){var i=S0(r);i.next===null&&(i=r.alternate.memoizedState),fu(r,i.next.queue,{},Ur())}function qm(){return qn(Tu)}function j0(){return pn().memoizedState}function E0(){return pn().memoizedState}function a2(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var u=Ur();r=Di(u);var d=zi(i,r,u);d!==null&&(Sr(d,i,u),lu(d,i,u)),i={cache:bm()},r.payload=i;return}i=i.return}}function i2(r,i,u){var d=Ur();u={lane:d,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Td(r)?N0(i,u):(u=om(r,i,u,d),u!==null&&(Sr(u,r,d),_0(u,i,d)))}function C0(r,i,u){var d=Ur();fu(r,i,u,d)}function fu(r,i,u,d){var y={lane:d,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Td(r))N0(i,y);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var S=i.lastRenderedState,T=v(S,u);if(y.hasEagerState=!0,y.eagerState=T,Mr(T,S))return ud(r,i,y,0),Pt===null&&od(),!1}catch{}finally{}if(u=om(r,i,y,d),u!==null)return Sr(u,r,d),_0(u,i,d),!0}return!1}function Zm(r,i,u,d){if(d={lane:2,revertLane:kp(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Td(r)){if(i)throw Error(a(479))}else i=om(r,u,d,2),i!==null&&Sr(i,r,2)}function Td(r){var i=r.alternate;return r===Je||i!==null&&i===Je}function N0(r,i){_l=Sd=!0;var u=r.pending;u===null?i.next=i:(i.next=u.next,u.next=i),r.pending=i}function _0(r,i,u){if((u&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,u|=d,i.lanes=u,ji(r,u)}}var hu={readContext:qn,use:Ed,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useLayoutEffect:sn,useInsertionEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useSyncExternalStore:sn,useId:sn,useHostTransitionStatus:sn,useFormState:sn,useActionState:sn,useOptimistic:sn,useMemoCache:sn,useCacheRefresh:sn};hu.useEffectEvent=sn;var T0={readContext:qn,use:Ed,useCallback:function(r,i){return sr().memoizedState=[r,i===void 0?null:i],r},useContext:qn,useEffect:f0,useImperativeHandle:function(r,i,u){u=u!=null?u.concat([r]):null,Nd(4194308,4,g0.bind(null,i,r),u)},useLayoutEffect:function(r,i){return Nd(4194308,4,r,i)},useInsertionEffect:function(r,i){Nd(4,2,r,i)},useMemo:function(r,i){var u=sr();i=i===void 0?null:i;var d=r();if(Ls){Lt(!0);try{r()}finally{Lt(!1)}}return u.memoizedState=[d,i],d},useReducer:function(r,i,u){var d=sr();if(u!==void 0){var y=u(i);if(Ls){Lt(!0);try{u(i)}finally{Lt(!1)}}}else y=i;return d.memoizedState=d.baseState=y,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:y},d.queue=r,r=r.dispatch=i2.bind(null,Je,r),[d.memoizedState,r]},useRef:function(r){var i=sr();return r={current:r},i.memoizedState=r},useState:function(r){r=Pm(r);var i=r.queue,u=C0.bind(null,Je,i);return i.dispatch=u,[r.memoizedState,u]},useDebugValue:Fm,useDeferredValue:function(r,i){var u=sr();return $m(u,r,i)},useTransition:function(){var r=Pm(!1);return r=w0.bind(null,Je,r.queue,!0,!1),sr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,u){var d=Je,y=sr();if(xt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),Pt===null)throw Error(a(349));(pt&127)!==0||Yx(d,i,u)}y.memoizedState=u;var v={value:u,getSnapshot:i};return y.queue=v,f0(Wx.bind(null,d,v,r),[r]),d.flags|=2048,Al(9,{destroy:void 0},Xx.bind(null,d,v,u,i),null),u},useId:function(){var r=sr(),i=Pt.identifierPrefix;if(xt){var u=Ea,d=ja;u=(d&~(1<<32-ht(d)-1)).toString(32)+u,i="_"+i+"R_"+u,u=kd++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=WA++,i="_"+i+"r_"+u.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:qm,useFormState:l0,useActionState:l0,useOptimistic:function(r){var i=sr();i.memoizedState=i.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=Zm.bind(null,Je,!0,u),u.dispatch=i,[r,i]},useMemoCache:zm,useCacheRefresh:function(){return sr().memoizedState=a2.bind(null,Je)},useEffectEvent:function(r){var i=sr(),u={impl:r};return i.memoizedState=u,function(){if((Nt&2)!==0)throw Error(a(440));return u.impl.apply(void 0,arguments)}}},Gm={readContext:qn,use:Ed,useCallback:v0,useContext:qn,useEffect:Bm,useImperativeHandle:y0,useInsertionEffect:m0,useLayoutEffect:p0,useMemo:b0,useReducer:Cd,useRef:d0,useState:function(){return Cd(Qa)},useDebugValue:Fm,useDeferredValue:function(r,i){var u=pn();return x0(u,Mt.memoizedState,r,i)},useTransition:function(){var r=Cd(Qa)[0],i=pn().memoizedState;return[typeof r=="boolean"?r:du(r),i]},useSyncExternalStore:Kx,useId:j0,useHostTransitionStatus:qm,useFormState:o0,useActionState:o0,useOptimistic:function(r,i){var u=pn();return t0(u,Mt,r,i)},useMemoCache:zm,useCacheRefresh:E0};Gm.useEffectEvent=h0;var A0={readContext:qn,use:Ed,useCallback:v0,useContext:qn,useEffect:Bm,useImperativeHandle:y0,useInsertionEffect:m0,useLayoutEffect:p0,useMemo:b0,useReducer:Lm,useRef:d0,useState:function(){return Lm(Qa)},useDebugValue:Fm,useDeferredValue:function(r,i){var u=pn();return Mt===null?$m(u,r,i):x0(u,Mt.memoizedState,r,i)},useTransition:function(){var r=Lm(Qa)[0],i=pn().memoizedState;return[typeof r=="boolean"?r:du(r),i]},useSyncExternalStore:Kx,useId:j0,useHostTransitionStatus:qm,useFormState:c0,useActionState:c0,useOptimistic:function(r,i){var u=pn();return Mt!==null?t0(u,Mt,r,i):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:zm,useCacheRefresh:E0};A0.useEffectEvent=h0;function Vm(r,i,u,d){i=r.memoizedState,u=u(d,i),u=u==null?i:g({},i,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Qm={enqueueSetState:function(r,i,u){r=r._reactInternals;var d=Ur(),y=Di(d);y.payload=i,u!=null&&(y.callback=u),i=zi(r,y,d),i!==null&&(Sr(i,r,d),lu(i,r,d))},enqueueReplaceState:function(r,i,u){r=r._reactInternals;var d=Ur(),y=Di(d);y.tag=1,y.payload=i,u!=null&&(y.callback=u),i=zi(r,y,d),i!==null&&(Sr(i,r,d),lu(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var u=Ur(),d=Di(u);d.tag=2,i!=null&&(d.callback=i),i=zi(r,d,u),i!==null&&(Sr(i,r,u),lu(i,r,u))}};function R0(r,i,u,d,y,v,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,S):i.prototype&&i.prototype.isPureReactComponent?!Jo(u,d)||!Jo(y,v):!0}function O0(r,i,u,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,d),i.state!==r&&Qm.enqueueReplaceState(i,i.state,null)}function Ps(r,i){var u=i;if("ref"in i){u={};for(var d in i)d!=="ref"&&(u[d]=i[d])}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 M0(r){ld(r)}function D0(r){console.error(r)}function z0(r){ld(r)}function Ad(r,i){try{var u=r.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function I0(r,i,u){try{var d=r.onCaughtError;d(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Km(r,i,u){return u=Di(u),u.tag=3,u.payload={element:null},u.callback=function(){Ad(r,i)},u}function L0(r){return r=Di(r),r.tag=3,r}function P0(r,i,u,d){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var v=d.value;r.payload=function(){return y(v)},r.callback=function(){I0(i,u,d)}}var S=u.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(r.callback=function(){I0(i,u,d),typeof y!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var T=d.stack;this.componentDidCatch(d.value,{componentStack:T!==null?T:""})})}function s2(r,i,u,d,y){if(u.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=u.alternate,i!==null&&Sl(i,u,y,!0),u=zr.current,u!==null){switch(u.tag){case 31:case 13:return ea===null?$d():u.alternate===null&&ln===0&&(ln=3),u.flags&=-257,u.flags|=65536,u.lanes=y,d===yd?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([d]):i.add(d),xp(r,d,y)),!1;case 22:return u.flags|=65536,d===yd?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([d]):u.add(d)),xp(r,d,y)),!1}throw Error(a(435,u.tag))}return xp(r,d,y),$d(),!1}if(xt)return i=zr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=y,d!==mm&&(r=Error(a(422),{cause:d}),nu(Yr(r,u)))):(d!==mm&&(i=Error(a(423),{cause:d}),nu(Yr(i,u))),r=r.current.alternate,r.flags|=65536,y&=-y,r.lanes|=y,d=Yr(d,u),y=Km(r.stateNode,d,y),Em(r,y),ln!==4&&(ln=2)),!1;var v=Error(a(520),{cause:d});if(v=Yr(v,u),wu===null?wu=[v]:wu.push(v),ln!==4&&(ln=2),i===null)return!0;d=Yr(d,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,r=y&-y,u.lanes|=r,r=Km(u.stateNode,d,r),Em(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"&&(Fi===null||!Fi.has(v))))return u.flags|=65536,y&=-y,u.lanes|=y,y=L0(y),P0(y,r,u,d),Em(u,y),!1}u=u.return}while(u!==null);return!1}var Ym=Error(a(461)),wn=!1;function Zn(r,i,u,d){i.child=r===null?$x(i,null,u,d):Is(i,r.child,u,d)}function U0(r,i,u,d,y){u=u.render;var v=i.ref;if("ref"in d){var S={};for(var T in d)T!=="ref"&&(S[T]=d[T])}else S=d;return Os(i),d=Rm(r,i,u,S,v,y),T=Om(),r!==null&&!wn?(Mm(r,i,y),Ka(r,i,y)):(xt&&T&&fm(i),i.flags|=1,Zn(r,i,d,y),i.child)}function B0(r,i,u,d,y){if(r===null){var v=u.type;return typeof v=="function"&&!um(v)&&v.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=v,F0(r,i,v,d,y)):(r=dd(u.type,null,d,i,i.mode,y),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!ap(r,y)){var S=v.memoizedProps;if(u=u.compare,u=u!==null?u:Jo,u(S,d)&&r.ref===i.ref)return Ka(r,i,y)}return i.flags|=1,r=Ha(v,d),r.ref=i.ref,r.return=i,i.child=r}function F0(r,i,u,d,y){if(r!==null){var v=r.memoizedProps;if(Jo(v,d)&&r.ref===i.ref)if(wn=!1,i.pendingProps=d=v,ap(r,y))(r.flags&131072)!==0&&(wn=!0);else return i.lanes=r.lanes,Ka(r,i,y)}return Xm(r,i,u,d,y)}function $0(r,i,u,d){var y=d.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|u:u,r!==null){for(d=i.child=r.child,y=0;d!==null;)y=y|d.lanes|d.childLanes,d=d.sibling;d=y&~v}else d=0,i.child=null;return H0(r,i,v,u,d)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&pd(i,v!==null?v.cachePool:null),v!==null?Zx(i,v):Nm(),Gx(i);else return d=i.lanes=536870912,H0(r,i,v!==null?v.baseLanes|u:u,u,d)}else v!==null?(pd(i,v.cachePool),Zx(i,v),Li(),i.memoizedState=null):(r!==null&&pd(i,null),Nm(),Li());return Zn(r,i,y,u),i.child}function mu(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function H0(r,i,u,d,y){var v=wm();return v=v===null?null:{parent:bn._currentValue,pool:v},i.memoizedState={baseLanes:u,cachePool:v},r!==null&&pd(i,null),Nm(),Gx(i),r!==null&&Sl(r,i,d,!0),i.childLanes=y,null}function Rd(r,i){return i=Md({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function q0(r,i,u){return Is(i,r.child,null,u),r=Rd(i,i.pendingProps),r.flags|=2,Ir(i),i.memoizedState=null,r}function l2(r,i,u){var d=i.pendingProps,y=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(xt){if(d.mode==="hidden")return r=Rd(i,d),i.lanes=536870912,mu(null,r);if(Tm(i),(r=Ht)?(r=nS(r,Jr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ti!==null?{id:ja,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},u=Nx(r),u.return=i,i.child=u,Hn=i,Ht=null)):r=null,r===null)throw Ri(i);return i.lanes=536870912,null}return Rd(i,d)}var v=r.memoizedState;if(v!==null){var S=v.dehydrated;if(Tm(i),y)if(i.flags&256)i.flags&=-257,i=q0(r,i,u);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(wn||Sl(r,i,u,!1),y=(u&r.childLanes)!==0,wn||y){if(d=Pt,d!==null&&(S=js(d,u),S!==0&&S!==v.retryLane))throw v.retryLane=S,_s(r,S),Sr(d,r,S),Ym;$d(),i=q0(r,i,u)}else r=v.treeContext,Ht=ta(S.nextSibling),Hn=i,xt=!0,Ai=null,Jr=!1,r!==null&&Ax(i,r),i=Rd(i,d),i.flags|=4096;return i}return r=Ha(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Od(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 Xm(r,i,u,d,y){return Os(i),u=Rm(r,i,u,d,void 0,y),d=Om(),r!==null&&!wn?(Mm(r,i,y),Ka(r,i,y)):(xt&&d&&fm(i),i.flags|=1,Zn(r,i,u,y),i.child)}function Z0(r,i,u,d,y,v){return Os(i),i.updateQueue=null,u=Qx(i,d,u,y),Vx(r),d=Om(),r!==null&&!wn?(Mm(r,i,v),Ka(r,i,v)):(xt&&d&&fm(i),i.flags|=1,Zn(r,i,u,v),i.child)}function G0(r,i,u,d,y){if(Os(i),i.stateNode===null){var v=vl,S=u.contextType;typeof S=="object"&&S!==null&&(v=qn(S)),v=new u(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Qm,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},km(i),S=u.contextType,v.context=typeof S=="object"&&S!==null?qn(S):vl,v.state=i.memoizedState,S=u.getDerivedStateFromProps,typeof S=="function"&&(Vm(i,u,S,d),v.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(S=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),S!==v.state&&Qm.enqueueReplaceState(v,v.state,null),uu(i,d,v,y),ou(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var T=i.memoizedProps,q=Ps(u,T);v.props=q;var ie=v.context,de=u.contextType;S=vl,typeof de=="object"&&de!==null&&(S=qn(de));var me=u.getDerivedStateFromProps;de=typeof me=="function"||typeof v.getSnapshotBeforeUpdate=="function",T=i.pendingProps!==T,de||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T||ie!==S)&&O0(i,v,d,S),Mi=!1;var le=i.memoizedState;v.state=le,uu(i,d,v,y),ou(),ie=i.memoizedState,T||le!==ie||Mi?(typeof me=="function"&&(Vm(i,u,me,d),ie=i.memoizedState),(q=Mi||R0(i,u,q,d,le,ie,S))?(de||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=ie),v.props=d,v.state=ie,v.context=S,d=q):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,jm(r,i),S=i.memoizedProps,de=Ps(u,S),v.props=de,me=i.pendingProps,le=v.context,ie=u.contextType,q=vl,typeof ie=="object"&&ie!==null&&(q=qn(ie)),T=u.getDerivedStateFromProps,(ie=typeof T=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==me||le!==q)&&O0(i,v,d,q),Mi=!1,le=i.memoizedState,v.state=le,uu(i,d,v,y),ou();var oe=i.memoizedState;S!==me||le!==oe||Mi||r!==null&&r.dependencies!==null&&hd(r.dependencies)?(typeof T=="function"&&(Vm(i,u,T,d),oe=i.memoizedState),(de=Mi||R0(i,u,de,d,le,oe,q)||r!==null&&r.dependencies!==null&&hd(r.dependencies))?(ie||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,oe,q),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,oe,q)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&le===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&le===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=oe),v.props=d,v.state=oe,v.context=q,d=de):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&le===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&le===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,Od(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,u=d&&typeof u.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=Is(i,r.child,null,y),i.child=Is(i,null,u,y)):Zn(r,i,u,y),i.memoizedState=v.state,r=i.child):r=Ka(r,i,y),r}function V0(r,i,u,d){return As(),i.flags|=256,Zn(r,i,u,d),i.child}var Wm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jm(r){return{baseLanes:r,cachePool:Ix()}}function ep(r,i,u){return r=r!==null?r.childLanes&~u:0,i&&(r|=Pr),r}function Q0(r,i,u){var d=i.pendingProps,y=!1,v=(i.flags&128)!==0,S;if((S=v)||(S=r!==null&&r.memoizedState===null?!1:(mn.current&2)!==0),S&&(y=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,r===null){if(xt){if(y?Ii(i):Li(),(r=Ht)?(r=nS(r,Jr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ti!==null?{id:ja,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},u=Nx(r),u.return=i,i.child=u,Hn=i,Ht=null)):r=null,r===null)throw Ri(i);return Ip(r)?i.lanes=32:i.lanes=536870912,null}var T=d.children;return d=d.fallback,y?(Li(),y=i.mode,T=Md({mode:"hidden",children:T},y),d=Ts(d,y,u,null),T.return=i,d.return=i,T.sibling=d,i.child=T,d=i.child,d.memoizedState=Jm(u),d.childLanes=ep(r,S,u),i.memoizedState=Wm,mu(null,d)):(Ii(i),tp(i,T))}var q=r.memoizedState;if(q!==null&&(T=q.dehydrated,T!==null)){if(v)i.flags&256?(Ii(i),i.flags&=-257,i=np(r,i,u)):i.memoizedState!==null?(Li(),i.child=r.child,i.flags|=128,i=null):(Li(),T=d.fallback,y=i.mode,d=Md({mode:"visible",children:d.children},y),T=Ts(T,y,u,null),T.flags|=2,d.return=i,T.return=i,d.sibling=T,i.child=d,Is(i,r.child,null,u),d=i.child,d.memoizedState=Jm(u),d.childLanes=ep(r,S,u),i.memoizedState=Wm,i=mu(null,d));else if(Ii(i),Ip(T)){if(S=T.nextSibling&&T.nextSibling.dataset,S)var ie=S.dgst;S=ie,d=Error(a(419)),d.stack="",d.digest=S,nu({value:d,source:null,stack:null}),i=np(r,i,u)}else if(wn||Sl(r,i,u,!1),S=(u&r.childLanes)!==0,wn||S){if(S=Pt,S!==null&&(d=js(S,u),d!==0&&d!==q.retryLane))throw q.retryLane=d,_s(r,d),Sr(S,r,d),Ym;zp(T)||$d(),i=np(r,i,u)}else zp(T)?(i.flags|=192,i.child=r.child,i=null):(r=q.treeContext,Ht=ta(T.nextSibling),Hn=i,xt=!0,Ai=null,Jr=!1,r!==null&&Ax(i,r),i=tp(i,d.children),i.flags|=4096);return i}return y?(Li(),T=d.fallback,y=i.mode,q=r.child,ie=q.sibling,d=Ha(q,{mode:"hidden",children:d.children}),d.subtreeFlags=q.subtreeFlags&65011712,ie!==null?T=Ha(ie,T):(T=Ts(T,y,u,null),T.flags|=2),T.return=i,d.return=i,d.sibling=T,i.child=d,mu(null,d),d=i.child,T=r.child.memoizedState,T===null?T=Jm(u):(y=T.cachePool,y!==null?(q=bn._currentValue,y=y.parent!==q?{parent:q,pool:q}:y):y=Ix(),T={baseLanes:T.baseLanes|u,cachePool:y}),d.memoizedState=T,d.childLanes=ep(r,S,u),i.memoizedState=Wm,mu(r.child,d)):(Ii(i),u=r.child,r=u.sibling,u=Ha(u,{mode:"visible",children:d.children}),u.return=i,u.sibling=null,r!==null&&(S=i.deletions,S===null?(i.deletions=[r],i.flags|=16):S.push(r)),i.child=u,i.memoizedState=null,u)}function tp(r,i){return i=Md({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Md(r,i){return r=Dr(22,r,null,i),r.lanes=0,r}function np(r,i,u){return Is(i,r.child,null,u),r=tp(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function K0(r,i,u){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),ym(r.return,i,u)}function rp(r,i,u,d,y,v){var S=r.memoizedState;S===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:u,tailMode:y,treeForkCount:v}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=u,S.tailMode=y,S.treeForkCount=v)}function Y0(r,i,u){var d=i.pendingProps,y=d.revealOrder,v=d.tail;d=d.children;var S=mn.current,T=(S&2)!==0;if(T?(S=S&1|2,i.flags|=128):S&=1,_(mn,S),Zn(r,i,d,u),d=xt?tu:0,!T&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&K0(r,u,i);else if(r.tag===19)K0(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&&wd(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=i.child,i.child=null):(y=u.sibling,u.sibling=null),rp(i,!1,y,u,v,d);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=i.child,i.child=null;y!==null;){if(r=y.alternate,r!==null&&wd(r)===null){i.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}rp(i,!0,u,null,v,d);break;case"together":rp(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Ka(r,i,u){if(r!==null&&(i.dependencies=r.dependencies),Bi|=i.lanes,(u&i.childLanes)===0)if(r!==null){if(Sl(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=Ha(r,r.pendingProps),i.child=u,u.return=i;r.sibling!==null;)r=r.sibling,u=u.sibling=Ha(r,r.pendingProps),u.return=i;u.sibling=null}return i.child}function ap(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&hd(r)))}function o2(r,i,u){switch(i.tag){case 3:Re(i,i.stateNode.containerInfo),Oi(i,bn,r.memoizedState.cache),As();break;case 27:case 5:He(i);break;case 4:Re(i,i.stateNode.containerInfo);break;case 10:Oi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Tm(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Ii(i),i.flags|=128,null):(u&i.child.childLanes)!==0?Q0(r,i,u):(Ii(i),r=Ka(r,i,u),r!==null?r.sibling:null);Ii(i);break;case 19:var y=(r.flags&128)!==0;if(d=(u&i.childLanes)!==0,d||(Sl(r,i,u,!1),d=(u&i.childLanes)!==0),y){if(d)return Y0(r,i,u);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),_(mn,mn.current),d)break;return null;case 22:return i.lanes=0,$0(r,i,u,i.pendingProps);case 24:Oi(i,bn,r.memoizedState.cache)}return Ka(r,i,u)}function X0(r,i,u){if(r!==null)if(r.memoizedProps!==i.pendingProps)wn=!0;else{if(!ap(r,u)&&(i.flags&128)===0)return wn=!1,o2(r,i,u);wn=(r.flags&131072)!==0}else wn=!1,xt&&(i.flags&1048576)!==0&&Tx(i,tu,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Ds(i.elementType),i.type=r,typeof r=="function")um(r)?(d=Ps(r,d),i.tag=1,i=G0(null,i,r,d,u)):(i.tag=0,i=Xm(null,i,r,d,u));else{if(r!=null){var y=r.$$typeof;if(y===D){i.tag=11,i=U0(null,i,r,d,u);break e}else if(y===F){i.tag=14,i=B0(null,i,r,d,u);break e}}throw i=X(r)||r,Error(a(306,i,""))}}return i;case 0:return Xm(r,i,i.type,i.pendingProps,u);case 1:return d=i.type,y=Ps(d,i.pendingProps),G0(r,i,d,y,u);case 3:e:{if(Re(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;y=v.element,jm(r,i),uu(i,d,null,u);var S=i.memoizedState;if(d=S.cache,Oi(i,bn,d),d!==v.cache&&vm(i,[bn],u,!0),ou(),d=S.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=V0(r,i,d,u);break e}else if(d!==y){y=Yr(Error(a(424)),i),nu(y),i=V0(r,i,d,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(Ht=ta(r.firstChild),Hn=i,xt=!0,Ai=null,Jr=!0,u=$x(i,null,d,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(As(),d===y){i=Ka(r,i,u);break e}Zn(r,i,d,u)}i=i.child}return i;case 26:return Od(r,i),r===null?(u=oS(i.type,null,i.pendingProps,null))?i.memoizedState=u:xt||(u=i.type,r=i.pendingProps,d=Kd(re.current).createElement(u),d[Ge]=i,d[mt]=r,Gn(d,u,r),bt(d),i.stateNode=d):i.memoizedState=oS(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return He(i),r===null&&xt&&(d=i.stateNode=iS(i.type,i.pendingProps,re.current),Hn=i,Jr=!0,y=Ht,Zi(i.type)?(Lp=y,Ht=ta(d.firstChild)):Ht=y),Zn(r,i,i.pendingProps.children,u),Od(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&xt&&((y=d=Ht)&&(d=P2(d,i.type,i.pendingProps,Jr),d!==null?(i.stateNode=d,Hn=i,Ht=ta(d.firstChild),Jr=!1,y=!0):y=!1),y||Ri(i)),He(i),y=i.type,v=i.pendingProps,S=r!==null?r.memoizedProps:null,d=v.children,Op(y,v)?d=null:S!==null&&Op(y,S)&&(i.flags|=32),i.memoizedState!==null&&(y=Rm(r,i,JA,null,null,u),Tu._currentValue=y),Od(r,i),Zn(r,i,d,u),i.child;case 6:return r===null&&xt&&((r=u=Ht)&&(u=U2(u,i.pendingProps,Jr),u!==null?(i.stateNode=u,Hn=i,Ht=null,r=!0):r=!1),r||Ri(i)),null;case 13:return Q0(r,i,u);case 4:return Re(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Is(i,null,d,u):Zn(r,i,d,u),i.child;case 11:return U0(r,i,i.type,i.pendingProps,u);case 7:return Zn(r,i,i.pendingProps,u),i.child;case 8:return Zn(r,i,i.pendingProps.children,u),i.child;case 12:return Zn(r,i,i.pendingProps.children,u),i.child;case 10:return d=i.pendingProps,Oi(i,i.type,d.value),Zn(r,i,d.children,u),i.child;case 9:return y=i.type._context,d=i.pendingProps.children,Os(i),y=qn(y),d=d(y),i.flags|=1,Zn(r,i,d,u),i.child;case 14:return B0(r,i,i.type,i.pendingProps,u);case 15:return F0(r,i,i.type,i.pendingProps,u);case 19:return Y0(r,i,u);case 31:return l2(r,i,u);case 22:return $0(r,i,u,i.pendingProps);case 24:return Os(i),d=qn(bn),r===null?(y=wm(),y===null&&(y=Pt,v=bm(),y.pooledCache=v,v.refCount++,v!==null&&(y.pooledCacheLanes|=u),y=v),i.memoizedState={parent:d,cache:y},km(i),Oi(i,bn,y)):((r.lanes&u)!==0&&(jm(r,i),uu(i,null,null,u),ou()),y=r.memoizedState,v=i.memoizedState,y.parent!==d?(y={parent:d,cache:d},i.memoizedState=y,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=y),Oi(i,bn,d)):(d=v.cache,Oi(i,bn,d),d!==y.cache&&vm(i,[bn],u,!0))),Zn(r,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ya(r){r.flags|=4}function ip(r,i,u,d,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(jw())r.flags|=8192;else throw zs=yd,Sm}else r.flags&=-16777217}function W0(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!hS(i))if(jw())r.flags|=8192;else throw zs=yd,Sm}function Dd(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Gr():536870912,r.lanes|=i,Dl|=i)}function pu(r,i){if(!xt)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 d=null;u!==null;)u.alternate!==null&&(d=u),u=u.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function qt(r){var i=r.alternate!==null&&r.alternate.child===r.child,u=0,d=0;if(i)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,d|=y.subtreeFlags&65011712,d|=y.flags&65011712,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,d|=y.subtreeFlags,d|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=d,r.childLanes=u,i}function u2(r,i,u){var d=i.pendingProps;switch(hm(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(i),null;case 1:return qt(i),null;case 3:return u=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Ga(bn),Ee(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(wl(i)?Ya(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,pm())),qt(i),null;case 26:var y=i.type,v=i.memoizedState;return r===null?(Ya(i),v!==null?(qt(i),W0(i,v)):(qt(i),ip(i,y,null,d,u))):v?v!==r.memoizedState?(Ya(i),qt(i),W0(i,v)):(qt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&Ya(i),qt(i),ip(i,y,r,d,u)),null;case 27:if(Le(i),u=re.current,y=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Ya(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return qt(i),null}r=V.current,wl(i)?Rx(i):(r=iS(y,d,u),i.stateNode=r,Ya(i))}return qt(i),null;case 5:if(Le(i),y=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Ya(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return qt(i),null}if(v=V.current,wl(i))Rx(i);else{var S=Kd(re.current);switch(v){case 1:v=S.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:v=S.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":v=S.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":v=S.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":v=S.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?S.createElement(y,{is:d.is}):S.createElement(y)}}v[Ge]=i,v[mt]=d;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)v.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=v;e:switch(Gn(v,y,d),y){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Ya(i)}}return qt(i),ip(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,u),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&Ya(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=re.current,wl(i)){if(r=i.stateNode,u=i.memoizedProps,d=null,y=Hn,y!==null)switch(y.tag){case 27:case 5:d=y.memoizedProps}r[Ge]=i,r=!!(r.nodeValue===u||d!==null&&d.suppressHydrationWarning===!0||Qw(r.nodeValue,u)),r||Ri(i,!0)}else r=Kd(r).createTextNode(d),r[Ge]=i,i.stateNode=r}return qt(i),null;case 31:if(u=i.memoizedState,r===null||r.memoizedState!==null){if(d=wl(i),u!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Ge]=i}else As(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;qt(i),r=!1}else u=pm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return i.flags&256?(Ir(i),i):(Ir(i),null);if((i.flags&128)!==0)throw Error(a(558))}return qt(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(y=wl(i),d!==null&&d.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[Ge]=i}else As(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;qt(i),y=!1}else y=pm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=y),y=!0;if(!y)return i.flags&256?(Ir(i),i):(Ir(i),null)}return Ir(i),(i.flags&128)!==0?(i.lanes=u,i):(u=d!==null,r=r!==null&&r.memoizedState!==null,u&&(d=i.child,y=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(y=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==y&&(d.flags|=2048)),u!==r&&u&&(i.child.flags|=8192),Dd(i,i.updateQueue),qt(i),null);case 4:return Ee(),r===null&&Np(i.stateNode.containerInfo),qt(i),null;case 10:return Ga(i.type),qt(i),null;case 19:if(B(mn),d=i.memoizedState,d===null)return qt(i),null;if(y=(i.flags&128)!==0,v=d.rendering,v===null)if(y)pu(d,!1);else{if(ln!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=wd(r),v!==null){for(i.flags|=128,pu(d,!1),r=v.updateQueue,i.updateQueue=r,Dd(i,r),i.subtreeFlags=0,r=u,u=i.child;u!==null;)Cx(u,r),u=u.sibling;return _(mn,mn.current&1|2),xt&&qa(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&an()>Ud&&(i.flags|=128,y=!0,pu(d,!1),i.lanes=4194304)}else{if(!y)if(r=wd(v),r!==null){if(i.flags|=128,y=!0,r=r.updateQueue,i.updateQueue=r,Dd(i,r),pu(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!xt)return qt(i),null}else 2*an()-d.renderingStartTime>Ud&&u!==536870912&&(i.flags|=128,y=!0,pu(d,!1),i.lanes=4194304);d.isBackwards?(v.sibling=i.child,i.child=v):(r=d.last,r!==null?r.sibling=v:i.child=v,d.last=v)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=an(),r.sibling=null,u=mn.current,_(mn,y?u&1|2:u&1),xt&&qa(i,d.treeForkCount),r):(qt(i),null);case 22:case 23:return Ir(i),_m(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(u&536870912)!==0&&(i.flags&128)===0&&(qt(i),i.subtreeFlags&6&&(i.flags|=8192)):qt(i),u=i.updateQueue,u!==null&&Dd(i,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==u&&(i.flags|=2048),r!==null&&B(Ms),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ga(bn),qt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function c2(r,i){switch(hm(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ga(bn),Ee(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Le(i),null;case 31:if(i.memoizedState!==null){if(Ir(i),i.alternate===null)throw Error(a(340));As()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Ir(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));As()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return B(mn),null;case 4:return Ee(),null;case 10:return Ga(i.type),null;case 22:case 23:return Ir(i),_m(),r!==null&&B(Ms),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ga(bn),null;case 25:return null;default:return null}}function J0(r,i){switch(hm(i),i.tag){case 3:Ga(bn),Ee();break;case 26:case 27:case 5:Le(i);break;case 4:Ee();break;case 31:i.memoizedState!==null&&Ir(i);break;case 13:Ir(i);break;case 19:B(mn);break;case 10:Ga(i.type);break;case 22:case 23:Ir(i),_m(),r!==null&&B(Ms);break;case 24:Ga(bn)}}function gu(r,i){try{var u=i.updateQueue,d=u!==null?u.lastEffect:null;if(d!==null){var y=d.next;u=y;do{if((u.tag&r)===r){d=void 0;var v=u.create,S=u.inst;d=v(),S.destroy=d}u=u.next}while(u!==y)}}catch(T){Ot(i,i.return,T)}}function Pi(r,i,u){try{var d=i.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var v=y.next;d=v;do{if((d.tag&r)===r){var S=d.inst,T=S.destroy;if(T!==void 0){S.destroy=void 0,y=i;var q=u,ie=T;try{ie()}catch(de){Ot(y,q,de)}}}d=d.next}while(d!==v)}}catch(de){Ot(i,i.return,de)}}function ew(r){var i=r.updateQueue;if(i!==null){var u=r.stateNode;try{qx(i,u)}catch(d){Ot(r,r.return,d)}}}function tw(r,i,u){u.props=Ps(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(d){Ot(r,i,d)}}function yu(r,i){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof u=="function"?r.refCleanup=u(d):u.current=d}}catch(y){Ot(r,i,y)}}function Ca(r,i){var u=r.ref,d=r.refCleanup;if(u!==null)if(typeof d=="function")try{d()}catch(y){Ot(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){Ot(r,i,y)}else u.current=null}function nw(r){var i=r.type,u=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&d.focus();break e;case"img":u.src?d.src=u.src:u.srcSet&&(d.srcset=u.srcSet)}}catch(y){Ot(r,r.return,y)}}function sp(r,i,u){try{var d=r.stateNode;O2(d,r.type,u,i),d[mt]=i}catch(y){Ot(r,r.return,y)}}function rw(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Zi(r.type)||r.tag===4}function lp(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||rw(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&&Zi(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 op(r,i,u){var d=r.tag;if(d===5||d===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=Fa));else if(d!==4&&(d===27&&Zi(r.type)&&(u=r.stateNode,i=null),r=r.child,r!==null))for(op(r,i,u),r=r.sibling;r!==null;)op(r,i,u),r=r.sibling}function zd(r,i,u){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?u.insertBefore(r,i):u.appendChild(r);else if(d!==4&&(d===27&&Zi(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(zd(r,i,u),r=r.sibling;r!==null;)zd(r,i,u),r=r.sibling}function aw(r){var i=r.stateNode,u=r.memoizedProps;try{for(var d=r.type,y=i.attributes;y.length;)i.removeAttributeNode(y[0]);Gn(i,d,u),i[Ge]=r,i[mt]=u}catch(v){Ot(r,r.return,v)}}var Xa=!1,Sn=!1,up=!1,iw=typeof WeakSet=="function"?WeakSet:Set,In=null;function d2(r,i){if(r=r.containerInfo,Ap=nf,r=yx(r),nm(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var d=u.getSelection&&u.getSelection();if(d&&d.rangeCount!==0){u=d.anchorNode;var y=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var S=0,T=-1,q=-1,ie=0,de=0,me=r,le=null;t:for(;;){for(var oe;me!==u||y!==0&&me.nodeType!==3||(T=S+y),me!==v||d!==0&&me.nodeType!==3||(q=S+d),me.nodeType===3&&(S+=me.nodeValue.length),(oe=me.firstChild)!==null;)le=me,me=oe;for(;;){if(me===r)break t;if(le===u&&++ie===y&&(T=S),le===v&&++de===d&&(q=S),(oe=me.nextSibling)!==null)break;me=le,le=me.parentNode}me=oe}u=T===-1||q===-1?null:{start:T,end:q}}else u=null}u=u||{start:0,end:0}}else u=null;for(Rp={focusedElem:r,selectionRange:u},nf=!1,In=i;In!==null;)if(i=In,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,In=r;else for(;In!==null;){switch(i=In,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,d=u.stateNode;try{var Ae=Ps(u.type,y);r=d.getSnapshotBeforeUpdate(Ae,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(Ve){Ot(u,u.return,Ve)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,u=r.nodeType,u===9)Dp(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Dp(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,In=r;break}In=i.return}}function sw(r,i,u){var d=u.flags;switch(u.tag){case 0:case 11:case 15:Ja(r,u),d&4&&gu(5,u);break;case 1:if(Ja(r,u),d&4)if(r=u.stateNode,i===null)try{r.componentDidMount()}catch(S){Ot(u,u.return,S)}else{var y=Ps(u.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(y,i,r.__reactInternalSnapshotBeforeUpdate)}catch(S){Ot(u,u.return,S)}}d&64&&ew(u),d&512&&yu(u,u.return);break;case 3:if(Ja(r,u),d&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{qx(r,i)}catch(S){Ot(u,u.return,S)}}break;case 27:i===null&&d&4&&aw(u);case 26:case 5:Ja(r,u),i===null&&d&4&&nw(u),d&512&&yu(u,u.return);break;case 12:Ja(r,u);break;case 31:Ja(r,u),d&4&&uw(r,u);break;case 13:Ja(r,u),d&4&&cw(r,u),d&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=x2.bind(null,u),B2(r,u))));break;case 22:if(d=u.memoizedState!==null||Xa,!d){i=i!==null&&i.memoizedState!==null||Sn,y=Xa;var v=Sn;Xa=d,(Sn=i)&&!v?ei(r,u,(u.subtreeFlags&8772)!==0):Ja(r,u),Xa=y,Sn=v}break;case 30:break;default:Ja(r,u)}}function lw(r){var i=r.alternate;i!==null&&(r.alternate=null,lw(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Be(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 Vt=null,vr=!1;function Wa(r,i,u){for(u=u.child;u!==null;)ow(r,i,u),u=u.sibling}function ow(r,i,u){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(Gt,u)}catch{}switch(u.tag){case 26:Sn||Ca(u,i),Wa(r,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Sn||Ca(u,i);var d=Vt,y=vr;Zi(u.type)&&(Vt=u.stateNode,vr=!1),Wa(r,i,u),Cu(u.stateNode),Vt=d,vr=y;break;case 5:Sn||Ca(u,i);case 6:if(d=Vt,y=vr,Vt=null,Wa(r,i,u),Vt=d,vr=y,Vt!==null)if(vr)try{(Vt.nodeType===9?Vt.body:Vt.nodeName==="HTML"?Vt.ownerDocument.body:Vt).removeChild(u.stateNode)}catch(v){Ot(u,i,v)}else try{Vt.removeChild(u.stateNode)}catch(v){Ot(u,i,v)}break;case 18:Vt!==null&&(vr?(r=Vt,eS(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),$l(r)):eS(Vt,u.stateNode));break;case 4:d=Vt,y=vr,Vt=u.stateNode.containerInfo,vr=!0,Wa(r,i,u),Vt=d,vr=y;break;case 0:case 11:case 14:case 15:Pi(2,u,i),Sn||Pi(4,u,i),Wa(r,i,u);break;case 1:Sn||(Ca(u,i),d=u.stateNode,typeof d.componentWillUnmount=="function"&&tw(u,i,d)),Wa(r,i,u);break;case 21:Wa(r,i,u);break;case 22:Sn=(d=Sn)||u.memoizedState!==null,Wa(r,i,u),Sn=d;break;default:Wa(r,i,u)}}function uw(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{$l(r)}catch(u){Ot(i,i.return,u)}}}function cw(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{$l(r)}catch(u){Ot(i,i.return,u)}}function f2(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new iw),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new iw),i;default:throw Error(a(435,r.tag))}}function Id(r,i){var u=f2(r);i.forEach(function(d){if(!u.has(d)){u.add(d);var y=w2.bind(null,r,d);d.then(y,y)}})}function br(r,i){var u=i.deletions;if(u!==null)for(var d=0;d<u.length;d++){var y=u[d],v=r,S=i,T=S;e:for(;T!==null;){switch(T.tag){case 27:if(Zi(T.type)){Vt=T.stateNode,vr=!1;break e}break;case 5:Vt=T.stateNode,vr=!1;break e;case 3:case 4:Vt=T.stateNode.containerInfo,vr=!0;break e}T=T.return}if(Vt===null)throw Error(a(160));ow(v,S,y),Vt=null,vr=!1,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)dw(i,r),i=i.sibling}var ya=null;function dw(r,i){var u=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:br(i,r),xr(r),d&4&&(Pi(3,r,r.return),gu(3,r),Pi(5,r,r.return));break;case 1:br(i,r),xr(r),d&512&&(Sn||u===null||Ca(u,u.return)),d&64&&Xa&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?d:u.concat(d))));break;case 26:var y=ya;if(br(i,r),xr(r),d&512&&(Sn||u===null||Ca(u,u.return)),d&4){var v=u!==null?u.memoizedState:null;if(d=r.memoizedState,u===null)if(d===null)if(r.stateNode===null){e:{d=r.type,u=r.memoizedProps,y=y.ownerDocument||y;t:switch(d){case"title":v=y.getElementsByTagName("title")[0],(!v||v[Ni]||v[Ge]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=y.createElement(d),y.head.insertBefore(v,y.querySelector("head > title"))),Gn(v,d,u),v[Ge]=r,bt(v),d=v;break e;case"link":var S=dS("link","href",y).get(d+(u.href||""));if(S){for(var T=0;T<S.length;T++)if(v=S[T],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)){S.splice(T,1);break t}}v=y.createElement(d),Gn(v,d,u),y.head.appendChild(v);break;case"meta":if(S=dS("meta","content",y).get(d+(u.content||""))){for(T=0;T<S.length;T++)if(v=S[T],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)){S.splice(T,1);break t}}v=y.createElement(d),Gn(v,d,u),y.head.appendChild(v);break;default:throw Error(a(468,d))}v[Ge]=r,bt(v),d=v}r.stateNode=d}else fS(y,r.type,r.stateNode);else r.stateNode=cS(y,d,r.memoizedProps);else v!==d?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,d===null?fS(y,r.type,r.stateNode):cS(y,d,r.memoizedProps)):d===null&&r.stateNode!==null&&sp(r,r.memoizedProps,u.memoizedProps)}break;case 27:br(i,r),xr(r),d&512&&(Sn||u===null||Ca(u,u.return)),u!==null&&d&4&&sp(r,r.memoizedProps,u.memoizedProps);break;case 5:if(br(i,r),xr(r),d&512&&(Sn||u===null||Ca(u,u.return)),r.flags&32){y=r.stateNode;try{dl(y,"")}catch(Ae){Ot(r,r.return,Ae)}}d&4&&r.stateNode!=null&&(y=r.memoizedProps,sp(r,y,u!==null?u.memoizedProps:y)),d&1024&&(up=!0);break;case 6:if(br(i,r),xr(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,u=r.stateNode;try{u.nodeValue=d}catch(Ae){Ot(r,r.return,Ae)}}break;case 3:if(Wd=null,y=ya,ya=Yd(i.containerInfo),br(i,r),ya=y,xr(r),d&4&&u!==null&&u.memoizedState.isDehydrated)try{$l(i.containerInfo)}catch(Ae){Ot(r,r.return,Ae)}up&&(up=!1,fw(r));break;case 4:d=ya,ya=Yd(r.stateNode.containerInfo),br(i,r),xr(r),ya=d;break;case 12:br(i,r),xr(r);break;case 31:br(i,r),xr(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Id(r,d)));break;case 13:br(i,r),xr(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Pd=an()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Id(r,d)));break;case 22:y=r.memoizedState!==null;var q=u!==null&&u.memoizedState!==null,ie=Xa,de=Sn;if(Xa=ie||y,Sn=de||q,br(i,r),Sn=de,Xa=ie,xr(r),d&8192)e:for(i=r.stateNode,i._visibility=y?i._visibility&-2:i._visibility|1,y&&(u===null||q||Xa||Sn||Us(r)),u=null,i=r;;){if(i.tag===5||i.tag===26){if(u===null){q=u=i;try{if(v=q.stateNode,y)S=v.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{T=q.stateNode;var me=q.memoizedProps.style,le=me!=null&&me.hasOwnProperty("display")?me.display:null;T.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(Ae){Ot(q,q.return,Ae)}}}else if(i.tag===6){if(u===null){q=i;try{q.stateNode.nodeValue=y?"":q.memoizedProps}catch(Ae){Ot(q,q.return,Ae)}}}else if(i.tag===18){if(u===null){q=i;try{var oe=q.stateNode;y?tS(oe,!0):tS(q.stateNode,!1)}catch(Ae){Ot(q,q.return,Ae)}}}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}d&4&&(d=r.updateQueue,d!==null&&(u=d.retryQueue,u!==null&&(d.retryQueue=null,Id(r,u))));break;case 19:br(i,r),xr(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Id(r,d)));break;case 30:break;case 21:break;default:br(i,r),xr(r)}}function xr(r){var i=r.flags;if(i&2){try{for(var u,d=r.return;d!==null;){if(rw(d)){u=d;break}d=d.return}if(u==null)throw Error(a(160));switch(u.tag){case 27:var y=u.stateNode,v=lp(r);zd(r,v,y);break;case 5:var S=u.stateNode;u.flags&32&&(dl(S,""),u.flags&=-33);var T=lp(r);zd(r,T,S);break;case 3:case 4:var q=u.stateNode.containerInfo,ie=lp(r);op(r,ie,q);break;default:throw Error(a(161))}}catch(de){Ot(r,r.return,de)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function fw(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;fw(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Ja(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)sw(r,i.alternate,i),i=i.sibling}function Us(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Pi(4,i,i.return),Us(i);break;case 1:Ca(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&tw(i,i.return,u),Us(i);break;case 27:Cu(i.stateNode);case 26:case 5:Ca(i,i.return),Us(i);break;case 22:i.memoizedState===null&&Us(i);break;case 30:Us(i);break;default:Us(i)}r=r.sibling}}function ei(r,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,y=r,v=i,S=v.flags;switch(v.tag){case 0:case 11:case 15:ei(y,v,u),gu(4,v);break;case 1:if(ei(y,v,u),d=v,y=d.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ie){Ot(d,d.return,ie)}if(d=v,y=d.updateQueue,y!==null){var T=d.stateNode;try{var q=y.shared.hiddenCallbacks;if(q!==null)for(y.shared.hiddenCallbacks=null,y=0;y<q.length;y++)Hx(q[y],T)}catch(ie){Ot(d,d.return,ie)}}u&&S&64&&ew(v),yu(v,v.return);break;case 27:aw(v);case 26:case 5:ei(y,v,u),u&&d===null&&S&4&&nw(v),yu(v,v.return);break;case 12:ei(y,v,u);break;case 31:ei(y,v,u),u&&S&4&&uw(y,v);break;case 13:ei(y,v,u),u&&S&4&&cw(y,v);break;case 22:v.memoizedState===null&&ei(y,v,u),yu(v,v.return);break;case 30:break;default:ei(y,v,u)}i=i.sibling}}function cp(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&&ru(u))}function dp(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&ru(r))}function va(r,i,u,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)hw(r,i,u,d),i=i.sibling}function hw(r,i,u,d){var y=i.flags;switch(i.tag){case 0:case 11:case 15:va(r,i,u,d),y&2048&&gu(9,i);break;case 1:va(r,i,u,d);break;case 3:va(r,i,u,d),y&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&ru(r)));break;case 12:if(y&2048){va(r,i,u,d),r=i.stateNode;try{var v=i.memoizedProps,S=v.id,T=v.onPostCommit;typeof T=="function"&&T(S,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(q){Ot(i,i.return,q)}}else va(r,i,u,d);break;case 31:va(r,i,u,d);break;case 13:va(r,i,u,d);break;case 23:break;case 22:v=i.stateNode,S=i.alternate,i.memoizedState!==null?v._visibility&2?va(r,i,u,d):vu(r,i):v._visibility&2?va(r,i,u,d):(v._visibility|=2,Rl(r,i,u,d,(i.subtreeFlags&10256)!==0||!1)),y&2048&&cp(S,i);break;case 24:va(r,i,u,d),y&2048&&dp(i.alternate,i);break;default:va(r,i,u,d)}}function Rl(r,i,u,d,y){for(y=y&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,S=i,T=u,q=d,ie=S.flags;switch(S.tag){case 0:case 11:case 15:Rl(v,S,T,q,y),gu(8,S);break;case 23:break;case 22:var de=S.stateNode;S.memoizedState!==null?de._visibility&2?Rl(v,S,T,q,y):vu(v,S):(de._visibility|=2,Rl(v,S,T,q,y)),y&&ie&2048&&cp(S.alternate,S);break;case 24:Rl(v,S,T,q,y),y&&ie&2048&&dp(S.alternate,S);break;default:Rl(v,S,T,q,y)}i=i.sibling}}function vu(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=r,d=i,y=d.flags;switch(d.tag){case 22:vu(u,d),y&2048&&cp(d.alternate,d);break;case 24:vu(u,d),y&2048&&dp(d.alternate,d);break;default:vu(u,d)}i=i.sibling}}var bu=8192;function Ol(r,i,u){if(r.subtreeFlags&bu)for(r=r.child;r!==null;)mw(r,i,u),r=r.sibling}function mw(r,i,u){switch(r.tag){case 26:Ol(r,i,u),r.flags&bu&&r.memoizedState!==null&&W2(u,ya,r.memoizedState,r.memoizedProps);break;case 5:Ol(r,i,u);break;case 3:case 4:var d=ya;ya=Yd(r.stateNode.containerInfo),Ol(r,i,u),ya=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=bu,bu=16777216,Ol(r,i,u),bu=d):Ol(r,i,u));break;default:Ol(r,i,u)}}function pw(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 xu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var d=i[u];In=d,yw(d,r)}pw(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)gw(r),r=r.sibling}function gw(r){switch(r.tag){case 0:case 11:case 15:xu(r),r.flags&2048&&Pi(9,r,r.return);break;case 3:xu(r);break;case 12:xu(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Ld(r)):xu(r);break;default:xu(r)}}function Ld(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var d=i[u];In=d,yw(d,r)}pw(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Pi(8,i,i.return),Ld(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Ld(i));break;default:Ld(i)}r=r.sibling}}function yw(r,i){for(;In!==null;){var u=In;switch(u.tag){case 0:case 11:case 15:Pi(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var d=u.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:ru(u.memoizedState.cache)}if(d=u.child,d!==null)d.return=u,In=d;else e:for(u=r;In!==null;){d=In;var y=d.sibling,v=d.return;if(lw(d),d===u){In=null;break e}if(y!==null){y.return=v,In=y;break e}In=v}}}var h2={getCacheForType:function(r){var i=qn(bn),u=i.data.get(r);return u===void 0&&(u=r(),i.data.set(r,u)),u},cacheSignal:function(){return qn(bn).controller.signal}},m2=typeof WeakMap=="function"?WeakMap:Map,Nt=0,Pt=null,ut=null,pt=0,Rt=0,Lr=null,Ui=!1,Ml=!1,fp=!1,ti=0,ln=0,Bi=0,Bs=0,hp=0,Pr=0,Dl=0,wu=null,wr=null,mp=!1,Pd=0,vw=0,Ud=1/0,Bd=null,Fi=null,Tn=0,$i=null,zl=null,ni=0,pp=0,gp=null,bw=null,Su=0,yp=null;function Ur(){return(Nt&2)!==0&&pt!==0?pt&-pt:G.T!==null?kp():Ei()}function xw(){if(Pr===0)if((pt&536870912)===0||xt){var r=ir;ir<<=1,(ir&3932160)===0&&(ir=262144),Pr=r}else Pr=536870912;return r=zr.current,r!==null&&(r.flags|=32),Pr}function Sr(r,i,u){(r===Pt&&(Rt===2||Rt===9)||r.cancelPendingCommit!==null)&&(Il(r,0),Hi(r,pt,Pr,!1)),pa(r,u),((Nt&2)===0||r!==Pt)&&(r===Pt&&((Nt&2)===0&&(Bs|=u),ln===4&&Hi(r,pt,Pr,!1)),Na(r))}function ww(r,i,u){if((Nt&6)!==0)throw Error(a(327));var d=!u&&(i&127)===0&&(i&r.expiredLanes)===0||ma(r,i),y=d?y2(r,i):bp(r,i,!0),v=d;do{if(y===0){Ml&&!d&&Hi(r,i,0,!1);break}else{if(u=r.current.alternate,v&&!p2(u)){y=bp(r,i,!1),v=!1;continue}if(y===2){if(v=i,r.errorRecoveryDisabledLanes&v)var S=0;else S=r.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var T=r;y=wu;var q=T.current.memoizedState.isDehydrated;if(q&&(Il(T,S).flags|=256),S=bp(T,S,!1),S!==2){if(fp&&!q){T.errorRecoveryDisabledLanes|=v,Bs|=v,y=4;break e}v=wr,wr=y,v!==null&&(wr===null?wr=v:wr.push.apply(wr,v))}y=S}if(v=!1,y!==2)continue}}if(y===1){Il(r,0),Hi(r,i,0,!0);break}e:{switch(d=r,v=y,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Hi(d,i,Pr,!Ui);break e;case 2:wr=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(y=Pd+300-an(),10<y)){if(Hi(d,i,Pr,!Ui),Pa(d,0,!0)!==0)break e;ni=i,d.timeoutHandle=Ww(Sw.bind(null,d,u,wr,Bd,mp,i,Pr,Bs,Dl,Ui,v,"Throttled",-0,0),y);break e}Sw(d,u,wr,Bd,mp,i,Pr,Bs,Dl,Ui,v,null,-0,0)}}break}while(!0);Na(r)}function Sw(r,i,u,d,y,v,S,T,q,ie,de,me,le,oe){if(r.timeoutHandle=-1,me=i.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fa},mw(i,v,me);var Ae=(v&62914560)===v?Pd-an():(v&4194048)===v?vw-an():0;if(Ae=J2(me,Ae),Ae!==null){ni=v,r.cancelPendingCommit=Ae(Aw.bind(null,r,i,v,u,d,y,S,T,q,de,me,null,le,oe)),Hi(r,v,S,!ie);return}}Aw(r,i,v,u,d,y,S,T,q)}function p2(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 d=0;d<u.length;d++){var y=u[d],v=y.getSnapshot;y=y.value;try{if(!Mr(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 Hi(r,i,u,d){i&=~hp,i&=~Bs,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var y=i;0<y;){var v=31-ht(y),S=1<<v;d[v]=-1,y&=~S}u!==0&&ki(r,u,i)}function Fd(){return(Nt&6)===0?(ku(0),!1):!0}function vp(){if(ut!==null){if(Rt===0)var r=ut.return;else r=ut,Za=Rs=null,Dm(r),Cl=null,iu=0,r=ut;for(;r!==null;)J0(r.alternate,r),r=r.return;ut=null}}function Il(r,i){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,z2(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),ni=0,vp(),Pt=r,ut=u=Ha(r.current,null),pt=i,Rt=0,Lr=null,Ui=!1,Ml=ma(r,i),fp=!1,Dl=Pr=hp=Bs=Bi=ln=0,wr=wu=null,mp=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var y=31-ht(d),v=1<<y;i|=r[y],d&=~v}return ti=i,od(),u}function kw(r,i){Je=null,G.H=hu,i===El||i===gd?(i=Ux(),Rt=3):i===Sm?(i=Ux(),Rt=4):Rt=i===Ym?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Lr=i,ut===null&&(ln=1,Ad(r,Yr(i,r.current)))}function jw(){var r=zr.current;return r===null?!0:(pt&4194048)===pt?ea===null:(pt&62914560)===pt||(pt&536870912)!==0?r===ea:!1}function Ew(){var r=G.H;return G.H=hu,r===null?hu:r}function Cw(){var r=G.A;return G.A=h2,r}function $d(){ln=4,Ui||(pt&4194048)!==pt&&zr.current!==null||(Ml=!0),(Bi&134217727)===0&&(Bs&134217727)===0||Pt===null||Hi(Pt,pt,Pr,!1)}function bp(r,i,u){var d=Nt;Nt|=2;var y=Ew(),v=Cw();(Pt!==r||pt!==i)&&(Bd=null,Il(r,i)),i=!1;var S=ln;e:do try{if(Rt!==0&&ut!==null){var T=ut,q=Lr;switch(Rt){case 8:vp(),S=6;break e;case 3:case 2:case 9:case 6:zr.current===null&&(i=!0);var ie=Rt;if(Rt=0,Lr=null,Ll(r,T,q,ie),u&&Ml){S=0;break e}break;default:ie=Rt,Rt=0,Lr=null,Ll(r,T,q,ie)}}g2(),S=ln;break}catch(de){kw(r,de)}while(!0);return i&&r.shellSuspendCounter++,Za=Rs=null,Nt=d,G.H=y,G.A=v,ut===null&&(Pt=null,pt=0,od()),S}function g2(){for(;ut!==null;)Nw(ut)}function y2(r,i){var u=Nt;Nt|=2;var d=Ew(),y=Cw();Pt!==r||pt!==i?(Bd=null,Ud=an()+500,Il(r,i)):Ml=ma(r,i);e:do try{if(Rt!==0&&ut!==null){i=ut;var v=Lr;t:switch(Rt){case 1:Rt=0,Lr=null,Ll(r,i,v,1);break;case 2:case 9:if(Lx(v)){Rt=0,Lr=null,_w(i);break}i=function(){Rt!==2&&Rt!==9||Pt!==r||(Rt=7),Na(r)},v.then(i,i);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:Lx(v)?(Rt=0,Lr=null,_w(i)):(Rt=0,Lr=null,Ll(r,i,v,7));break;case 5:var S=null;switch(ut.tag){case 26:S=ut.memoizedState;case 5:case 27:var T=ut;if(S?hS(S):T.stateNode.complete){Rt=0,Lr=null;var q=T.sibling;if(q!==null)ut=q;else{var ie=T.return;ie!==null?(ut=ie,Hd(ie)):ut=null}break t}}Rt=0,Lr=null,Ll(r,i,v,5);break;case 6:Rt=0,Lr=null,Ll(r,i,v,6);break;case 8:vp(),ln=6;break e;default:throw Error(a(462))}}v2();break}catch(de){kw(r,de)}while(!0);return Za=Rs=null,G.H=d,G.A=y,Nt=u,ut!==null?0:(Pt=null,pt=0,od(),ln)}function v2(){for(;ut!==null&&!rn();)Nw(ut)}function Nw(r){var i=X0(r.alternate,r,ti);r.memoizedProps=r.pendingProps,i===null?Hd(r):ut=i}function _w(r){var i=r,u=i.alternate;switch(i.tag){case 15:case 0:i=Z0(u,i,i.pendingProps,i.type,void 0,pt);break;case 11:i=Z0(u,i,i.pendingProps,i.type.render,i.ref,pt);break;case 5:Dm(i);default:J0(u,i),i=ut=Cx(i,ti),i=X0(u,i,ti)}r.memoizedProps=r.pendingProps,i===null?Hd(r):ut=i}function Ll(r,i,u,d){Za=Rs=null,Dm(i),Cl=null,iu=0;var y=i.return;try{if(s2(r,y,i,u,pt)){ln=1,Ad(r,Yr(u,r.current)),ut=null;return}}catch(v){if(y!==null)throw ut=y,v;ln=1,Ad(r,Yr(u,r.current)),ut=null;return}i.flags&32768?(xt||d===1?r=!0:Ml||(pt&536870912)!==0?r=!1:(Ui=r=!0,(d===2||d===9||d===3||d===6)&&(d=zr.current,d!==null&&d.tag===13&&(d.flags|=16384))),Tw(i,r)):Hd(i)}function Hd(r){var i=r;do{if((i.flags&32768)!==0){Tw(i,Ui);return}r=i.return;var u=u2(i.alternate,i,ti);if(u!==null){ut=u;return}if(i=i.sibling,i!==null){ut=i;return}ut=i=r}while(i!==null);ln===0&&(ln=5)}function Tw(r,i){do{var u=c2(r.alternate,r);if(u!==null){u.flags&=32767,ut=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(r=r.sibling,r!==null)){ut=r;return}ut=r=u}while(r!==null);ln=6,ut=null}function Aw(r,i,u,d,y,v,S,T,q){r.cancelPendingCommit=null;do qd();while(Tn!==0);if((Nt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=lm,Si(r,u,v,S,T,q),r===Pt&&(ut=Pt=null,pt=0),zl=i,$i=r,ni=u,pp=v,gp=y,bw=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,S2(Fe,function(){return zw(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=G.T,G.T=null,y=se.p,se.p=2,S=Nt,Nt|=4;try{d2(r,i,u)}finally{Nt=S,se.p=y,G.T=d}}Tn=1,Rw(),Ow(),Mw()}}function Rw(){if(Tn===1){Tn=0;var r=$i,i=zl,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=G.T,G.T=null;var d=se.p;se.p=2;var y=Nt;Nt|=4;try{dw(i,r);var v=Rp,S=yx(r.containerInfo),T=v.focusedElem,q=v.selectionRange;if(S!==T&&T&&T.ownerDocument&&gx(T.ownerDocument.documentElement,T)){if(q!==null&&nm(T)){var ie=q.start,de=q.end;if(de===void 0&&(de=ie),"selectionStart"in T)T.selectionStart=ie,T.selectionEnd=Math.min(de,T.value.length);else{var me=T.ownerDocument||document,le=me&&me.defaultView||window;if(le.getSelection){var oe=le.getSelection(),Ae=T.textContent.length,Ve=Math.min(q.start,Ae),zt=q.end===void 0?Ve:Math.min(q.end,Ae);!oe.extend&&Ve>zt&&(S=zt,zt=Ve,Ve=S);var J=px(T,Ve),K=px(T,zt);if(J&&K&&(oe.rangeCount!==1||oe.anchorNode!==J.node||oe.anchorOffset!==J.offset||oe.focusNode!==K.node||oe.focusOffset!==K.offset)){var ae=me.createRange();ae.setStart(J.node,J.offset),oe.removeAllRanges(),Ve>zt?(oe.addRange(ae),oe.extend(K.node,K.offset)):(ae.setEnd(K.node,K.offset),oe.addRange(ae))}}}}for(me=[],oe=T;oe=oe.parentNode;)oe.nodeType===1&&me.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<me.length;T++){var he=me[T];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}nf=!!Ap,Rp=Ap=null}finally{Nt=y,se.p=d,G.T=u}}r.current=i,Tn=2}}function Ow(){if(Tn===2){Tn=0;var r=$i,i=zl,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=G.T,G.T=null;var d=se.p;se.p=2;var y=Nt;Nt|=4;try{sw(r,i.alternate,i)}finally{Nt=y,se.p=d,G.T=u}}Tn=3}}function Mw(){if(Tn===4||Tn===3){Tn=0,La();var r=$i,i=zl,u=ni,d=bw;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Tn=5:(Tn=0,zl=$i=null,Dw(r,r.pendingLanes));var y=r.pendingLanes;if(y===0&&(Fi=null),gr(u),i=i.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(Gt,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=G.T,y=se.p,se.p=2,G.T=null;try{for(var v=r.onRecoverableError,S=0;S<d.length;S++){var T=d[S];v(T.value,{componentStack:T.stack})}}finally{G.T=i,se.p=y}}(ni&3)!==0&&qd(),Na(r),y=r.pendingLanes,(u&261930)!==0&&(y&42)!==0?r===yp?Su++:(Su=0,yp=r):Su=0,ku(0)}}function Dw(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,ru(i)))}function qd(){return Rw(),Ow(),Mw(),zw()}function zw(){if(Tn!==5)return!1;var r=$i,i=pp;pp=0;var u=gr(ni),d=G.T,y=se.p;try{se.p=32>u?32:u,G.T=null,u=gp,gp=null;var v=$i,S=ni;if(Tn=0,zl=$i=null,ni=0,(Nt&6)!==0)throw Error(a(331));var T=Nt;if(Nt|=4,gw(v.current),hw(v,v.current,S,u),Nt=T,ku(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(Gt,v)}catch{}return!0}finally{se.p=y,G.T=d,Dw(r,i)}}function Iw(r,i,u){i=Yr(u,i),i=Km(r.stateNode,i,2),r=zi(r,i,2),r!==null&&(pa(r,2),Na(r))}function Ot(r,i,u){if(r.tag===3)Iw(r,r,u);else for(;i!==null;){if(i.tag===3){Iw(i,r,u);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Fi===null||!Fi.has(d))){r=Yr(u,r),u=L0(2),d=zi(i,u,2),d!==null&&(P0(u,d,i,r),pa(d,2),Na(d));break}}i=i.return}}function xp(r,i,u){var d=r.pingCache;if(d===null){d=r.pingCache=new m2;var y=new Set;d.set(i,y)}else y=d.get(i),y===void 0&&(y=new Set,d.set(i,y));y.has(u)||(fp=!0,y.add(u),r=b2.bind(null,r,i,u),i.then(r,r))}function b2(r,i,u){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Pt===r&&(pt&u)===u&&(ln===4||ln===3&&(pt&62914560)===pt&&300>an()-Pd?(Nt&2)===0&&Il(r,0):hp|=u,Dl===pt&&(Dl=0)),Na(r)}function Lw(r,i){i===0&&(i=Gr()),r=_s(r,i),r!==null&&(pa(r,i),Na(r))}function x2(r){var i=r.memoizedState,u=0;i!==null&&(u=i.retryLane),Lw(r,u)}function w2(r,i){var u=0;switch(r.tag){case 31:case 13:var d=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),Lw(r,u)}function S2(r,i){return qe(r,i)}var Zd=null,Pl=null,wp=!1,Gd=!1,Sp=!1,qi=0;function Na(r){r!==Pl&&r.next===null&&(Pl===null?Zd=Pl=r:Pl=Pl.next=r),Gd=!0,wp||(wp=!0,j2())}function ku(r,i){if(!Sp&&Gd){Sp=!0;do for(var u=!1,d=Zd;d!==null;){if(r!==0){var y=d.pendingLanes;if(y===0)var v=0;else{var S=d.suspendedLanes,T=d.pingedLanes;v=(1<<31-ht(42|r)+1)-1,v&=y&~(S&~T),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,Fw(d,v))}else v=pt,v=Pa(d,d===Pt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||ma(d,v)||(u=!0,Fw(d,v));d=d.next}while(u);Sp=!1}}function k2(){Pw()}function Pw(){Gd=wp=!1;var r=0;qi!==0&&D2()&&(r=qi);for(var i=an(),u=null,d=Zd;d!==null;){var y=d.next,v=Uw(d,i);v===0?(d.next=null,u===null?Zd=y:u.next=y,y===null&&(Pl=u)):(u=d,(r!==0||(v&3)!==0)&&(Gd=!0)),d=y}Tn!==0&&Tn!==5||ku(r),qi!==0&&(qi=0)}function Uw(r,i){for(var u=r.suspendedLanes,d=r.pingedLanes,y=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var S=31-ht(v),T=1<<S,q=y[S];q===-1?((T&u)===0||(T&d)!==0)&&(y[S]=Jt(T,i)):q<=i&&(r.expiredLanes|=T),v&=~T}if(i=Pt,u=pt,u=Pa(r,r===i?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,u===0||r===i&&(Rt===2||Rt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Mn(d),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||ma(r,u)){if(i=u&-u,i===r.callbackPriority)return i;switch(d!==null&&Mn(d),gr(u)){case 2:case 8:u=we;break;case 32:u=Fe;break;case 268435456:u=vt;break;default:u=Fe}return d=Bw.bind(null,r),u=qe(u,d),r.callbackPriority=i,r.callbackNode=u,i}return d!==null&&d!==null&&Mn(d),r.callbackPriority=2,r.callbackNode=null,2}function Bw(r,i){if(Tn!==0&&Tn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(qd()&&r.callbackNode!==u)return null;var d=pt;return d=Pa(r,r===Pt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(ww(r,d,i),Uw(r,an()),r.callbackNode!=null&&r.callbackNode===u?Bw.bind(null,r):null)}function Fw(r,i){if(qd())return null;ww(r,i,!0)}function j2(){I2(function(){(Nt&6)!==0?qe(ue,k2):Pw()})}function kp(){if(qi===0){var r=kl;r===0&&(r=ka,ka<<=1,(ka&261888)===0&&(ka=256)),qi=r}return qi}function $w(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ed(""+r)}function Hw(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 E2(r,i,u,d,y){if(i==="submit"&&u&&u.stateNode===y){var v=$w((y[mt]||null).action),S=d.submitter;S&&(i=(i=S[mt]||null)?$w(i.formAction):S.getAttribute("formAction"),i!==null&&(v=i,S=null));var T=new ad("action","action",null,d,y);r.push({event:T,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(qi!==0){var q=S?Hw(y,S):new FormData(y);Hm(u,{pending:!0,data:q,method:y.method,action:v},null,q)}}else typeof v=="function"&&(T.preventDefault(),q=S?Hw(y,S):new FormData(y),Hm(u,{pending:!0,data:q,method:y.method,action:v},v,q))},currentTarget:y}]})}}for(var jp=0;jp<sm.length;jp++){var Ep=sm[jp],C2=Ep.toLowerCase(),N2=Ep[0].toUpperCase()+Ep.slice(1);ga(C2,"on"+N2)}ga(xx,"onAnimationEnd"),ga(wx,"onAnimationIteration"),ga(Sx,"onAnimationStart"),ga("dblclick","onDoubleClick"),ga("focusin","onFocus"),ga("focusout","onBlur"),ga(HA,"onTransitionRun"),ga(qA,"onTransitionStart"),ga(ZA,"onTransitionCancel"),ga(kx,"onTransitionEnd"),zn("onMouseEnter",["mouseout","mouseover"]),zn("onMouseLeave",["mouseout","mouseover"]),zn("onPointerEnter",["pointerout","pointerover"]),zn("onPointerLeave",["pointerout","pointerover"]),vn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vn("onBeforeInput",["compositionend","keypress","textInput","paste"]),vn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ju="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(" "),_2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ju));function qw(r,i){i=(i&4)!==0;for(var u=0;u<r.length;u++){var d=r[u],y=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var S=d.length-1;0<=S;S--){var T=d[S],q=T.instance,ie=T.currentTarget;if(T=T.listener,q!==v&&y.isPropagationStopped())break e;v=T,y.currentTarget=ie;try{v(y)}catch(de){ld(de)}y.currentTarget=null,v=q}else for(S=0;S<d.length;S++){if(T=d[S],q=T.instance,ie=T.currentTarget,T=T.listener,q!==v&&y.isPropagationStopped())break e;v=T,y.currentTarget=ie;try{v(y)}catch(de){ld(de)}y.currentTarget=null,v=q}}}}function ct(r,i){var u=i[Ua];u===void 0&&(u=i[Ua]=new Set);var d=r+"__bubble";u.has(d)||(Zw(i,r,2,!1),u.add(d))}function Cp(r,i,u){var d=0;i&&(d|=4),Zw(u,r,d,i)}var Vd="_reactListening"+Math.random().toString(36).slice(2);function Np(r){if(!r[Vd]){r[Vd]=!0,en.forEach(function(u){u!=="selectionchange"&&(_2.has(u)||Cp(u,!1,r),Cp(u,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Vd]||(i[Vd]=!0,Cp("selectionchange",!1,i))}}function Zw(r,i,u,d){switch(xS(i)){case 2:var y=nR;break;case 8:y=rR;break;default:y=$p}u=y.bind(null,i,u,r),y=void 0,!Vh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),d?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 _p(r,i,u,d,y){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var T=d.stateNode.containerInfo;if(T===y)break;if(S===4)for(S=d.return;S!==null;){var q=S.tag;if((q===3||q===4)&&S.stateNode.containerInfo===y)return;S=S.return}for(;T!==null;){if(S=H(T),S===null)return;if(q=S.tag,q===5||q===6||q===26||q===27){d=v=S;continue e}T=T.parentNode}}d=d.return}Yb(function(){var ie=v,de=Zh(u),me=[];e:{var le=jx.get(r);if(le!==void 0){var oe=ad,Ae=r;switch(r){case"keypress":if(nd(u)===0)break e;case"keydown":case"keyup":oe=wA;break;case"focusin":Ae="focus",oe=Xh;break;case"focusout":Ae="blur",oe=Xh;break;case"beforeblur":case"afterblur":oe=Xh;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=Jb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=uA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=jA;break;case xx:case wx:case Sx:oe=fA;break;case kx:oe=CA;break;case"scroll":case"scrollend":oe=lA;break;case"wheel":oe=_A;break;case"copy":case"cut":case"paste":oe=mA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=tx;break;case"toggle":case"beforetoggle":oe=AA}var Ve=(i&4)!==0,zt=!Ve&&(r==="scroll"||r==="scrollend"),J=Ve?le!==null?le+"Capture":null:le;Ve=[];for(var K=ie,ae;K!==null;){var he=K;if(ae=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ae===null||J===null||(he=Go(K,J),he!=null&&Ve.push(Eu(K,he,ae))),zt)break;K=K.return}0<Ve.length&&(le=new oe(le,Ae,null,u,de),me.push({event:le,listeners:Ve}))}}if((i&7)===0){e:{if(le=r==="mouseover"||r==="pointerover",oe=r==="mouseout"||r==="pointerout",le&&u!==qh&&(Ae=u.relatedTarget||u.fromElement)&&(H(Ae)||Ae[Fn]))break e;if((oe||le)&&(le=de.window===de?de:(le=de.ownerDocument)?le.defaultView||le.parentWindow:window,oe?(Ae=u.relatedTarget||u.toElement,oe=ie,Ae=Ae?H(Ae):null,Ae!==null&&(zt=o(Ae),Ve=Ae.tag,Ae!==zt||Ve!==5&&Ve!==27&&Ve!==6)&&(Ae=null)):(oe=null,Ae=ie),oe!==Ae)){if(Ve=Jb,he="onMouseLeave",J="onMouseEnter",K="mouse",(r==="pointerout"||r==="pointerover")&&(Ve=tx,he="onPointerLeave",J="onPointerEnter",K="pointer"),zt=oe==null?le:Ne(oe),ae=Ae==null?le:Ne(Ae),le=new Ve(he,K+"leave",oe,u,de),le.target=zt,le.relatedTarget=ae,he=null,H(de)===ie&&(Ve=new Ve(J,K+"enter",Ae,u,de),Ve.target=ae,Ve.relatedTarget=zt,he=Ve),zt=he,oe&&Ae)t:{for(Ve=T2,J=oe,K=Ae,ae=0,he=J;he;he=Ve(he))ae++;he=0;for(var $e=K;$e;$e=Ve($e))he++;for(;0<ae-he;)J=Ve(J),ae--;for(;0<he-ae;)K=Ve(K),he--;for(;ae--;){if(J===K||K!==null&&J===K.alternate){Ve=J;break t}J=Ve(J),K=Ve(K)}Ve=null}else Ve=null;oe!==null&&Gw(me,le,oe,Ve,!1),Ae!==null&&zt!==null&&Gw(me,zt,Ae,Ve,!0)}}e:{if(le=ie?Ne(ie):window,oe=le.nodeName&&le.nodeName.toLowerCase(),oe==="select"||oe==="input"&&le.type==="file")var Et=ux;else if(lx(le))if(cx)Et=BA;else{Et=PA;var Ie=LA}else oe=le.nodeName,!oe||oe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ie&&Hh(ie.elementType)&&(Et=ux):Et=UA;if(Et&&(Et=Et(r,ie))){ox(me,Et,u,de);break e}Ie&&Ie(r,le,ie),r==="focusout"&&ie&&le.type==="number"&&ie.memoizedProps.value!=null&&$h(le,"number",le.value)}switch(Ie=ie?Ne(ie):window,r){case"focusin":(lx(Ie)||Ie.contentEditable==="true")&&(pl=Ie,rm=ie,eu=null);break;case"focusout":eu=rm=pl=null;break;case"mousedown":am=!0;break;case"contextmenu":case"mouseup":case"dragend":am=!1,vx(me,u,de);break;case"selectionchange":if($A)break;case"keydown":case"keyup":vx(me,u,de)}var tt;if(Jh)e:{switch(r){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else ml?ix(r,u)&&(gt="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(gt="onCompositionStart");gt&&(nx&&u.locale!=="ko"&&(ml||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&ml&&(tt=Xb()):(_i=de,Qh="value"in _i?_i.value:_i.textContent,ml=!0)),Ie=Qd(ie,gt),0<Ie.length&&(gt=new ex(gt,r,null,u,de),me.push({event:gt,listeners:Ie}),tt?gt.data=tt:(tt=sx(u),tt!==null&&(gt.data=tt)))),(tt=OA?MA(r,u):DA(r,u))&&(gt=Qd(ie,"onBeforeInput"),0<gt.length&&(Ie=new ex("onBeforeInput","beforeinput",null,u,de),me.push({event:Ie,listeners:gt}),Ie.data=tt)),E2(me,r,ie,u,de)}qw(me,i)})}function Eu(r,i,u){return{instance:r,listener:i,currentTarget:u}}function Qd(r,i){for(var u=i+"Capture",d=[];r!==null;){var y=r,v=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||v===null||(y=Go(r,u),y!=null&&d.unshift(Eu(r,y,v)),y=Go(r,i),y!=null&&d.push(Eu(r,y,v))),r.tag===3)return d;r=r.return}return[]}function T2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Gw(r,i,u,d,y){for(var v=i._reactName,S=[];u!==null&&u!==d;){var T=u,q=T.alternate,ie=T.stateNode;if(T=T.tag,q!==null&&q===d)break;T!==5&&T!==26&&T!==27||ie===null||(q=ie,y?(ie=Go(u,v),ie!=null&&S.unshift(Eu(u,ie,q))):y||(ie=Go(u,v),ie!=null&&S.push(Eu(u,ie,q)))),u=u.return}S.length!==0&&r.push({event:i,listeners:S})}var A2=/\r\n?/g,R2=/\u0000|\uFFFD/g;function Vw(r){return(typeof r=="string"?r:""+r).replace(A2,`
|
|
49
|
+
`).replace(R2,"")}function Qw(r,i){return i=Vw(i),Vw(r)===i}function Dt(r,i,u,d,y,v){switch(u){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||dl(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&dl(r,""+d);break;case"className":Wc(r,"class",d);break;case"tabIndex":Wc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Wc(r,u,d);break;case"style":Qb(r,d,v);break;case"data":if(i!=="object"){Wc(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||u!=="href")){r.removeAttribute(u);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(u);break}d=ed(""+d),r.setAttribute(u,d);break;case"action":case"formAction":if(typeof d=="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"&&Dt(r,i,"name",y.name,y,null),Dt(r,i,"formEncType",y.formEncType,y,null),Dt(r,i,"formMethod",y.formMethod,y,null),Dt(r,i,"formTarget",y.formTarget,y,null)):(Dt(r,i,"encType",y.encType,y,null),Dt(r,i,"method",y.method,y,null),Dt(r,i,"target",y.target,y,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(u);break}d=ed(""+d),r.setAttribute(u,d);break;case"onClick":d!=null&&(r.onclick=Fa);break;case"onScroll":d!=null&&ct("scroll",r);break;case"onScrollEnd":d!=null&&ct("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(u=d.__html,u!=null){if(y.children!=null)throw Error(a(60));r.innerHTML=u}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}u=ed(""+d),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":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(u,""+d):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":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":d===!0?r.setAttribute(u,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(u,d):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(u,d):r.removeAttribute(u);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(u):r.setAttribute(u,d);break;case"popover":ct("beforetoggle",r),ct("toggle",r),Xc(r,"popover",d);break;case"xlinkActuate":Ba(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Ba(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Ba(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Ba(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Ba(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Ba(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Ba(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Ba(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Ba(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Xc(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=iA.get(u)||u,Xc(r,u,d))}}function Tp(r,i,u,d,y,v){switch(u){case"style":Qb(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(u=d.__html,u!=null){if(y.children!=null)throw Error(a(60));r.innerHTML=u}}break;case"children":typeof d=="string"?dl(r,d):(typeof d=="number"||typeof d=="bigint")&&dl(r,""+d);break;case"onScroll":d!=null&&ct("scroll",r);break;case"onScrollEnd":d!=null&&ct("scrollend",r);break;case"onClick":d!=null&&(r.onclick=Fa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$n.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[mt]||null,v=v!=null?v[u]:null,typeof v=="function"&&r.removeEventListener(i,v,y),typeof d=="function")){typeof v!="function"&&v!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(i,d,y);break e}u in r?r[u]=d:d===!0?r.setAttribute(u,""):Xc(r,u,d)}}}function Gn(r,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ct("error",r),ct("load",r);var d=!1,y=!1,v;for(v in u)if(u.hasOwnProperty(v)){var S=u[v];if(S!=null)switch(v){case"src":d=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Dt(r,i,v,S,u,null)}}y&&Dt(r,i,"srcSet",u.srcSet,u,null),d&&Dt(r,i,"src",u.src,u,null);return;case"input":ct("invalid",r);var T=v=S=y=null,q=null,ie=null;for(d in u)if(u.hasOwnProperty(d)){var de=u[d];if(de!=null)switch(d){case"name":y=de;break;case"type":S=de;break;case"checked":q=de;break;case"defaultChecked":ie=de;break;case"value":v=de;break;case"defaultValue":T=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(a(137,i));break;default:Dt(r,i,d,de,u,null)}}qb(r,v,T,q,ie,S,y,!1);return;case"select":ct("invalid",r),d=S=v=null;for(y in u)if(u.hasOwnProperty(y)&&(T=u[y],T!=null))switch(y){case"value":v=T;break;case"defaultValue":S=T;break;case"multiple":d=T;default:Dt(r,i,y,T,u,null)}i=v,u=S,r.multiple=!!d,i!=null?cl(r,!!d,i,!1):u!=null&&cl(r,!!d,u,!0);return;case"textarea":ct("invalid",r),v=y=d=null;for(S in u)if(u.hasOwnProperty(S)&&(T=u[S],T!=null))switch(S){case"value":d=T;break;case"defaultValue":y=T;break;case"children":v=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(a(91));break;default:Dt(r,i,S,T,u,null)}Gb(r,d,y,v);return;case"option":for(q in u)if(u.hasOwnProperty(q)&&(d=u[q],d!=null))switch(q){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Dt(r,i,q,d,u,null)}return;case"dialog":ct("beforetoggle",r),ct("toggle",r),ct("cancel",r),ct("close",r);break;case"iframe":case"object":ct("load",r);break;case"video":case"audio":for(d=0;d<ju.length;d++)ct(ju[d],r);break;case"image":ct("error",r),ct("load",r);break;case"details":ct("toggle",r);break;case"embed":case"source":case"link":ct("error",r),ct("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(ie in u)if(u.hasOwnProperty(ie)&&(d=u[ie],d!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Dt(r,i,ie,d,u,null)}return;default:if(Hh(i)){for(de in u)u.hasOwnProperty(de)&&(d=u[de],d!==void 0&&Tp(r,i,de,d,u,void 0));return}}for(T in u)u.hasOwnProperty(T)&&(d=u[T],d!=null&&Dt(r,i,T,d,u,null))}function O2(r,i,u,d){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,S=null,T=null,q=null,ie=null,de=null;for(oe in u){var me=u[oe];if(u.hasOwnProperty(oe)&&me!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":q=me;default:d.hasOwnProperty(oe)||Dt(r,i,oe,null,d,me)}}for(var le in d){var oe=d[le];if(me=u[le],d.hasOwnProperty(le)&&(oe!=null||me!=null))switch(le){case"type":v=oe;break;case"name":y=oe;break;case"checked":ie=oe;break;case"defaultChecked":de=oe;break;case"value":S=oe;break;case"defaultValue":T=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,i));break;default:oe!==me&&Dt(r,i,le,oe,d,me)}}Fh(r,S,T,q,ie,de,v,y);return;case"select":oe=S=T=le=null;for(v in u)if(q=u[v],u.hasOwnProperty(v)&&q!=null)switch(v){case"value":break;case"multiple":oe=q;default:d.hasOwnProperty(v)||Dt(r,i,v,null,d,q)}for(y in d)if(v=d[y],q=u[y],d.hasOwnProperty(y)&&(v!=null||q!=null))switch(y){case"value":le=v;break;case"defaultValue":T=v;break;case"multiple":S=v;default:v!==q&&Dt(r,i,y,v,d,q)}i=T,u=S,d=oe,le!=null?cl(r,!!u,le,!1):!!d!=!!u&&(i!=null?cl(r,!!u,i,!0):cl(r,!!u,u?[]:"",!1));return;case"textarea":oe=le=null;for(T in u)if(y=u[T],u.hasOwnProperty(T)&&y!=null&&!d.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Dt(r,i,T,null,d,y)}for(S in d)if(y=d[S],v=u[S],d.hasOwnProperty(S)&&(y!=null||v!=null))switch(S){case"value":le=y;break;case"defaultValue":oe=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(a(91));break;default:y!==v&&Dt(r,i,S,y,d,v)}Zb(r,le,oe);return;case"option":for(var Ae in u)if(le=u[Ae],u.hasOwnProperty(Ae)&&le!=null&&!d.hasOwnProperty(Ae))switch(Ae){case"selected":r.selected=!1;break;default:Dt(r,i,Ae,null,d,le)}for(q in d)if(le=d[q],oe=u[q],d.hasOwnProperty(q)&&le!==oe&&(le!=null||oe!=null))switch(q){case"selected":r.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:Dt(r,i,q,le,d,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 Ve in u)le=u[Ve],u.hasOwnProperty(Ve)&&le!=null&&!d.hasOwnProperty(Ve)&&Dt(r,i,Ve,null,d,le);for(ie in d)if(le=d[ie],oe=u[ie],d.hasOwnProperty(ie)&&le!==oe&&(le!=null||oe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,i));break;default:Dt(r,i,ie,le,d,oe)}return;default:if(Hh(i)){for(var zt in u)le=u[zt],u.hasOwnProperty(zt)&&le!==void 0&&!d.hasOwnProperty(zt)&&Tp(r,i,zt,void 0,d,le);for(de in d)le=d[de],oe=u[de],!d.hasOwnProperty(de)||le===oe||le===void 0&&oe===void 0||Tp(r,i,de,le,d,oe);return}}for(var J in u)le=u[J],u.hasOwnProperty(J)&&le!=null&&!d.hasOwnProperty(J)&&Dt(r,i,J,null,d,le);for(me in d)le=d[me],oe=u[me],!d.hasOwnProperty(me)||le===oe||le==null&&oe==null||Dt(r,i,me,le,d,oe)}function Kw(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function M2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,u=performance.getEntriesByType("resource"),d=0;d<u.length;d++){var y=u[d],v=y.transferSize,S=y.initiatorType,T=y.duration;if(v&&T&&Kw(S)){for(S=0,T=y.responseEnd,d+=1;d<u.length;d++){var q=u[d],ie=q.startTime;if(ie>T)break;var de=q.transferSize,me=q.initiatorType;de&&Kw(me)&&(q=q.responseEnd,S+=de*(q<T?1:(T-ie)/(q-ie)))}if(--d,i+=8*(v+S)/(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 Ap=null,Rp=null;function Kd(r){return r.nodeType===9?r:r.ownerDocument}function Yw(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 Xw(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 Op(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 Mp=null;function D2(){var r=window.event;return r&&r.type==="popstate"?r===Mp?!1:(Mp=r,!0):(Mp=null,!1)}var Ww=typeof setTimeout=="function"?setTimeout:void 0,z2=typeof clearTimeout=="function"?clearTimeout:void 0,Jw=typeof Promise=="function"?Promise:void 0,I2=typeof queueMicrotask=="function"?queueMicrotask:typeof Jw<"u"?function(r){return Jw.resolve(null).then(r).catch(L2)}:Ww;function L2(r){setTimeout(function(){throw r})}function Zi(r){return r==="head"}function eS(r,i){var u=i,d=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(d===0){r.removeChild(y),$l(i);return}d--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")d++;else if(u==="html")Cu(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,Cu(u);for(var v=u.firstChild;v;){var S=v.nextSibling,T=v.nodeName;v[Ni]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=S}}else u==="body"&&Cu(r.ownerDocument.body);u=y}while(u);$l(i)}function tS(r,i){var u=r;r=0;do{var d=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||""),d&&d.nodeType===8)if(u=d.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=d}while(u)}function Dp(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":Dp(u),Be(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function P2(r,i,u,d){for(;r.nodeType===1;){var y=u;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[Ni])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=ta(r.nextSibling),r===null)break}return null}function U2(r,i,u){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=ta(r.nextSibling),r===null))return null;return r}function nS(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=ta(r.nextSibling),r===null))return null;return r}function zp(r){return r.data==="$?"||r.data==="$~"}function Ip(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function B2(r,i){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||u.readyState!=="loading")i();else{var d=function(){i(),u.removeEventListener("DOMContentLoaded",d)};u.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function ta(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 Lp=null;function rS(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"||u==="/&"){if(i===0)return ta(r.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}r=r.nextSibling}return null}function aS(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 iS(r,i,u){switch(i=Kd(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 Cu(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Be(r)}var na=new Map,sS=new Set;function Yd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ri=se.d;se.d={f:F2,r:$2,D:H2,C:q2,L:Z2,m:G2,X:Q2,S:V2,M:K2};function F2(){var r=ri.f(),i=Fd();return r||i}function $2(r){var i=pe(r);i!==null&&i.tag===5&&i.type==="form"?k0(i):ri.r(r)}var Ul=typeof document>"u"?null:document;function lS(r,i,u){var d=Ul;if(d&&typeof i=="string"&&i){var y=Qr(i);y='link[rel="'+r+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),sS.has(y)||(sS.add(y),r={rel:r,crossOrigin:u,href:i},d.querySelector(y)===null&&(i=d.createElement("link"),Gn(i,"link",r),bt(i),d.head.appendChild(i)))}}function H2(r){ri.D(r),lS("dns-prefetch",r,null)}function q2(r,i){ri.C(r,i),lS("preconnect",r,i)}function Z2(r,i,u){ri.L(r,i,u);var d=Ul;if(d&&r&&i){var y='link[rel="preload"][as="'+Qr(i)+'"]';i==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Qr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Qr(u.imageSizes)+'"]')):y+='[href="'+Qr(r)+'"]';var v=y;switch(i){case"style":v=Bl(r);break;case"script":v=Fl(r)}na.has(v)||(r=g({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:r,as:i},u),na.set(v,r),d.querySelector(y)!==null||i==="style"&&d.querySelector(Nu(v))||i==="script"&&d.querySelector(_u(v))||(i=d.createElement("link"),Gn(i,"link",r),bt(i),d.head.appendChild(i)))}}function G2(r,i){ri.m(r,i);var u=Ul;if(u&&r){var d=i&&typeof i.as=="string"?i.as:"script",y='link[rel="modulepreload"][as="'+Qr(d)+'"][href="'+Qr(r)+'"]',v=y;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Fl(r)}if(!na.has(v)&&(r=g({rel:"modulepreload",href:r},i),na.set(v,r),u.querySelector(y)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(_u(v)))return}d=u.createElement("link"),Gn(d,"link",r),bt(d),u.head.appendChild(d)}}}function V2(r,i,u){ri.S(r,i,u);var d=Ul;if(d&&r){var y=jt(d).hoistableStyles,v=Bl(r);i=i||"default";var S=y.get(v);if(!S){var T={loading:0,preload:null};if(S=d.querySelector(Nu(v)))T.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},u),(u=na.get(v))&&Pp(r,u);var q=S=d.createElement("link");bt(q),Gn(q,"link",r),q._p=new Promise(function(ie,de){q.onload=ie,q.onerror=de}),q.addEventListener("load",function(){T.loading|=1}),q.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Xd(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:T},y.set(v,S)}}}function Q2(r,i){ri.X(r,i);var u=Ul;if(u&&r){var d=jt(u).hoistableScripts,y=Fl(r),v=d.get(y);v||(v=u.querySelector(_u(y)),v||(r=g({src:r,async:!0},i),(i=na.get(y))&&Up(r,i),v=u.createElement("script"),bt(v),Gn(v,"link",r),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(y,v))}}function K2(r,i){ri.M(r,i);var u=Ul;if(u&&r){var d=jt(u).hoistableScripts,y=Fl(r),v=d.get(y);v||(v=u.querySelector(_u(y)),v||(r=g({src:r,async:!0,type:"module"},i),(i=na.get(y))&&Up(r,i),v=u.createElement("script"),bt(v),Gn(v,"link",r),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(y,v))}}function oS(r,i,u,d){var y=(y=re.current)?Yd(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=Bl(u.href),u=jt(y).hoistableStyles,d=u.get(i),d||(d={type:"style",instance:null,count:0,state:null},u.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=Bl(u.href);var v=jt(y).hoistableStyles,S=v.get(r);if(S||(y=y.ownerDocument||y,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,S),(v=y.querySelector(Nu(r)))&&!v._p&&(S.instance=v,S.state.loading=5),na.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},na.set(r,u),v||Y2(y,r,u,S.state))),i&&d===null)throw Error(a(528,""));return S}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Fl(u),u=jt(y).hoistableScripts,d=u.get(i),d||(d={type:"script",instance:null,count:0,state:null},u.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Bl(r){return'href="'+Qr(r)+'"'}function Nu(r){return'link[rel="stylesheet"]['+r+"]"}function uS(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function Y2(r,i,u,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Gn(i,"link",u),bt(i),r.head.appendChild(i))}function Fl(r){return'[src="'+Qr(r)+'"]'}function _u(r){return"script[async]"+r}function cS(r,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+Qr(u.href)+'"]');if(d)return i.instance=d,bt(d),d;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),bt(d),Gn(d,"style",y),Xd(d,u.precedence,r),i.instance=d;case"stylesheet":y=Bl(u.href);var v=r.querySelector(Nu(y));if(v)return i.state.loading|=4,i.instance=v,bt(v),v;d=uS(u),(y=na.get(y))&&Pp(d,y),v=(r.ownerDocument||r).createElement("link"),bt(v);var S=v;return S._p=new Promise(function(T,q){S.onload=T,S.onerror=q}),Gn(v,"link",d),i.state.loading|=4,Xd(v,u.precedence,r),i.instance=v;case"script":return v=Fl(u.src),(y=r.querySelector(_u(v)))?(i.instance=y,bt(y),y):(d=u,(y=na.get(v))&&(d=g({},u),Up(d,y)),r=r.ownerDocument||r,y=r.createElement("script"),bt(y),Gn(y,"link",d),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&&(d=i.instance,i.state.loading|=4,Xd(d,u.precedence,r));return i.instance}function Xd(r,i,u){for(var d=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=d.length?d[d.length-1]:null,v=y,S=0;S<d.length;S++){var T=d[S];if(T.dataset.precedence===i)v=T;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 Pp(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Up(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Wd=null;function dS(r,i,u){if(Wd===null){var d=new Map,y=Wd=new Map;y.set(u,d)}else y=Wd,d=y.get(u),d||(d=new Map,y.set(u,d));if(d.has(r))return d;for(d.set(r,null),u=u.getElementsByTagName(r),y=0;y<u.length;y++){var v=u[y];if(!(v[Ni]||v[Ge]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var S=v.getAttribute(i)||"";S=r+S;var T=d.get(S);T?T.push(v):d.set(S,[v])}}return d}function fS(r,i,u){r=r.ownerDocument||r,r.head.insertBefore(u,i==="title"?r.querySelector("head > title"):null)}function X2(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 hS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function W2(r,i,u,d){if(u.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Bl(d.href),v=i.querySelector(Nu(y));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Jd.bind(r),i.then(r,r)),u.state.loading|=4,u.instance=v,bt(v);return}v=i.ownerDocument||i,d=uS(d),(y=na.get(y))&&Pp(d,y),v=v.createElement("link"),bt(v);var S=v;S._p=new Promise(function(T,q){S.onload=T,S.onerror=q}),Gn(v,"link",d),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=Jd.bind(r),i.addEventListener("load",u),i.addEventListener("error",u))}}var Bp=0;function J2(r,i){return r.stylesheets&&r.count===0&&tf(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var d=setTimeout(function(){if(r.stylesheets&&tf(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Bp===0&&(Bp=62500*M2());var y=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&tf(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Bp?50:800)+i);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(y)}}:null}function Jd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ef=null;function tf(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ef=new Map,i.forEach(eR,r),ef=null,Jd.call(r))}function eR(r,i){if(!(i.state.loading&4)){var u=ef.get(r);if(u)var d=u.get(null);else{u=new Map,ef.set(r,u);for(var y=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<y.length;v++){var S=y[v];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(u.set(S.dataset.precedence,S),d=S)}d&&u.set(null,d)}y=i.instance,S=y.getAttribute("data-precedence"),v=u.get(S)||d,v===d&&u.set(null,y),u.set(S,y),this.count++,d=Jd.bind(this),y.addEventListener("load",d),y.addEventListener("error",d),v?v.parentNode.insertBefore(y,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(y,r.firstChild)),i.state.loading|=4}}var Tu={$$typeof:O,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function tR(r,i,u,d,y,v,S,T,q){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=wi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wi(0),this.hiddenUpdates=wi(null),this.identifierPrefix=d,this.onUncaughtError=y,this.onCaughtError=v,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function mS(r,i,u,d,y,v,S,T,q,ie,de,me){return r=new tR(r,i,u,S,q,ie,de,me,T),i=1,v===!0&&(i|=24),v=Dr(3,null,null,i),r.current=v,v.stateNode=r,i=bm(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:u,cache:i},km(v),r}function pS(r){return r?(r=vl,r):vl}function gS(r,i,u,d,y,v){y=pS(y),d.context===null?d.context=y:d.pendingContext=y,d=Di(i),d.payload={element:u},v=v===void 0?null:v,v!==null&&(d.callback=v),u=zi(r,d,i),u!==null&&(Sr(u,r,i),lu(u,r,i))}function yS(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<i?u:i}}function Fp(r,i){yS(r,i),(r=r.alternate)&&yS(r,i)}function vS(r){if(r.tag===13||r.tag===31){var i=_s(r,67108864);i!==null&&Sr(i,r,67108864),Fp(r,67108864)}}function bS(r){if(r.tag===13||r.tag===31){var i=Ur();i=Dn(i);var u=_s(r,i);u!==null&&Sr(u,r,i),Fp(r,i)}}var nf=!0;function nR(r,i,u,d){var y=G.T;G.T=null;var v=se.p;try{se.p=2,$p(r,i,u,d)}finally{se.p=v,G.T=y}}function rR(r,i,u,d){var y=G.T;G.T=null;var v=se.p;try{se.p=8,$p(r,i,u,d)}finally{se.p=v,G.T=y}}function $p(r,i,u,d){if(nf){var y=Hp(d);if(y===null)_p(r,i,d,rf,u),wS(r,d);else if(iR(y,r,i,u,d))d.stopPropagation();else if(wS(r,d),i&4&&-1<aR.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 S=Bn(v.pendingLanes);if(S!==0){var T=v;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var q=1<<31-ht(S);T.entanglements[1]|=q,S&=~q}Na(v),(Nt&6)===0&&(Ud=an()+500,ku(0))}}break;case 31:case 13:T=_s(v,2),T!==null&&Sr(T,v,2),Fd(),Fp(v,2)}if(v=Hp(d),v===null&&_p(r,i,d,rf,u),v===y)break;y=v}y!==null&&d.stopPropagation()}else _p(r,i,d,null,u)}}function Hp(r){return r=Zh(r),qp(r)}var rf=null;function qp(r){if(rf=null,r=H(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=f(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 rf=r,null}function xS(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(fa()){case ue:return 2;case we:return 8;case Fe:case Xe:return 32;case vt:return 268435456;default:return 32}default:return 32}}var Zp=!1,Gi=null,Vi=null,Qi=null,Au=new Map,Ru=new Map,Ki=[],aR="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 wS(r,i){switch(r){case"focusin":case"focusout":Gi=null;break;case"dragenter":case"dragleave":Vi=null;break;case"mouseover":case"mouseout":Qi=null;break;case"pointerover":case"pointerout":Au.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ru.delete(i.pointerId)}}function Ou(r,i,u,d,y,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:u,eventSystemFlags:d,nativeEvent:v,targetContainers:[y]},i!==null&&(i=pe(i),i!==null&&vS(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),r)}function iR(r,i,u,d,y){switch(i){case"focusin":return Gi=Ou(Gi,r,i,u,d,y),!0;case"dragenter":return Vi=Ou(Vi,r,i,u,d,y),!0;case"mouseover":return Qi=Ou(Qi,r,i,u,d,y),!0;case"pointerover":var v=y.pointerId;return Au.set(v,Ou(Au.get(v)||null,r,i,u,d,y)),!0;case"gotpointercapture":return v=y.pointerId,Ru.set(v,Ou(Ru.get(v)||null,r,i,u,d,y)),!0}return!1}function SS(r){var i=H(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,Ci(r.priority,function(){bS(u)});return}}else if(i===31){if(i=f(u),i!==null){r.blockedOn=i,Ci(r.priority,function(){bS(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 af(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var u=Hp(r.nativeEvent);if(u===null){u=r.nativeEvent;var d=new u.constructor(u.type,u);qh=d,u.target.dispatchEvent(d),qh=null}else return i=pe(u),i!==null&&vS(i),r.blockedOn=u,!1;i.shift()}return!0}function kS(r,i,u){af(r)&&u.delete(i)}function sR(){Zp=!1,Gi!==null&&af(Gi)&&(Gi=null),Vi!==null&&af(Vi)&&(Vi=null),Qi!==null&&af(Qi)&&(Qi=null),Au.forEach(kS),Ru.forEach(kS)}function sf(r,i){r.blockedOn===i&&(r.blockedOn=null,Zp||(Zp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sR)))}var lf=null;function jS(r){lf!==r&&(lf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lf===r&&(lf=null);for(var i=0;i<r.length;i+=3){var u=r[i],d=r[i+1],y=r[i+2];if(typeof d!="function"){if(qp(d||u)===null)continue;break}var v=pe(u);v!==null&&(r.splice(i,3),i-=3,Hm(v,{pending:!0,data:y,method:u.method,action:d},d,y))}}))}function $l(r){function i(q){return sf(q,r)}Gi!==null&&sf(Gi,r),Vi!==null&&sf(Vi,r),Qi!==null&&sf(Qi,r),Au.forEach(i),Ru.forEach(i);for(var u=0;u<Ki.length;u++){var d=Ki[u];d.blockedOn===r&&(d.blockedOn=null)}for(;0<Ki.length&&(u=Ki[0],u.blockedOn===null);)SS(u),u.blockedOn===null&&Ki.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(d=0;d<u.length;d+=3){var y=u[d],v=u[d+1],S=y[mt]||null;if(typeof v=="function")S||jS(u);else if(S){var T=null;if(v&&v.hasAttribute("formAction")){if(y=v,S=v[mt]||null)T=S.formAction;else if(qp(y)!==null)continue}else T=S.action;typeof T=="function"?u[d+1]=T:(u.splice(d,3),d-=3),jS(u)}}}function ES(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(S){return y=S})},focusReset:"manual",scroll:"manual"})}function i(){y!==null&&(y(),y=null),d||setTimeout(u,20)}function u(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,y=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),y!==null&&(y(),y=null)}}}function Gp(r){this._internalRoot=r}of.prototype.render=Gp.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var u=i.current,d=Ur();gS(u,d,r,i,null,null)},of.prototype.unmount=Gp.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;gS(r.current,2,null,r,null,null),Fd(),i[Fn]=null}};function of(r){this._internalRoot=r}of.prototype.unstable_scheduleHydration=function(r){if(r){var i=Ei();r={blockedOn:null,target:r,priority:i};for(var u=0;u<Ki.length&&i!==0&&i<Ki[u].priority;u++);Ki.splice(u,0,r),u===0&&SS(r)}};var CS=t.version;if(CS!=="19.2.4")throw Error(a(527,CS,"19.2.4"));se.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 lR={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uf.isDisabled&&uf.supportsFiber)try{Gt=uf.inject(lR),Ft=uf}catch{}}return Du.createRoot=function(r,i){if(!s(r))throw Error(a(299));var u=!1,d="",y=M0,v=D0,S=z0;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),i=mS(r,1,!1,null,null,u,d,null,y,v,S,ES),r[Fn]=i.current,Np(r),new Gp(i)},Du.hydrateRoot=function(r,i,u){if(!s(r))throw Error(a(299));var d=!1,y="",v=M0,S=D0,T=z0,q=null;return u!=null&&(u.unstable_strictMode===!0&&(d=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(S=u.onCaughtError),u.onRecoverableError!==void 0&&(T=u.onRecoverableError),u.formState!==void 0&&(q=u.formState)),i=mS(r,1,!0,i,u??null,d,y,q,v,S,T,ES),i.context=pS(null),u=i.current,d=Ur(),d=Dn(d),y=Di(d),y.callback=null,zi(u,y,d),u=d,i.current.lanes=u,pa(i,u),Na(i),r[Fn]=i.current,Np(r),new of(i)},Du.version="19.2.4",Du}var LS;function vR(){if(LS)return Yp.exports;LS=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(),Yp.exports=yR(),Yp.exports}var bR=vR(),il=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(){}},Gs,rs,oo,Pj,xR=(Pj=class extends il{constructor(){super();Te(this,Gs);Te(this,rs);Te(this,oo);ke(this,oo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){$(this,rs)||this.setEventListener($(this,oo))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,rs))==null||t.call(this),ke(this,rs,void 0))}setEventListener(t){var n;ke(this,oo,t),(n=$(this,rs))==null||n.call(this),ke(this,rs,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){$(this,Gs)!==t&&(ke(this,Gs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof $(this,Gs)=="boolean"?$(this,Gs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Gs=new WeakMap,rs=new WeakMap,oo=new WeakMap,Pj),cv=new xR,wR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},as,lv,Uj,SR=(Uj=class{constructor(){Te(this,as,wR);Te(this,lv,!1)}setTimeoutProvider(e){ke(this,as,e)}setTimeout(e,t){return $(this,as).setTimeout(e,t)}clearTimeout(e){$(this,as).clearTimeout(e)}setInterval(e,t){return $(this,as).setInterval(e,t)}clearInterval(e){$(this,as).clearInterval(e)}},as=new WeakMap,lv=new WeakMap,Uj),qs=new SR;function kR(e){setTimeout(e,0)}var jR=typeof window>"u"||"Deno"in globalThis;function er(){}function ER(e,t){return typeof e=="function"?e(t):e}function Kg(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ms(e,t){return typeof e=="function"?e(t):e}function sa(e,t){return typeof e=="function"?e(t):e}function PS(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==dv(c,t.options))return!1}else if(!sc(t.queryKey,c))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||s&&s!==t.state.fetchStatus||o&&!o(t))}function US(e,t){const{exact:n,status:a,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(tl(t.options.mutationKey)!==tl(o))return!1}else if(!sc(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function dv(e,t){return((t==null?void 0:t.queryKeyHashFn)||tl)(e)}function tl(e){return JSON.stringify(e,(t,n)=>Yg(n)?Object.keys(n).sort().reduce((a,s)=>(a[s]=n[s],a),{}):n)}function sc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>sc(e[n],t[n])):!1}var CR=Object.prototype.hasOwnProperty;function fv(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=BS(e)&&BS(t);if(!a&&!(Yg(e)&&Yg(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),f=c.length,m=a?new Array(f):{};let h=0;for(let p=0;p<f;p++){const g=a?p:c[p],w=e[g],x=t[g];if(w===x){m[g]=w,(a?p<o:CR.call(e,g))&&h++;continue}if(w===null||x===null||typeof w!="object"||typeof x!="object"){m[g]=x;continue}const k=fv(w,x,n+1);m[g]=k,k===w&&h++}return o===f&&h===o?e:m}function lc(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 BS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yg(e){if(!FS(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!FS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function FS(e){return Object.prototype.toString.call(e)==="[object Object]"}function NR(e){return new Promise(t=>{qs.setTimeout(t,e)})}function Xg(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?fv(e,t):t}function _R(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function TR(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var hv=Symbol();function Wj(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mv(e,t){return typeof e=="function"?e(...t):!!e}function AR(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 oc=(()=>{let e=()=>jR;return{isServer(){return e()},setIsServer(t){e=t}}})();function Wg(){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 RR=kR;function OR(){let e=[],t=0,n=f=>{f()},a=f=>{f()},s=RR;const o=f=>{t?e.push(f):s(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&s(()=>{a(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||c()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{s=f}}}var cn=OR(),uo,is,co,Bj,MR=(Bj=class extends il{constructor(){super();Te(this,uo,!0);Te(this,is);Te(this,co);ke(this,co,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(){$(this,is)||this.setEventListener($(this,co))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,is))==null||t.call(this),ke(this,is,void 0))}setEventListener(t){var n;ke(this,co,t),(n=$(this,is))==null||n.call(this),ke(this,is,t(this.setOnline.bind(this)))}setOnline(t){$(this,uo)!==t&&(ke(this,uo,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return $(this,uo)}},uo=new WeakMap,is=new WeakMap,co=new WeakMap,Bj),$f=new MR;function DR(e){return Math.min(1e3*2**e,3e4)}function Jj(e){return(e??"online")==="online"?$f.isOnline():!0}var Jg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function eE(e){let t=!1,n=0,a;const s=Wg(),o=()=>s.status!=="pending",c=j=>{var E;if(!o()){const C=new Jg(j);w(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>cv.isFocused()&&(e.networkMode==="always"||$f.isOnline())&&e.canRun(),p=()=>Jj(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),s.resolve(j))},w=j=>{o()||(a==null||a(),s.reject(j))},x=()=>new Promise(j=>{var E;a=C=>{(o()||h())&&j(C)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(C){j=Promise.reject(C)}Promise.resolve(j).then(g).catch(C=>{var R;if(o())return;const A=e.retry??(oc.isServer()?0:3),O=e.retryDelay??DR,D=typeof O=="function"?O(n,C):O,I=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,C);if(t||!I){w(C);return}n++,(R=e.onFail)==null||R.call(e,n,C),NR(D).then(()=>h()?void 0:x()).then(()=>{t?w(C):k()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(a==null||a(),s),cancelRetry:f,continueRetry:m,canStart:p,start:()=>(p()?k():x().then(k),s)}}var Vs,Fj,tE=(Fj=class{constructor(){Te(this,Vs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kg(this.gcTime)&&ke(this,Vs,qs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(oc.isServer()?1/0:300*1e3))}clearGcTimeout(){$(this,Vs)&&(qs.clearTimeout($(this,Vs)),ke(this,Vs,void 0))}},Vs=new WeakMap,Fj),Qs,fo,aa,Ks,Ln,jc,Ys,$r,nE,ii,$j,zR=($j=class extends tE{constructor(t){super();Te(this,$r);Te(this,Qs);Te(this,fo);Te(this,aa);Te(this,Ks);Te(this,Ln);Te(this,jc);Te(this,Ys);ke(this,Ys,!1),ke(this,jc,t.defaultOptions),this.setOptions(t.options),this.observers=[],ke(this,Ks,t.client),ke(this,aa,$(this,Ks).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ke(this,Qs,HS(this.options)),this.state=t.state??$(this,Qs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$(this,Ln))==null?void 0:t.promise}setOptions(t){if(this.options={...$(this,jc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=HS(this.options);n.data!==void 0&&(this.setState($S(n.data,n.dataUpdatedAt)),ke(this,Qs,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,aa).remove(this)}setData(t,n){const a=Xg(this.state.data,t,this.options);return Qe(this,$r,ii).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Qe(this,$r,ii).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,s;const n=(a=$(this,Ln))==null?void 0:a.promise;return(s=$(this,Ln))==null||s.cancel(t),n?n.then(er).catch(er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return $(this,Qs)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>sa(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hv||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ms(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:!Xj(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,Ln))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,Ln))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,aa).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||($(this,Ln)&&($(this,Ys)||Qe(this,$r,nE).call(this)?$(this,Ln).cancel({revert:!0}):$(this,Ln).cancelRetry()),this.scheduleGc()),$(this,aa).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Qe(this,$r,ii).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,p,g,w,x,k,j,E,C,A,O;if(this.state.fetchStatus!=="idle"&&((m=$(this,Ln))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if($(this,Ln))return $(this,Ln).continueRetry(),$(this,Ln).promise}if(t&&this.setOptions(t),!this.options.queryFn){const D=this.observers.find(I=>I.options.queryFn);D&&this.setOptions(D.options)}const a=new AbortController,s=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>(ke(this,Ys,!0),a.signal)})},o=()=>{const D=Wj(this.options,n),R=(()=>{const F={client:$(this,Ks),queryKey:this.queryKey,meta:this.meta};return s(F),F})();return ke(this,Ys,!1),this.options.persister?this.options.persister(D,R,this):D(R)},f=(()=>{const D={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:$(this,Ks),state:this.state,fetchFn:o};return s(D),D})();(h=this.options.behavior)==null||h.onFetch(f,this),ke(this,fo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=f.fetchOptions)==null?void 0:p.meta))&&Qe(this,$r,ii).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),ke(this,Ln,eE({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:D=>{D instanceof Jg&&D.revert&&this.setState({...$(this,fo),fetchStatus:"idle"}),a.abort()},onFail:(D,I)=>{Qe(this,$r,ii).call(this,{type:"failed",failureCount:D,error:I})},onPause:()=>{Qe(this,$r,ii).call(this,{type:"pause"})},onContinue:()=>{Qe(this,$r,ii).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const D=await $(this,Ln).start();if(D===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(D),(x=(w=$(this,aa).config).onSuccess)==null||x.call(w,D,this),(j=(k=$(this,aa).config).onSettled)==null||j.call(k,D,this.state.error,this),D}catch(D){if(D instanceof Jg){if(D.silent)return $(this,Ln).promise;if(D.revert){if(this.state.data===void 0)throw D;return this.state.data}}throw Qe(this,$r,ii).call(this,{type:"error",error:D}),(C=(E=$(this,aa).config).onError)==null||C.call(E,D,this),(O=(A=$(this,aa).config).onSettled)==null||O.call(A,this.state.data,D,this),D}finally{this.scheduleGc()}}},Qs=new WeakMap,fo=new WeakMap,aa=new WeakMap,Ks=new WeakMap,Ln=new WeakMap,jc=new WeakMap,Ys=new WeakMap,$r=new WeakSet,nE=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ii=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,...rE(a.data,this.options),fetchMeta:t.meta??null};case"success":const s={...a,...$S(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ke(this,fo,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),cn.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),$(this,aa).notify({query:this,type:"updated",action:t})})},$j);function rE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jj(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $S(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function HS(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 Er,wt,Ec,ur,Xs,ho,si,ss,Cc,mo,po,Ws,Js,ls,go,Tt,Xu,ey,ty,ny,ry,ay,iy,sy,aE,Hj,pv=(Hj=class extends il{constructor(t,n){super();Te(this,Tt);Te(this,Er);Te(this,wt);Te(this,Ec);Te(this,ur);Te(this,Xs);Te(this,ho);Te(this,si);Te(this,ss);Te(this,Cc);Te(this,mo);Te(this,po);Te(this,Ws);Te(this,Js);Te(this,ls);Te(this,go,new Set);this.options=n,ke(this,Er,t),ke(this,ss,null),ke(this,si,Wg()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,wt).addObserver(this),qS($(this,wt),this.options)?Qe(this,Tt,Xu).call(this):this.updateResult(),Qe(this,Tt,ry).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ly($(this,wt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ly($(this,wt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Qe(this,Tt,ay).call(this),Qe(this,Tt,iy).call(this),$(this,wt).removeObserver(this)}setOptions(t){const n=this.options,a=$(this,wt);if(this.options=$(this,Er).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof sa(this.options.enabled,$(this,wt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Qe(this,Tt,sy).call(this),$(this,wt).setOptions(this.options),n._defaulted&&!lc(this.options,n)&&$(this,Er).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,wt),observer:this});const s=this.hasListeners();s&&ZS($(this,wt),a,this.options,n)&&Qe(this,Tt,Xu).call(this),this.updateResult(),s&&($(this,wt)!==a||sa(this.options.enabled,$(this,wt))!==sa(n.enabled,$(this,wt))||ms(this.options.staleTime,$(this,wt))!==ms(n.staleTime,$(this,wt)))&&Qe(this,Tt,ey).call(this);const o=Qe(this,Tt,ty).call(this);s&&($(this,wt)!==a||sa(this.options.enabled,$(this,wt))!==sa(n.enabled,$(this,wt))||o!==$(this,ls))&&Qe(this,Tt,ny).call(this,o)}getOptimisticResult(t){const n=$(this,Er).getQueryCache().build($(this,Er),t),a=this.createResult(n,t);return LR(this,a)&&(ke(this,ur,a),ke(this,ho,this.options),ke(this,Xs,$(this,wt).state)),a}getCurrentResult(){return $(this,ur)}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&&$(this,si).status==="pending"&&$(this,si).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,s))})}trackProp(t){$(this,go).add(t)}getCurrentQuery(){return $(this,wt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=$(this,Er).defaultQueryOptions(t),a=$(this,Er).getQueryCache().build($(this,Er),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Qe(this,Tt,Xu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,ur)))}createResult(t,n){var te;const a=$(this,wt),s=this.options,o=$(this,ur),c=$(this,Xs),f=$(this,ho),h=t!==a?t.state:$(this,Ec),{state:p}=t;let g={...p},w=!1,x;if(n._optimisticResults){const z=this.hasListeners(),L=!z&&qS(t,n),Q=z&&ZS(t,a,n,s);(L||Q)&&(g={...g,...rE(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;x=g.data;let C=!1;if(n.placeholderData!==void 0&&x===void 0&&E==="pending"){let z;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(z=o.data,C=!0):z=typeof n.placeholderData=="function"?n.placeholderData((te=$(this,po))==null?void 0:te.state.data,$(this,po)):n.placeholderData,z!==void 0&&(E="success",x=Xg(o==null?void 0:o.data,z,n),w=!0)}if(n.select&&x!==void 0&&!C)if(o&&x===(c==null?void 0:c.data)&&n.select===$(this,Cc))x=$(this,mo);else try{ke(this,Cc,n.select),x=n.select(x),x=Xg(o==null?void 0:o.data,x,n),ke(this,mo,x),ke(this,ss,null)}catch(z){ke(this,ss,z)}$(this,ss)&&(k=$(this,ss),x=$(this,mo),j=Date.now(),E="error");const A=g.fetchStatus==="fetching",O=E==="pending",D=E==="error",I=O&&A,R=x!==void 0,P={status:E,fetchStatus:g.fetchStatus,isPending:O,isSuccess:E==="success",isError:D,isInitialLoading:I,isLoading:I,data:x,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!O,isLoadingError:D&&!R,isPaused:g.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:D&&R,isStale:gv(t,n),refetch:this.refetch,promise:$(this,si),isEnabled:sa(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=P.data!==void 0,L=P.status==="error"&&!z,Q=W=>{L?W.reject(P.error):z&&W.resolve(P.data)},ce=()=>{const W=ke(this,si,P.promise=Wg());Q(W)},X=$(this,si);switch(X.status){case"pending":t.queryHash===a.queryHash&&Q(X);break;case"fulfilled":(L||P.data!==X.value)&&ce();break;case"rejected":(!L||P.error!==X.reason)&&ce();break}}return P}updateResult(){const t=$(this,ur),n=this.createResult($(this,wt),this.options);if(ke(this,Xs,$(this,wt).state),ke(this,ho,this.options),$(this,Xs).data!==void 0&&ke(this,po,$(this,wt)),lc(n,t))return;ke(this,ur,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!$(this,go).size)return!0;const c=new Set(o??$(this,go));return this.options.throwOnError&&c.add("error"),Object.keys($(this,ur)).some(f=>{const m=f;return $(this,ur)[m]!==t[m]&&c.has(m)})};Qe(this,Tt,aE).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Qe(this,Tt,ry).call(this)}},Er=new WeakMap,wt=new WeakMap,Ec=new WeakMap,ur=new WeakMap,Xs=new WeakMap,ho=new WeakMap,si=new WeakMap,ss=new WeakMap,Cc=new WeakMap,mo=new WeakMap,po=new WeakMap,Ws=new WeakMap,Js=new WeakMap,ls=new WeakMap,go=new WeakMap,Tt=new WeakSet,Xu=function(t){Qe(this,Tt,sy).call(this);let n=$(this,wt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(er)),n},ey=function(){Qe(this,Tt,ay).call(this);const t=ms(this.options.staleTime,$(this,wt));if(oc.isServer()||$(this,ur).isStale||!Kg(t))return;const a=Xj($(this,ur).dataUpdatedAt,t)+1;ke(this,Ws,qs.setTimeout(()=>{$(this,ur).isStale||this.updateResult()},a))},ty=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,wt)):this.options.refetchInterval)??!1},ny=function(t){Qe(this,Tt,iy).call(this),ke(this,ls,t),!(oc.isServer()||sa(this.options.enabled,$(this,wt))===!1||!Kg($(this,ls))||$(this,ls)===0)&&ke(this,Js,qs.setInterval(()=>{(this.options.refetchIntervalInBackground||cv.isFocused())&&Qe(this,Tt,Xu).call(this)},$(this,ls)))},ry=function(){Qe(this,Tt,ey).call(this),Qe(this,Tt,ny).call(this,Qe(this,Tt,ty).call(this))},ay=function(){$(this,Ws)&&(qs.clearTimeout($(this,Ws)),ke(this,Ws,void 0))},iy=function(){$(this,Js)&&(qs.clearInterval($(this,Js)),ke(this,Js,void 0))},sy=function(){const t=$(this,Er).getQueryCache().build($(this,Er),this.options);if(t===$(this,wt))return;const n=$(this,wt);ke(this,wt,t),ke(this,Ec,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},aE=function(t){cn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n($(this,ur))}),$(this,Er).getQueryCache().notify({query:$(this,wt),type:"observerResultsUpdated"})})},Hj);function IR(e,t){return sa(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qS(e,t){return IR(e,t)||e.state.data!==void 0&&ly(e,t,t.refetchOnMount)}function ly(e,t,n){if(sa(t.enabled,e)!==!1&&ms(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&gv(e,t)}return!1}function ZS(e,t,n,a){return(e!==t||sa(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&gv(e,n)}function gv(e,t){return sa(t.enabled,e)!==!1&&e.isStaleByTime(ms(t.staleTime,e))}function LR(e,t){return!lc(e.getCurrentResult(),t)}function GS(e){return{onFetch:(t,n)=>{var p,g,w,x,k;const a=t.options,s=(w=(g=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:g.fetchMore)==null?void 0:w.direction,o=((x=t.state.data)==null?void 0:x.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{AR(O,()=>t.signal,()=>j=!0)},C=Wj(t.options,t.fetchOptions),A=async(O,D,I)=>{if(j)return Promise.reject();if(D==null&&O.pages.length)return Promise.resolve(O);const F=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:D,direction:I?"backward":"forward",meta:t.options.meta};return E(L),L})(),P=await C(F),{maxPages:te}=t.options,z=I?TR:_R;return{pages:z(O.pages,P,te),pageParams:z(O.pageParams,D,te)}};if(s&&o.length){const O=s==="backward",D=O?PR:VS,I={pages:o,pageParams:c},R=D(a,I);f=await A(I,R,O)}else{const O=e??o.length;do{const D=m===0?c[0]??a.initialPageParam:VS(a,f);if(m>0&&D==null)break;f=await A(f,D),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function VS(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 PR(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 Nc,Ta,Wn,el,Aa,es,qj,UR=(qj=class extends tE{constructor(t){super();Te(this,Aa);Te(this,Nc);Te(this,Ta);Te(this,Wn);Te(this,el);ke(this,Nc,t.client),this.mutationId=t.mutationId,ke(this,Wn,t.mutationCache),ke(this,Ta,[]),this.state=t.state||iE(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,Ta).includes(t)||($(this,Ta).push(t),this.clearGcTimeout(),$(this,Wn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ke(this,Ta,$(this,Ta).filter(n=>n!==t)),this.scheduleGc(),$(this,Wn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,Ta).length||(this.state.status==="pending"?this.scheduleGc():$(this,Wn).remove(this))}continue(){var t;return((t=$(this,el))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,p,g,w,x,k,j,E,C,A,O,D,I,R,F;const n=()=>{Qe(this,Aa,es).call(this,{type:"continue"})},a={client:$(this,Nc),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,el,eE({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(P,te)=>{Qe(this,Aa,es).call(this,{type:"failed",failureCount:P,error:te})},onPause:()=>{Qe(this,Aa,es).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,Wn).canRun(this)}));const s=this.state.status==="pending",o=!$(this,el).canStart();try{if(s)n();else{Qe(this,Aa,es).call(this,{type:"pending",variables:t,isPaused:o}),$(this,Wn).config.onMutate&&await $(this,Wn).config.onMutate(t,this,a);const te=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));te!==this.state.context&&Qe(this,Aa,es).call(this,{type:"pending",context:te,variables:t,isPaused:o})}const P=await $(this,el).start();return await((h=(m=$(this,Wn).config).onSuccess)==null?void 0:h.call(m,P,t,this.state.context,this,a)),await((g=(p=this.options).onSuccess)==null?void 0:g.call(p,P,t,this.state.context,a)),await((x=(w=$(this,Wn).config).onSettled)==null?void 0:x.call(w,P,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,P,null,t,this.state.context,a)),Qe(this,Aa,es).call(this,{type:"success",data:P}),P}catch(P){try{await((C=(E=$(this,Wn).config).onError)==null?void 0:C.call(E,P,t,this.state.context,this,a))}catch(te){Promise.reject(te)}try{await((O=(A=this.options).onError)==null?void 0:O.call(A,P,t,this.state.context,a))}catch(te){Promise.reject(te)}try{await((I=(D=$(this,Wn).config).onSettled)==null?void 0:I.call(D,void 0,P,this.state.variables,this.state.context,this,a))}catch(te){Promise.reject(te)}try{await((F=(R=this.options).onSettled)==null?void 0:F.call(R,void 0,P,t,this.state.context,a))}catch(te){Promise.reject(te)}throw Qe(this,Aa,es).call(this,{type:"error",error:P}),P}finally{$(this,Wn).runNext(this)}}},Nc=new WeakMap,Ta=new WeakMap,Wn=new WeakMap,el=new WeakMap,Aa=new WeakSet,es=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),cn.batch(()=>{$(this,Ta).forEach(a=>{a.onMutationUpdate(t)}),$(this,Wn).notify({mutation:this,type:"updated",action:t})})},qj);function iE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var li,ba,_c,Zj,BR=(Zj=class extends il{constructor(t={}){super();Te(this,li);Te(this,ba);Te(this,_c);this.config=t,ke(this,li,new Set),ke(this,ba,new Map),ke(this,_c,0)}build(t,n,a){const s=new UR({client:t,mutationCache:this,mutationId:++cf(this,_c)._,options:t.defaultMutationOptions(n),state:a});return this.add(s),s}add(t){$(this,li).add(t);const n=df(t);if(typeof n=="string"){const a=$(this,ba).get(n);a?a.push(t):$(this,ba).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,li).delete(t)){const n=df(t);if(typeof n=="string"){const a=$(this,ba).get(n);if(a)if(a.length>1){const s=a.indexOf(t);s!==-1&&a.splice(s,1)}else a[0]===t&&$(this,ba).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=df(t);if(typeof n=="string"){const a=$(this,ba).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=df(t);if(typeof n=="string"){const s=(a=$(this,ba).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(){cn.batch(()=>{$(this,li).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,li).clear(),$(this,ba).clear()})}getAll(){return Array.from($(this,li))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>US(n,a))}findAll(t={}){return this.getAll().filter(n=>US(t,n))}notify(t){cn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return cn.batch(()=>Promise.all(t.map(n=>n.continue().catch(er))))}},li=new WeakMap,ba=new WeakMap,_c=new WeakMap,Zj);function df(e){var t;return(t=e.options.scope)==null?void 0:t.id}var oi,os,Cr,ui,fi,Mf,oy,Gj,FR=(Gj=class extends il{constructor(n,a){super();Te(this,fi);Te(this,oi);Te(this,os);Te(this,Cr);Te(this,ui);ke(this,oi,n),this.setOptions(a),this.bindMethods(),Qe(this,fi,Mf).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=$(this,oi).defaultMutationOptions(n),lc(this.options,a)||$(this,oi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:$(this,Cr),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&tl(a.mutationKey)!==tl(this.options.mutationKey)?this.reset():((s=$(this,Cr))==null?void 0:s.state.status)==="pending"&&$(this,Cr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=$(this,Cr))==null||n.removeObserver(this)}onMutationUpdate(n){Qe(this,fi,Mf).call(this),Qe(this,fi,oy).call(this,n)}getCurrentResult(){return $(this,os)}reset(){var n;(n=$(this,Cr))==null||n.removeObserver(this),ke(this,Cr,void 0),Qe(this,fi,Mf).call(this),Qe(this,fi,oy).call(this)}mutate(n,a){var s;return ke(this,ui,a),(s=$(this,Cr))==null||s.removeObserver(this),ke(this,Cr,$(this,oi).getMutationCache().build($(this,oi),this.options)),$(this,Cr).addObserver(this),$(this,Cr).execute(n)}},oi=new WeakMap,os=new WeakMap,Cr=new WeakMap,ui=new WeakMap,fi=new WeakSet,Mf=function(){var a;const n=((a=$(this,Cr))==null?void 0:a.state)??iE();ke(this,os,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},oy=function(n){cn.batch(()=>{var a,s,o,c,f,m,h,p;if($(this,ui)&&this.hasListeners()){const g=$(this,os).variables,w=$(this,os).context,x={client:$(this,oi),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(a=$(this,ui)).onSuccess)==null||s.call(a,n.data,g,w,x)}catch(k){Promise.reject(k)}try{(c=(o=$(this,ui)).onSettled)==null||c.call(o,n.data,null,g,w,x)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=$(this,ui)).onError)==null||m.call(f,n.error,g,w,x)}catch(k){Promise.reject(k)}try{(p=(h=$(this,ui)).onSettled)==null||p.call(h,void 0,n.error,g,w,x)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g($(this,os))})})},Gj);function QS(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function $R(e,t,n){const a=e.slice(0);return a[t]=n,a}var yo,Fr,vo,bo,ia,us,Tc,Ac,Rc,Oc,Yn,uy,cy,dy,fy,hy,Vj,HR=(Vj=class extends il{constructor(t,n,a){super();Te(this,Yn);Te(this,yo);Te(this,Fr);Te(this,vo);Te(this,bo);Te(this,ia);Te(this,us);Te(this,Tc);Te(this,Ac);Te(this,Rc);Te(this,Oc,[]);ke(this,yo,t),ke(this,bo,a),ke(this,vo,[]),ke(this,ia,[]),ke(this,Fr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&$(this,ia).forEach(t=>{t.subscribe(n=>{Qe(this,Yn,fy).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,$(this,ia).forEach(t=>{t.destroy()})}setQueries(t,n){ke(this,vo,t),ke(this,bo,n),cn.batch(()=>{const a=$(this,ia),s=Qe(this,Yn,dy).call(this,$(this,vo));s.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=s.map(g=>g.observer),c=o.map(g=>g.getCurrentResult()),f=a.length!==o.length,m=o.some((g,w)=>g!==a[w]),h=f||m,p=h?!0:c.some((g,w)=>{const x=$(this,Fr)[w];return!x||!lc(g,x)});!h&&!p||(h&&(ke(this,Oc,s),ke(this,ia,o)),ke(this,Fr,c),this.hasListeners()&&(h&&(QS(a,o).forEach(g=>{g.destroy()}),QS(o,a).forEach(g=>{g.subscribe(w=>{Qe(this,Yn,fy).call(this,g,w)})})),Qe(this,Yn,hy).call(this)))})}getCurrentResult(){return $(this,Fr)}getQueries(){return $(this,ia).map(t=>t.getCurrentQuery())}getObservers(){return $(this,ia)}getOptimisticResult(t,n){const a=Qe(this,Yn,dy).call(this,t),s=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[s,c=>Qe(this,Yn,cy).call(this,c??s,n,o),()=>Qe(this,Yn,uy).call(this,s,a)]}},yo=new WeakMap,Fr=new WeakMap,vo=new WeakMap,bo=new WeakMap,ia=new WeakMap,us=new WeakMap,Tc=new WeakMap,Ac=new WeakMap,Rc=new WeakMap,Oc=new WeakMap,Yn=new WeakSet,uy=function(t,n){return n.map((a,s)=>{const o=t[s];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{n.forEach(f=>{f.observer.trackProp(c)})})})},cy=function(t,n,a){if(n){const s=$(this,Rc),o=a!==void 0&&s!==void 0&&(s.length!==a.length||a.some((c,f)=>c!==s[f]));return(!$(this,us)||$(this,Fr)!==$(this,Ac)||o||n!==$(this,Tc))&&(ke(this,Tc,n),ke(this,Ac,$(this,Fr)),a!==void 0&&ke(this,Rc,a),ke(this,us,fv($(this,us),n(t)))),$(this,us)}return t},dy=function(t){const n=new Map;$(this,ia).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=$(this,yo).defaultQueryOptions(s),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new pv($(this,yo),o);a.push({defaultedQueryOptions:o,observer:f})}),a},fy=function(t,n){const a=$(this,ia).indexOf(t);a!==-1&&(ke(this,Fr,$R($(this,Fr),a,n)),Qe(this,Yn,hy).call(this))},hy=function(){var t;if(this.hasListeners()){const n=$(this,us),a=Qe(this,Yn,uy).call(this,$(this,Fr),$(this,Oc)),s=Qe(this,Yn,cy).call(this,a,(t=$(this,bo))==null?void 0:t.combine);n!==s&&cn.batch(()=>{this.listeners.forEach(o=>{o($(this,Fr))})})}},Vj),Ra,Qj,qR=(Qj=class extends il{constructor(t={}){super();Te(this,Ra);this.config=t,ke(this,Ra,new Map)}build(t,n,a){const s=n.queryKey,o=n.queryHash??dv(s,n);let c=this.get(o);return c||(c=new zR({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(s)}),this.add(c)),c}add(t){$(this,Ra).has(t.queryHash)||($(this,Ra).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=$(this,Ra).get(t.queryHash);n&&(t.destroy(),n===t&&$(this,Ra).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){cn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,Ra).get(t)}getAll(){return[...$(this,Ra).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>PS(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>PS(t,a)):n}notify(t){cn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){cn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){cn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ra=new WeakMap,Qj),un,cs,ds,xo,wo,fs,So,ko,Kj,ZR=(Kj=class{constructor(e={}){Te(this,un);Te(this,cs);Te(this,ds);Te(this,xo);Te(this,wo);Te(this,fs);Te(this,So);Te(this,ko);ke(this,un,e.queryCache||new qR),ke(this,cs,e.mutationCache||new BR),ke(this,ds,e.defaultOptions||{}),ke(this,xo,new Map),ke(this,wo,new Map),ke(this,fs,0)}mount(){cf(this,fs)._++,$(this,fs)===1&&(ke(this,So,cv.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,un).onFocus())})),ke(this,ko,$f.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,un).onOnline())})))}unmount(){var e,t;cf(this,fs)._--,$(this,fs)===0&&((e=$(this,So))==null||e.call(this),ke(this,So,void 0),(t=$(this,ko))==null||t.call(this),ke(this,ko,void 0))}isFetching(e){return $(this,un).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,cs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,un).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=$(this,un).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ms(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return $(this,un).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=$(this,un).get(a.queryHash),o=s==null?void 0:s.state.data,c=ER(t,o);if(c!==void 0)return $(this,un).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return cn.batch(()=>$(this,un).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,un).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=$(this,un);cn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=$(this,un);return cn.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=cn.batch(()=>$(this,un).findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(er).catch(er)}invalidateQueries(e,t={}){return cn.batch(()=>($(this,un).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=cn.batch(()=>$(this,un).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(er)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(er)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=$(this,un).build(this,t);return n.isStaleByTime(ms(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(er).catch(er)}fetchInfiniteQuery(e){return e.behavior=GS(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(er).catch(er)}ensureInfiniteQueryData(e){return e.behavior=GS(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return $f.isOnline()?$(this,cs).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,un)}getMutationCache(){return $(this,cs)}getDefaultOptions(){return $(this,ds)}setDefaultOptions(e){ke(this,ds,e)}setQueryDefaults(e,t){$(this,xo).set(tl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,xo).values()],n={};return t.forEach(a=>{sc(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){$(this,wo).set(tl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,wo).values()],n={};return t.forEach(a=>{sc(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,ds).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=dv(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===hv&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,ds).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,un).clear(),$(this,cs).clear()}},un=new WeakMap,cs=new WeakMap,ds=new WeakMap,xo=new WeakMap,wo=new WeakMap,fs=new WeakMap,So=new WeakMap,ko=new WeakMap,Kj),sE=b.createContext(void 0),gn=e=>{const t=b.useContext(sE);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},GR=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(sE.Provider,{value:e,children:t})),lE=b.createContext(!1),oE=()=>b.useContext(lE);lE.Provider;function VR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var QR=b.createContext(VR()),uE=()=>b.useContext(QR),cE=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?mv(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},dE=e=>{b.useEffect(()=>{e.clearReset()},[e])},fE=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||mv(n,[e.error,a])),hE=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))}},KR=(e,t)=>e.isLoading&&e.isFetching&&!t,my=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,py=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function YR({queries:e,...t},n){const a=gn(),s=oE(),o=uE(),c=b.useMemo(()=>e.map(j=>{const E=a.defaultQueryOptions(j);return E._optimisticResults=s?"isRestoring":"optimistic",E}),[e,a,s]);c.forEach(j=>{hE(j);const E=a.getQueryCache().get(j.queryHash);cE(j,o,E)}),dE(o);const[f]=b.useState(()=>new HR(a,c,t)),[m,h,p]=f.getOptimisticResult(c,t.combine),g=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(j=>g?f.subscribe(cn.batchCalls(j)):er,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const x=m.some((j,E)=>my(c[E],j))?m.flatMap((j,E)=>{const C=c[E];if(C&&my(C,j)){const A=new pv(a,C);return py(C,A,o)}return[]}):[];if(x.length>0)throw Promise.all(x);const k=m.find((j,E)=>{const C=c[E];return C&&fE({result:j,errorResetBoundary:o,throwOnError:C.throwOnError,query:a.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(k!=null&&k.error)throw k.error;return h(p())}function XR(e,t,n){var w,x,k,j;const a=oE(),s=uE(),o=gn(),c=o.defaultQueryOptions(e);(x=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||x.call(w,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",hE(c),cE(c,s,f),dE(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(E=>{const C=g?h.subscribe(cn.batchCalls(E)):er;return h.updateResult(),C},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),b.useEffect(()=>{h.setOptions(c)},[c,h]),my(c,p))throw py(c,h,s);if(fE({result:p,errorResetBoundary:s,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw p.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,c,p),c.experimental_prefetchInRender&&!oc.isServer()&&KR(p,a)){const E=m?py(c,h,s):f==null?void 0:f.promise;E==null||E.catch(er).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?p:h.trackResult(p)}function Ye(e,t){return XR(e,pv)}function yt(e,t){const n=gn(),[a]=b.useState(()=>new FR(n,e));b.useEffect(()=>{a.setOptions(e)},[a,e]);const s=b.useSyncExternalStore(b.useCallback(c=>a.subscribe(cn.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=b.useCallback((c,f)=>{a.mutate(c,f).catch(er)},[a]);if(s.error&&mv(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 KS="popstate";function YS(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function WR(e={}){function t(a,s){var h;let o=(h=s.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=o||a.location;return gy("",{pathname:c,search:f,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:uc(s)}return eO(t,n,null,e)}function Kt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function JR(){return Math.random().toString(36).substring(2,10)}function XS(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 gy(e,t,n=null,a,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?To(t):t,state:n,key:t&&t.key||a||JR(),unstable_mask:s}}function uc({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 To(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 eO(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:o=!1}=a,c=s.history,f="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(){f="POP";let E=p(),C=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:C})}function w(E,C){f="PUSH";let A=YS(E)?E:gy(j.location,E,C);h=p()+1;let O=XS(A,h),D=j.createHref(A.unstable_mask||A);try{c.pushState(O,"",D)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;s.location.assign(D)}o&&m&&m({action:f,location:j.location,delta:1})}function x(E,C){f="REPLACE";let A=YS(E)?E:gy(j.location,E,C);h=p();let O=XS(A,h),D=j.createHref(A.unstable_mask||A);c.replaceState(O,"",D),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return tO(E)}let j={get action(){return f},get location(){return e(s,c)},listen(E){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(KS,g),m=E,()=>{s.removeEventListener(KS,g),m=null}},createHref(E){return t(s,E)},createURL:k,encodeLocation(E){let C=k(E);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:w,replace:x,go(E){return c.go(E)}};return j}function tO(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Kt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:uc(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function mE(e,t,n="/"){return nO(e,t,n,!1)}function nO(e,t,n,a){let s=typeof t=="string"?To(t):t,o=hi(s.pathname||"/",n);if(o==null)return null;let c=pE(e);rO(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=mO(o);f=fO(c[m],h,a)}return f}function pE(e,t=[],n=[],a="",s=!1){let o=(c,f,m=s,h)=>{let p={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(a)&&m)return;Kt(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=Ma([a,p.relativePath]),w=n.concat(p);c.children&&c.children.length>0&&(Kt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),pE(c.children,t,w,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:cO(g,c.index),routesMeta:w})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))o(c,f);else for(let h of gE(c.path))o(c,f,!0,h)}),t}function gE(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=gE(a.join("/")),f=[];return f.push(...c.map(m=>m===""?o:[o,m].join("/"))),s&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function rO(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dO(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var aO=/^:[\w-]+$/,iO=3,sO=2,lO=1,oO=10,uO=-2,WS=e=>e==="*";function cO(e,t){let n=e.split("/"),a=n.length;return n.some(WS)&&(a+=uO),t&&(a+=sO),n.filter(s=>!WS(s)).reduce((s,o)=>s+(aO.test(o)?iO:o===""?lO:oO),a)}function dO(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 fO(e,t,n=!1){let{routesMeta:a}=e,s={},o="/",c=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,p=o==="/"?t:t.slice(o.length)||"/",g=Hf({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},p),w=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Hf({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},p)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:Ma([o,g.pathname]),pathnameBase:vO(Ma([o,g.pathnameBase])),route:w}),g.pathnameBase!=="/"&&(o=Ma([o,g.pathnameBase]))}return c}function Hf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=hO(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],c=o.replace(/(.)\/+$/,"$1"),f=s.slice(1);return{params:a.reduce((h,{paramName:p,isOptional:g},w)=>{if(p==="*"){let k=f[w]||"";c=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const x=f[w];return g&&!x?h[p]=void 0:h[p]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function hO(e,t=!1,n=!0){oa(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,f,m,h,p)=>{if(a.push({paramName:f,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 mO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oa(!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 hi(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 pO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function gO(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?To(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=JS(n.substring(1),"/"):o=JS(n,t)):o=t,{pathname:o,search:bO(a),hash:xO(s)}}function JS(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 eg(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 yO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yv(e){let t=yO(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function ch(e,t,n,a=!1){let s;typeof e=="string"?s=To(e):(s={...e},Kt(!s.pathname||!s.pathname.includes("?"),eg("?","pathname","search",s)),Kt(!s.pathname||!s.pathname.includes("#"),eg("#","pathname","hash",s)),Kt(!s.search||!s.search.includes("#"),eg("#","search","hash",s)));let o=e===""||s.pathname==="",c=o?"/":s.pathname,f;if(c==null)f=n;else{let g=t.length-1;if(!a&&c.startsWith("..")){let w=c.split("/");for(;w[0]==="..";)w.shift(),g-=1;s.pathname=w.join("/")}f=g>=0?t[g]:"/"}let m=gO(s,f),h=c&&c!=="/"&&c.endsWith("/"),p=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||p)&&(m.pathname+="/"),m}var Ma=e=>e.join("/").replace(/\/\/+/g,"/"),vO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,xO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,wO=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 SO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function kO(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var yE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vE(e,t){let n=e;if(typeof n!="string"||!pO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(yE)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=hi(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:s=!0}catch{oa(!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 bE=["POST","PUT","PATCH","DELETE"];new Set(bE);var jO=["GET",...bE];new Set(jO);var Ao=b.createContext(null);Ao.displayName="DataRouter";var dh=b.createContext(null);dh.displayName="DataRouterState";var EO=b.createContext(!1),xE=b.createContext({isTransitioning:!1});xE.displayName="ViewTransition";var CO=b.createContext(new Map);CO.displayName="Fetchers";var NO=b.createContext(null);NO.displayName="Await";var qr=b.createContext(null);qr.displayName="Navigation";var Mc=b.createContext(null);Mc.displayName="Location";var ca=b.createContext({outlet:null,matches:[],isDataRoute:!1});ca.displayName="Route";var vv=b.createContext(null);vv.displayName="RouteError";var wE="REACT_ROUTER_ERROR",_O="REDIRECT",TO="ROUTE_ERROR_RESPONSE";function AO(e){if(e.startsWith(`${wE}:${_O}:{`))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 RO(e){if(e.startsWith(`${wE}:${TO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new wO(t.status,t.statusText,t.data)}catch{}}function OO(e,{relative:t}={}){Kt(Ro(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=b.useContext(qr),{hash:s,pathname:o,search:c}=Dc(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Ma([n,o])),a.createHref({pathname:f,search:c,hash:s})}function Ro(){return b.useContext(Mc)!=null}function Tr(){return Kt(Ro(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Mc).location}var SE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kE(e){b.useContext(qr).static||b.useLayoutEffect(e)}function Rn(){let{isDataRoute:e}=b.useContext(ca);return e?VO():MO()}function MO(){Kt(Ro(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Ao),{basename:t,navigator:n}=b.useContext(qr),{matches:a}=b.useContext(ca),{pathname:s}=Tr(),o=JSON.stringify(yv(a)),c=b.useRef(!1);return kE(()=>{c.current=!0}),b.useCallback((m,h={})=>{if(oa(c.current,SE),!c.current)return;if(typeof m=="number"){n.go(m);return}let p=ch(m,JSON.parse(o),s,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ma([t,p.pathname])),(h.replace?n.replace:n.push)(p,h.state,h)},[t,n,o,s,e])}var DO=b.createContext(null);function zO(e){let t=b.useContext(ca).outlet;return b.useMemo(()=>t&&b.createElement(DO.Provider,{value:e},t),[t,e])}function jE(){let{matches:e}=b.useContext(ca),t=e[e.length-1];return t?t.params:{}}function Dc(e,{relative:t}={}){let{matches:n}=b.useContext(ca),{pathname:a}=Tr(),s=JSON.stringify(yv(n));return b.useMemo(()=>ch(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function IO(e,t){return EE(e,t)}function EE(e,t,n){var E;Kt(Ro(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(qr),{matches:s}=b.useContext(ca),o=s[s.length-1],c=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";NE(f,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let p=Tr(),g;if(t){let C=typeof t=="string"?To(t):t;Kt(m==="/"||((E=C.pathname)==null?void 0:E.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),g=C}else g=p;let w=g.pathname||"/",x=w;if(m!=="/"){let C=m.replace(/^\//,"").split("/");x="/"+w.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=mE(e,{pathname:x});oa(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),oa(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=FO(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:Ma([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Ma([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),s,n);return t&&j?b.createElement(Mc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function LO(){let e=GO(),t=SO(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 PO=b.createElement(LO,null),CE=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=RO(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(ca.Provider,{value:this.props.routeContext},b.createElement(vv.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(UO,{error:e},t):t}};CE.contextType=EO;var tg=new WeakMap;function UO({children:e,error:t}){let{basename:n}=b.useContext(qr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=AO(t.digest);if(a){let s=tg.get(t);if(s)throw s;let o=vE(a.location,n);if(yE&&!tg.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 tg.set(t,c),c}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function BO({routeContext:e,match:t,children:n}){let a=b.useContext(Ao);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(ca.Provider,{value:e},n)}function FO(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);Kt(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,f=-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)&&(f=p),g.route.id){let{loaderData:w,errors:x}=a,k=g.route.loader&&!w.hasOwnProperty(g.route.id)&&(!x||x[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(c=!0),f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(p,g)=>{var w,x;m(p,{location:a.location,params:((x=(w=a.matches)==null?void 0:w[0])==null?void 0:x.params)??{},unstable_pattern:kO(a.matches),errorInfo:g})}:void 0;return s.reduceRight((p,g,w)=>{let x,k=!1,j=null,E=null;a&&(x=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||PO,c&&(f<0&&w===0?(NE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===w&&(k=!0,E=g.route.hydrateFallbackElement||null)));let C=t.concat(s.slice(0,w+1)),A=()=>{let O;return x?O=j:k?O=E:g.route.Component?O=b.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=p,b.createElement(BO,{match:g,routeContext:{outlet:p,matches:C,isDataRoute:a!=null},children:O})};return a&&(g.route.ErrorBoundary||g.route.errorElement||w===0)?b.createElement(CE,{location:a.location,revalidation:a.revalidation,component:j,error:x,children:A(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):A()},null)}function bv(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $O(e){let t=b.useContext(Ao);return Kt(t,bv(e)),t}function HO(e){let t=b.useContext(dh);return Kt(t,bv(e)),t}function qO(e){let t=b.useContext(ca);return Kt(t,bv(e)),t}function xv(e){let t=qO(e),n=t.matches[t.matches.length-1];return Kt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ZO(){return xv("useRouteId")}function GO(){var a;let e=b.useContext(vv),t=HO("useRouteError"),n=xv("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function VO(){let{router:e}=$O("useNavigate"),t=xv("useNavigate"),n=b.useRef(!1);return kE(()=>{n.current=!0}),b.useCallback(async(s,o={})=>{oa(n.current,SE),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var e1={};function NE(e,t,n){!t&&!e1[e]&&(e1[e]=!0,oa(!1,n))}b.memo(QO);function QO({routes:e,future:t,state:n,isStatic:a,onError:s}){return EE(e,void 0,{state:n,isStatic:a,onError:s})}function Jn({to:e,replace:t,state:n,relative:a}){Kt(Ro(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=b.useContext(qr);oa(!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(ca),{pathname:c}=Tr(),f=Rn(),m=ch(e,yv(o),c,a==="path"),h=JSON.stringify(m);return b.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function qf(e){return zO(e.context)}function Ut(e){Kt(!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 KO({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:o=!1,unstable_useTransitions:c}){Kt(!Ro(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:f,navigator:s,static:o,unstable_useTransitions:c,future:{}}),[f,s,o,c]);typeof n=="string"&&(n=To(n));let{pathname:h="/",search:p="",hash:g="",state:w=null,key:x="default",unstable_mask:k}=n,j=b.useMemo(()=>{let E=hi(h,f);return E==null?null:{location:{pathname:E,search:p,hash:g,state:w,key:x,unstable_mask:k},navigationType:a}},[f,h,p,g,w,x,a,k]);return oa(j!=null,`<Router basename="${f}"> 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.`),j==null?null:b.createElement(qr.Provider,{value:m},b.createElement(Mc.Provider,{children:t,value:j}))}function YO({children:e,location:t}){return IO(yy(e),t)}function yy(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,yy(a.props.children,o));return}Kt(a.type===Ut,`[${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>`),Kt(!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=yy(a.props.children,o)),n.push(c)}),n}var Df="get",zf="application/x-www-form-urlencoded";function fh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function XO(e){return fh(e)&&e.tagName.toLowerCase()==="button"}function WO(e){return fh(e)&&e.tagName.toLowerCase()==="form"}function JO(e){return fh(e)&&e.tagName.toLowerCase()==="input"}function eM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tM(e,t){return e.button===0&&(!t||t==="_self")&&!eM(e)}function vy(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 nM(e,t){let n=vy(e);return t&&t.forEach((a,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var ff=null;function rM(){if(ff===null)try{new FormData(document.createElement("form"),0),ff=!1}catch{ff=!0}return ff}var aM=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ng(e){return e!=null&&!aM.has(e)?(oa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${zf}"`),null):e}function iM(e,t){let n,a,s,o,c;if(WO(e)){let f=e.getAttribute("action");a=f?hi(f,t):null,n=e.getAttribute("method")||Df,s=ng(e.getAttribute("enctype"))||zf,o=new FormData(e)}else if(XO(e)||JO(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(a=m?hi(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Df,s=ng(e.getAttribute("formenctype"))||ng(f.getAttribute("enctype"))||zf,o=new FormData(f,e),!rM()){let{name:h,type:p,value:g}=e;if(p==="image"){let w=h?`${h}.`:"";o.append(`${w}x`,"0"),o.append(`${w}y`,"0")}else h&&o.append(h,g)}}else{if(fh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Df,a=null,s=zf,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 wv(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function sM(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&&hi(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function lM(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 oM(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 uM(e,t,n){let a=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let c=await lM(o,n);return c.links?c.links():[]}return[]}));return hM(a.flat(1).filter(oM).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function t1(e,t,n,a,s,o){let c=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(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)||f(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)||f(m,h))return!0;if(m.route.shouldRevalidate){let w=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 w=="boolean")return w}return!0}):[]}function cM(e,t,{includeHydrateFallback:n}={}){return dM(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 dM(e){return[...new Set(e)]}function fM(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function hM(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let o=JSON.stringify(fM(s));return n.has(o)||(n.add(o),a.push({key:o,link:s})),a},[])}function _E(){let e=b.useContext(Ao);return wv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function mM(){let e=b.useContext(dh);return wv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Sv=b.createContext(void 0);Sv.displayName="FrameworkContext";function TE(){let e=b.useContext(Sv);return wv(e,"You must render this element inside a <HydratedRouter> element"),e}function pM(e,t){let n=b.useContext(Sv),[a,s]=b.useState(!1),[o,c]=b.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:p,onTouchStart:g}=t,w=b.useRef(null);b.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=C=>{C.forEach(A=>{c(A.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return w.current&&E.observe(w.current),()=>{E.disconnect()}}},[e]),b.useEffect(()=>{if(a){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[a]);let x=()=>{s(!0)},k=()=>{s(!1),c(!1)};return n?e!=="intent"?[o,w,{}]:[o,w,{onFocus:zu(f,x),onBlur:zu(m,k),onMouseEnter:zu(h,x),onMouseLeave:zu(p,k),onTouchStart:zu(g,x)}]:[!1,w,{}]}function zu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function gM({page:e,...t}){let{router:n}=_E(),a=b.useMemo(()=>mE(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?b.createElement(vM,{page:e,matches:a,...t}):null}function yM(e){let{manifest:t,routeModules:n}=TE(),[a,s]=b.useState([]);return b.useEffect(()=>{let o=!1;return uM(e,t,n).then(c=>{o||s(c)}),()=>{o=!0}},[e,t,n]),a}function vM({page:e,matches:t,...n}){let a=Tr(),{future:s,manifest:o,routeModules:c}=TE(),{basename:f}=_E(),{loaderData:m,matches:h}=mM(),p=b.useMemo(()=>t1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=b.useMemo(()=>t1(e,t,h,o,a,"assets"),[e,t,h,o,a]),w=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,E=!1;if(t.forEach(A=>{var D;let O=o.routes[A.route.id];!O||!O.hasLoader||(!p.some(I=>I.route.id===A.route.id)&&A.route.id in m&&((D=c[A.route.id])!=null&&D.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(A.route.id))}),j.size===0)return[];let C=sM(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(A=>j.has(A.route.id)).map(A=>A.route.id).join(",")),[C.pathname+C.search]},[f,s.unstable_trailingSlashAwareDataRequests,m,a,o,p,t,e,c]),x=b.useMemo(()=>cM(g,o),[g,o]),k=yM(g);return b.createElement(b.Fragment,null,w.map(j=>b.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),x.map(j=>b.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>b.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function bM(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var xM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{xM&&(window.__reactRouterVersion="7.13.1")}catch{}function wM({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=b.useRef();s.current==null&&(s.current=WR({window:a,v5Compat:!0}));let o=s.current,[c,f]=b.useState({action:o.action,location:o.location}),m=b.useCallback(h=>{n===!1?f(h):b.startTransition(()=>f(h))},[n]);return b.useLayoutEffect(()=>o.listen(m),[o,m]),b.createElement(KO,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var AE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zc=b.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:o,replace:c,unstable_mask:f,state:m,target:h,to:p,preventScrollReset:g,viewTransition:w,unstable_defaultShouldRevalidate:x,...k},j){let{basename:E,navigator:C,unstable_useTransitions:A}=b.useContext(qr),O=typeof p=="string"&&AE.test(p),D=vE(p,E);p=D.to;let I=OO(p,{relative:s}),R=Tr(),F=null;if(f){let W=ch(f,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);E!=="/"&&(W.pathname=W.pathname==="/"?E:Ma([E,W.pathname])),F=C.createHref(W)}let[P,te,z]=pM(a,k),L=jM(p,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:s,viewTransition:w,unstable_defaultShouldRevalidate:x,unstable_useTransitions:A});function Q(W){t&&t(W),W.defaultPrevented||L(W)}let ce=!(D.isExternal||o),X=b.createElement("a",{...k,...z,href:(ce?F:void 0)||D.absoluteURL||I,onClick:ce?Q:t,ref:bM(j,te),target:h,"data-discover":!O&&n==="render"?"true":void 0});return P&&!O?b.createElement(b.Fragment,null,X,b.createElement(gM,{page:I})):X});zc.displayName="Link";var kv=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:o,to:c,viewTransition:f,children:m,...h},p){let g=Dc(c,{relative:h.relative}),w=Tr(),x=b.useContext(dh),{navigator:k,basename:j}=b.useContext(qr),E=x!=null&&TM(g)&&f===!0,C=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,A=w.pathname,O=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(A=A.toLowerCase(),O=O?O.toLowerCase():null,C=C.toLowerCase()),O&&j&&(O=hi(O,j)||O);const D=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let I=A===C||!s&&A.startsWith(C)&&A.charAt(D)==="/",R=O!=null&&(O===C||!s&&O.startsWith(C)&&O.charAt(C.length)==="/"),F={isActive:I,isPending:R,isTransitioning:E},P=I?t:void 0,te;typeof a=="function"?te=a(F):te=[a,I?"active":null,R?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let z=typeof o=="function"?o(F):o;return b.createElement(zc,{...h,"aria-current":P,className:te,ref:p,style:z,to:c,viewTransition:f},typeof m=="function"?m(F):m)});kv.displayName="NavLink";var SM=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:o,method:c=Df,action:f,onSubmit:m,relative:h,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:w,...x},k)=>{let{unstable_useTransitions:j}=b.useContext(qr),E=NM(),C=_M(f,{relative:h}),A=c.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&AE.test(f),D=I=>{if(m&&m(I),I.defaultPrevented)return;I.preventDefault();let R=I.nativeEvent.submitter,F=(R==null?void 0:R.getAttribute("formmethod"))||c,P=()=>E(R||I.currentTarget,{fetcherKey:t,method:F,navigate:n,replace:s,state:o,relative:h,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:w});j&&n!==!1?b.startTransition(()=>P()):P()};return b.createElement("form",{ref:k,method:A,action:C,onSubmit:a?m:D,...x,"data-discover":!O&&e==="render"?"true":void 0})});SM.displayName="Form";function kM(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function RE(e){let t=b.useContext(Ao);return Kt(t,kM(e)),t}function jM(e,{target:t,replace:n,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let p=Rn(),g=Tr(),w=Dc(e,{relative:c});return b.useCallback(x=>{if(tM(x,t)){x.preventDefault();let k=n!==void 0?n:uc(g)===uc(w),j=()=>p(e,{replace:k,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});h?b.startTransition(()=>j()):j()}},[g,p,w,n,a,s,t,e,o,c,f,m,h])}function Oo(e){oa(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(vy(e)),n=b.useRef(!1),a=Tr(),s=b.useMemo(()=>nM(a.search,n.current?null:t.current),[a.search]),o=Rn(),c=b.useCallback((f,m)=>{const h=vy(typeof f=="function"?f(new URLSearchParams(s)):f);n.current=!0,o("?"+h,m)},[o,s]);return[s,c]}var EM=0,CM=()=>`__${String(++EM)}__`;function NM(){let{router:e}=RE("useSubmit"),{basename:t}=b.useContext(qr),n=ZO(),a=e.fetch,s=e.navigate;return b.useCallback(async(o,c={})=>{let{action:f,method:m,encType:h,formData:p,body:g}=iM(o,t);if(c.navigate===!1){let w=c.fetcherKey||CM();await a(w,n,c.action||f,{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||f,{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 _M(e,{relative:t}={}){let{basename:n}=b.useContext(qr),a=b.useContext(ca);Kt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),o={...Dc(e||".",{relative:t})},c=Tr();if(e==null){o.search=c.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(p=>p==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let p=f.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:Ma([n,o.pathname])),uc(o)}function TM(e,{relative:t}={}){let n=b.useContext(xE);Kt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=RE("useViewTransitionState"),s=Dc(e,{relative:t});if(!n.isTransitioning)return!1;let o=hi(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=hi(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Hf(s.pathname,c)!=null||Hf(s.pathname,o)!=null}const AM="/api/v1";async function RM(e,t){const n=await fetch(`${AM}/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 OE="/api/v1",jv="first-tree-hub:tokens";let by=null;function Iu(e){by=e}function dn(e){if(!by)throw new Error(`withOrg("${e}") called before an organization is selected`);return`/orgs/${encodeURIComponent(by)}${e}`}function xy(e,t){return`/orgs/${encodeURIComponent(e)}${t}`}function Ic(){const e=localStorage.getItem(jv);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function wy(e){localStorage.setItem(jv,JSON.stringify(e))}function ME(){localStorage.removeItem(jv)}class xs extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let Lu=null;async function OM(){const e=Ic();return e!=null&&e.refreshToken?DE(e.refreshToken):null}async function DE(e){return Lu||(Lu=(async()=>{try{const t=await fetch(`${OE}/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 wy(a),a}catch{return null}finally{Lu=null}})(),Lu)}async function Pu(e,t){const{method:n="GET",body:a}=t??{},s=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${OE}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=Ic();let c=await s(o==null?void 0:o.accessToken);if(c.status===401&&(o!=null&&o.refreshToken)){const f=await DE(o.refreshToken);f&&(c=await s(f.accessToken))}if(!c.ok){c.status===401&&(ME(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await c.text();let m,h;try{const p=JSON.parse(f);m=p.error??f,Array.isArray(p.details)&&(h=p.details.filter(g=>typeof g=="object"&&g!==null&&Array.isArray(g.path)))}catch{m=f}throw new xs(c.status,m,h)}if(c.status!==204)return await c.json()}const je={get:e=>Pu(e),post:(e,t)=>Pu(e,{method:"POST",body:t}),patch:(e,t)=>Pu(e,{method:"PATCH",body:t}),put:(e,t)=>Pu(e,{method:"PUT",body:t}),delete:e=>Pu(e,{method:"DELETE"})};async function mi(e,t){try{await je.post("/me/onboarding/events",{event:e,attrs:t})}catch{}}async function MM(){try{await je.post("/me/onboarding-completed",{})}catch{}}const Ev="onboarding:joinPath",DM="onboarding:draft",Sy="onboarding:step1Confirmed";function zE(){return typeof window>"u"?!1:window.sessionStorage.getItem(Sy)==="1"}function zM(e){typeof window>"u"||(e?window.sessionStorage.setItem(Sy,"1"):window.sessionStorage.removeItem(Sy))}const ky="onboarding:agentUuid";function IM(){return typeof window>"u"?null:window.sessionStorage.getItem(ky)}function LM(e){typeof window>"u"||(e?window.sessionStorage.setItem(ky,e):window.sessionStorage.removeItem(ky))}function IE(e){typeof window>"u"||window.sessionStorage.setItem(Ev,e)}function PM(){if(typeof window>"u")return null;const e=window.sessionStorage.getItem(Ev);return e==="solo"||e==="invite"?e:null}function UM(){typeof window>"u"||window.sessionStorage.removeItem(Ev)}function BM(e,t){return`${e??"unknown-org"}:${t??"unknown-member"}`}function Cv(e){return`${DM}:${e}`}function FM(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;if(a!==null&&typeof a!="number")return null;const s="visibility"in e?e.visibility:null,o=s==="private"||s==="organization"?s:null;return{displayName:e.displayName,selectedRuntime:t,connectToken:n,connectTokenExpiresAt:a,visibility:o}}function $M(e){if(typeof window>"u")return null;const t=window.sessionStorage.getItem(Cv(e));if(!t)return null;try{return FM(JSON.parse(t))}catch{return null}}function HM(e,t){typeof window>"u"||window.sessionStorage.setItem(Cv(e),JSON.stringify(t))}function qM(e){typeof window>"u"||window.sessionStorage.removeItem(Cv(e))}function ZM(){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 LE=b.createContext(null),jy="first-tree-hub:selectedOrganizationId";function GM(){try{return localStorage.getItem(jy)}catch{return null}}function rg(e){try{e===null?localStorage.removeItem(jy):localStorage.setItem(jy,e)}catch{}}function VM({children:e}){const t=gn(),[n,a]=b.useState(()=>!!Ic()),[s,o]=b.useState(null),[c,f]=b.useState([]),[m,h]=b.useState(()=>{const Q=GM();return Iu(Q),Q}),[p,g]=b.useState(null),[w,x]=b.useState(null),[k,j]=b.useState(null),[E,C]=b.useState(!1),A=b.useCallback(()=>{ME(),rg(null),Iu(null),t.clear(),ZM(),a(!1),o(null),f([]),h(null),g(null),x(null),j(null),C(!1)},[t]),O=b.useCallback(async()=>{var Q,ce,X;try{const W=await je.get("/me");o(W.user??null);const G=W.memberships??[];f(G);const se=((Q=W.onboarding)==null?void 0:Q.step)??null;g(se),x(((ce=W.onboarding)==null?void 0:ce.dismissedAt)??null),j(((X=W.onboarding)==null?void 0:X.completedAt)??null),se==="completed"&&UM(),h(ee=>{var U;const ve=ee&&G.some(B=>B.organizationId===ee)?ee:null;if(ve)return Iu(ve),ve;const M=W.defaultOrganizationId??((U=G[0])==null?void 0:U.organizationId)??null;return rg(M),Iu(M),M})}catch{}finally{C(!0)}},[]),D=b.useCallback(async(Q,ce)=>{const X=await RM(Q,ce);wy({accessToken:X.accessToken,refreshToken:X.refreshToken}),a(!0),await O()},[O]),I=b.useCallback(async Q=>{wy(Q),a(!0),await O()},[O]),R=b.useCallback(async Q=>{rg(Q),Iu(Q),t.clear(),h(Q),await O()},[O,t]),F=b.useRef(null);b.useEffect(()=>{F.current=w},[w]);const P=b.useCallback(async()=>{const Q=F.current;x(new Date().toISOString());try{const ce=await je.patch("/me/onboarding",{dismissed:!0});ce!=null&&ce.dismissedAt&&x(ce.dismissedAt)}catch{x(Q)}},[]),te=b.useCallback(async()=>{const Q=F.current;x(null);try{await je.patch("/me/onboarding",{dismissed:!1})}catch{x(Q)}},[]),z=b.useCallback(async()=>{j(Q=>Q??new Date().toISOString()),await MM()},[]);b.useEffect(()=>{n&&!s&&O()},[n,s,O]),b.useEffect(()=>{const Q=()=>A();return window.addEventListener("auth:logout",Q),()=>window.removeEventListener("auth:logout",Q)},[A]);const L=b.useMemo(()=>c.length===0?null:c.find(ce=>ce.organizationId===m)??c[0]??null,[c,m]);return l.jsx(LE.Provider,{value:{isAuthenticated:n,meLoaded:E,user:s,memberships:c,currentMembership:L,organizationId:(L==null?void 0:L.organizationId)??null,memberId:(L==null?void 0:L.id)??null,role:(L==null?void 0:L.role)??null,agentId:(L==null?void 0:L.agentId)??null,teamDisplayName:(L==null?void 0:L.organizationName)??null,orgHasOtherMembers:(L==null?void 0:L.orgHasOtherMembers)??!1,onboardingStep:p,onboardingDismissedAt:w,onboardingCompletedAt:k,dismissOnboarding:P,restoreOnboarding:te,markOnboardingCompleted:z,login:D,adoptTokens:I,selectOrganization:R,refreshMe:O,logout:A},children:e})}function lt(){const e=b.useContext(LE);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const QM="modulepreload",KM=function(e){return"/"+e},n1={},YM=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 f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));s=c(n.map(h=>{if(h=KM(h),h in n1)return;n1[h]=!0;const p=h.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const w=document.createElement("link");if(w.rel=p?"stylesheet":QM,p||(w.as="script"),w.crossOrigin="",w.href=h,m&&w.setAttribute("nonce",m),document.head.appendChild(w),p)return new Promise((x,k)=>{w.addEventListener("load",x),w.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return s.then(c=>{for(const f of c||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})},XM=b.lazy(()=>YM(()=>import("./index-BppGbmdT.js"),[]).then(e=>({default:e.LandingPage}))),r1=()=>l.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function WM(){const{isAuthenticated:e,meLoaded:t}=lt(),n=Tr();return e?t?l.jsx(qf,{}):l.jsx(r1,{}):n.pathname==="/"?l.jsx(b.Suspense,{fallback:l.jsx(r1,{}),children:l.jsx(XM,{})}):l.jsx(Jn,{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 PE=(...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 JM=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 eD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());/**
|
|
76
|
+
* @license lucide-react v0.577.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const a1=e=>{const t=eD(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 tD={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 nD=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 rD=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:o,iconNode:c,...f},m)=>b.createElement("svg",{ref:m,...tD,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:PE("lucide",s),...!o&&!nD(f)&&{"aria-hidden":"true"},...f},[...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 it=(e,t)=>{const n=b.forwardRef(({className:a,...s},o)=>b.createElement(rD,{ref:o,iconNode:t,className:PE(`lucide-${JM(a1(e))}`,`lucide-${e}`,a),...s}));return n.displayName=a1(e),n};/**
|
|
101
|
+
* @license lucide-react v0.577.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const aD=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Nv=it("arrow-left",aD);/**
|
|
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 iD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],UE=it("arrow-right",iD);/**
|
|
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 sD=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],BE=it("arrow-up",sD);/**
|
|
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 lD=[["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"}]],oD=it("at-sign",lD);/**
|
|
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 uD=[["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"}]],cD=it("bell",uD);/**
|
|
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 dD=[["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"}]],FE=it("bot",dD);/**
|
|
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 fD=[["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"}]],hD=it("building-2",fD);/**
|
|
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 mD=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fr=it("check",mD);/**
|
|
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 pD=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_v=it("chevron-down",pD);/**
|
|
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 gD=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yD=it("chevron-right",gD);/**
|
|
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 vD=[["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"}]],bD=it("circle-pause",vD);/**
|
|
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 xD=[["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"}]],$E=it("copy",xD);/**
|
|
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 wD=[["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"}]],SD=it("ellipsis",wD);/**
|
|
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 kD=[["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"}]],Tv=it("external-link",kD);/**
|
|
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 jD=[["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"}]],ED=it("eye-off",jD);/**
|
|
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 CD=[["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"}]],HE=it("eye",CD);/**
|
|
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 ND=[["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"}]],qE=it("github",ND);/**
|
|
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 _D=[["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"}]],TD=it("layout-dashboard",_D);/**
|
|
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 AD=[["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"}]],Ey=it("link-2",AD);/**
|
|
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 RD=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Zf=it("loader-circle",RD);/**
|
|
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 OD=[["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"}]],hh=it("lock",OD);/**
|
|
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 MD=[["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"}]],DD=it("log-out",MD);/**
|
|
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 zD=[["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"}]],Av=it("message-square",zD);/**
|
|
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 ID=[["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"}]],LD=it("moon",ID);/**
|
|
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 PD=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],UD=it("network",PD);/**
|
|
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 BD=[["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"}]],FD=it("paperclip",BD);/**
|
|
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 $D=[["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"}]],mh=it("pencil",$D);/**
|
|
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 HD=[["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"}]],ZE=it("play",HD);/**
|
|
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 qD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wa=it("plus",qD);/**
|
|
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 ZD=[["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"}]],GD=it("refresh-cw",ZD);/**
|
|
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 VD=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Rv=it("search",VD);/**
|
|
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 QD=[["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"}]],KD=it("sun",QD);/**
|
|
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 YD=[["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"}]],Gf=it("trash-2",YD);/**
|
|
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 XD=[["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"}]],Lc=it("triangle-alert",XD);/**
|
|
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 WD=[["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"}]],JD=it("undo-2",WD);/**
|
|
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 e3=[["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"}]],GE=it("user-plus",e3);/**
|
|
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 t3=[["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"}]],Ov=it("user",t3);/**
|
|
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 n3=[["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"}]],VE=it("users",n3);/**
|
|
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 r3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pi=it("x",r3);/**
|
|
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 a3=[["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"}]],i3=it("zap",a3);function QE(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=QE(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function KE(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=QE(e))&&(a&&(a+=" "),a+=t);return a}const s3=(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},l3=(e,t)=>({classGroupId:e,validator:t}),YE=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vf="-",i1=[],o3="arbitrary..",u3=e=>{const t=d3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return c3(c);const f=c.split(Vf),m=f[0]===""&&f.length>1?1:0;return XE(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=a[c],h=n[c];return m?h?s3(h,m):m:h||i1}return n[c]||i1}}},XE=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const h=XE(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const f=t===0?e.join(Vf):e.slice(t).join(Vf),m=c.length;for(let h=0;h<m;h++){const p=c[h];if(p.validator(f))return p.classGroupId}},c3=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?o3+a:void 0})(),d3=e=>{const{theme:t,classGroups:n}=e;return f3(n,t)},f3=(e,t)=>{const n=YE();for(const a in e){const s=e[a];Mv(s,n,a,t)}return n},Mv=(e,t,n,a)=>{const s=e.length;for(let o=0;o<s;o++){const c=e[o];h3(c,t,n,a)}},h3=(e,t,n,a)=>{if(typeof e=="string"){m3(e,t,n);return}if(typeof e=="function"){p3(e,t,n,a);return}g3(e,t,n,a)},m3=(e,t,n)=>{const a=e===""?t:WE(t,e);a.classGroupId=n},p3=(e,t,n,a)=>{if(y3(e)){Mv(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(l3(n,e))},g3=(e,t,n,a)=>{const s=Object.entries(e),o=s.length;for(let c=0;c<o;c++){const[f,m]=s[c];Mv(m,WE(t,f),n,a)}},WE=(e,t)=>{let n=e;const a=t.split(Vf),s=a.length;for(let o=0;o<s;o++){const c=a[o];let f=n.nextPart.get(c);f||(f=YE(),n.nextPart.set(c,f)),n=f}return n},y3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,v3=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)}}},Cy="!",s1=":",b3=[],l1=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),x3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const o=[];let c=0,f=0,m=0,h;const p=s.length;for(let j=0;j<p;j++){const E=s[j];if(c===0&&f===0){if(E===s1){o.push(s.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?c++:E==="]"?c--:E==="("?f++:E===")"&&f--}const g=o.length===0?s:s.slice(m);let w=g,x=!1;g.endsWith(Cy)?(w=g.slice(0,-1),x=!0):g.startsWith(Cy)&&(w=g.slice(1),x=!0);const k=h&&h>m?h-m:void 0;return l1(o,x,w,k)};if(t){const s=t+s1,o=a;a=c=>c.startsWith(s)?o(c.slice(s.length)):l1(b3,!1,c,void 0,!0)}if(n){const s=a;a=o=>n({className:o,parseClassName:s})}return a},w3=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],f=c[0]==="[",m=t.has(c);f||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}},S3=e=>({cache:v3(e.cacheSize),parseClassName:x3(e),sortModifiers:w3(e),...u3(e)}),k3=/\s+/,j3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:o}=t,c=[],f=e.trim().split(k3);let m="";for(let h=f.length-1;h>=0;h-=1){const p=f[h],{isExternal:g,modifiers:w,hasImportantModifier:x,baseClassName:k,maybePostfixModifierPosition:j}=n(p);if(g){m=p+(m.length>0?" "+m:m);continue}let E=!!j,C=a(E?k.substring(0,j):k);if(!C){if(!E){m=p+(m.length>0?" "+m:m);continue}if(C=a(k),!C){m=p+(m.length>0?" "+m:m);continue}E=!1}const A=w.length===0?"":w.length===1?w[0]:o(w).join(":"),O=x?A+Cy:A,D=O+C;if(c.indexOf(D)>-1)continue;c.push(D);const I=s(C,E);for(let R=0;R<I.length;++R){const F=I[R];c.push(O+F)}m=p+(m.length>0?" "+m:m)}return m},E3=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=JE(n))&&(s&&(s+=" "),s+=a);return s},JE=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=JE(e[a]))&&(n&&(n+=" "),n+=t);return n},C3=(e,...t)=>{let n,a,s,o;const c=m=>{const h=t.reduce((p,g)=>g(p),e());return n=S3(h),a=n.cache.get,s=n.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const p=j3(m,n);return s(m,p),p};return o=c,(...m)=>o(E3(...m))},N3=[],An=e=>{const t=n=>n[e]||N3;return t.isThemeGetter=!0,t},eC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,T3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,A3=/\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$/,R3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,O3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,M3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xi=e=>_3.test(e),st=e=>!!e&&!Number.isNaN(Number(e)),Wi=e=>!!e&&Number.isInteger(Number(e)),ag=e=>e.endsWith("%")&&st(e.slice(0,-1)),ai=e=>T3.test(e),nC=()=>!0,D3=e=>A3.test(e)&&!R3.test(e),Dv=()=>!1,z3=e=>O3.test(e),I3=e=>M3.test(e),L3=e=>!Oe(e)&&!De(e),P3=e=>ws(e,iC,Dv),Oe=e=>eC.test(e),Fs=e=>ws(e,sC,D3),o1=e=>ws(e,G3,st),U3=e=>ws(e,oC,nC),B3=e=>ws(e,lC,Dv),u1=e=>ws(e,rC,Dv),F3=e=>ws(e,aC,I3),hf=e=>ws(e,uC,z3),De=e=>tC.test(e),Uu=e=>sl(e,sC),$3=e=>sl(e,lC),c1=e=>sl(e,rC),H3=e=>sl(e,iC),q3=e=>sl(e,aC),mf=e=>sl(e,uC,!0),Z3=e=>sl(e,oC,!0),ws=(e,t,n)=>{const a=eC.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},sl=(e,t,n=!1)=>{const a=tC.exec(e);return a?a[1]?t(a[1]):n:!1},rC=e=>e==="position"||e==="percentage",aC=e=>e==="image"||e==="url",iC=e=>e==="length"||e==="size"||e==="bg-size",sC=e=>e==="length",G3=e=>e==="number",lC=e=>e==="family-name",oC=e=>e==="number"||e==="weight",uC=e=>e==="shadow",V3=()=>{const e=An("color"),t=An("font"),n=An("text"),a=An("font-weight"),s=An("tracking"),o=An("leading"),c=An("breakpoint"),f=An("container"),m=An("spacing"),h=An("radius"),p=An("shadow"),g=An("inset-shadow"),w=An("text-shadow"),x=An("drop-shadow"),k=An("blur"),j=An("perspective"),E=An("aspect"),C=An("ease"),A=An("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...D(),De,Oe],R=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],P=()=>[De,Oe,m],te=()=>[Xi,"full","auto",...P()],z=()=>[Wi,"none","subgrid",De,Oe],L=()=>["auto",{span:["full",Wi,De,Oe]},Wi,De,Oe],Q=()=>[Wi,"auto",De,Oe],ce=()=>["auto","min","max","fr",De,Oe],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...P()],se=()=>[Xi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],ee=()=>[Xi,"screen","full","dvw","lvw","svw","min","max","fit",...P()],ve=()=>[Xi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],M=()=>[e,De,Oe],U=()=>[...D(),c1,u1,{position:[De,Oe]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",H3,P3,{size:[De,Oe]}],V=()=>[ag,Uu,Fs],Z=()=>["","none","full",h,De,Oe],re=()=>["",st,Uu,Fs],xe=()=>["solid","dashed","dotted","double"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[st,ag,c1,u1],He=()=>["","none",k,De,Oe],Le=()=>["none",st,De,Oe],Ke=()=>["none",st,De,Oe],et=()=>[st,De,Oe],St=()=>[Xi,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ai],breakpoint:[ai],color:[nC],container:[ai],"drop-shadow":[ai],ease:["in","out","in-out"],font:[L3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ai],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ai],shadow:[ai],spacing:["px",st],text:[ai],"text-shadow":[ai],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xi,Oe,De,E]}],container:["container"],columns:[{columns:[st,Oe,De,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{"inset-s":te(),start:te()}],end:[{"inset-e":te(),end:te()}],"inset-bs":[{"inset-bs":te()}],"inset-be":[{"inset-be":te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[Wi,"auto",De,Oe]}],basis:[{basis:[Xi,"full","auto",f,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[st,Xi,"auto","initial","none",Oe]}],grow:[{grow:["",st,De,Oe]}],shrink:[{shrink:["",st,De,Oe]}],order:[{order:[Wi,"first","last","none",De,Oe]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:se()}],"inline-size":[{inline:["auto",...ee()]}],"min-inline-size":[{"min-inline":["auto",...ee()]}],"max-inline-size":[{"max-inline":["none",...ee()]}],"block-size":[{block:["auto",...ve()]}],"min-block-size":[{"min-block":["auto",...ve()]}],"max-block-size":[{"max-block":["none",...ve()]}],w:[{w:[f,"screen",...se()]}],"min-w":[{"min-w":[f,"screen","none",...se()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...se()]}],h:[{h:["screen","lh",...se()]}],"min-h":[{"min-h":["screen","lh","none",...se()]}],"max-h":[{"max-h":["screen","lh",...se()]}],"font-size":[{text:["base",n,Uu,Fs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Z3,U3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ag,Oe]}],"font-family":[{font:[$3,B3,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,De,Oe]}],"line-clamp":[{"line-clamp":[st,"none",De,o1]}],leading:[{leading:[o,...P()]}],"list-image":[{"list-image":["none",De,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,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:[st,"from-font","auto",De,Fs]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[st,"auto",De,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,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",De,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:U()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wi,De,Oe],radial:["",De,Oe],conic:[Wi,De,Oe]},q3,F3]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"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":[st,De,Oe]}],"outline-w":[{outline:["",st,Uu,Fs]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",p,mf,hf]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",g,mf,hf]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[st,Fs]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",w,mf,hf]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[st,De,Oe]}],"mix-blend":[{"mix-blend":[...Re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Re()}],"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":[st]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"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":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"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":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"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":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"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":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"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":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"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":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[De,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[st]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"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:U()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Oe]}],filter:[{filter:["","none",De,Oe]}],blur:[{blur:He()}],brightness:[{brightness:[st,De,Oe]}],contrast:[{contrast:[st,De,Oe]}],"drop-shadow":[{"drop-shadow":["","none",x,mf,hf]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",st,De,Oe]}],"hue-rotate":[{"hue-rotate":[st,De,Oe]}],invert:[{invert:["",st,De,Oe]}],saturate:[{saturate:[st,De,Oe]}],sepia:[{sepia:["",st,De,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Oe]}],"backdrop-blur":[{"backdrop-blur":He()}],"backdrop-brightness":[{"backdrop-brightness":[st,De,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[st,De,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",st,De,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[st,De,Oe]}],"backdrop-invert":[{"backdrop-invert":["",st,De,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[st,De,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[st,De,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",st,De,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[st,"initial",De,Oe]}],ease:[{ease:["linear","initial",C,De,Oe]}],delay:[{delay:[st,De,Oe]}],animate:[{animate:["none",A,De,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,De,Oe]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:Ke()}],"scale-x":[{"scale-x":Ke()}],"scale-y":[{"scale-y":Ke()}],"scale-z":[{"scale-z":Ke()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],transform:[{transform:[De,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:St()}],"translate-x":[{"translate-x":St()}],"translate-y":[{"translate-y":St()}],"translate-z":[{"translate-z":St()}],"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",De,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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",De,Oe]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[st,Uu,Fs,o1]}],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"]}},Q3=C3(V3);function Me(...e){return Q3(KE(e))}function cc(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 cC(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(e)):"—"}function K3(e){return je.delete(`/clients/${encodeURIComponent(e)}`)}function Pc(){return je.get(dn("/activity"))}function gi(){return je.get("/me/clients")}function Y3(){return je.get(dn("/clients"))}function ph(e){return je.get(`/clients/${e}`)}function X3(e){return je.post(`/clients/${e}/disconnect`)}function W3(){return je.post("/me/connect-tokens")}const d1=e=>["agent-sessions",e];function J3(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 ez(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 tz(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function dC(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 je.get(`/agents/${e}/sessions${a?`?${a}`:""}`)}function nz(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 je.get(`/agents/${e}/sessions/${t}/events${s?`?${s}`:""}`)}var f1=1,rz=.9,az=.8,iz=.17,ig=.1,sg=.999,sz=.9999,lz=.99,oz=/[\\\/_+.#"@\[\(\{&]/,uz=/[\\\/_+.#"@\[\(\{&]/g,cz=/[\s-]/,fC=/[\s-]/g;function Ny(e,t,n,a,s,o,c){if(o===t.length)return s===e.length?f1:lz;var f=`${s},${o}`;if(c[f]!==void 0)return c[f];for(var m=a.charAt(o),h=n.indexOf(m,s),p=0,g,w,x,k;h>=0;)g=Ny(e,t,n,a,h+1,o+1,c),g>p&&(h===s?g*=f1:oz.test(e.charAt(h-1))?(g*=az,x=e.slice(s,h-1).match(uz),x&&s>0&&(g*=Math.pow(sg,x.length))):cz.test(e.charAt(h-1))?(g*=rz,k=e.slice(s,h-1).match(fC),k&&s>0&&(g*=Math.pow(sg,k.length))):(g*=iz,s>0&&(g*=Math.pow(sg,h-s))),e.charAt(h)!==t.charAt(o)&&(g*=sz)),(g<ig&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(w=Ny(e,t,n,a,h+1,o+2,c),w*ig>g&&(g=w*ig)),g>p&&(p=g),h=n.indexOf(m,h+1);return c[f]=p,p}function h1(e){return e.toLowerCase().replace(fC," ")}function dz(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Ny(e,t,h1(e),h1(t),0,0,{})}function ps(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 m1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gs(...e){return t=>{let n=!1;const a=e.map(s=>{const o=m1(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():m1(e[s],null)}}}}function ll(...e){return b.useCallback(gs(...e),e)}function fz(e,t){const n=b.createContext(t),a=o=>{const{children:c,...f}=o,m=b.useMemo(()=>f,Object.values(f));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 hz(e,t=[]){let n=[];function a(o,c){const f=b.createContext(c),m=n.length;n=[...n,c];const h=g=>{var C;const{scope:w,children:x,...k}=g,j=((C=w==null?void 0:w[e])==null?void 0:C[m])||f,E=b.useMemo(()=>k,Object.values(k));return l.jsx(j.Provider,{value:E,children:x})};h.displayName=o+"Provider";function p(g,w){var j;const x=((j=w==null?void 0:w[e])==null?void 0:j[m])||f,k=b.useContext(x);if(k)return k;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(f){const m=(f==null?void 0:f[e])||o;return b.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return s.scopeName=e,[a,mz(s,...t)]}function mz(...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((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var dc=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},pz=uv[" useId ".trim().toString()]||(()=>{}),gz=0;function ci(e){const[t,n]=b.useState(pz());return dc(()=>{n(a=>a??String(gz++))},[e]),t?`radix-${t}`:""}var yz=uv[" useInsertionEffect ".trim().toString()]||dc;function vz({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[s,o,c]=bz({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:s;{const p=b.useRef(e!==void 0);b.useEffect(()=>{const g=p.current;g!==f&&console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=f},[f,a])}const h=b.useCallback(p=>{var g;if(f){const w=xz(p)?p(e):p;w!==e&&((g=c.current)==null||g.call(c,w))}else o(p)},[f,e,o,c]);return[m,h]}function bz({defaultProp:e,onChange:t}){const[n,a]=b.useState(e),s=b.useRef(n),o=b.useRef(t);return yz(()=>{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 xz(e){return typeof e=="function"}var zv=Yj();const wz=uh(zv);function hC(e){const t=Sz(e),n=b.forwardRef((a,s)=>{const{children:o,...c}=a,f=b.Children.toArray(o),m=f.find(jz);if(m){const h=m.props.children,p=f.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 Sz(e){const t=b.forwardRef((n,a)=>{const{children:s,...o}=n;if(b.isValidElement(s)){const c=Cz(s),f=Ez(o,s.props);return s.type!==b.Fragment&&(f.ref=a?gs(a,c):c),b.cloneElement(s,f)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kz=Symbol("radix.slottable");function jz(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kz}function Ez(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]=(...f)=>{const m=o(...f);return s(...f),m}:s&&(n[a]=s):a==="style"?n[a]={...s,...o}:a==="className"&&(n[a]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Cz(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 Nz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yi=Nz.reduce((e,t)=>{const n=hC(`Primitive.${t}`),a=b.forwardRef((s,o)=>{const{asChild:c,...f}=s,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function _z(e,t){e&&zv.flushSync(()=>e.dispatchEvent(t))}function fc(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 Tz(e,t=globalThis==null?void 0:globalThis.document){const n=fc(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 Az="DismissableLayer",_y="dismissableLayer.update",Rz="dismissableLayer.pointerDownOutside",Oz="dismissableLayer.focusOutside",p1,mC=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pC=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:c,onDismiss:f,...m}=e,h=b.useContext(mC),[p,g]=b.useState(null),w=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=b.useState({}),k=ll(t,F=>g(F)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),A=p?j.indexOf(p):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,D=A>=C,I=zz(F=>{const P=F.target,te=[...h.branches].some(z=>z.contains(P));!D||te||(s==null||s(F),c==null||c(F),F.defaultPrevented||f==null||f())},w),R=Iz(F=>{const P=F.target;[...h.branches].some(z=>z.contains(P))||(o==null||o(F),c==null||c(F),F.defaultPrevented||f==null||f())},w);return Tz(F=>{A===h.layers.size-1&&(a==null||a(F),!F.defaultPrevented&&f&&(F.preventDefault(),f()))},w),b.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(p1=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),g1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=p1)}},[p,w,n,h]),b.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),g1())},[p,h]),b.useEffect(()=>{const F=()=>x({});return document.addEventListener(_y,F),()=>document.removeEventListener(_y,F)},[]),l.jsx(yi.div,{...m,ref:k,style:{pointerEvents:O?D?"auto":"none":void 0,...e.style},onFocusCapture:ps(e.onFocusCapture,R.onFocusCapture),onBlurCapture:ps(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:ps(e.onPointerDownCapture,I.onPointerDownCapture)})});pC.displayName=Az;var Mz="DismissableLayerBranch",Dz=b.forwardRef((e,t)=>{const n=b.useContext(mC),a=b.useRef(null),s=ll(t,a);return b.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),l.jsx(yi.div,{...e,ref:s})});Dz.displayName=Mz;function zz(e,t=globalThis==null?void 0:globalThis.document){const n=fc(e),a=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){gC(Rz,n,h,{discrete:!0})};const h={originalEvent:f};f.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 Iz(e,t=globalThis==null?void 0:globalThis.document){const n=fc(e),a=b.useRef(!1);return b.useEffect(()=>{const s=o=>{o.target&&!a.current&&gC(Oz,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 g1(){const e=new CustomEvent(_y);document.dispatchEvent(e)}function gC(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?_z(s,o):s.dispatchEvent(o)}var lg="focusScope.autoFocusOnMount",og="focusScope.autoFocusOnUnmount",y1={bubbles:!1,cancelable:!0},Lz="FocusScope",yC=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...c}=e,[f,m]=b.useState(null),h=fc(s),p=fc(o),g=b.useRef(null),w=ll(t,j=>m(j)),x=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(a){let j=function(O){if(x.paused||!f)return;const D=O.target;f.contains(D)?g.current=D:ts(g.current,{select:!0})},E=function(O){if(x.paused||!f)return;const D=O.relatedTarget;D!==null&&(f.contains(D)||ts(g.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const I of O)I.removedNodes.length>0&&ts(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const A=new MutationObserver(C);return f&&A.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),A.disconnect()}}},[a,f,x.paused]),b.useEffect(()=>{if(f){b1.add(x);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(lg,y1);f.addEventListener(lg,h),f.dispatchEvent(C),C.defaultPrevented||(Pz(Hz(vC(f)),{select:!0}),document.activeElement===j&&ts(f))}return()=>{f.removeEventListener(lg,h),setTimeout(()=>{const C=new CustomEvent(og,y1);f.addEventListener(og,p),f.dispatchEvent(C),C.defaultPrevented||ts(j??document.body,{select:!0}),f.removeEventListener(og,p),b1.remove(x)},0)}}},[f,h,p,x]);const k=b.useCallback(j=>{if(!n&&!a||x.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const A=j.currentTarget,[O,D]=Uz(A);O&&D?!j.shiftKey&&C===D?(j.preventDefault(),n&&ts(O,{select:!0})):j.shiftKey&&C===O&&(j.preventDefault(),n&&ts(D,{select:!0})):C===A&&j.preventDefault()}},[n,a,x.paused]);return l.jsx(yi.div,{tabIndex:-1,...c,ref:w,onKeyDown:k})});yC.displayName=Lz;function Pz(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(ts(a,{select:t}),document.activeElement!==n)return}function Uz(e){const t=vC(e),n=v1(t,e),a=v1(t.reverse(),e);return[n,a]}function vC(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 v1(e,t){for(const n of e)if(!Bz(n,{upTo:t}))return n}function Bz(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 Fz(e){return e instanceof HTMLInputElement&&"select"in e}function ts(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fz(e)&&t&&e.select()}}var b1=$z();function $z(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=x1(e,t),e.unshift(t)},remove(t){var n;e=x1(e,t),(n=e[0])==null||n.resume()}}}function x1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function Hz(e){return e.filter(t=>t.tagName!=="A")}var qz="Portal",bC=b.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[s,o]=b.useState(!1);dc(()=>o(!0),[]);const c=n||s&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?wz.createPortal(l.jsx(yi.div,{...a,ref:t}),c):null});bC.displayName=qz;function Zz(e,t){return b.useReducer((n,a)=>t[n][a]??n,e)}var gh=e=>{const{present:t,children:n}=e,a=Gz(t),s=typeof n=="function"?n({present:a.isPresent}):b.Children.only(n),o=ll(a.ref,Vz(s));return typeof n=="function"||a.isPresent?b.cloneElement(s,{ref:o}):null};gh.displayName="Presence";function Gz(e){const[t,n]=b.useState(),a=b.useRef(null),s=b.useRef(e),o=b.useRef("none"),c=e?"mounted":"unmounted",[f,m]=Zz(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const h=pf(a.current);o.current=f==="mounted"?h:"none"},[f]),dc(()=>{const h=a.current,p=s.current;if(p!==e){const w=o.current,x=pf(h);e?m("MOUNT"):x==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(p&&w!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,m]),dc(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,g=x=>{const j=pf(a.current).includes(CSS.escape(x.animationName));if(x.target===t&&j&&(m("ANIMATION_END"),!s.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},w=x=>{x.target===t&&(o.current=pf(a.current))};return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:b.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function pf(e){return(e==null?void 0:e.animationName)||"none"}function Vz(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 ug=0;function Qz(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??w1()),document.body.insertAdjacentElement("beforeend",e[1]??w1()),ug++,()=>{ug===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ug--}},[])}function w1(){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 Oa=function(){return Oa=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},Oa.apply(this,arguments)};function xC(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 Kz(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 If="right-scroll-bar-position",Lf="width-before-scroll-bar",Yz="with-scroll-bars-hidden",Xz="--removed-body-scroll-bar-size";function cg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Wz(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 Jz=typeof window<"u"?b.useLayoutEffect:b.useEffect,S1=new WeakMap;function eI(e,t){var n=Wz(null,function(a){return e.forEach(function(s){return cg(s,a)})});return Jz(function(){var a=S1.get(n);if(a){var s=new Set(a),o=new Set(e),c=n.current;s.forEach(function(f){o.has(f)||cg(f,null)}),o.forEach(function(f){s.has(f)||cg(f,c)})}S1.set(n,e)},[e]),n}function tI(e){return e}function nI(e,t){t===void 0&&(t=tI);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(f){return f!==c})}},assignSyncMedium:function(o){for(a=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var c=[];if(n.length){var f=n;n=[],f.forEach(o),c=n}var m=function(){var 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 rI(e){e===void 0&&(e={});var t=nI(null);return t.options=Oa({async:!0,ssr:!1},e),t}var wC=function(e){var t=e.sideCar,n=xC(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,Oa({},n))};wC.isSideCarExport=!0;function aI(e,t){return e.useMedium(t),wC}var SC=rI(),dg=function(){},yh=b.forwardRef(function(e,t){var n=b.useRef(null),a=b.useState({onScrollCapture:dg,onWheelCapture:dg,onTouchMoveCapture:dg}),s=a[0],o=a[1],c=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,w=e.sideCar,x=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,C=e.as,A=C===void 0?"div":C,O=e.gapMode,D=xC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=w,R=eI([n,t]),F=Oa(Oa({},D),s);return b.createElement(b.Fragment,null,p&&b.createElement(I,{sideCar:SC,removeScrollBar:h,shards:g,noRelative:x,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),c?b.cloneElement(b.Children.only(f),Oa(Oa({},F),{ref:R})):b.createElement(A,Oa({},F,{className:m,ref:R}),f))});yh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yh.classNames={fullWidth:Lf,zeroRight:If};var iI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=iI();return t&&e.setAttribute("nonce",t),e}function lI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function oI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var uI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sI())&&(lI(t,n),oI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cI=function(){var e=uI();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},kC=function(){var e=cI(),t=function(n){var a=n.styles,s=n.dynamic;return e(a,s),null};return t},dI={left:0,top:0,right:0,gap:0},fg=function(e){return parseInt(e||"",10)||0},fI=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[fg(n),fg(a),fg(s)]},hI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dI;var t=fI(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])}},mI=kC(),ao="data-scroll-locked",pI=function(e,t,n,a){var s=e.left,o=e.top,c=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
301
|
+
.`.concat(Yz,` {
|
|
302
|
+
overflow: hidden `).concat(a,`;
|
|
303
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
304
|
+
}
|
|
305
|
+
body[`).concat(ao,`] {
|
|
306
|
+
overflow: hidden `).concat(a,`;
|
|
307
|
+
overscroll-behavior: contain;
|
|
308
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
309
|
+
padding-left: `.concat(s,`px;
|
|
310
|
+
padding-top: `).concat(o,`px;
|
|
311
|
+
padding-right: `).concat(c,`px;
|
|
312
|
+
margin-left:0;
|
|
313
|
+
margin-top:0;
|
|
314
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
315
|
+
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.`).concat(If,` {
|
|
319
|
+
right: `).concat(f,"px ").concat(a,`;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.`).concat(Lf,` {
|
|
323
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.`).concat(If," .").concat(If,` {
|
|
327
|
+
right: 0 `).concat(a,`;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.`).concat(Lf," .").concat(Lf,` {
|
|
331
|
+
margin-right: 0 `).concat(a,`;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
body[`).concat(ao,`] {
|
|
335
|
+
`).concat(Xz,": ").concat(f,`px;
|
|
336
|
+
}
|
|
337
|
+
`)},k1=function(){var e=parseInt(document.body.getAttribute(ao)||"0",10);return isFinite(e)?e:0},gI=function(){b.useEffect(function(){return document.body.setAttribute(ao,(k1()+1).toString()),function(){var e=k1()-1;e<=0?document.body.removeAttribute(ao):document.body.setAttribute(ao,e.toString())}},[])},yI=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,s=a===void 0?"margin":a;gI();var o=b.useMemo(function(){return hI(s)},[s]);return b.createElement(mI,{styles:pI(o,!t,s,n?"":"!important")})},Ty=!1;if(typeof window<"u")try{var gf=Object.defineProperty({},"passive",{get:function(){return Ty=!0,!0}});window.addEventListener("test",gf,gf),window.removeEventListener("test",gf,gf)}catch{Ty=!1}var Hl=Ty?{passive:!1}:!1,vI=function(e){return e.tagName==="TEXTAREA"},jC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vI(e)&&n[t]==="visible")},bI=function(e){return jC(e,"overflowY")},xI=function(e){return jC(e,"overflowX")},j1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var s=EC(e,a);if(s){var o=CC(e,a),c=o[1],f=o[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},wI=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},SI=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},EC=function(e,t){return e==="v"?bI(t):xI(t)},CC=function(e,t){return e==="v"?wI(t):SI(t)},kI=function(e,t){return e==="h"&&t==="rtl"?-1:1},jI=function(e,t,n,a,s){var o=kI(e,window.getComputedStyle(t).direction),c=o*a,f=n.target,m=t.contains(f),h=!1,p=c>0,g=0,w=0;do{if(!f)break;var x=CC(e,f),k=x[0],j=x[1],E=x[2],C=j-E-o*k;(k||C)&&EC(e,f)&&(g+=C,w+=k);var A=f.parentNode;f=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(p&&Math.abs(g)<1||!p&&Math.abs(w)<1)&&(h=!0),h},yf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},E1=function(e){return[e.deltaX,e.deltaY]},C1=function(e){return e&&"current"in e?e.current:e},EI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},CI=function(e){return`
|
|
338
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
339
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
340
|
+
`)},NI=0,ql=[];function _I(e){var t=b.useRef([]),n=b.useRef([0,0]),a=b.useRef(),s=b.useState(NI++)[0],o=b.useState(kC)[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 j=Kz([e.lockRef.current],(e.shards||[]).map(C1),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var f=b.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var C=yf(j),A=n.current,O="deltaX"in j?j.deltaX:A[0]-C[0],D="deltaY"in j?j.deltaY:A[1]-C[1],I,R=j.target,F=Math.abs(O)>Math.abs(D)?"h":"v";if("touches"in j&&F==="h"&&R.type==="range")return!1;var P=window.getSelection(),te=P&&P.anchorNode,z=te?te===R||te.contains(R):!1;if(z)return!1;var L=j1(F,R);if(!L)return!0;if(L?I=F:(I=F==="v"?"h":"v",L=j1(F,R)),!L)return!1;if(!a.current&&"changedTouches"in j&&(O||D)&&(a.current=I),!I)return!0;var Q=a.current||I;return jI(Q,E,j,Q==="h"?O:D)},[]),m=b.useCallback(function(j){var E=j;if(!(!ql.length||ql[ql.length-1]!==o)){var C="deltaY"in E?E1(E):yf(E),A=t.current.filter(function(I){return I.name===E.type&&(I.target===E.target||E.target===I.shadowParent)&&EI(I.delta,C)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var O=(c.current.shards||[]).map(C1).filter(Boolean).filter(function(I){return I.contains(E.target)}),D=O.length>0?f(E,O[0]):!c.current.noIsolation;D&&E.cancelable&&E.preventDefault()}}},[]),h=b.useCallback(function(j,E,C,A){var O={name:j,delta:E,target:C,should:A,shadowParent:TI(C)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(D){return D!==O})},1)},[]),p=b.useCallback(function(j){n.current=yf(j),a.current=void 0},[]),g=b.useCallback(function(j){h(j.type,E1(j),j.target,f(j,e.lockRef.current))},[]),w=b.useCallback(function(j){h(j.type,yf(j),j.target,f(j,e.lockRef.current))},[]);b.useEffect(function(){return ql.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:w}),document.addEventListener("wheel",m,Hl),document.addEventListener("touchmove",m,Hl),document.addEventListener("touchstart",p,Hl),function(){ql=ql.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,Hl),document.removeEventListener("touchmove",m,Hl),document.removeEventListener("touchstart",p,Hl)}},[]);var x=e.removeScrollBar,k=e.inert;return b.createElement(b.Fragment,null,k?b.createElement(o,{styles:CI(s)}):null,x?b.createElement(yI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function TI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const AI=aI(SC,_I);var NC=b.forwardRef(function(e,t){return b.createElement(yh,Oa({},e,{ref:t,sideCar:AI}))});NC.classNames=yh.classNames;var RI=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zl=new WeakMap,vf=new WeakMap,bf={},hg=0,_C=function(e){return e&&(e.host||_C(e.parentNode))},OI=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=_C(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})},MI=function(e,t,n,a){var s=OI(t,Array.isArray(e)?e:[e]);bf[n]||(bf[n]=new WeakMap);var o=bf[n],c=[],f=new Set,m=new Set(s),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};s.forEach(h);var p=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(w){if(f.has(w))p(w);else try{var x=w.getAttribute(a),k=x!==null&&x!=="false",j=(Zl.get(w)||0)+1,E=(o.get(w)||0)+1;Zl.set(w,j),o.set(w,E),c.push(w),j===1&&k&&vf.set(w,!0),E===1&&w.setAttribute(n,"true"),k||w.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",w,C)}})};return p(t),f.clear(),hg++,function(){c.forEach(function(g){var w=Zl.get(g)-1,x=o.get(g)-1;Zl.set(g,w),o.set(g,x),w||(vf.has(g)||g.removeAttribute(a),vf.delete(g)),x||g.removeAttribute(n)}),hg--,hg||(Zl=new WeakMap,Zl=new WeakMap,vf=new WeakMap,bf={})}},DI=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),s=RI(e);return s?(a.push.apply(a,Array.from(s.querySelectorAll("[aria-live], script"))),MI(a,s,n,"aria-hidden")):function(){return null}},vh="Dialog",[TC]=hz(vh),[zI,Sa]=TC(vh),AC=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:s,onOpenChange:o,modal:c=!0}=e,f=b.useRef(null),m=b.useRef(null),[h,p]=vz({prop:a,defaultProp:s??!1,onChange:o,caller:vh});return l.jsx(zI,{scope:t,triggerRef:f,contentRef:m,contentId:ci(),titleId:ci(),descriptionId:ci(),open:h,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(g=>!g),[p]),modal:c,children:n})};AC.displayName=vh;var RC="DialogTrigger",II=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=Sa(RC,n),o=ll(t,s.triggerRef);return l.jsx(yi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Pv(s.open),...a,ref:o,onClick:ps(e.onClick,s.onOpenToggle)})});II.displayName=RC;var Iv="DialogPortal",[LI,OC]=TC(Iv,{forceMount:void 0}),MC=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:s}=e,o=Sa(Iv,t);return l.jsx(LI,{scope:t,forceMount:n,children:b.Children.map(a,c=>l.jsx(gh,{present:n||o.open,children:l.jsx(bC,{asChild:!0,container:s,children:c})}))})};MC.displayName=Iv;var Qf="DialogOverlay",DC=b.forwardRef((e,t)=>{const n=OC(Qf,e.__scopeDialog),{forceMount:a=n.forceMount,...s}=e,o=Sa(Qf,e.__scopeDialog);return o.modal?l.jsx(gh,{present:a||o.open,children:l.jsx(UI,{...s,ref:t})}):null});DC.displayName=Qf;var PI=hC("DialogOverlay.RemoveScroll"),UI=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=Sa(Qf,n);return l.jsx(NC,{as:PI,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(yi.div,{"data-state":Pv(s.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),nl="DialogContent",zC=b.forwardRef((e,t)=>{const n=OC(nl,e.__scopeDialog),{forceMount:a=n.forceMount,...s}=e,o=Sa(nl,e.__scopeDialog);return l.jsx(gh,{present:a||o.open,children:o.modal?l.jsx(BI,{...s,ref:t}):l.jsx(FI,{...s,ref:t})})});zC.displayName=nl;var BI=b.forwardRef((e,t)=>{const n=Sa(nl,e.__scopeDialog),a=b.useRef(null),s=ll(t,n.contentRef,a);return b.useEffect(()=>{const o=a.current;if(o)return DI(o)},[]),l.jsx(IC,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ps(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ps(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&o.preventDefault()}),onFocusOutside:ps(e.onFocusOutside,o=>o.preventDefault())})}),FI=b.forwardRef((e,t)=>{const n=Sa(nl,e.__scopeDialog),a=b.useRef(!1),s=b.useRef(!1);return l.jsx(IC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,f;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,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()}})}),IC=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:o,...c}=e,f=Sa(nl,n),m=b.useRef(null),h=ll(t,m);return Qz(),l.jsxs(l.Fragment,{children:[l.jsx(yC,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(pC,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Pv(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx($I,{titleId:f.titleId}),l.jsx(qI,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Lv="DialogTitle",LC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=Sa(Lv,n);return l.jsx(yi.h2,{id:s.titleId,...a,ref:t})});LC.displayName=Lv;var PC="DialogDescription",UC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=Sa(PC,n);return l.jsx(yi.p,{id:s.descriptionId,...a,ref:t})});UC.displayName=PC;var BC="DialogClose",FC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,s=Sa(BC,n);return l.jsx(yi.button,{type:"button",...a,ref:t,onClick:ps(e.onClick,()=>s.onOpenChange(!1))})});FC.displayName=BC;function Pv(e){return e?"open":"closed"}var $C="DialogTitleWarning",[CX,HC]=fz($C,{contentName:nl,titleName:Lv,docsSlug:"dialog"}),$I=({titleId:e})=>{const t=HC($C),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
341
|
+
|
|
342
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
343
|
+
|
|
344
|
+
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},HI="DialogDescriptionWarning",qI=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${HC(HI).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},qC=AC,ZC=MC,GC=DC,VC=zC,ZI=LC,GI=UC,VI=FC,QI=Symbol.for("react.lazy"),Kf=uv[" use ".trim().toString()];function KI(e){return typeof e=="object"&&e!==null&&"then"in e}function QC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===QI&&"_payload"in e&&KI(e._payload)}function KC(e){const t=XI(e),n=b.forwardRef((a,s)=>{let{children:o,...c}=a;QC(o)&&typeof Kf=="function"&&(o=Kf(o._payload));const f=b.Children.toArray(o),m=f.find(JI);if(m){const h=m.props.children,p=f.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 YI=KC("Slot");function XI(e){const t=b.forwardRef((n,a)=>{let{children:s,...o}=n;if(QC(s)&&typeof Kf=="function"&&(s=Kf(s._payload)),b.isValidElement(s)){const c=t4(s),f=e4(o,s.props);return s.type!==b.Fragment&&(f.ref=a?gs(a,c):c),b.cloneElement(s,f)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WI=Symbol("radix.slottable");function JI(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WI}function e4(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]=(...f)=>{const m=o(...f);return s(...f),m}:s&&(n[a]=s):a==="style"?n[a]={...s,...o}:a==="className"&&(n[a]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function t4(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 n4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vi=n4.reduce((e,t)=>{const n=KC(`Primitive.${t}`),a=b.forwardRef((s,o)=>{const{asChild:c,...f}=s,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Bu='[cmdk-group=""]',mg='[cmdk-group-items=""]',r4='[cmdk-group-heading=""]',YC='[cmdk-item=""]',N1=`${YC}:not([aria-disabled="true"])`,Ay="cmdk-item-select",Kl="data-value",a4=(e,t,n)=>dz(e,t,n),XC=b.createContext(void 0),Uc=()=>b.useContext(XC),WC=b.createContext(void 0),Uv=()=>b.useContext(WC),JC=b.createContext(void 0),eN=b.forwardRef((e,t)=>{let n=Yl(()=>{var B,_;return{search:"",value:(_=(B=e.value)!=null?B:e.defaultValue)!=null?_:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=Yl(()=>new Set),s=Yl(()=>new Map),o=Yl(()=>new Map),c=Yl(()=>new Set),f=tN(e),{label:m,children:h,value:p,onValueChange:g,filter:w,shouldFilter:x,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,A=ci(),O=ci(),D=ci(),I=b.useRef(null),R=p4();rl(()=>{if(p!==void 0){let B=p.trim();n.current.value=B,F.emit()}},[p]),rl(()=>{R(6,ce)},[]);let F=b.useMemo(()=>({subscribe:B=>(c.current.add(B),()=>c.current.delete(B)),snapshot:()=>n.current,setState:(B,_,V)=>{var Z,re,xe,Re;if(!Object.is(n.current[B],_)){if(n.current[B]=_,B==="search")Q(),z(),R(1,L);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ee=document.getElementById(D);Ee?Ee.focus():(Z=document.getElementById(A))==null||Z.focus()}if(R(7,()=>{var Ee;n.current.selectedItemId=(Ee=X())==null?void 0:Ee.id,F.emit()}),V||R(5,ce),((re=f.current)==null?void 0:re.value)!==void 0){let Ee=_??"";(Re=(xe=f.current).onValueChange)==null||Re.call(xe,Ee);return}}F.emit()}},emit:()=>{c.current.forEach(B=>B())}}),[]),P=b.useMemo(()=>({value:(B,_,V)=>{var Z;_!==((Z=o.current.get(B))==null?void 0:Z.value)&&(o.current.set(B,{value:_,keywords:V}),n.current.filtered.items.set(B,te(_,V)),R(2,()=>{z(),F.emit()}))},item:(B,_)=>(a.current.add(B),_&&(s.current.has(_)?s.current.get(_).add(B):s.current.set(_,new Set([B]))),R(3,()=>{Q(),z(),n.current.value||L(),F.emit()}),()=>{o.current.delete(B),a.current.delete(B),n.current.filtered.items.delete(B);let V=X();R(4,()=>{Q(),(V==null?void 0:V.getAttribute("id"))===B&&L(),F.emit()})}),group:B=>(s.current.has(B)||s.current.set(B,new Set),()=>{o.current.delete(B),s.current.delete(B)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:A,inputId:D,labelId:O,listInnerRef:I}),[]);function te(B,_){var V,Z;let re=(Z=(V=f.current)==null?void 0:V.filter)!=null?Z:a4;return B?re(B,n.current.search,_):0}function z(){if(!n.current.search||f.current.shouldFilter===!1)return;let B=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(Z=>{let re=s.current.get(Z),xe=0;re.forEach(Re=>{let Ee=B.get(Re);xe=Math.max(Ee,xe)}),_.push([Z,xe])});let V=I.current;W().sort((Z,re)=>{var xe,Re;let Ee=Z.getAttribute("id"),He=re.getAttribute("id");return((xe=B.get(He))!=null?xe:0)-((Re=B.get(Ee))!=null?Re:0)}).forEach(Z=>{let re=Z.closest(mg);re?re.appendChild(Z.parentElement===re?Z:Z.closest(`${mg} > *`)):V.appendChild(Z.parentElement===V?Z:Z.closest(`${mg} > *`))}),_.sort((Z,re)=>re[1]-Z[1]).forEach(Z=>{var re;let xe=(re=I.current)==null?void 0:re.querySelector(`${Bu}[${Kl}="${encodeURIComponent(Z[0])}"]`);xe==null||xe.parentElement.appendChild(xe)})}function L(){let B=W().find(V=>V.getAttribute("aria-disabled")!=="true"),_=B==null?void 0:B.getAttribute(Kl);F.setState("value",_||void 0)}function Q(){var B,_,V,Z;if(!n.current.search||f.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 Re=(_=(B=o.current.get(xe))==null?void 0:B.value)!=null?_:"",Ee=(Z=(V=o.current.get(xe))==null?void 0:V.keywords)!=null?Z:[],He=te(Re,Ee);n.current.filtered.items.set(xe,He),He>0&&re++}for(let[xe,Re]of s.current)for(let Ee of Re)if(n.current.filtered.items.get(Ee)>0){n.current.filtered.groups.add(xe);break}n.current.filtered.count=re}function ce(){var B,_,V;let Z=X();Z&&(((B=Z.parentElement)==null?void 0:B.firstChild)===Z&&((V=(_=Z.closest(Bu))==null?void 0:_.querySelector(r4))==null||V.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function X(){var B;return(B=I.current)==null?void 0:B.querySelector(`${YC}[aria-selected="true"]`)}function W(){var B;return Array.from(((B=I.current)==null?void 0:B.querySelectorAll(N1))||[])}function G(B){let _=W()[B];_&&F.setState("value",_.getAttribute(Kl))}function se(B){var _;let V=X(),Z=W(),re=Z.findIndex(Re=>Re===V),xe=Z[re+B];(_=f.current)!=null&&_.loop&&(xe=re+B<0?Z[Z.length-1]:re+B===Z.length?Z[0]:Z[re+B]),xe&&F.setState("value",xe.getAttribute(Kl))}function ee(B){let _=X(),V=_==null?void 0:_.closest(Bu),Z;for(;V&&!Z;)V=B>0?h4(V,Bu):m4(V,Bu),Z=V==null?void 0:V.querySelector(N1);Z?F.setState("value",Z.getAttribute(Kl)):se(B)}let ve=()=>G(W().length-1),M=B=>{B.preventDefault(),B.metaKey?ve():B.altKey?ee(1):se(1)},U=B=>{B.preventDefault(),B.metaKey?G(0):B.altKey?ee(-1):se(-1)};return b.createElement(vi.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:B=>{var _;(_=C.onKeyDown)==null||_.call(C,B);let V=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||V))switch(B.key){case"n":case"j":{E&&B.ctrlKey&&M(B);break}case"ArrowDown":{M(B);break}case"p":case"k":{E&&B.ctrlKey&&U(B);break}case"ArrowUp":{U(B);break}case"Home":{B.preventDefault(),G(0);break}case"End":{B.preventDefault(),ve();break}case"Enter":{B.preventDefault();let Z=X();if(Z){let re=new Event(Ay);Z.dispatchEvent(re)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:y4},m),bh(e,B=>b.createElement(WC.Provider,{value:F},b.createElement(XC.Provider,{value:P},B))))}),i4=b.forwardRef((e,t)=>{var n,a;let s=ci(),o=b.useRef(null),c=b.useContext(JC),f=Uc(),m=tN(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;rl(()=>{if(!h)return f.item(s,c==null?void 0:c.id)},[h]);let p=nN(s,o,[e.value,e.children,o],e.keywords),g=Uv(),w=ys(R=>R.value&&R.value===p.current),x=ys(R=>h||f.filter()===!1?!0:R.search?R.filtered.items.get(s)>0:!0);b.useEffect(()=>{let R=o.current;if(!(!R||e.disabled))return R.addEventListener(Ay,k),()=>R.removeEventListener(Ay,k)},[x,e.onSelect,e.disabled]);function k(){var R,F;j(),(F=(R=m.current).onSelect)==null||F.call(R,p.current)}function j(){g.setState("value",p.current,!0)}if(!x)return null;let{disabled:E,value:C,onSelect:A,forceMount:O,keywords:D,...I}=e;return b.createElement(vi.div,{ref:gs(o,t),...I,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!w,"data-disabled":!!E,"data-selected":!!w,onPointerMove:E||f.getDisablePointerSelection()?void 0:j,onClick:E?void 0:k},e.children)}),s4=b.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:s,...o}=e,c=ci(),f=b.useRef(null),m=b.useRef(null),h=ci(),p=Uc(),g=ys(x=>s||p.filter()===!1?!0:x.search?x.filtered.groups.has(c):!0);rl(()=>p.group(c),[]),nN(c,f,[e.value,e.heading,m]);let w=b.useMemo(()=>({id:c,forceMount:s}),[s]);return b.createElement(vi.div,{ref:gs(f,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),bh(e,x=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},b.createElement(JC.Provider,{value:w},x))))}),l4=b.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,s=b.useRef(null),o=ys(c=>!c.search);return!n&&!o?null:b.createElement(vi.div,{ref:gs(s,t),...a,"cmdk-separator":"",role:"separator"})}),o4=b.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,s=e.value!=null,o=Uv(),c=ys(h=>h.search),f=ys(h=>h.selectedItemId),m=Uc();return b.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),b.createElement(vi.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:s?e.value:c,onChange:h=>{s||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),u4=b.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...s}=e,o=b.useRef(null),c=b.useRef(null),f=ys(h=>h.selectedItemId),m=Uc();return b.useEffect(()=>{if(c.current&&o.current){let h=c.current,p=o.current,g,w=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let x=h.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return w.observe(h),()=>{cancelAnimationFrame(g),w.unobserve(h)}}},[]),b.createElement(vi.div,{ref:gs(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},bh(e,h=>b.createElement("div",{ref:gs(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),c4=b.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:s,contentClassName:o,container:c,...f}=e;return b.createElement(qC,{open:n,onOpenChange:a},b.createElement(ZC,{container:c},b.createElement(GC,{"cmdk-overlay":"",className:s}),b.createElement(VC,{"aria-label":e.label,"cmdk-dialog":"",className:o},b.createElement(eN,{ref:t,...f}))))}),d4=b.forwardRef((e,t)=>ys(n=>n.filtered.count===0)?b.createElement(vi.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),f4=b.forwardRef((e,t)=>{let{progress:n,children:a,label:s="Loading...",...o}=e;return b.createElement(vi.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},bh(e,c=>b.createElement("div",{"aria-hidden":!0},c)))}),Ar=Object.assign(eN,{List:u4,Item:i4,Input:o4,Group:s4,Separator:l4,Dialog:c4,Empty:d4,Loading:f4});function h4(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function m4(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function tN(e){let t=b.useRef(e);return rl(()=>{t.current=e}),t}var rl=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Yl(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function ys(e){let t=Uv(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function nN(e,t,n,a=[]){let s=b.useRef(),o=Uc();return rl(()=>{var c;let f=(()=>{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,f,m),(c=t.current)==null||c.setAttribute(Kl,f),s.current=f}),s}var p4=()=>{let[e,t]=b.useState(),n=Yl(()=>new Map);return rl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,s)=>{n.current.set(a,s),t({})}};function g4(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function bh({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(g4(t),{ref:t.ref},n(t.props.children)):n(t)}var y4={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Cn=qC,v4=ZC,rN=b.forwardRef(({className:e,...t},n)=>l.jsx(GC,{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}));rN.displayName="DialogOverlay";const yn=b.forwardRef(({className:e,children:t,...n},a)=>l.jsxs(v4,{children:[l.jsx(rN,{}),l.jsxs(VC,{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(VI,{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(pi,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yn.displayName="DialogContent";function On({className:e,...t}){return l.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function rr({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 Nn=b.forwardRef(({className:e,...t},n)=>l.jsx(ZI,{ref:n,className:Me("text-subtitle leading-none tracking-tight",e),...t}));Nn.displayName="DialogTitle";const Bv=b.forwardRef(({className:e,...t},n)=>l.jsx(GI,{ref:n,className:Me("text-body text-muted-foreground",e),...t}));Bv.displayName="DialogDescription";const aN=b.forwardRef(({className:e,...t},n)=>l.jsx(Ar,{ref:n,className:Me("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));aN.displayName=Ar.displayName;function b4({open:e,onOpenChange:t,children:n}){return l.jsx(Cn,{open:e,onOpenChange:t,children:l.jsx(yn,{className:"overflow-hidden p-0 shadow-lg",children:l.jsx(aN,{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 iN=b.forwardRef(({className:e,...t},n)=>l.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[l.jsx(Rv,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),l.jsx(Ar.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})]}));iN.displayName=Ar.Input.displayName;const sN=b.forwardRef(({className:e,...t},n)=>l.jsx(Ar.List,{ref:n,className:Me("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));sN.displayName=Ar.List.displayName;const lN=b.forwardRef((e,t)=>l.jsx(Ar.Empty,{ref:t,className:"py-6 text-center text-body",...e}));lN.displayName=Ar.Empty.displayName;const Pf=b.forwardRef(({className:e,...t},n)=>l.jsx(Ar.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}));Pf.displayName=Ar.Group.displayName;const Ry=b.forwardRef(({className:e,...t},n)=>l.jsx(Ar.Separator,{ref:n,className:Me("-mx-1 h-px bg-border",e),...t}));Ry.displayName=Ar.Separator.displayName;const Uf=b.forwardRef(({className:e,...t},n)=>l.jsx(Ar.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}));Uf.displayName=Ar.Item.displayName;function Bc(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 je.get(dn(`/agents${n?`?${n}`:""}`))}function x4(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 je.get(dn(`/agents/all${n?`?${n}`:""}`))}function Fv(){return je.get("/me/managed-agents")}function w4(e){return je.get(`/agents/${encodeURIComponent(e)}`)}function S4(e){return je.post(dn("/agents"),e)}function k4(e){return je.get(dn(`/agents/names/${encodeURIComponent(e)}/availability`))}function Oy(e,t){return je.patch(`/agents/${encodeURIComponent(e)}`,t)}function j4(e,t){return je.patch(`/agents/${encodeURIComponent(e)}/rebind`,t)}function oN(e){return je.delete(`/agents/${encodeURIComponent(e)}`)}async function E4(e,t){const n=Ic(),a={"Content-Type":t.type||"application/octet-stream"};n!=null&&n.accessToken&&(a.Authorization=`Bearer ${n.accessToken}`);const s=await fetch(`/api/v1/agents/${encodeURIComponent(e)}/avatar`,{method:"PUT",headers:a,body:t});if(!s.ok){const o=await s.text();let c=o;try{const f=JSON.parse(o);f.error&&(c=f.error)}catch{}throw new xs(s.status,c)}return await s.json()}function C4(e){return je.delete(`/agents/${encodeURIComponent(e)}/avatar`)}function uN(e){return je.post(`/agents/${encodeURIComponent(e)}/suspend`,{})}function cN(e){return je.post(`/agents/${encodeURIComponent(e)}/reactivate`,{})}function N4(e){return je.post(`/agents/${encodeURIComponent(e)}/test`,{})}function xh(){const{data:e}=Ye({queryKey:["agents","name-map"],queryFn:()=>Bc({limit:100}),staleTime:3e4}),{data:t}=Ye({queryKey:["managed-agents","name-map"],queryFn:Fv,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 $v(){const{data:e}=Ye({queryKey:["agents","name-map"],queryFn:()=>Bc({limit:100}),staleTime:3e4}),{data:t}=Ye({queryKey:["managed-agents","name-map"],queryFn:Fv,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 _4=[{path:"/",label:"Workspace"},{path:"/context",label:"Context"},{path:"/team",label:"Team"},{path:"/settings",label:"Settings"}];function T4({open:e,onOpenChange:t}){const n=Rn(),a=xh(),{data:s}=Ye({queryKey:["activity"],queryFn:Pc,enabled:e,staleTime:3e4}),o=(s==null?void 0:s.agents)??[],f=Ye({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const p of o)try{const g=await dC(p.agentId);for(const w of g)h.push({agentId:p.agentId,session:w})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return l.jsxs(b4,{open:e,onOpenChange:t,children:[l.jsx(iN,{placeholder:"Jump to agent, chat, or page…"}),l.jsxs(sN,{children:[l.jsx(lN,{children:"No results"}),o.length>0&&l.jsx(Pf,{heading:"Agents",children:o.map(h=>{const p=a(h.agentId);return l.jsxs(Uf,{value:`agent ${p} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[l.jsx(FE,{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)})}),f.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(Ry,{}),l.jsx(Pf,{heading:"Chats",children:f.map(({agentId:h,session:p})=>{const g=a(h);return l.jsxs(Uf,{value:`chat ${g} ${p.chatId}`,onSelect:()=>m(`/?a=${h}&c=${p.chatId}`),children:[l.jsx(Av,{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(Ry,{}),l.jsx(Pf,{heading:"Pages",children:_4.map(h=>l.jsxs(Uf,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[l.jsx(TD,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),l.jsx("span",{children:h.label})]},h.path))})]})]})}function A4(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function R4(){var a;const{user:e}=lt(),{data:t}=Ye({queryKey:["clients"],queryFn:gi,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=A4(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const O4=160;function M4(){const e=Rn(),{rows:t,firstHostname:n}=R4();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(D4,{}),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:O4,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 D4(){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 Fc(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 z4(e){const t=new URLSearchParams;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 je.get(dn(`/notifications${n?`?${n}`:""}`))}function I4(e){return je.post(dn(`/notifications/${e}/read`))}function L4(){return je.post(dn("/notifications/read-all"))}function P4(){return je.get(dn("/notifications/unread-count"))}const U4={agent_error:"Error",agent_blocked:"Blocked",agent_stale:"Stale"};function B4(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=(U4[e.type]??e.type).toString(),s=B4(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:cc(e.createdAt)})]}),l.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function $4(){const[e,t]=b.useState(!1),[n,a]=b.useState(null),s=b.useRef(null),o=Rn(),c=gn(),{data:f}=Ye({queryKey:["notifications","bell"],queryFn:()=>z4({limit:8})}),{data:m}=Ye({queryKey:["notifications","unread-count"],queryFn:()=>P4()}),h=(m==null?void 0:m.count)??0,p=h>0,g=b.useCallback(async x=>{x.read||(I4(x.id).catch(()=>{}),c.invalidateQueries({queryKey:["notifications"]})),t(!1),x.chatId?o(`/?c=${x.chatId}`):x.agentId&&o(`/agents/${x.agentId}`)},[o,c]),w=b.useCallback(async()=>{a(null);try{await L4(),await c.invalidateQueries({queryKey:["notifications"]})}catch(x){a(x instanceof Error?x.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(cD,{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:w,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:!(f!=null&&f.items)||f.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"}):f.items.map(x=>l.jsx(F4,{notification:x,clickable:!!x.chatId||!!x.agentId,onClick:()=>g(x)},x.id))})]})]})]})}function H4(){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 q4(){const[e,t]=b.useState(H4);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(KD,{className:"h-4 w-4"}):l.jsx(LD,{className:"h-4 w-4"})})}function dN(e){var t;return((t=e.trim()[0])==null?void 0:t.toUpperCase())??"?"}const Z4=8,G4="var(--avatar-hue-0)";function V4(e){if(e.length===0)return G4;let t=5381;for(let a=0;a<e.length;a++)t=t*33^e.charCodeAt(a);return`var(--avatar-hue-${Math.abs(t)%Z4})`}function $c(e,t){return typeof e=="string"&&/^hue-[0-7]$/.test(e)?`var(--avatar-${e})`:V4(t)}function Q4(e){return e<=1?"single":e===2?"n2":e===3?"n3":e===4?"n4":"n5+"}function K4(e){return e<=0?null:e>99?"99+":String(e)}function Y4(e){const t=[];return e.engaged&&t.push("engaged"),e.unread>0&&t.push(`${e.unread} unread`),t.length>0?t.join(", "):null}function X4({title:e,type:t,participants:n,selfAgentId:a,engagedAgentIds:s,unreadCount:o,size:c=36}){const f=t==="direct",m=n.filter(x=>x.agentId!==a),h=m[0],p=m.some(x=>s.includes(x.agentId)),g=Y4({engaged:p,unread:o}),w=g===null?{"aria-hidden":!0}:{role:"img","aria-label":g};return l.jsxs("span",{...w,style:{position:"relative",width:c,height:c,flexShrink:0,display:"inline-block"},children:[f||m.length<=1?l.jsx(W4,{size:c,name:(h==null?void 0:h.displayName)??e,hueSeed:(h==null?void 0:h.agentId)??e,colorToken:(h==null?void 0:h.avatarColorToken)??null,imageUrl:(h==null?void 0:h.avatarImageUrl)??null}):l.jsx(J4,{size:c,peers:m}),p&&l.jsx(t5,{size:c}),o>0&&l.jsx(n5,{count:o})]})}function W4({size:e,name:t,hueSeed:n,colorToken:a,imageUrl:s}){return s?l.jsx("img",{src:s,alt:t,width:e,height:e,style:{width:e,height:e,borderRadius:"50%",objectFit:"cover",display:"block"}}):l.jsx("span",{"aria-hidden":"true",style:{width:e,height:e,borderRadius:"50%",background:$c(a,n),color:"var(--fg-on-vivid)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:Math.round(e*.42),fontWeight:700,lineHeight:1,letterSpacing:"-0.02em",userSelect:"none"},children:dN(t)})}function J4({size:e,peers:t}){var m,h,p,g,w,x,k,j,E,C,A,O,D,I,R,F,P,te,z,L,Q,ce,X,W,G,se,ee,ve,M,U,B,_,V,Z,re,xe;const n=t.length,a=Q4(n),s=Math.round(e*(n===2?.36:.28)),o=Math.round(e*.32),c=Math.round(e*.26),f=a==="n2"?{gridTemplateColumns:"1fr 1fr"}:{gridTemplateColumns:"1fr 1fr",gridTemplateRows:"1fr 1fr"};return l.jsxs("div",{"aria-hidden":"true",style:{width:e,height:e,borderRadius:"50%",overflow:"hidden",display:"grid",gap:"var(--hairline)",background:"var(--bg-raised)",userSelect:"none",...f},children:[a==="n2"&&l.jsxs(l.Fragment,{children:[l.jsx(ra,{name:((m=t[0])==null?void 0:m.displayName)??"?",hueSeed:((h=t[0])==null?void 0:h.agentId)??"0",colorToken:((p=t[0])==null?void 0:p.avatarColorToken)??null,fontSize:s}),l.jsx(ra,{name:((g=t[1])==null?void 0:g.displayName)??"?",hueSeed:((w=t[1])==null?void 0:w.agentId)??"1",colorToken:((x=t[1])==null?void 0:x.avatarColorToken)??null,fontSize:s})]}),a==="n3"&&l.jsxs(l.Fragment,{children:[l.jsx(ra,{name:((k=t[0])==null?void 0:k.displayName)??"?",hueSeed:((j=t[0])==null?void 0:j.agentId)??"0",colorToken:((E=t[0])==null?void 0:E.avatarColorToken)??null,fontSize:o,fullWidth:!0}),l.jsx(ra,{name:((C=t[1])==null?void 0:C.displayName)??"?",hueSeed:((A=t[1])==null?void 0:A.agentId)??"1",colorToken:((O=t[1])==null?void 0:O.avatarColorToken)??null,fontSize:s}),l.jsx(ra,{name:((D=t[2])==null?void 0:D.displayName)??"?",hueSeed:((I=t[2])==null?void 0:I.agentId)??"2",colorToken:((R=t[2])==null?void 0:R.avatarColorToken)??null,fontSize:s})]}),a==="n4"&&l.jsxs(l.Fragment,{children:[l.jsx(ra,{name:((F=t[0])==null?void 0:F.displayName)??"?",hueSeed:((P=t[0])==null?void 0:P.agentId)??"0",colorToken:((te=t[0])==null?void 0:te.avatarColorToken)??null,fontSize:s}),l.jsx(ra,{name:((z=t[1])==null?void 0:z.displayName)??"?",hueSeed:((L=t[1])==null?void 0:L.agentId)??"1",colorToken:((Q=t[1])==null?void 0:Q.avatarColorToken)??null,fontSize:s}),l.jsx(ra,{name:((ce=t[2])==null?void 0:ce.displayName)??"?",hueSeed:((X=t[2])==null?void 0:X.agentId)??"2",colorToken:((W=t[2])==null?void 0:W.avatarColorToken)??null,fontSize:s}),l.jsx(ra,{name:((G=t[3])==null?void 0:G.displayName)??"?",hueSeed:((se=t[3])==null?void 0:se.agentId)??"3",colorToken:((ee=t[3])==null?void 0:ee.avatarColorToken)??null,fontSize:s})]}),a==="n5+"&&l.jsxs(l.Fragment,{children:[l.jsx(ra,{name:((ve=t[0])==null?void 0:ve.displayName)??"?",hueSeed:((M=t[0])==null?void 0:M.agentId)??"0",colorToken:((U=t[0])==null?void 0:U.avatarColorToken)??null,fontSize:s}),l.jsx(ra,{name:((B=t[1])==null?void 0:B.displayName)??"?",hueSeed:((_=t[1])==null?void 0:_.agentId)??"1",colorToken:((V=t[1])==null?void 0:V.avatarColorToken)??null,fontSize:s}),l.jsx(ra,{name:((Z=t[2])==null?void 0:Z.displayName)??"?",hueSeed:((re=t[2])==null?void 0:re.agentId)??"2",colorToken:((xe=t[2])==null?void 0:xe.avatarColorToken)??null,fontSize:s}),l.jsx(e5,{count:n-3,fontSize:c})]})]})}function ra({name:e,hueSeed:t,colorToken:n,fontSize:a,fullWidth:s}){return l.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",background:$c(n,t),color:"var(--fg-on-vivid)",fontSize:a,fontWeight:700,lineHeight:1,letterSpacing:"-0.02em",...s?{gridColumn:"1 / -1"}:null},children:dN(e)})}function e5({count:e,fontSize:t}){return l.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-sunken)",color:"var(--fg-3)",fontSize:t,fontWeight:600,lineHeight:1,userSelect:"none"},children:`+${e}`})}function t5({size:e}){return l.jsx("span",{"aria-hidden":"true",className:"chat-row-avatar__working-ring",style:{position:"absolute",inset:-3,width:e+6,height:e+6,borderRadius:"50%",border:"var(--hairline-bold) solid var(--state-working)",pointerEvents:"none",zIndex:1}})}function n5({count:e}){const t=K4(e);return t===null?null:l.jsx("span",{"aria-hidden":"true",style:{position:"absolute",bottom:-3,right:-3,minWidth:"var(--sp-4)",height:"var(--sp-4)",padding:"0 var(--sp-1)",borderRadius:"var(--sp-2)",background:"var(--state-error)",color:"var(--fg-on-vivid)",fontSize:"var(--text-caption)",fontWeight:700,lineHeight:"var(--sp-4)",textAlign:"center",border:"var(--hairline-bold) solid var(--bg-raised)",boxSizing:"content-box",zIndex:3,userSelect:"none"},children:t})}function r5(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function _1({src:e,name:t,size:n=28,className:a,colorToken:s,seed:o}){const c=`${n}px`;if(e)return l.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:c,height:c,borderRadius:"50%",objectFit:"cover",display:"block"}});const f=typeof s=="string"&&s.length>0||o&&o.length>0,m=f?$c(s,o??""):"var(--accent)",h=f?"var(--fg-on-vivid)":"var(--bg-raised)";return l.jsx("span",{className:a,role:"img","aria-label":t,style:{width:c,height:c,borderRadius:"50%",background:m,color:h,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,userSelect:"none"},children:l.jsx("span",{className:"text-subtitle font-semibold",children:r5(t)})})}const T1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,A1=KE,a5=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return A1(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 w=T1(p)||T1(g);return s[h][w]}),f=n&&Object.entries(n).reduce((h,p)=>{let[g,w]=p;return w===void 0||(h[g]=w),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,p)=>{let{class:g,className:w,...x}=p;return Object.entries(x).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,w]:h},[]);return A1(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},i5=a5("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"}}),be=b.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...s},o)=>{const c=a?YI:"button";return l.jsx(c,{className:Me(i5({variant:t,size:n,className:e})),ref:o,...s})});be.displayName="Button";const Zt=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}));Zt.displayName="Input";function s5({action:e,onClose:t}){const n=e!==null;return l.jsx(Cn,{open:n,onOpenChange:a=>!a&&t(),children:l.jsxs(yn,{children:[l.jsxs(On,{children:[l.jsx(Nn,{children:e==="join"?"Join a team":"Create a new team"}),l.jsx(Bv,{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(o5,{onDone:t}),e==="join"&&l.jsx(u5,{onDone:t})]})})}function l5(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function o5({onDone:e}){const{adoptTokens:t}=lt(),n=Rn(),[a,s]=b.useState(""),[o,c]=b.useState(null),[f,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 w=await je.post("/me/organizations",{name:l5(g),displayName:g});await t(w.tokens),e(),n("/",{replace:!0})}catch(w){c(w instanceof Error?w.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(Zt,{id:"team-display-name","aria-label":"Team name",value:a,onChange:p=>s(p.target.value),placeholder:"Acme Robotics",autoFocus:!0}),l.jsx(be,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function u5({onDone:e}){const{adoptTokens:t}=lt(),n=Rn(),[a,s]=b.useState(""),[o,c]=b.useState(null),[f,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(),w=/\/invite\/([^/?#]+)/.exec(g),x=(w==null?void 0:w[1])??g,k=await je.post("/me/organizations/join",{token:x});await t(k.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(Zt,{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(be,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function c5(){var I,R;const{organizationId:e,role:t,user:n,selectOrganization:a,logout:s}=lt(),o=Rn(),[c,f]=b.useState([]),[m,h]=b.useState(!1),[p,g]=b.useState(null),w=b.useRef(null);b.useEffect(()=>{(async()=>{try{const F=await je.get("/me/organizations");f(F)}catch{}})()},[]),b.useEffect(()=>{const F=te=>{m&&w.current&&!w.current.contains(te.target)&&h(!1)},P=te=>{m&&te.key==="Escape"&&h(!1)};return window.addEventListener("mousedown",F),window.addEventListener("keydown",P),()=>{window.removeEventListener("mousedown",F),window.removeEventListener("keydown",P)}},[m]);const x=(n==null?void 0:n.displayName)??"User",k=(n==null?void 0:n.username)??"",j=(n==null?void 0:n.avatarUrl)??null,E=c.find(F=>F.id===e)??null,C=(E==null?void 0:E.role)??(t==="admin"||t==="member"?t:null),A=async F=>{if(F===e){h(!1);return}try{await a(F),h(!1),o("/",{replace:!0})}catch{}},O=()=>{h(!1),g("create")},D=()=>{h(!1),g("join")};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{ref:w,className:"relative","data-testid":"user-menu",children:[l.jsx("button",{type:"button","aria-label":`User menu, ${x}`,"aria-haspopup":"menu","aria-expanded":m,onClick:()=>h(F=>!F),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(_1,{src:j,name:x,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(_1,{src:j,name:x,size:32}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:x}),k&&k!==x&&l.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",k]})]})]}),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(fr,{className:"h-3.5 w-3.5"})}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:(I=c[0])==null?void 0:I.displayName}),l.jsx(R1,{role:((R=c[0])==null?void 0:R.role)??C})]}):l.jsx("div",{children:c.map(F=>l.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void A(F.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:F.id===e?l.jsx(fr,{className:"h-3.5 w-3.5"}):null}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:F.displayName}),l.jsx(R1,{role:F.role})]},F.id))})]}),l.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[l.jsxs("button",{type:"button",role:"menuitem",onClick:O,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(wa,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Create new team"})]}),l.jsxs("button",{type:"button",role:"menuitem",onClick:D,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(GE,{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(DD,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Sign out"})]})})]})]}),l.jsx(s5,{action:p,onClose:()=>g(null)})]})}function R1({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 d5=[{to:"/",label:"Workspace",end:!0},{to:"/context",label:"Context",end:!1},{to:"/team",label:"Team",end:!1},{to:"/settings",label:"Settings",end:!1}];function f5(){const[e,t]=b.useState(!1),n=Tr(),a=n.pathname==="/"||n.search.includes("a=");return 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(Fc,{width:16,height:18,style:{color:"var(--fg)"}}),l.jsx("span",{className:"text-title",style:{color:"var(--fg)"},children:"First Tree"})]}),l.jsx(M4,{})]}),l.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:d5.map(s=>l.jsx(kv,{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.jsx("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})},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-3)",minWidth:200,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(Rv,{className:"h-4 w-4"}),l.jsx("span",{children:"Jump to…"})]}),l.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),l.jsx($4,{}),l.jsx(q4,{}),l.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),l.jsx(c5,{})]})]}),l.jsx(T4,{open:e,onOpenChange:t}),a?l.jsx(qf,{}):l.jsx("main",{className:"flex-1 overflow-auto",children:l.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:l.jsx(qf,{})})})]})}const fN=b.createContext(null),h5=5e3;function m5({children:e}){const[t,n]=b.useState([]),a=b.useCallback(c=>{n(f=>f.filter(m=>m.id!==c))},[]),o={addToast:b.useCallback(c=>{const f=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;n(m=>[...m,{...c,id:f}])},[])};return l.jsxs(fN.Provider,{value:o,children:[e,l.jsx(p5,{toasts:t,onDismiss:a})]})}function Hc(){const e=b.useContext(fN);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function p5({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(g5,{toast:n,onDismiss:()=>t(n.id)},n.id))})}function g5({toast:e,onDismiss:t}){const n=b.useRef(t);return n.current=t,b.useEffect(()=>{if(e.durationMs===null)return;const a=e.durationMs??h5,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(pi,{className:"h-4 w-4"})})]})}function fe(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=c.prototype,p=Object.keys(h);for(let g=0;g<p.length;g++){const w=p[g];w in f||(f[w]=h[w].bind(f))}}const s=(n==null?void 0:n.Parent)??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function c(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const p of h._zod.deferred)p();return h}return Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class io extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class hN extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const mN={};function vs(e){return mN}function pN(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 My(e,t){return typeof t=="bigint"?t.toString():t}function wh(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Hv(e){return e==null}function qv(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function y5(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(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return c%f/10**o}const O1=Symbol("evaluating");function _t(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==O1)return a===void 0&&(a=O1,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function ol(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ss(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function M1(e){return JSON.stringify(e)}function v5(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const gN="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function hc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const b5=wh(()=>{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 jo(e){if(hc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(hc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function yN(e){return jo(e)?{...e}:Array.isArray(e)?[...e]:e}const x5=new Set(["string","number","symbol"]);function Eo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bi(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 Pe(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 w5(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const S5={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 k5(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=Ss(e._zod.def,{get shape(){const c={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(c[f]=n.shape[f])}return ol(this,"shape",c),c},checks:[]});return bi(e,o)}function j5(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=Ss(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete c[f]}return ol(this,"shape",c),c},checks:[]});return bi(e,o)}function E5(e,t){if(!jo(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=Ss(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return ol(this,"shape",o),o}});return bi(e,s)}function C5(e,t){if(!jo(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ss(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return ol(this,"shape",a),a}});return bi(e,n)}function N5(e,t){const n=Ss(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return ol(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return bi(e,n)}function _5(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=Ss(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return ol(this,"shape",m),m},checks:[]});return bi(t,c)}function T5(e,t,n){const a=Ss(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 ol(this,"shape",o),o}});return bi(t,a)}function eo(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 to(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function xf(e){return typeof e=="string"?e:e==null?void 0:e.message}function bs(e,t,n){var s,o,c,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const p=xf((c=(o=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:o.error)==null?void 0:c.call(o,e))??xf((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??xf((m=n.customError)==null?void 0:m.call(n,e))??xf((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 Zv(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function mc(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const vN=(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,My,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},bN=fe("$ZodError",vN),xN=fe("$ZodError",vN,{Parent:Error});function A5(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 R5(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,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(o))):c[m]=c[m]||{_errors:[]},c=c[m],f++}}};return a(e),n}const Gv=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 io;if(c.issues.length){const f=new((s==null?void 0:s.Err)??e)(c.issues.map(m=>bs(m,o,vs())));throw gN(f,s==null?void 0:s.callee),f}return c.value},Vv=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 f=new((s==null?void 0:s.Err)??e)(c.issues.map(m=>bs(m,o,vs())));throw gN(f,s==null?void 0:s.callee),f}return c.value},Sh=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 io;return o.issues.length?{success:!1,error:new(e??bN)(o.issues.map(c=>bs(c,s,vs())))}:{success:!0,data:o.value}},O5=Sh(xN),kh=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=>bs(c,s,vs())))}:{success:!0,data:o.value}},M5=kh(xN),D5=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gv(e)(t,n,s)},z5=e=>(t,n,a)=>Gv(e)(t,n,a),I5=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Vv(e)(t,n,s)},L5=e=>async(t,n,a)=>Vv(e)(t,n,a),P5=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sh(e)(t,n,s)},U5=e=>(t,n,a)=>Sh(e)(t,n,a),B5=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return kh(e)(t,n,s)},F5=e=>async(t,n,a)=>kh(e)(t,n,a),$5=/^[cC][^\s-]{8,}$/,H5=/^[0-9a-z]+$/,q5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Z5=/^[0-9a-vA-V]{20}$/,G5=/^[A-Za-z0-9]{27}$/,V5=/^[a-zA-Z0-9_-]{21}$/,Q5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,K5=/^([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})$/,D1=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)$/,Y5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,X5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function W5(){return new RegExp(X5,"u")}const J5=/^(?:(?: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])$/,eL=/^(([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}|:))$/,tL=/^((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])$/,nL=/^(([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])$/,rL=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,wN=/^[A-Za-z0-9_-]*$/,aL=/^\+[1-9]\d{6,14}$/,SN="(?:(?:\\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])))",iL=new RegExp(`^${SN}$`);function kN(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 sL(e){return new RegExp(`^${kN(e)}$`)}function lL(e){const t=kN({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(`^${SN}T(?:${a})$`)}const oL=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}$`)},uL=/^-?\d+$/,jN=/^-?\d+(?:\.\d+)?$/,cL=/^(?:true|false)$/i,dL=/^null$/i,fL=/^[^A-Z]*$/,hL=/^[^a-z]*$/,Rr=fe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),EN={number:"number",bigint:"bigint",object:"date"},CN=fe("$ZodCheckLessThan",(e,t)=>{Rr.init(e,t);const n=EN[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})}}),NN=fe("$ZodCheckGreaterThan",(e,t)=>{Rr.init(e,t);const n=EN[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})}}),mL=fe("$ZodCheckMultipleOf",(e,t)=>{Rr.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):y5(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})}}),pL=fe("$ZodCheckNumberFormat",(e,t)=>{var c;Rr.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]=S5[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=s,m.maximum=o,n&&(m.pattern=uL)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}m<s&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),m>o&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),gL=fe("$ZodCheckMaxLength",(e,t)=>{var n;Rr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Hv(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=Zv(s);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),yL=fe("$ZodCheckMinLength",(e,t)=>{var n;Rr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Hv(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=Zv(s);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),vL=fe("$ZodCheckLengthEquals",(e,t)=>{var n;Rr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!Hv(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=Zv(s),f=o>t.length;a.issues.push({origin:c,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),jh=fe("$ZodCheckStringFormat",(e,t)=>{var n,a;Rr.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=()=>{})}),bL=fe("$ZodCheckRegex",(e,t)=>{jh.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})}}),xL=fe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=fL),jh.init(e,t)}),wL=fe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=hL),jh.init(e,t)}),SL=fe("$ZodCheckIncludes",(e,t)=>{Rr.init(e,t);const n=Eo(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})}}),kL=fe("$ZodCheckStartsWith",(e,t)=>{Rr.init(e,t);const n=new RegExp(`^${Eo(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})}}),jL=fe("$ZodCheckEndsWith",(e,t)=>{Rr.init(e,t);const n=new RegExp(`.*${Eo(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})}}),EL=fe("$ZodCheckOverwrite",(e,t)=>{Rr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class CL{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(`
|
|
345
|
+
`).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(`
|
|
346
|
+
`))}}const NL={major:4,minor:3,patch:6},Yt=fe("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=NL;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=(f,m,h)=>{let p=eo(f),g;for(const w of m){if(w._zod.def.when){if(!w._zod.def.when(f))continue}else if(p)continue;const x=f.issues.length,k=w._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new io;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==x&&(p||(p=eo(f,x)))});else{if(f.issues.length===x)continue;p||(p=eo(f,x))}}return g?g.then(()=>f):f},c=(f,m,h)=>{if(eo(f))return f.aborted=!0,f;const p=o(m,a,h);if(p instanceof Promise){if(h.async===!1)throw new io;return p.then(g=>e._zod.parse(g,h))}return e._zod.parse(p,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const p=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return p instanceof Promise?p.then(g=>c(g,f,m)):c(p,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new io;return h.then(p=>o(p,a,m))}return o(h,a,m)}}_t(e,"~standard",()=>({validate:o=>{var c;try{const f=O5(e,o);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return M5(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}))}),Qv=fe("$ZodString",(e,t)=>{var n;Yt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??oL(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}}),Xt=fe("$ZodStringFormat",(e,t)=>{jh.init(e,t),Qv.init(e,t)}),_L=fe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=K5),Xt.init(e,t)}),TL=fe("$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=D1(a))}else t.pattern??(t.pattern=D1());Xt.init(e,t)}),AL=fe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Y5),Xt.init(e,t)}),RL=fe("$ZodURL",(e,t)=>{Xt.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})}}}),OL=fe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=W5()),Xt.init(e,t)}),ML=fe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=V5),Xt.init(e,t)}),DL=fe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$5),Xt.init(e,t)}),zL=fe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=H5),Xt.init(e,t)}),IL=fe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=q5),Xt.init(e,t)}),LL=fe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Z5),Xt.init(e,t)}),PL=fe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=G5),Xt.init(e,t)}),UL=fe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=lL(t)),Xt.init(e,t)}),BL=fe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=iL),Xt.init(e,t)}),FL=fe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=sL(t)),Xt.init(e,t)}),$L=fe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Q5),Xt.init(e,t)}),HL=fe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=J5),Xt.init(e,t),e._zod.bag.format="ipv4"}),qL=fe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=eL),Xt.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})}}}),ZL=fe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tL),Xt.init(e,t)}),GL=fe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=nL),Xt.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 _N(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const VL=fe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rL),Xt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{_N(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function QL(e){if(!wN.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return _N(n)}const KL=fe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=wN),Xt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{QL(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),YL=fe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=aL),Xt.init(e,t)});function XL(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 WL=fe("$ZodJWT",(e,t)=>{Xt.init(e,t),e._zod.check=n=>{XL(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),TN=fe("$ZodNumber",(e,t)=>{Yt.init(e,t),e._zod.pattern=e._zod.bag.pattern??jN,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}}),JL=fe("$ZodNumberFormat",(e,t)=>{pL.init(e,t),TN.init(e,t)}),eP=fe("$ZodBoolean",(e,t)=>{Yt.init(e,t),e._zod.pattern=cL,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}}),tP=fe("$ZodNull",(e,t)=>{Yt.init(e,t),e._zod.pattern=dL,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}}),nP=fe("$ZodUnknown",(e,t)=>{Yt.init(e,t),e._zod.parse=n=>n}),rP=fe("$ZodNever",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function z1(e,t,n){e.issues.length&&t.issues.push(...to(n,e.issues)),t.value[n]=e.value}const aP=fe("$ZodArray",(e,t)=>{Yt.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 f=s[c],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>z1(h,n,c))):z1(m,n,c)}return o.length?Promise.all(o).then(()=>n):n}});function Yf(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...to(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function AN(e){var a,s,o,c;const t=Object.keys(e.shape);for(const f of t)if(!((c=(o=(s=(a=e.shape)==null?void 0:a[f])==null?void 0:s._zod)==null?void 0:o.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=w5(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=[],f=s.keySet,m=s.catchall._zod,h=m.def.type,p=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){c.push(g);continue}const w=m.run({value:t[g],issues:[]},a);w instanceof Promise?e.push(w.then(x=>Yf(x,n,g,t,p))):Yf(w,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 iP=fe("$ZodObject",(e,t)=>{Yt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=wh(()=>AN(t));_t(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const p=f[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=hc,o=t.catchall;let c;e._zod.parse=(f,m)=>{c??(c=a.value);const h=f.value;if(!s(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const p=[],g=c.shape;for(const w of c.keys){const x=g[w],k=x._zod.optout==="optional",j=x._zod.run({value:h[w],issues:[]},m);j instanceof Promise?p.push(j.then(E=>Yf(E,f,w,h,k))):Yf(j,f,w,h,k)}return o?RN(p,h,f,m,a.value,e):p.length?Promise.all(p).then(()=>f):f}}),sP=fe("$ZodObjectJIT",(e,t)=>{iP.init(e,t);const n=e._zod.parse,a=wh(()=>AN(t)),s=w=>{var O;const x=new CL(["shape","payload","ctx"]),k=a.value,j=D=>{const I=M1(D);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};x.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const D of k.keys)E[D]=`key_${C++}`;x.write("const newResult = {};");for(const D of k.keys){const I=E[D],R=M1(D),F=w[D],P=((O=F==null?void 0:F._zod)==null?void 0:O.optout)==="optional";x.write(`const ${I} = ${j(D)};`),P?x.write(`
|
|
347
|
+
if (${I}.issues.length) {
|
|
348
|
+
if (${R} in input) {
|
|
349
|
+
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
350
|
+
...iss,
|
|
351
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
352
|
+
})));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
if (${I}.value === undefined) {
|
|
357
|
+
if (${R} in input) {
|
|
358
|
+
newResult[${R}] = undefined;
|
|
359
|
+
}
|
|
360
|
+
} else {
|
|
361
|
+
newResult[${R}] = ${I}.value;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
`):x.write(`
|
|
365
|
+
if (${I}.issues.length) {
|
|
366
|
+
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
367
|
+
...iss,
|
|
368
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
369
|
+
})));
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (${I}.value === undefined) {
|
|
373
|
+
if (${R} in input) {
|
|
374
|
+
newResult[${R}] = undefined;
|
|
375
|
+
}
|
|
376
|
+
} else {
|
|
377
|
+
newResult[${R}] = ${I}.value;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
`)}x.write("payload.value = newResult;"),x.write("return payload;");const A=x.compile();return(D,I)=>A(w,D,I)};let o;const c=hc,f=!mN.jitless,h=f&&b5.value,p=t.catchall;let g;e._zod.parse=(w,x)=>{g??(g=a.value);const k=w.value;return c(k)?f&&h&&(x==null?void 0:x.async)===!1&&x.jitless!==!0?(o||(o=s(t.shape)),w=o(w,x),p?RN([],k,w,x,g,e):w):n(w,x):(w.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),w)}});function I1(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=>!eo(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=>bs(c,a,vs())))}),t)}const ON=fe("$ZodUnion",(e,t)=>{Yt.init(e,t),_t(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),_t(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),_t(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),_t(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=>qv(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 f=[];for(const m of t.options){const h=m._zod.run({value:s.value,issues:[]},o);if(h instanceof Promise)f.push(h),c=!0;else{if(h.issues.length===0)return h;f.push(h)}}return c?Promise.all(f).then(m=>I1(m,s,e,o)):I1(f,s,e,o)}}),lP=fe("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ON.init(e,t);const n=e._zod.parse;_t(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[f,m]of Object.entries(c)){s[f]||(s[f]=new Set);for(const h of m)s[f].add(h)}}return s});const a=wh(()=>{var c;const s=t.options,o=new Map;for(const f of s){const m=(c=f._zod.propValues)==null?void 0:c[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(s,o)=>{const c=s.value;if(!hc(c))return s.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),s;const f=a.value.get(c==null?void 0:c[t.discriminator]);return f?f._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)}}),oP=fe("$ZodIntersection",(e,t)=>{Yt.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])=>L1(n,m,h)):L1(n,o,c)}});function Dy(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(jo(e)&&jo(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=Dy(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=Dy(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 L1(e,t,n){const a=new Map;let s;for(const f of t.issues)if(f.code==="unrecognized_keys"){s??(s=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const o=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&s&&e.issues.push({...s,keys:o}),eo(e))return e;const c=Dy(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 uP=fe("$ZodRecord",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!jo(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 f=new Set;for(const h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const p=t.valueType._zod.run({value:s[h],issues:[]},a);p instanceof Promise?o.push(p.then(g=>{g.issues.length&&n.issues.push(...to(h,g.issues)),n.value[h]=g.value})):(p.issues.length&&n.issues.push(...to(h,p.issues)),n.value[h]=p.value)}let m;for(const h in s)f.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 f of Reflect.ownKeys(s)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&jN.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},a);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){t.mode==="loose"?n.value[f]=s[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>bs(g,a,vs())),input:f,path:[f],inst:e});continue}const p=t.valueType._zod.run({value:s[f],issues:[]},a);p instanceof Promise?o.push(p.then(g=>{g.issues.length&&n.issues.push(...to(f,g.issues)),n.value[m.value]=g.value})):(p.issues.length&&n.issues.push(...to(f,p.issues)),n.value[m.value]=p.value)}}return o.length?Promise.all(o).then(()=>n):n}}),cP=fe("$ZodEnum",(e,t)=>{Yt.init(e,t);const n=pN(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>x5.has(typeof s)).map(s=>typeof s=="string"?Eo(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}}),dP=fe("$ZodLiteral",(e,t)=>{if(Yt.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"?Eo(a):a?Eo(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}}),fP=fe("$ZodTransform",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new hN(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 io;return n.value=s,n}});function P1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const MN=fe("$ZodOptional",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_t(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_t(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${qv(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=>P1(o,n.value)):P1(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),hP=fe("$ZodExactOptional",(e,t)=>{MN.init(e,t),_t(e._zod,"values",()=>t.innerType._zod.values),_t(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),mP=fe("$ZodNullable",(e,t)=>{Yt.init(e,t),_t(e._zod,"optin",()=>t.innerType._zod.optin),_t(e._zod,"optout",()=>t.innerType._zod.optout),_t(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${qv(n.source)}|null)$`):void 0}),_t(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)}),pP=fe("$ZodDefault",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",_t(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=>U1(o,t)):U1(s,t)}});function U1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const gP=fe("$ZodPrefault",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",_t(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))}),yP=fe("$ZodNonOptional",(e,t)=>{Yt.init(e,t),_t(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=>B1(o,e)):B1(s,e)}});function B1(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const vP=fe("$ZodCatch",(e,t)=>{Yt.init(e,t),_t(e._zod,"optin",()=>t.innerType._zod.optin),_t(e._zod,"optout",()=>t.innerType._zod.optout),_t(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=>bs(c,a,vs()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>bs(o,a,vs()))},input:n.value}),n.issues=[]),n)}}),bP=fe("$ZodPipe",(e,t)=>{Yt.init(e,t),_t(e._zod,"values",()=>t.in._zod.values),_t(e._zod,"optin",()=>t.in._zod.optin),_t(e._zod,"optout",()=>t.out._zod.optout),_t(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=>wf(c,t.in,a)):wf(o,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(o=>wf(o,t.out,a)):wf(s,t.out,a)}});function wf(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const xP=fe("$ZodReadonly",(e,t)=>{Yt.init(e,t),_t(e._zod,"propValues",()=>t.innerType._zod.propValues),_t(e._zod,"values",()=>t.innerType._zod.values),_t(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),_t(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(F1):F1(s)}});function F1(e){return e.value=Object.freeze(e.value),e}const wP=fe("$ZodCustom",(e,t)=>{Rr.init(e,t),Yt.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=>$1(o,n,a,e));$1(s,n,a,e)}});function $1(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(mc(s))}}var H1;class SP{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 kP(){return new SP}(H1=globalThis).__zod_globalRegistry??(H1.__zod_globalRegistry=kP());const Wu=globalThis.__zod_globalRegistry;function jP(e,t){return new e({type:"string",...Pe(t)})}function EP(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Pe(t)})}function q1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Pe(t)})}function CP(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Pe(t)})}function NP(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Pe(t)})}function _P(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Pe(t)})}function TP(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Pe(t)})}function AP(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Pe(t)})}function RP(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Pe(t)})}function OP(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Pe(t)})}function MP(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Pe(t)})}function DP(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Pe(t)})}function zP(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Pe(t)})}function IP(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Pe(t)})}function LP(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Pe(t)})}function PP(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Pe(t)})}function UP(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Pe(t)})}function BP(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Pe(t)})}function FP(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Pe(t)})}function $P(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Pe(t)})}function HP(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Pe(t)})}function qP(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Pe(t)})}function ZP(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Pe(t)})}function GP(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Pe(t)})}function VP(e,t){return new e({type:"string",format:"date",check:"string_format",...Pe(t)})}function QP(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Pe(t)})}function KP(e,t){return new e({type:"string",format:"duration",check:"string_format",...Pe(t)})}function YP(e,t){return new e({type:"number",checks:[],...Pe(t)})}function XP(e,t){return new e({type:"number",coerce:!0,checks:[],...Pe(t)})}function WP(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Pe(t)})}function JP(e,t){return new e({type:"boolean",...Pe(t)})}function eU(e,t){return new e({type:"null",...Pe(t)})}function tU(e){return new e({type:"unknown"})}function nU(e,t){return new e({type:"never",...Pe(t)})}function Z1(e,t){return new CN({check:"less_than",...Pe(t),value:e,inclusive:!1})}function pg(e,t){return new CN({check:"less_than",...Pe(t),value:e,inclusive:!0})}function G1(e,t){return new NN({check:"greater_than",...Pe(t),value:e,inclusive:!1})}function gg(e,t){return new NN({check:"greater_than",...Pe(t),value:e,inclusive:!0})}function V1(e,t){return new mL({check:"multiple_of",...Pe(t),value:e})}function DN(e,t){return new gL({check:"max_length",...Pe(t),maximum:e})}function Xf(e,t){return new yL({check:"min_length",...Pe(t),minimum:e})}function zN(e,t){return new vL({check:"length_equals",...Pe(t),length:e})}function rU(e,t){return new bL({check:"string_format",format:"regex",...Pe(t),pattern:e})}function aU(e){return new xL({check:"string_format",format:"lowercase",...Pe(e)})}function iU(e){return new wL({check:"string_format",format:"uppercase",...Pe(e)})}function sU(e,t){return new SL({check:"string_format",format:"includes",...Pe(t),includes:e})}function lU(e,t){return new kL({check:"string_format",format:"starts_with",...Pe(t),prefix:e})}function oU(e,t){return new jL({check:"string_format",format:"ends_with",...Pe(t),suffix:e})}function Mo(e){return new EL({check:"overwrite",tx:e})}function uU(e){return Mo(t=>t.normalize(e))}function cU(){return Mo(e=>e.trim())}function dU(){return Mo(e=>e.toLowerCase())}function fU(){return Mo(e=>e.toUpperCase())}function hU(){return Mo(e=>v5(e))}function mU(e,t,n){return new e({type:"array",element:t,...Pe(n)})}function pU(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Pe(n)})}function gU(e){const t=yU(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(mc(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(mc(s))}},e(n.value,n)));return t}function yU(e,t){const n=new Rr({check:"custom",...Pe(t)});return n._zod.check=e,n}function IN(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)??Wu,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 jn(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 f=(g=(p=e._zod).toJSONSchema)==null?void 0:g.call(p);if(f)c.schema=f;else{const w={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,w);else{const k=c.schema,j=t.processors[s.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);j(e,t,k,w)}const x=e._zod.parent;x&&(c.ref||(c.ref=x),jn(x,t,w),t.seen.get(x).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&lr(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 LN(e,t){var c,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const p of e.seen.entries()){const g=(c=e.metadataRegistry.get(p[0]))==null?void 0:c.id;if(g){const w=a.get(g);if(w&&w!==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 j;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(j=e.external.registry.get(p[0]))==null?void 0:j.id,C=e.external.uri??(O=>O);if(E)return{ref:C(E)};const A=p[1].defId??p[1].schema.id??`schema${e.counter++}`;return p[1].defId=A,{defId:A,ref:`${C("__shared")}#/${g}/${A}`}}if(p[1]===n)return{ref:"#"};const x=`#/${g}/`,k=p[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:x+k}},o=p=>{if(p[1].schema.$ref)return;const g=p[1],{ref:w,defId:x}=s(p);g.def={...g.schema},x&&(g.defId=x);const k=g.schema;for(const j in k)delete k[j];k.$ref=w};if(e.cycles==="throw")for(const p of e.seen.entries()){const g=p[1];if(g.cycle)throw new Error(`Cycle detected: #/${(f=g.cycle)==null?void 0:f.join("/")}/<root>
|
|
381
|
+
|
|
382
|
+
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 x=(m=e.external.registry.get(p[0]))==null?void 0:m.id;if(t!==p[0]&&x){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 PN(e,t){var c,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const p=e.seen.get(h);if(p.ref===null)return;const g=p.def??p.schema,w={...g},x=p.ref;if(p.ref=null,x){a(x);const j=e.seen.get(x),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(E)):Object.assign(g,E),Object.assign(g,w),h._zod.parent===x)for(const A in g)A==="$ref"||A==="allOf"||A in w||delete g[A];if(E.$ref&&j.def)for(const A in g)A==="$ref"||A==="allOf"||A in j.def&&JSON.stringify(g[A])===JSON.stringify(j.def[A])&&delete g[A]}const k=h._zod.parent;if(k&&k!==x){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const E in g)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(g[E])===JSON.stringify(j.def[E])&&delete g[E]}e.override({zodSchema:h,jsonSchema:g,path: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=(f=e.external.registry.get(t))==null?void 0:f.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:Wf(t,"input",e.processors),output:Wf(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function lr(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 lr(a.element,n);if(a.type==="set")return lr(a.valueType,n);if(a.type==="lazy")return lr(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 lr(a.innerType,n);if(a.type==="intersection")return lr(a.left,n)||lr(a.right,n);if(a.type==="record"||a.type==="map")return lr(a.keyType,n)||lr(a.valueType,n);if(a.type==="pipe")return lr(a.in,n)||lr(a.out,n);if(a.type==="object"){for(const s in a.shape)if(lr(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(lr(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(lr(s,n))return!0;return!!(a.rest&&lr(a.rest,n))}return!1}const vU=(e,t={})=>n=>{const a=IN({...n,processors:t});return jn(e,a),LN(a,e),PN(a,e)},Wf=(e,t,n={})=>a=>{const{libraryOptions:s,target:o}=a??{},c=IN({...s??{},target:o,io:t,processors:n});return jn(e,c),LN(c,e),PN(c,e)},bU={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},xU=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:o,maximum:c,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof c=="number"&&(s.maxLength=c),f&&(s.format=bU[f]??f,s.format===""&&delete s.format,f==="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}))])}},wU=(e,t,n,a)=>{const s=n,{minimum:o,maximum:c,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:p}=e._zod.bag;typeof f=="string"&&f.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)},SU=(e,t,n,a)=>{n.type="boolean"},kU=(e,t,n,a)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},jU=(e,t,n,a)=>{n.not={}},EU=(e,t,n,a)=>{},CU=(e,t,n,a)=>{const s=e._zod.def,o=pN(s.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},NU=(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},_U=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},TU=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},AU=(e,t,n,a)=>{const s=n,o=e._zod.def,{minimum:c,maximum:f}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof f=="number"&&(s.maxItems=f),s.type="array",s.items=jn(o.element,t,{...a,path:[...a.path,"items"]})},RU=(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]=jn(c[p],t,{...a,path:[...a.path,"properties",p]});const f=new Set(Object.keys(c)),m=new Set([...f].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=jn(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},OU=(e,t,n,a)=>{const s=e._zod.def,o=s.inclusive===!1,c=s.options.map((f,m)=>jn(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=c:n.anyOf=c},MU=(e,t,n,a)=>{const s=e._zod.def,o=jn(s.left,t,{...a,path:[...a.path,"allOf",0]}),c=jn(s.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(c)?c.allOf:[c]];n.allOf=m},DU=(e,t,n,a)=>{const s=n,o=e._zod.def;s.type="object";const c=o.keyType,f=c._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const p=jn(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=jn(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=jn(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)}},zU=(e,t,n,a)=>{const s=e._zod.def,o=jn(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"}]},IU=(e,t,n,a)=>{const s=e._zod.def;jn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType},LU=(e,t,n,a)=>{const s=e._zod.def;jn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},PU=(e,t,n,a)=>{const s=e._zod.def;jn(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)))},UU=(e,t,n,a)=>{const s=e._zod.def;jn(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},BU=(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;jn(o,t,a);const c=t.seen.get(e);c.ref=o},FU=(e,t,n,a)=>{const s=e._zod.def;jn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType,n.readOnly=!0},UN=(e,t,n,a)=>{const s=e._zod.def;jn(s.innerType,t,a);const o=t.seen.get(e);o.ref=s.innerType},$U=fe("ZodISODateTime",(e,t)=>{UL.init(e,t),nn.init(e,t)});function HU(e){return GP($U,e)}const qU=fe("ZodISODate",(e,t)=>{BL.init(e,t),nn.init(e,t)});function ZU(e){return VP(qU,e)}const GU=fe("ZodISOTime",(e,t)=>{FL.init(e,t),nn.init(e,t)});function VU(e){return QP(GU,e)}const QU=fe("ZodISODuration",(e,t)=>{$L.init(e,t),nn.init(e,t)});function KU(e){return KP(QU,e)}const YU=(e,t)=>{bN.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>R5(e,n)},flatten:{value:n=>A5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,My,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,My,2)}},isEmpty:{get(){return e.issues.length===0}}})},da=fe("ZodError",YU,{Parent:Error}),XU=Gv(da),WU=Vv(da),JU=Sh(da),e6=kh(da),t6=D5(da),n6=z5(da),r6=I5(da),a6=L5(da),i6=P5(da),s6=U5(da),l6=B5(da),o6=F5(da),Wt=fe("ZodType",(e,t)=>(Yt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Wf(e,"input"),output:Wf(e,"output")}}),e.toJSONSchema=vU(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ss(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)=>bi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>XU(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>JU(e,n,a),e.parseAsync=async(n,a)=>WU(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>e6(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>t6(e,n,a),e.decode=(n,a)=>n6(e,n,a),e.encodeAsync=async(n,a)=>r6(e,n,a),e.decodeAsync=async(n,a)=>a6(e,n,a),e.safeEncode=(n,a)=>i6(e,n,a),e.safeDecode=(n,a)=>s6(e,n,a),e.safeEncodeAsync=async(n,a)=>l6(e,n,a),e.safeDecodeAsync=async(n,a)=>o6(e,n,a),e.refine=(n,a)=>e.check(nB(n,a)),e.superRefine=n=>e.check(rB(n)),e.overwrite=n=>e.check(Mo(n)),e.optional=()=>Y1(e),e.exactOptional=()=>H6(e),e.nullable=()=>X1(e),e.nullish=()=>Y1(X1(e)),e.nonoptional=n=>K6(e,n),e.array=()=>ot(e),e.or=n=>Eh([e,n]),e.and=n=>P6(e,n),e.transform=n=>Iy(e,HN(n)),e.default=n=>G6(e,n),e.prefault=n=>Q6(e,n),e.catch=n=>X6(e,n),e.pipe=n=>Iy(e,n),e.readonly=()=>eB(e),e.describe=n=>{const a=e.clone();return Wu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=Wu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Wu.get(e);const a=e.clone();return Wu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),BN=fe("_ZodString",(e,t)=>{Qv.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(a,s,o)=>xU(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(rU(...a)),e.includes=(...a)=>e.check(sU(...a)),e.startsWith=(...a)=>e.check(lU(...a)),e.endsWith=(...a)=>e.check(oU(...a)),e.min=(...a)=>e.check(Xf(...a)),e.max=(...a)=>e.check(DN(...a)),e.length=(...a)=>e.check(zN(...a)),e.nonempty=(...a)=>e.check(Xf(1,...a)),e.lowercase=a=>e.check(aU(a)),e.uppercase=a=>e.check(iU(a)),e.trim=()=>e.check(cU()),e.normalize=(...a)=>e.check(uU(...a)),e.toLowerCase=()=>e.check(dU()),e.toUpperCase=()=>e.check(fU()),e.slugify=()=>e.check(hU())}),u6=fe("ZodString",(e,t)=>{Qv.init(e,t),BN.init(e,t),e.email=n=>e.check(EP(c6,n)),e.url=n=>e.check(AP(d6,n)),e.jwt=n=>e.check(ZP(C6,n)),e.emoji=n=>e.check(RP(f6,n)),e.guid=n=>e.check(q1(Q1,n)),e.uuid=n=>e.check(CP(Sf,n)),e.uuidv4=n=>e.check(NP(Sf,n)),e.uuidv6=n=>e.check(_P(Sf,n)),e.uuidv7=n=>e.check(TP(Sf,n)),e.nanoid=n=>e.check(OP(h6,n)),e.guid=n=>e.check(q1(Q1,n)),e.cuid=n=>e.check(MP(m6,n)),e.cuid2=n=>e.check(DP(p6,n)),e.ulid=n=>e.check(zP(g6,n)),e.base64=n=>e.check($P(k6,n)),e.base64url=n=>e.check(HP(j6,n)),e.xid=n=>e.check(IP(y6,n)),e.ksuid=n=>e.check(LP(v6,n)),e.ipv4=n=>e.check(PP(b6,n)),e.ipv6=n=>e.check(UP(x6,n)),e.cidrv4=n=>e.check(BP(w6,n)),e.cidrv6=n=>e.check(FP(S6,n)),e.e164=n=>e.check(qP(E6,n)),e.datetime=n=>e.check(HU(n)),e.date=n=>e.check(ZU(n)),e.time=n=>e.check(VU(n)),e.duration=n=>e.check(KU(n))});function N(e){return jP(u6,e)}const nn=fe("ZodStringFormat",(e,t)=>{Xt.init(e,t),BN.init(e,t)}),c6=fe("ZodEmail",(e,t)=>{AL.init(e,t),nn.init(e,t)}),Q1=fe("ZodGUID",(e,t)=>{_L.init(e,t),nn.init(e,t)}),Sf=fe("ZodUUID",(e,t)=>{TL.init(e,t),nn.init(e,t)}),d6=fe("ZodURL",(e,t)=>{RL.init(e,t),nn.init(e,t)}),f6=fe("ZodEmoji",(e,t)=>{OL.init(e,t),nn.init(e,t)}),h6=fe("ZodNanoID",(e,t)=>{ML.init(e,t),nn.init(e,t)}),m6=fe("ZodCUID",(e,t)=>{DL.init(e,t),nn.init(e,t)}),p6=fe("ZodCUID2",(e,t)=>{zL.init(e,t),nn.init(e,t)}),g6=fe("ZodULID",(e,t)=>{IL.init(e,t),nn.init(e,t)}),y6=fe("ZodXID",(e,t)=>{LL.init(e,t),nn.init(e,t)}),v6=fe("ZodKSUID",(e,t)=>{PL.init(e,t),nn.init(e,t)}),b6=fe("ZodIPv4",(e,t)=>{HL.init(e,t),nn.init(e,t)}),x6=fe("ZodIPv6",(e,t)=>{qL.init(e,t),nn.init(e,t)}),w6=fe("ZodCIDRv4",(e,t)=>{ZL.init(e,t),nn.init(e,t)}),S6=fe("ZodCIDRv6",(e,t)=>{GL.init(e,t),nn.init(e,t)}),k6=fe("ZodBase64",(e,t)=>{VL.init(e,t),nn.init(e,t)}),j6=fe("ZodBase64URL",(e,t)=>{KL.init(e,t),nn.init(e,t)}),E6=fe("ZodE164",(e,t)=>{YL.init(e,t),nn.init(e,t)}),C6=fe("ZodJWT",(e,t)=>{WL.init(e,t),nn.init(e,t)}),Kv=fe("ZodNumber",(e,t)=>{TN.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(a,s,o)=>wU(e,a,s),e.gt=(a,s)=>e.check(G1(a,s)),e.gte=(a,s)=>e.check(gg(a,s)),e.min=(a,s)=>e.check(gg(a,s)),e.lt=(a,s)=>e.check(Z1(a,s)),e.lte=(a,s)=>e.check(pg(a,s)),e.max=(a,s)=>e.check(pg(a,s)),e.int=a=>e.check(K1(a)),e.safe=a=>e.check(K1(a)),e.positive=a=>e.check(G1(0,a)),e.nonnegative=a=>e.check(gg(0,a)),e.negative=a=>e.check(Z1(0,a)),e.nonpositive=a=>e.check(pg(0,a)),e.multipleOf=(a,s)=>e.check(V1(a,s)),e.step=(a,s)=>e.check(V1(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 Ue(e){return YP(Kv,e)}const N6=fe("ZodNumberFormat",(e,t)=>{JL.init(e,t),Kv.init(e,t)});function K1(e){return WP(N6,e)}const _6=fe("ZodBoolean",(e,t)=>{eP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>SU(e,n,a)});function Pn(e){return JP(_6,e)}const T6=fe("ZodNull",(e,t)=>{tP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>kU(e,n,a)});function A6(e){return eU(T6,e)}const R6=fe("ZodUnknown",(e,t)=>{nP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>EU()});function tn(){return tU(R6)}const O6=fe("ZodNever",(e,t)=>{rP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>jU(e,n,a)});function M6(e){return nU(O6,e)}const D6=fe("ZodArray",(e,t)=>{aP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>AU(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(Xf(n,a)),e.nonempty=n=>e.check(Xf(1,n)),e.max=(n,a)=>e.check(DN(n,a)),e.length=(n,a)=>e.check(zN(n,a)),e.unwrap=()=>e.element});function ot(e,t){return mU(D6,e,t)}const z6=fe("ZodObject",(e,t)=>{sP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>RU(e,n,a,s),_t(e,"shape",()=>t.shape),e.keyof=()=>ze(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:tn()}),e.loose=()=>e.clone({...e._zod.def,catchall:tn()}),e.strict=()=>e.clone({...e._zod.def,catchall:M6()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>E5(e,n),e.safeExtend=n=>C5(e,n),e.merge=n=>N5(e,n),e.pick=n=>k5(e,n),e.omit=n=>j5(e,n),e.partial=(...n)=>_5(qN,e,n[0]),e.required=(...n)=>T5(ZN,e,n[0])});function ne(e,t){const n={type:"object",shape:e??{},...Pe(t)};return new z6(n)}const FN=fe("ZodUnion",(e,t)=>{ON.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>OU(e,n,a,s),e.options=t.options});function Eh(e,t){return new FN({type:"union",options:e,...Pe(t)})}const I6=fe("ZodDiscriminatedUnion",(e,t)=>{FN.init(e,t),lP.init(e,t)});function Ch(e,t,n){return new I6({type:"union",options:t,discriminator:e,...Pe(n)})}const L6=fe("ZodIntersection",(e,t)=>{oP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>MU(e,n,a,s)});function P6(e,t){return new L6({type:"intersection",left:e,right:t})}const $N=fe("ZodRecord",(e,t)=>{uP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>DU(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function fn(e,t,n){return new $N({type:"record",keyType:e,valueType:t,...Pe(n)})}function U6(e,t,n){const a=bi(e);return a._zod.values=void 0,new $N({type:"record",keyType:a,valueType:t,...Pe(n)})}const zy=fe("ZodEnum",(e,t)=>{cP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(a,s,o)=>CU(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:[],...Pe(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:[],...Pe(s),entries:o})}});function ze(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new zy({type:"enum",entries:n,...Pe(t)})}const B6=fe("ZodLiteral",(e,t)=>{dP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>NU(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 It(e,t){return new B6({type:"literal",values:Array.isArray(e)?e:[e],...Pe(t)})}const F6=fe("ZodTransform",(e,t)=>{fP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>TU(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new hN(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(mc(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(mc(c))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(o=>(n.value=o,n)):(n.value=s,n)}});function HN(e){return new F6({type:"transform",transform:e})}const qN=fe("ZodOptional",(e,t)=>{MN.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>UN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Y1(e){return new qN({type:"optional",innerType:e})}const $6=fe("ZodExactOptional",(e,t)=>{hP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>UN(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function H6(e){return new $6({type:"optional",innerType:e})}const q6=fe("ZodNullable",(e,t)=>{mP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>zU(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function X1(e){return new q6({type:"nullable",innerType:e})}const Z6=fe("ZodDefault",(e,t)=>{pP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>LU(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function G6(e,t){return new Z6({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():yN(t)}})}const V6=fe("ZodPrefault",(e,t)=>{gP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>PU(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Q6(e,t){return new V6({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():yN(t)}})}const ZN=fe("ZodNonOptional",(e,t)=>{yP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>IU(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function K6(e,t){return new ZN({type:"nonoptional",innerType:e,...Pe(t)})}const Y6=fe("ZodCatch",(e,t)=>{vP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>UU(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function X6(e,t){return new Y6({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const W6=fe("ZodPipe",(e,t)=>{bP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>BU(e,n,a,s),e.in=t.in,e.out=t.out});function Iy(e,t){return new W6({type:"pipe",in:e,out:t})}const J6=fe("ZodReadonly",(e,t)=>{xP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>FU(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function eB(e){return new J6({type:"readonly",innerType:e})}const tB=fe("ZodCustom",(e,t)=>{wP.init(e,t),Wt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>_U(e,n)});function nB(e,t={}){return pU(tB,e,t)}function rB(e){return gU(e)}function aB(e,t){return Iy(HN(e),t)}const hs={custom:"custom"};function Nh(e){return XP(Kv,e)}const iB=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function sB(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function GN(e,t){const n=sB(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(iB)){const c=o[1];if(!c)continue;const f=a.get(c.toLowerCase());f&&s.add(f)}return[...s]}const lB=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,W1="/";function VN(e){return!e||typeof e!="string"||e.length>256||!lB.test(e)?"/":e}const oB={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},QN=ze(["feishu","slack","kael"]),KN=ze(["active","inactive"]);ne({platform:QN,agentId:N().min(1),credentials:fn(N(),tn()),status:KN.default("active")});ne({agentId:N().min(1).optional(),credentials:fn(N(),tn()).optional(),status:KN.optional()});ne({id:Ue(),platform:N(),agentId:N(),hasCredentials:Pn(),status:N(),createdAt:N(),updatedAt:N()});const uB=ze(["code","reverse_token","oauth","manual"]);ne({appId:N().min(1),appSecret:N().min(1)});ne({platform:QN,externalUserId:N().min(1),agentId:N().min(1),boundVia:uB.default("manual"),displayName:N().max(200).optional()});ne({id:Ue(),platform:N(),externalUserId:N(),agentId:N(),boundVia:N().nullable(),displayName:N().nullable(),createdAt:N()});ne({feishuUserId:N().min(1),displayName:N().max(200).optional()});ne({configId:Ue(),platform:N(),agentId:N(),appId:N(),connected:Pn(),lastActiveAt:N().nullable()});const cB=32e3,Yv=/^[a-z0-9][a-z0-9_-]{0,63}$/i,dB=/^[A-Z][A-Z0-9_]*$/,fB=/^[A-Za-z]:/,YN=ne({append:N().max(cB).default("")}),hB=ne({name:N().regex(Yv,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:It("stdio"),command:N().min(1),args:ot(N()).optional()}),mB=ne({name:N().regex(Yv,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:It("http"),url:N().url(),headers:fn(N(),N()).optional()}),pB=ne({name:N().regex(Yv,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:It("sse"),url:N().url(),headers:fn(N(),N()).optional()}),XN=Ch("transport",[hB,mB,pB]),WN=ne({key:N().regex(dB,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:N(),sensitive:Pn().default(!1)});function gB(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function yB(e){if(e.length===0)return"Git repo local path must not be empty";if(e.trim()!==e)return"Git repo local path must not have leading or trailing whitespace";if(gB(e))return"Git repo local path must not contain control characters";if(e.includes("\\"))return"Git repo local path must use forward slashes";if(e.startsWith("/")||fB.test(e))return"Git repo local path must be relative";const t=e.split("/");for(const n of t){if(!n)return"Git repo local path must not contain empty path segments";if(n==="."||n==="..")return"Git repo local path must not contain dot segments";if(n.trim()!==n)return"Git repo local path segments must not have leading or trailing whitespace"}return null}const Xv=ne({url:N().min(1),ref:N().min(1).optional(),localPath:N().min(1).superRefine((e,t)=>{const n=yB(e);n&&t.addIssue({code:hs.custom,message:n})}).optional()}),JN=ne({prompt:YN.default({append:""}),model:N().default("opus"),mcpServers:ot(XN).default([]),env:ot(WN).default([]),gitRepos:ot(Xv).default([])}),vB=JN.extend({kind:It("claude-code")}),bB=JN.extend({kind:It("codex")}),xB=Ch("kind",[vB,bB]),wB=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,c)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:hs.custom,path:["mcpServers",c,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,c)=>{a.has(o.key)&&t.addIssue({code:hs.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 f=o.localPath??Jf(o.url);f&&(s.has(f)&&t.addIssue({code:hs.custom,path:["gitRepos",c,"localPath"],message:`Duplicate git repo local path "${f}"`}),s.add(f))})},e_=aB(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,xB).superRefine((e,t)=>{wB(e,t)}),SB=ne({agentId:N(),version:Ue().int().positive(),payload:e_,updatedAt:N(),updatedBy:N()}),t_=ne({prompt:YN,model:N(),mcpServers:ot(XN),env:ot(WN),gitRepos:ot(Xv)}).partial();ne({expectedVersion:Ue().int().positive(),payload:t_});ne({payload:t_});ne({current:SB,next:e_,diff:ot(ne({path:N(),op:ze(["add","remove","replace"]),before:tn().optional(),after:tn().optional()}))});const pc="***";function Jf(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}const n_=ze(["online","offline"]),r_=ze(["idle","working","blocked","error"]);ze(["active","suspended","evicted","errored"]);const kB=ze(["active","suspended","errored"]);ne({chatId:N().min(1),state:kB});ne({runtimeState:r_});ne({agentId:N().min(1),runtimeType:N().max(50),runtimeVersion:N().max(50).optional()});ze(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);ne({agentId:N(),status:n_,connectedAt:N().nullable(),lastSeenAt:N(),clientId:N().nullable().optional(),runtimeType:N().nullable().optional(),runtimeVersion:N().nullable().optional(),runtimeState:r_.nullable().optional(),activeSessions:Ue().int().nullable().optional(),totalSessions:Ue().int().nullable().optional(),runtimeUpdatedAt:N().nullable().optional()});ne({total:Ue().int(),running:Ue().int(),byState:ne({idle:Ue().int(),working:Ue().int(),blocked:Ue().int(),error:Ue().int()}),clients:Ue().int()});const eh={CLAUDE_CODE:"claude-code",CODEX:"codex"},_h=ze(["claude-code","codex"]),Th=ze(["human","personal_assistant","autonomous_agent"]),J1={PRIVATE:"private",ORGANIZATION:"organization"},Wv=ze(["private","organization"]),Ly=["hue-0","hue-1","hue-2","hue-3","hue-4","hue-5","hue-6","hue-7"],jB=ze(Ly),EB=ze(["admin-api","portal"]);ze(["active","suspended"]);const Py=/^[a-z0-9][a-z0-9_-]{0,63}$/,no=64,CB=["admin","agent","first-tree","hub","me","null","system","undefined"],NB=new Set(CB);function Uy(e){return NB.has(e)}ne({name:N().min(1).max(64).regex(Py,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!Uy(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:Th,displayName:N().min(1).max(200).optional(),delegateMention:N().max(100).optional(),organizationId:N().min(1).max(100).optional(),source:EB.optional(),visibility:Wv.optional(),metadata:fn(N(),tn()).optional(),managerId:N().optional(),clientId:N().min(1).max(100).optional(),runtimeProvider:_h.optional(),gitRepos:ot(Xv).optional()});ne({type:Th.optional(),displayName:N().min(1).max(200).optional(),delegateMention:N().max(100).nullable().optional(),visibility:Wv.optional(),metadata:fn(N(),tn()).optional(),managerId:N().nullable().optional(),clientId:N().min(1).max(100).nullable().optional(),avatarColorToken:jB.nullable().optional()});ne({clientId:N().min(1).max(100),runtimeProvider:_h,force:Pn().optional()});ne({uuid:N(),name:N().nullable(),organizationId:N(),type:Th,displayName:N(),delegateMention:N().nullable(),inboxId:N(),status:N(),source:N().nullable().optional(),visibility:Wv,metadata:fn(N(),tn()),managerId:N().nullable(),clientId:N().nullable(),runtimeProvider:_h,avatarColorToken:N().nullable(),avatarImageUrl:N().nullable(),presenceStatus:n_.optional(),createdAt:N(),updatedAt:N()});ne({repo:N().nullable(),branch:N().nullable()});ne({type:It("agent:pinned"),agentId:N(),name:N().nullable(),displayName:N(),agentType:Th,runtimeProvider:_h});ne({username:N().min(1),password:N().min(1)});ne({accessToken:N(),refreshToken:N()});ne({refreshToken:N().min(1)});ne({token:N().min(1)});ne({token:N(),expiresIn:Ue(),command:N()});const _B=["issue","pull_request","discussion","commit"],Jv=ze(_B),TB=ne({source:It("github"),entityType:Jv,entityKey:N().min(1),entityUrl:N().url().optional()}),AB=ne({source:It("feishu"),externalChannelId:N().min(1)}),RB=Ch("source",[TB,AB]),OB=Eh([ne({}).strict(),RB]),MB=["manual","github_issue","github_pull_request","github_discussion","github_commit","feishu"],eb=ze(MB),DB=ze(["direct","group"]),By={ACTIVE:"active",ARCHIVED:"archived",DELETED:"deleted"},tb=ze(["active","archived","deleted"]);ne({status:tb});ne({type:DB,topic:N().max(500).optional(),participantIds:ot(N()).min(1),metadata:OB.optional()});const a_=ne({agentId:N(),role:N(),mode:N(),joinedAt:N()});a_.extend({name:N().nullable(),displayName:N(),type:N()});const zB=ne({id:N(),organizationId:N(),type:N(),topic:N().nullable(),lifecyclePolicy:N().nullable().optional(),metadata:fn(N(),tn()),createdAt:N(),updatedAt:N()});zB.extend({participants:ot(a_),title:N(),firstMessagePreview:N().nullable(),engagementStatus:tb});ne({topic:N().trim().max(500).nullable()});ne({agentId:N().min(1)});ne({agentId:N().min(1)});const IB=ze(["connected","disconnected"]),LB=ze(["ok","expired"]);ne({id:N(),userId:N().nullable(),status:IB,authState:LB,sdkVersion:N().max(50).nullable(),hostname:N().max(100).nullable(),os:N().max(50).nullable(),agentCount:Ue().int().min(0),connectedAt:N().nullable(),lastSeenAt:N(),metadata:fn(N(),tn()).nullable()});const PB=ne({wsInboxDeliver:Pn().default(!1)}).partial();ne({clientId:N().min(1).max(100),hostname:N().max(100).optional(),os:N().max(50).optional(),sdkVersion:N().max(50).optional(),wireCapabilities:PB.optional()});ne({clientId:N(),previousUserId:N().nullable(),unpinnedAgentCount:Ue().int().nonnegative()});const UB=ze(["ok","missing","unauthenticated","error"]),BB=ze(["api_key","oauth","auth_json","none"]),FB=ne({state:UB,available:Pn(),authenticated:Pn(),sdkVersion:N().nullable().optional(),authMethod:BB,error:N().nullable().optional(),detectedAt:N()}),$B=fn(N(),FB);ne({capabilities:$B});ne({limit:Nh().int().min(1).max(100).default(20),cursor:N().optional()});const HB=ze(["active","stale","unavailable"]),qB=ze(["ok","warning","error"]),ZB=ne({label:N(),detail:N().nullable(),severity:qB}),GB=ze(["root","domain","subdomain","leaf"]),nb=ze(["added","edited","removed"]),VB=ze(["parent","soft_link","markdown_link"]),QB=ze(["low","medium","high"]),KB=ne({id:N(),path:N(),sourcePath:N().nullable(),title:N(),kind:GB,owners:ot(N()),parentId:N().nullable(),preview:N().nullable(),relatedNodeIds:ot(N()),affectedContextArea:N(),changeType:nb.nullable(),changedAtCommit:N().nullable()}),YB=ne({source:N(),target:N(),kind:VB}),XB=ne({path:N(),nodeId:N().nullable(),type:nb,commit:N().nullable(),changedAt:N().nullable(),changedBy:N().nullable(),summary:N().nullable()}),WB=ne({id:N(),nodeId:N().nullable(),path:N(),title:N(),changeType:nb,affectedContextArea:N(),reason:N(),summary:N(),changedBy:N().nullable(),owners:ot(N()),relatedNodeIds:ot(N()),sourceCommit:N().nullable(),riskLevel:QB}),JB=ne({addedCount:Ue().int().nonnegative(),editedCount:Ue().int().nonnegative(),removedCount:Ue().int().nonnegative(),changedNodeCount:Ue().int().nonnegative()}),e9=ne({windowDays:Ue().int().positive(),agentCount:Ue().int().nonnegative(),usageCount:Ue().int().nonnegative()});ne({repo:N().nullable(),branch:N().nullable(),headCommit:N().nullable(),syncedAt:N().nullable(),snapshotStatus:HB,contextStatus:ZB,summary:JB,usage:e9,updates:ot(WB),nodes:ot(KB),edges:ot(YB),changes:ot(XB)});const t9=["User","Organization"],n9=ze(t9),r9=["read","write","admin"],a9=ze(r9),i9=fn(N(),a9),s9=ot(N());ne({login:N().optional(),accessToken:N().optional(),accessTokenExpiresAt:N().datetime({offset:!0}).optional(),refreshToken:N().optional(),refreshTokenExpiresAt:N().datetime({offset:!0}).optional()});ne({installationId:Ue().int().positive()});ne({installationId:Ue().int().positive(),accountType:n9,accountLogin:N(),accountGithubId:Ue().int().positive(),permissions:i9,events:s9,suspended:Pn(),manageUrl:N().url(),createdAt:N().datetime({offset:!0}),updatedAt:N().datetime({offset:!0})});const l9=["image/png","image/jpeg","image/gif","image/webp"],rb=ze(l9);ne({data:N().min(1),mimeType:rb,filename:N().min(1),size:Ue().int().nonnegative().optional(),imageId:N().uuid().optional()});ne({imageId:N().uuid(),mimeType:rb,filename:N().min(1),size:Ue().int().nonnegative().optional()});ne({type:It("image_payload"),imageId:N().uuid(),chatId:N(),base64:N().min(1),mimeType:rb,filename:N().min(1),size:Ue().int().nonnegative().optional()});const ab=ze(["hub_ui","cli","feishu","github","api"]),i_=ze(["text","markdown","card","reference","file","question","question_answer"]);ne({format:i_.default("text"),content:tn(),metadata:fn(N(),tn()).optional(),inReplyTo:N().optional(),replyToInbox:N().optional(),replyToChat:N().optional(),source:ab.optional()});ne({format:i_.default("text"),content:tn(),metadata:fn(N(),tn()).optional(),replyToInbox:N().optional(),replyToChat:N().optional(),source:ab.optional()});const o9=ne({id:N(),chatId:N(),senderId:N(),format:N(),content:tn(),metadata:fn(N(),tn()),replyToInbox:N().nullable(),replyToChat:N().nullable(),inReplyTo:N().nullable(),source:ab.nullable(),createdAt:N()}),u9=ne({senderId:N(),chatId:N(),replyToChat:N().nullable()}).nullable(),c9=ze(["full","mention_only"]),d9=ne({id:N(),senderId:N(),format:N(),content:tn(),metadata:fn(N(),tn()).default({}),createdAt:N()}),s_=o9.extend({configVersion:Ue().int().positive(),recipientMode:c9.default("full"),inReplyToSnapshot:u9.default(null),precedingMessages:ot(d9).default([])});ze(["pending","delivered","acked","failed"]);const f9=ne({id:Ue(),inboxId:N(),messageId:N(),chatId:N().nullable(),status:N(),retryCount:Ue(),createdAt:N(),deliveredAt:N().nullable(),ackedAt:N().nullable()});f9.extend({message:s_});ne({limit:Nh().int().min(1).max(50).default(10)});ne({type:It("inbox:deliver"),entryId:Ue().int().nonnegative(),inboxId:N().min(1),chatId:N().nullable(),message:s_}).passthrough();ne({type:It("inbox:ack"),entryId:Ue().int().nonnegative()});const h9=7;ne({organizationId:N(),organizationName:N(),organizationDisplayName:N(),role:N(),expiresAt:N().nullable()});ne({id:N(),organizationId:N(),token:N(),inviteUrl:N(),role:N(),createdAt:N(),expiresAt:N().nullable()});ne({token:N().min(1)});ne({}).optional();const m9=["all","unread","watching"],p9=ze(m9),l_=ze(["participant","watching"]),g9=["active","archived","all"],ib=ze(g9);ne({cursor:N().optional(),limit:Nh().int().min(1).max(200).default(50),filter:p9.default("all"),engagement:ib.default("active"),source:eb.optional()});const y9=ne({agentId:N(),displayName:N(),type:N(),avatarColorToken:N().nullable(),avatarImageUrl:N().nullable()}),v9=ze(["tool_call","thinking","assistant_text"]),b9=ne({agentId:N(),kind:v9,label:N(),startedAt:N()}),x9=ne({chatId:N(),type:N(),membershipKind:l_,title:N(),topic:N().nullable(),participants:ot(y9),participantCount:Ue().int(),lastMessageAt:N().nullable(),lastMessagePreview:N().nullable(),unreadMentionCount:Ue().int(),canReply:Pn(),engagementStatus:tb,engagedAgentIds:ot(N()),liveActivity:b9.nullable()});ne({rows:ot(x9),nextCursor:N().nullable()});ne({participantIds:ot(N().min(1)).min(1),topic:N().trim().max(500).optional().nullable()});ne({participantIds:ot(N().min(1)).min(1)});ne({chatId:N(),lastReadAt:N(),unreadMentionCount:Ue().int()});ne({chatId:N(),membershipKind:l_.nullable()});ne({type:It("chat:message"),chatId:N()});const w9=ne({chatCount:Ue().int().nonnegative(),unreadChatCount:Ue().int().nonnegative()});ne({engagement:ib.default("active")});ne({counts:U6(eb,w9)});const S9=ne({type:It("workspace"),chatId:N().trim().min(1),agentId:N().trim().min(1),basePath:N().trim().optional(),path:N().trim().min(1)}),k9=ne({basePath:N().trim().min(1)});ne({agentId:N().trim().min(1),basePath:N().trim().optional(),path:N().trim().min(1)});ne({ref:S9,path:N(),content:N()});ze(["connect","create_agent","completed"]);ne({id:N(),name:N(),displayName:N(),role:ze(["admin","member"])});ne({name:N().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:N().min(1).max(200)});ne({dismissed:Pn().optional()});const j9=ze(["team_renamed","agent_created","tree_chat_started","tree_intro_dismissed"]);ne({event:j9,attrs:fn(N(),Eh([N(),Ue(),Pn(),A6()])).optional()});ne({id:N(),organizationId:N(),organizationName:N(),role:ze(["admin","member"]),agentId:N(),orgHasOtherMembers:Pn()});const E9={ADMIN:"admin",MEMBER:"member"},sb=ze(["admin","member"]),C9=ne({id:N(),userId:N(),organizationId:N(),agentId:N(),role:sb,createdAt:N()});ne({username:N().min(1).max(100),displayName:N().min(1).max(200),role:sb.default("member")});ne({role:sb.optional(),displayName:N().min(1).max(200).optional()});C9.extend({username:N(),displayName:N(),password:N()});const N9=ne({kind:It("github-app-installation"),installationId:Ue().int(),organizationId:N().min(1)}),_9=["mentioned","review_requested","assigned"],T9=ze(_9),A9=["opened","edited","closed","merged","reopened","commented","review_requested","reviewed","review_comment","synchronized","commit_commented","assigned","other"],o_=ze(A9),R9=ne({type:Jv,repo:N().min(1),key:N().min(1),title:N().optional(),url:N().optional()}),O9=ne({githubLogin:N().min(1),isBot:Pn()}),M9=ne({githubLogin:N().min(1),reason:T9}),D9=ne({title:N(),body:N(),url:N()}),z9=ne({type:It("issue"),key:N().min(1)});ne({source:N9,deliveryId:N().nullable(),rawEventType:N().min(1),rawAction:N().nullable(),entity:R9,actor:O9,kind:o_,involves:ot(M9),surface:D9,relatedRefs:ot(z9)});const I9=["mentioned","review_requested","assigned","subscribed"],L9=ze(I9);ne({type:It("github_event"),reason:L9,event:N().min(1),action:N().nullable(),kind:o_,repository:N(),sender:N(),title:N(),body:N(),url:N(),entity:ne({type:Jv,key:N().min(1),url:N().nullable()}),mentionedUser:N().optional()});const P9=ze(["agent_error","agent_blocked","agent_stale"]),u_=ze(["high","medium","low"]);ne({id:N(),organizationId:N(),type:P9,severity:u_,agentId:N().nullable(),chatId:N().nullable(),message:N(),read:Pn(),createdAt:N()});ne({limit:Nh().int().min(1).max(100).default(20),cursor:N().optional(),severity:u_.optional(),read:ze(["true","false"]).transform(e=>e==="true").optional(),agentId:N().optional()});ne({next:N().max(256).optional()});ne({code:N().min(1),state:N().min(1),installation_id:N().regex(/^\d+$/).optional(),setup_action:ze(["install","update","request"]).optional()});ne({githubId:N().min(1),login:N().min(1),email:N().email().optional(),displayName:N().optional(),next:N().max(256).optional(),installationId:N().regex(/^\d+$/).optional(),installationAccountType:ze(["User","Organization"]).optional(),installationAccountLogin:N().min(1).optional(),installationAccountGithubId:N().regex(/^\d+$/).optional()});const U9=/^(?:[A-Za-z0-9_.-]+@)?[A-Za-z0-9.-]+:(?!\d+(?:\/|$))[^/:@\s][^:@\s]*$/;function B9(e){return e.includes("://")?!1:U9.test(e)}const Ah=N().min(1).superRefine((e,t)=>{if(B9(e))return;let n;try{n=new URL(e)}catch{t.addIssue({code:hs.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:hs.custom,message:"Repo URL must use HTTPS or SSH."});return}if(n.password.length>0){t.addIssue({code:hs.custom,message:"Repo URL must not include credentials."});return}if(n.protocol==="https:"&&n.username.length>0){t.addIssue({code:hs.custom,message:"Repo URL must not include credentials."});return}}),F9=ne({repo:Ah.optional(),branch:N().default("main")}),$9=ne({repo:Ah.nullish(),branch:N().min(1).nullish()}),H9=ne({repo:N().optional(),branch:N().optional()}),q9=ne({repos:ot(ne({url:Ah,defaultBranch:N().optional()})).default([])}),Z9=ne({repos:ot(ne({url:Ah,defaultBranch:N().min(1).optional()})).optional()}),G9=ne({repos:ot(ne({url:N(),defaultBranch:N().optional()}))}),V9={context_tree:{storage:F9,input:$9,output:H9,readPolicy:"member"},source_repos:{storage:q9,input:Z9,output:G9,readPolicy:"member"}},Q9=Object.keys(V9);ze(Q9);const c_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;ne({name:N().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=>!c_.test(e),"Name must not be a UUID format"),displayName:N().min(1).max(200),maxAgents:Ue().int().min(0).default(0),maxMessagesPerMinute:Ue().int().min(0).default(0),features:fn(N(),tn()).default({})});ne({name:N().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=>!c_.test(e),"Name must not be a UUID format").optional(),displayName:N().min(1).max(200).optional(),maxAgents:Ue().int().min(0).optional(),maxMessagesPerMinute:Ue().int().min(0).optional(),features:fn(N(),tn()).optional()});ne({id:N(),name:N(),displayName:N(),maxAgents:Ue(),maxMessagesPerMinute:Ue(),features:fn(N(),tn()),createdAt:N(),updatedAt:N()});const K9=ne({workingCount:Ue().int().nonnegative(),errorMask:Pn()}),Y9=ne({type:It("pulse:tick"),organizationId:N(),agents:fn(N(),ot(K9).length(32))}),X9=ne({label:N().min(1),description:N(),preview:N().nullable().optional()}),W9=ne({question:N().min(1),header:N().min(1).max(24),options:ot(X9).min(2).max(4),multiSelect:Pn()}),J9=ze(["html","markdown"]).nullable(),eF=ne({correlationId:N().min(1),questions:ot(W9).min(1).max(4),previewFormat:J9,allowFreeText:Pn()}),tF=ne({correlationId:N().min(1),answers:fn(N().min(1),N())});ne({answers:fn(N().min(1),N())});ze(["pending","answered","superseded"]);const nF=ze(["tool_call","error","assistant_text","thinking","turn_end","context_tree_usage"]),d_=ne({toolUseId:N(),name:N(),args:tn(),status:ze(["pending","ok","error"]),durationMs:Ue().int().nonnegative().optional(),resultPreview:N().max(400).optional()}),f_=ne({source:ze(["sdk","runtime","tool"]),message:N().max(2e3)}),h_=ne({text:N().max(8e3)}),m_=ne({}),p_=ne({status:ze(["success","error"])}),g_=ne({purpose:It("design_decision"),treeRepoUrl:N().nullable()}),rF=Ch("kind",[ne({kind:It("tool_call"),payload:d_}),ne({kind:It("error"),payload:f_}),ne({kind:It("assistant_text"),payload:h_}),ne({kind:It("thinking"),payload:m_}),ne({kind:It("turn_end"),payload:p_}),ne({kind:It("context_tree_usage"),payload:g_})]);ne({id:N(),agentId:N(),chatId:N(),seq:Ue().int().positive(),kind:nF,payload:Eh([d_,f_,h_,m_,p_,g_]),createdAt:N()});ne({agentId:N(),chatId:N(),event:rF});ne({type:It("session:reconcile"),agentId:N().min(1),chatIds:ot(N().min(1)).max(500)});ne({type:It("session:reconcile:result"),agentId:N().min(1),staleChatIds:ot(N().min(1))});const aF=ne({organizationId:N(),agentCount:Ue(),chatCount:Ue(),messageCount:Ue()});ne({totalAgents:Ue(),totalChats:Ue(),totalMessages:Ue(),byOrganization:ot(aF)});const iF=ze(["active","suspended"]);ne({id:N(),username:N(),displayName:N(),avatarUrl:N().nullable(),status:iF,createdAt:N(),updatedAt:N()});ne({username:N().min(1).max(100),displayName:N().min(1).max(200),password:N().min(8).max(200)});ne({displayName:N().min(1).max(200).optional(),password:N().min(8).max(200).optional()});ne({type:It("auth"),token:N().min(1)});const sF=ne({wsInboxDeliver:Pn().default(!1)}).partial();ne({type:It("server:welcome"),serverCommandVersion:N().min(1),serverTimeMs:Ue().int().nonnegative(),capabilities:sF.optional()}).passthrough();const y_=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function lF(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 oF=2e3,uF=3e4;let ns=null,gc=!1,th=0,tc=null;const Fy=new Set;let Qn=null,Zs=0;const ek=500;let yg=0,so=null;function tk(e){const t=Date.now(),n=t-yg;if(n>=ek){yg=t,e.invalidateQueries({queryKey:["me","chats"]});return}so===null&&(so=setTimeout(()=>{so=null,yg=Date.now(),Qn&&Qn.invalidateQueries({queryKey:["me","chats"]})},ek-n))}function cF(e){for(const t of Fy)try{t(e)}catch{}if(Qn){if(e.type==="notification")Qn.invalidateQueries({queryKey:["notifications"]});else if(e.type==="session:state")Qn.invalidateQueries({queryKey:["activity"]}),Qn.invalidateQueries({queryKey:["sessions"]}),tk(Qn);else if(e.type==="session:event")tk(Qn);else if(e.type==="chat:message"){const t=typeof e.chatId=="string"?e.chatId:null;Qn.invalidateQueries({queryKey:["me","chats"]}),t&&(Qn.invalidateQueries({queryKey:["chat-messages",t]}),Qn.invalidateQueries({queryKey:["chat-detail",t]}))}}}function lb(){const e=Ic();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);ns=s,s.onmessage=o=>{if(s===ns)try{const c=JSON.parse(o.data);cF(c)}catch{}},s.onopen=()=>{s===ns&&(th=0,Qn&&(Qn.invalidateQueries({queryKey:["notifications"]}),Qn.invalidateQueries({queryKey:["activity"]}),Qn.invalidateQueries({queryKey:["sessions"]}),Qn.invalidateQueries({queryKey:["me","chats"]})))},s.onclose=o=>{if(s===ns&&(ns=null,!(gc||Zs===0))){if(o.code===4001){OM().then(c=>{gc||Zs===0||(c?(th=0,lb()):nk())});return}nk()}}}function nk(){th++;const e=Math.min(oF*2**(th-1),uF);tc=setTimeout(()=>{tc=null,!gc&&Zs>0&&lb()},e)}function dF(){gc=!0,tc&&(clearTimeout(tc),tc=null),so&&(clearTimeout(so),so=null),ns&&(ns.close(1e3,"unmount"),ns=null)}function v_(e){const{onMessage:t,enabled:n=!0}=e??{},a=gn(),s=b.useRef(t);s.current=t,b.useEffect(()=>{Qn=a},[a]),b.useEffect(()=>{if(!n)return;const o=c=>{var f;return(f=s.current)==null?void 0:f.call(s,c)};return Fy.add(o),Zs++,Zs===1&&(gc=!1,lb()),()=>{Fy.delete(o),Zs--,Zs===0&&dF()}},[n])}const fF=b.createContext({aggregated:y_,agents:{},receivedAtMs:null,stale:!0});function hF({children:e}){const[t,n]=b.useState({aggregated:y_,agents:{},receivedAtMs:null}),[a,s]=b.useState(()=>Date.now());v_({onMessage:c=>{const f=Y9.safeParse(c);f.success&&n({aggregated:lF(f.data.agents),agents:f.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(fF.Provider,{value:o,children:e})}function yc(e){return je.get(`/agents/${e}/config`)}function Rh(e,t){return je.patch(`/agents/${e}/config`,t)}function mF(e,t){return je.post(`/agents/${e}/config/dry-run`,{payload:t})}function pF(e){return je.get(`/agents/${e}/client-status`)}function gF({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 yF({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 vF(){return l.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function bF({children:e,mono:t}){return l.jsx("span",{className:Me("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}const xF={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 dr({tone:e="neutral",className:t,style:n,...a}){const s=xF[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 $y({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 ob({className:e,style:t,...n}){return l.jsx("span",{className:Me("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function nc({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 wF(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function vc({state:e,className:t}){const n=e!==null&&wF(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(nc,{state:n,size:7}),n]})}function kf({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 SF(e,t,n){return e?n==="admin"||!!t&&e.managerId===t:!1}function kF(e){var t;return e.agentStatus!=="active"?{disabled:!0,title:"Only active agents can be tested."}:e.clientStatusLoading?{disabled:!0,title:"Checking the bound computer before testing."}:(t=e.clientStatus)!=null&&t.clientId?e.clientStatus.online?e.testPending?{disabled:!0,title:"Test in progress."}:{disabled:!1,title:"Send a test message to verify this agent can respond."}:{disabled:!0,title:"The bound computer is offline."}:{disabled:!0,title:"Bind a computer before testing this agent."}}function rk(e){return e.status==="connected"}var jF="Label",b_=b.forwardRef((e,t)=>l.jsx(vi.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())}}));b_.displayName=jF;var EF=b_;const dt=b.forwardRef(({className:e,...t},n)=>l.jsx(EF,{ref:n,className:Me("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));dt.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 Da=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}));Da.displayName="PanelHeader";const za=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}));za.displayName="PanelTitle";const Zr=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}));Zr.displayName="PanelBody";const jf=256,CF="image/png,image/jpeg,image/webp";function NF(e){var t;return((t=e.trim()[0])==null?void 0:t.toUpperCase())??"?"}function Hy({agent:e,size:t}){return e.avatarImageUrl?l.jsx("img",{src:e.avatarImageUrl,alt:e.displayName,width:t,height:t,style:{width:t,height:t,borderRadius:"50%",objectFit:"cover",display:"block"}}):l.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:t,height:t,borderRadius:"50%",background:$c(e.avatarColorToken,e.uuid),color:"var(--fg-on-vivid)",fontSize:Math.round(t*.42),fontWeight:700,lineHeight:1,letterSpacing:"-0.02em",userSelect:"none"},children:NF(e.displayName)})}function _F({agent:e,canEdit:t=!0,onSave:n,onRefresh:a}){const[s,o]=b.useState(!1),c=typeof e.avatarColorToken=="string"&&e.avatarColorToken.length>0?e.avatarColorToken:"auto";return l.jsxs(Kn,{children:[l.jsxs(Da,{children:[l.jsx(za,{children:"Appearance"}),t&&e.status==="active"&&l.jsxs(be,{size:"xs",variant:"outline",onClick:()=>o(!0),children:[l.jsx(mh,{className:"h-3 w-3"})," Edit"]})]}),l.jsx(Zr,{className:"text-body",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Hy,{agent:e,size:48}),l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsx("span",{className:"text-body",children:"Color"}),l.jsx("span",{className:"mono text-caption text-muted-foreground",children:c})]}),l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsx("span",{className:"text-body",children:"Image"}),l.jsx("span",{className:"mono text-caption text-muted-foreground",children:e.avatarImageUrl?"custom":"none"})]})]})]})}),t&&l.jsx(AF,{agent:e,open:s,onOpenChange:o,onSave:n,onRefresh:a})]})}async function TF(e){const t=URL.createObjectURL(e);try{const n=await new Promise((h,p)=>{const g=new Image;g.onload=()=>h(g),g.onerror=()=>p(new Error("Unable to decode the selected image.")),g.src=t}),a=Math.min(n.naturalWidth,n.naturalHeight),s=Math.max(0,Math.round((n.naturalWidth-a)/2)),o=Math.max(0,Math.round((n.naturalHeight-a)/2)),c=document.createElement("canvas");c.width=jf,c.height=jf;const f=c.getContext("2d");if(!f)throw new Error("Canvas 2D context is unavailable in this browser.");f.drawImage(n,s,o,a,a,0,0,jf,jf);const m=await new Promise(h=>c.toBlob(p=>h(p),"image/webp",.85));if(!m)throw new Error("Failed to encode resized image to WEBP.");return m}finally{URL.revokeObjectURL(t)}}function AF({agent:e,open:t,onOpenChange:n,onSave:a,onRefresh:s}){const o=Ly.find(D=>D===e.avatarColorToken)??null,[c,f]=b.useState(o),[m,h]=b.useState(!1),[p,g]=b.useState(!1),[w,x]=b.useState(null),k=b.useRef(null);b.useEffect(()=>{t&&(f(o),x(null))},[t,o]);async function j(D){D.preventDefault(),x(null),h(!0);try{await a({avatarColorToken:c}),n(!1)}catch(I){x(I instanceof Error?I.message:String(I))}finally{h(!1)}}async function E(D){var R;const I=(R=D.target.files)==null?void 0:R[0];if(k.current&&(k.current.value=""),!!I){x(null),g(!0);try{const F=await TF(I);await E4(e.uuid,F),await(s==null?void 0:s())}catch(F){x(F instanceof Error?F.message:String(F))}finally{g(!1)}}}async function C(){x(null),g(!0);try{await C4(e.uuid),await(s==null?void 0:s())}catch(D){x(D instanceof Error?D.message:String(D))}finally{g(!1)}}const A={...e,avatarColorToken:c},O=!!e.avatarImageUrl;return l.jsx(Cn,{open:t,onOpenChange:n,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:"Edit Appearance"})}),l.jsxs("form",{onSubmit:j,className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(Hy,{agent:A,size:64}),l.jsx(Hy,{agent:A,size:32}),l.jsx("span",{className:"text-caption text-muted-foreground",children:"Preview at 64 / 32 px"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{children:"Image"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("input",{ref:k,type:"file",accept:CF,onChange:E,style:{display:"none"}}),l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{var D;return(D=k.current)==null?void 0:D.click()},disabled:p||m,children:p?"Uploading…":O?"Replace image":"Upload image"}),O&&l.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:C,disabled:p||m,children:"Remove image"})]}),l.jsx("p",{className:"text-caption text-muted-foreground",children:"PNG / JPEG / WEBP. The browser crops to a square and resizes to 256 × 256 WEBP before upload. An image takes precedence over the color below."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{children:"Color"}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx(ak,{label:"Auto",selected:c===null,onClick:()=>f(null),background:$c(null,e.uuid),isAuto:!0}),Ly.map(D=>l.jsx(ak,{label:D,selected:c===D,onClick:()=>f(D),background:`var(--avatar-${D})`},D))]}),l.jsx("p",{className:"text-caption text-muted-foreground",children:`"Auto" falls back to a hash of the agent's id, matching the legacy default. The color is used as the background under the initial when no image is set.`})]}),w&&l.jsx("p",{className:"text-body text-destructive",children:w}),l.jsxs(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:m||p,children:"Cancel"}),l.jsx(be,{type:"submit",disabled:m||p,children:m?"Saving…":"Save"})]})]})]})})}function ak({label:e,selected:t,onClick:n,background:a,isAuto:s}){return l.jsx("button",{type:"button",onClick:n,"aria-pressed":t,title:e,style:{position:"relative",width:32,height:32,borderRadius:"50%",background:a,border:t?"var(--hairline-bold) solid var(--fg)":"var(--hairline) solid var(--border)",cursor:"pointer",padding:0,outline:"none",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s&&l.jsx("span",{"aria-hidden":!0,style:{position:"absolute",inset:4,borderRadius:"50%",background:"var(--bg-raised)",color:"var(--fg-3)",fontSize:10,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:"A"})})}function RF({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 OF(e){const{agent:t}=e,[n,a]=b.useState(!1),[s,o]=b.useState(!1),c=t.displayName||t.name||t.uuid,f=t.status==="suspended";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(Lc,{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(vg,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:l.jsx(be,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):l.jsx(vg,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:l.jsx(be,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),l.jsx(vg,{title:"Delete agent",body:f?"Permanent. Configuration, bindings, tokens, and session history are all dropped.":"Suspend this agent before deleting it.",action:l.jsxs(be,{variant:"destructive",size:"xs",onClick:()=>{f&&a(!0)},disabled:e.deletePending||!f,title:f?void 0:"Suspend this agent before deleting it",children:[l.jsx(Gf,{className:"h-3 w-3"}),"Delete"]})})]}),e.errorMessage&&l.jsx("div",{className:"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)",color:"var(--state-error)"},children:e.errorMessage}),l.jsx(MF,{open:s,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),l.jsx(DF,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function vg(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 MF({open:e,onOpenChange:t,label:n,onConfirm:a,pending:s}){return l.jsx(Cn,{open:e,onOpenChange:t,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsxs(Nn,{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(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:s,children:"Cancel"}),l.jsx(be,{type:"button",variant:"destructive",onClick:a,disabled:s,children:s?"Suspending…":"Suspend"})]})]})})}function DF({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:s}){const[o,c]=b.useState("");function f(m){m.preventDefault(),o===n&&a()}return l.jsx(Cn,{open:e,onOpenChange:m=>{t(m),m||c("")},children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsxs(Nn,{children:['Delete "',n,'"?']})}),l.jsxs("form",{onSubmit:f,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(Zt,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),l.jsxs(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:s,children:"Cancel"}),l.jsx(be,{type:"submit",variant:"destructive",disabled:o!==n||s,children:s?"Deleting…":"Delete"})]})]})]})})}const zF={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 ub({status:e,onEdit:t,onDelete:n,onUndo:a,children:s,disabled:o}){const c=zF[e],f=e==="deleted";return l.jsxs("div",{className:Me("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[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&&(f?l.jsxs(be,{size:"sm",variant:"ghost",onClick:a,children:[l.jsx(JD,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):l.jsxs("div",{className:"flex gap-1 shrink-0",children:[l.jsxs(be,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[l.jsx(mh,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"sr-only",children:"Edit"})]}),l.jsxs(be,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[l.jsx(Gf,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function IF(e){var f;const[t,n]=b.useState(null),[a,s]=b.useState(()=>new Set),o=m=>s(h=>{const p=new Set(h);return p.has(m)?p.delete(m):p.add(m),p}),c=e.items.filter(m=>m.status!=="deleted").length;return l.jsxs(Kn,{children:[l.jsxs(Da,{children:[l.jsxs(za,{children:["Environment variables (",c,")"]}),!e.disabled&&l.jsxs(be,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[l.jsx(wa,{className:"h-3 w-3"})," Add"]})]}),l.jsx(Zr,{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(m=>{const h=m.value.sensitive,p=m.value.value===pc,g=h&&!p&&!!m.value.value,w=a.has(m.key);let x;return h?g&&w?x=m.value.value:x="••••••":x=m.value.value||l.jsx("em",{children:"(empty)"}),l.jsxs(ub,{status:m.status,onEdit:()=>n({mode:"edit",key:m.key,initial:m.value}),onDelete:()=>e.onDelete(m.key),onUndo:()=>e.onUndoDelete(m.key),disabled:e.disabled,children:[l.jsx("span",{className:"font-mono font-medium",children:m.value.key}),l.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:x}),h&&l.jsx(hh,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),h&&l.jsx("button",{type:"button",onClick:()=>g&&o(m.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:g?w?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":w?"Hide value":"Reveal value",disabled:!g,style:{padding:0,opacity:g?1:.4},children:w?l.jsx(ED,{className:"h-3.5 w-3.5"}):l.jsx(HE,{className:"h-3.5 w-3.5"})})]},m.key)})}),t&&l.jsx(UF,{open:!!t,onOpenChange:m=>!m&&n(null),initial:t.mode==="edit"?t.initial:null,allowKeepExisting:t.mode==="edit"&&LF(t.initial,(f=e.items.find(m=>m.key===t.key))==null?void 0:f.status),forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:m=>{t.mode==="edit"?e.onUpdate(t.key,m):e.onAdd(m),n(null)}})]})}function LF(e,t){return e.sensitive&&e.value===pc&&t!==void 0&&t!=="added"}function ik(e,t){return!e||t?"":e.value}function PF(e){return e.sensitive&&e.allowKeepExisting&&!e.value?{ok:!0,value:pc}:e.sensitive&&!e.value?{ok:!1,error:"Value is required for sensitive entries."}:{ok:!0,value:e.value}}function UF({open:e,onOpenChange:t,initial:n,allowKeepExisting:a,forbiddenKeys:s,onSubmit:o}){const[c,f]=b.useState((n==null?void 0:n.key)??""),[m,h]=b.useState(ik(n,a)),[p,g]=b.useState((n==null?void 0:n.sensitive)??!1),[w,x]=b.useState(null);b.useEffect(()=>{e&&(f((n==null?void 0:n.key)??""),h(ik(n,a)),g((n==null?void 0:n.sensitive)??!1),x(null))},[e,n,a]);function k(j){if(j.preventDefault(),!c.match(/^[A-Z][A-Z0-9_]*$/)){x("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(s.has(c)){x(`Another entry already uses key "${c}".`);return}const E=PF({value:m,sensitive:p,allowKeepExisting:a});if(!E.ok){x(E.error);return}if(!p&&!n&&!m){x("Value is required for non-sensitive entries.");return}o({key:c,value:E.value,sensitive:p})}return l.jsx(Cn,{open:e,onOpenChange:t,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:n?"Edit environment variable":"Add environment variable"})}),l.jsxs("form",{onSubmit:k,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"env-key",children:"Key"}),l.jsx(Zt,{id:"env-key",value:c,onChange:j=>f(j.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(dt,{htmlFor:"env-value",children:"Value"}),l.jsx(Zt,{id:"env-value",type:p?"password":"text",autoComplete:"new-password",value:m,onChange:j=>h(j.target.value),placeholder:a?"Leave empty to keep existing value":p?"new secret":"value",className:"font-mono"})]}),l.jsxs("label",{className:"flex items-center gap-2 text-body",children:[l.jsx("input",{type:"checkbox",checked:p,onChange:j=>g(j.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."}),w&&l.jsx("p",{className:"text-body text-destructive",children:w}),l.jsxs(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),l.jsx(be,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function BF(e){const[t,n]=b.useState(null),a=e.items.filter(s=>s.status!=="deleted").length;return l.jsxs(Kn,{children:[l.jsxs(Da,{children:[l.jsxs(za,{children:["Git repositories (",a,")"]}),!e.disabled&&l.jsxs(be,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[l.jsx(wa,{className:"h-3 w-3"})," Add"]})]}),l.jsx(Zr,{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??Jf(s.value.url);return l.jsxs(ub,{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(FF,{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 FF({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:s}){const[o,c]=b.useState((n==null?void 0:n.url)??""),[f,m]=b.useState((n==null?void 0:n.ref)??""),[h,p]=b.useState((n==null?void 0:n.localPath)??""),[g,w]=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)??""),w(null))},[e,n]);function x(k){k.preventDefault();const j=o.trim();if(!j){w("URL is required.");return}const E=h.trim()||Jf(j);if(E&&a.has(E)){w(`Another repo already occupies local path "${E}".`);return}const C={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};s(C)}return l.jsx(Cn,{open:e,onOpenChange:t,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:n?"Edit Git repository":"Add Git repository"})}),l.jsxs("form",{onSubmit:x,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"git-url",children:"URL"}),l.jsx(Zt,{id:"git-url",value:o,onChange:k=>c(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),l.jsx(Zt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"git-path",children:"Local path (optional)"}),l.jsx(Zt,{id:"git-path",value:h,onChange:k=>p(k.target.value),placeholder:Jf(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(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),l.jsx(be,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function x_({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:s="—",className:o,style:c,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return l.jsx("span",{className:Me("mono text-label",o),style:{color:"var(--fg-4)",...c},title:f,children:s});const p=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,w=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:w},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:w},children:["@",e]})]})}function cb(){return je.get(dn("/members"))}function $F(e,t){return je.patch(dn(`/members/${encodeURIComponent(e)}`),t)}function HF(e){return je.delete(dn(`/members/${encodeURIComponent(e)}`))}function w_(){const{data:e}=Ye({queryKey:["members","name-map"],queryFn:cb,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 qF({agent:e,canEdit:t=!0,onSave:n}){const[a,s]=b.useState(!1),o=$v(),c=w_(),f=e.metadata,m=f==null?void 0:f.tree,h=typeof(m==null?void 0:m.role)=="string"?m.role:null,p=Array.isArray(m==null?void 0:m.domains)?(m==null?void 0:m.domains).filter(x=>typeof x=="string"):[],g=e.managerId?c(e.managerId):null,w=e.delegateMention?o(e.delegateMention):null;return l.jsxs(Kn,{children:[l.jsxs(Da,{children:[l.jsx(za,{children:"Profile"}),t&&e.status==="active"&&l.jsxs(be,{size:"xs",variant:"outline",onClick:()=>s(!0),children:[l.jsx(mh,{className:"h-3 w-3"})," Edit"]})]}),l.jsxs(Zr,{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]}),w&&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(x_,{name:w.name,displayName:w.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:g??"—"})]}),h&&l.jsxs("span",{children:["role ",l.jsx("span",{className:"text-foreground",children:h})]}),l.jsxs("span",{children:["type ",l.jsx(dr,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),l.jsxs("span",{children:["visibility"," ",l.jsx(dr,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),p.length>0&&l.jsxs("span",{children:["domains"," ",l.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:p.map(x=>l.jsx(dr,{tone:"outline",children:x},x))})]})]})]}),t&&l.jsx(ZF,{agent:e,open:a,onOpenChange:s,onSave:n})]})}function ZF({agent:e,open:t,onOpenChange:n,onSave:a}){var D;const{memberId:s,role:o}=lt(),[c,f]=b.useState(e.displayName),[m,h]=b.useState(e.delegateMention??""),[p,g]=b.useState(e.visibility),[w,x]=b.useState(!1),[k,j]=b.useState(null);b.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const E=e.type==="human",C=o==="admin"||e.managerId===s,A=Ye({queryKey:["agents-for-delegate"],queryFn:async()=>(await Bc({limit:100})).items.filter(R=>R.type==="personal_assistant"&&R.status==="active"),enabled:t&&E});async function O(I){I.preventDefault(),j(null);const R=c.trim();if(!R){j("Display name is required.");return}x(!0);try{const F={displayName:R,delegateMention:m||null};p!==e.visibility&&(F.visibility=p),await a(F),n(!1)}catch(F){j(F instanceof Error?F.message:String(F))}finally{x(!1)}}return l.jsx(Cn,{open:t,onOpenChange:n,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:"Edit Identity"})}),l.jsxs("form",{onSubmit:O,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{children:"Agent name"}),l.jsx(Zt,{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(dt,{htmlFor:"id-display",children:"Display Name"}),l.jsx(Zt,{id:"id-display",value:c,onChange:I=>f(I.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"id-visibility",children:"Visibility"}),l.jsxs("select",{id:"id-visibility",value:p,onChange:I=>g(I.target.value),disabled:!C,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[l.jsx("option",{value:J1.PRIVATE,children:"Private — only the manager"}),l.jsx("option",{value:J1.ORGANIZATION,children:"Organization — all members"})]}),l.jsx("p",{className:"text-caption text-muted-foreground",children:C?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),E&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"id-delegate",children:"Delegate Mention"}),l.jsxs("select",{id:"id-delegate",value:m,onChange:I=>h(I.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"}),(D=A.data)==null?void 0:D.map(I=>l.jsx("option",{value:I.uuid,children:I.displayName?`${I.displayName} (@${I.name??I.uuid})`:I.name?`@${I.name}`:I.uuid},I.uuid))]}),l.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&l.jsx("p",{className:"text-body text-destructive",children:k}),l.jsxs(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:w,children:"Cancel"}),l.jsx(be,{type:"submit",disabled:w,children:w?"Saving…":"Save"})]})]})]})})}function GF(e){return e==="working"?"accent":e==="error"?"error":"outline"}function VF(e){const[t,n]=b.useState(null),a=e.items.filter(s=>s.status!=="deleted").length;return l.jsxs(Kn,{children:[l.jsxs(Da,{children:[l.jsxs(za,{children:["MCP servers (",a,")"]}),!e.disabled&&l.jsxs(be,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[l.jsx(wa,{className:"h-3 w-3"})," Add"]})]}),l.jsx(Zr,{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=e.toolHealth?s.status==="deleted"?"unknown":e.toolHealth(s.value.name):null;return l.jsxs(ub,{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}),o&&l.jsx(dr,{tone:GF(o),children:o}),l.jsx("span",{className:"text-caption text-muted-foreground truncate",children:QF(s.value)})]},s.key)})}),t&&l.jsx(XF,{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 QF(e){var t;if(e.transport==="stdio"){const n=(t=e.args)!=null&&t.length?` ${e.args.map(a=>/[\s"']/.test(a)?JSON.stringify(a):a).join(" ")}`:"";return`${e.command}${n}`}return e.url}function sk(e){return e!=null&&e.length?JSON.stringify(e,null,2):""}function KF(e){const t=e.trim();if(!t)return{ok:!0,value:void 0};let n;try{n=JSON.parse(t)}catch{return{ok:!1,error:"Args must be a JSON array of strings."}}return!Array.isArray(n)||n.some(a=>typeof a!="string")?{ok:!1,error:"Args must be a JSON array of strings."}:{ok:!0,value:n}}function lk(e){return e&&Object.keys(e).length>0?JSON.stringify(e,null,2):""}function YF(e){const t=e.trim();if(!t)return{ok:!0,value:void 0};let n;try{n=JSON.parse(t)}catch{return{ok:!1,error:"Headers must be a JSON object with string values."}}if(!n||typeof n!="object"||Array.isArray(n))return{ok:!1,error:"Headers must be a JSON object with string values."};const a=Object.entries(n);return a.some(([s,o])=>!s||typeof o!="string")?{ok:!1,error:"Headers must be a JSON object with string values."}:{ok:!0,value:a.length>0?Object.fromEntries(a):void 0}}function XF({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:s}){const[o,c]=b.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=b.useState((n==null?void 0:n.name)??""),[h,p]=b.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,w]=b.useState(sk((n==null?void 0:n.transport)==="stdio"?n.args:void 0)),[x,k]=b.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=b.useState(lk(n&&(n.transport==="http"||n.transport==="sse")?n.headers:void 0)),[C,A]=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:""),w(sk((n==null?void 0:n.transport)==="stdio"?n.args:void 0)),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),E(lk(n&&(n.transport==="http"||n.transport==="sse")?n.headers:void 0)),A(null))},[e,n]);function O(D){if(D.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){A("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){A(`Another MCP server is already named "${f}".`);return}let I;if(o==="stdio"){if(!h.trim()){A("stdio transport requires a command.");return}const R=KF(g);if(!R.ok){A(R.error);return}I={name:f,transport:"stdio",command:h.trim(),...R.value?{args:R.value}:{}}}else{const R=x.trim();try{new URL(R)}catch{A("URL is not valid.");return}const F=YF(j);if(!F.ok){A(F.error);return}I={name:f,transport:o,url:R,...F.value?{headers:F.value}:{}}}s(I)}return l.jsx(Cn,{open:e,onOpenChange:t,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:n?"Edit MCP server":"Add MCP server"})}),l.jsxs("form",{onSubmit:O,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"mcp-transport",children:"Transport"}),l.jsxs("select",{id:"mcp-transport",value:o,onChange:D=>c(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:"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(dt,{htmlFor:"mcp-name",children:"Name"}),l.jsx(Zt,{id:"mcp-name",value:f,onChange:D=>m(D.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"mcp-command",children:"Command"}),l.jsx(Zt,{id:"mcp-command",value:h,onChange:D=>p(D.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"mcp-args",children:"Args (JSON array, optional)"}),l.jsx("p",{className:"text-caption text-muted-foreground",children:"Each arg as a separate JSON string. Use this when an arg contains spaces or quotes."}),l.jsx("textarea",{id:"mcp-args",value:g,onChange:D=>w(D.target.value),placeholder:'["--port", "3000"]',className:"flex min-h-24 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body font-mono shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"})]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"mcp-url",children:"URL"}),l.jsx(Zt,{id:"mcp-url",value:x,onChange:D=>k(D.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"mcp-headers",children:"Headers (JSON object, optional)"}),l.jsx("p",{className:"text-caption text-muted-foreground",children:"JSON object of request headers, for example auth headers required by the MCP server."}),l.jsx("textarea",{id:"mcp-headers",value:j,onChange:D=>E(D.target.value),placeholder:'{"Authorization": "Bearer ..."}',className:"flex min-h-24 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body font-mono shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"})]})]}),C&&l.jsx("p",{className:"text-body text-destructive",children:C}),l.jsxs(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),l.jsx(be,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const WF=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],JF=[{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"}],e$={"claude-code":WF,codex:JF},t$={"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."},n$={value:"",label:"(unset — inherits local)"};function r$({value:e,baseline:t,onChange:n,onRevert:a,disabled:s,provider:o="claude-code"}){const c=e!==t,f=e$[o],m=b.useMemo(()=>{const h=[n$,...f];return e!==""&&!f.some(p=>p.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return l.jsxs(Kn,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[l.jsxs(Da,{children:[l.jsxs(za,{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(be,{size:"xs",variant:"ghost",onClick:a,disabled:s,children:"Revert"})]}),l.jsxs(Zr,{className:"space-y-2",children:[l.jsx(a$,{items:m,value:e,onChange:n,disabled:s}),l.jsx("p",{className:"text-caption text-muted-foreground",children:t$[o]})]})]})}function a$({items:e,value:t,onChange:n,disabled:a}){const[s,o]=b.useState(!1),[c,f]=b.useState(null),m=b.useRef(null),h=b.useRef(null),p=e.find(w=>w.value===t)??e[0],g=b.useCallback(()=>{const w=m.current;if(!w)return;const x=w.getBoundingClientRect();f({top:x.bottom+4,left:x.left,width:x.width})},[]);return b.useLayoutEffect(()=>{s&&g()},[s,g]),b.useEffect(()=>{if(!s)return;const w=j=>{var C,A;const E=j.target;(C=m.current)!=null&&C.contains(E)||(A=h.current)!=null&&A.contains(E)||o(!1)},x=j=>{var E;j.key==="Escape"&&(o(!1),(E=m.current)==null||E.focus())},k=()=>g();return document.addEventListener("pointerdown",w),document.addEventListener("keydown",x),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",w),document.removeEventListener("keydown",x),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[s,g]),l.jsxs("div",{className:"max-w-md",children:[l.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(w=>!w),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(_v,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:s?"rotate(180deg)":void 0}})]}),s&&c&&zv.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(w=>{const x=w.value===t;return l.jsxs("button",{type:"button",onClick:()=>{n(w.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:x?"var(--bg-hover)":void 0,color:w.value===""?"var(--fg-3)":void 0},children:[l.jsx(fr,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:x?"visible":"hidden",color:"var(--state-idle)"}}),l.jsx("span",{className:"flex-1 truncate",children:w.label}),w.hint&&l.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:w.hint})]},w.value||"__unset")})}),document.body)]})}function i$(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const s$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o$={};function ok(e,t){return(o$.jsx?l$:s$).test(e)}const u$=/[ \t\n\f\r]/g;function c$(e){return typeof e=="object"?e.type==="text"?uk(e.value):!1:uk(e)}function uk(e){return e.replace(u$,"")===""}class qc{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}qc.prototype.normal={};qc.prototype.property={};qc.prototype.space=void 0;function S_(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new qc(n,a,t)}function qy(e){return e.toLowerCase()}class Or{constructor(t,n){this.attribute=n,this.property=t}}Or.prototype.attribute="";Or.prototype.booleanish=!1;Or.prototype.boolean=!1;Or.prototype.commaOrSpaceSeparated=!1;Or.prototype.commaSeparated=!1;Or.prototype.defined=!1;Or.prototype.mustUseProperty=!1;Or.prototype.number=!1;Or.prototype.overloadedBoolean=!1;Or.prototype.property="";Or.prototype.spaceSeparated=!1;Or.prototype.space=void 0;let d$=0;const rt=ul(),kn=ul(),Zy=ul(),Se=ul(),$t=ul(),lo=ul(),Br=ul();function ul(){return 2**++d$}const Gy=Object.freeze(Object.defineProperty({__proto__:null,boolean:rt,booleanish:kn,commaOrSpaceSeparated:Br,commaSeparated:lo,number:Se,overloadedBoolean:Zy,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),bg=Object.keys(Gy);class db extends Or{constructor(t,n,a,s){let o=-1;if(super(t,n),ck(this,"space",s),typeof a=="number")for(;++o<bg.length;){const c=bg[o];ck(this,bg[o],(a&Gy[c])===Gy[c])}}}db.prototype.defined=!0;function ck(e,t,n){n&&(e[t]=n)}function Do(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const o=new db(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[qy(a)]=a,n[qy(o.attribute)]=a}return new qc(t,n,e.space)}const k_=Do({properties:{ariaActiveDescendant:null,ariaAtomic:kn,ariaAutoComplete:null,ariaBusy:kn,ariaChecked:kn,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:kn,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:kn,ariaFlowTo:$t,ariaGrabbed:kn,ariaHasPopup:null,ariaHidden:kn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:Se,ariaLive:null,ariaModal:kn,ariaMultiLine:kn,ariaMultiSelectable:kn,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:kn,ariaReadOnly:kn,ariaRelevant:null,ariaRequired:kn,ariaRoleDescription:$t,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:kn,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 j_(e,t){return t in e?e[t]:t}function E_(e,t){return j_(e,t.toLowerCase())}const f$=Do({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:lo,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:rt,allowPaymentRequest:rt,allowUserMedia:rt,alt:null,as:null,async:rt,autoCapitalize:null,autoComplete:$t,autoFocus:rt,autoPlay:rt,blocking:$t,capture:null,charSet:null,checked:rt,cite:null,className:$t,cols:Se,colSpan:null,content:null,contentEditable:kn,controls:rt,controlsList:$t,coords:Se|lo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:rt,defer:rt,dir:null,dirName:null,disabled:rt,download:Zy,draggable:kn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:rt,formTarget:null,headers:$t,height:Se,hidden:Zy,high:Se,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:rt,inputMode:null,integrity:null,is:null,isMap:rt,itemId:null,itemProp:$t,itemRef:$t,itemScope:rt,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:rt,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:rt,muted:rt,name:null,nonce:null,noModule:rt,noValidate:rt,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:rt,optimum:Se,pattern:null,ping:$t,placeholder:null,playsInline:rt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:rt,referrerPolicy:null,rel:$t,required:rt,reversed:rt,rows:Se,rowSpan:Se,sandbox:$t,scope:null,scoped:rt,seamless:rt,selected:rt,shadowRootClonable:rt,shadowRootDelegatesFocus:rt,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:kn,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:rt,useMap:null,value:kn,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,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:rt,declare:rt,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:rt,noHref:rt,noShade:rt,noWrap:rt,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:kn,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:rt,disableRemotePlayback:rt,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:E_}),h$=Do({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:Br,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:$t,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:rt,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:lo,g2:lo,glyphName:lo,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:Br,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:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Br,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Br,rev:Br,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Br,requiredFeatures:Br,requiredFonts:Br,requiredFormats:Br,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:Br,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:Br,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:Br,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:j_}),C_=Do({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()}}),N_=Do({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:E_}),__=Do({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),m$={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"},p$=/[A-Z]/g,dk=/-[a-z]/g,g$=/^data[-\w.:]+$/i;function y$(e,t){const n=qy(t);let a=t,s=Or;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&g$.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(dk,b$);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!dk.test(o)){let c=o.replace(p$,v$);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}s=db}return new s(a,t)}function v$(e){return"-"+e.toLowerCase()}function b$(e){return e.charAt(1).toUpperCase()}const x$=S_([k_,f$,C_,N_,__],"html"),fb=S_([k_,h$,C_,N_,__],"svg");function w$(e){return e.join(" ").trim()}var Gl={},xg,fk;function S$(){if(fk)return xg;fk=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
383
|
+
`,h="/",p="*",g="",w="comment",x="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var A=1,O=1;function D(X){var W=X.match(t);W&&(A+=W.length);var G=X.lastIndexOf(m);O=~G?X.length-G:O+X.length}function I(){var X={line:A,column:O};return function(W){return W.position=new R(X),te(),W}}function R(X){this.start=X,this.end={line:A,column:O},this.source=C.source}R.prototype.content=E;function F(X){var W=new Error(C.source+":"+A+":"+O+": "+X);if(W.reason=X,W.filename=C.source,W.line=A,W.column=O,W.source=E,!C.silent)throw W}function P(X){var W=X.exec(E);if(W){var G=W[0];return D(G),E=E.slice(G.length),W}}function te(){P(n)}function z(X){var W;for(X=X||[];W=L();)W!==!1&&X.push(W);return X}function L(){var X=I();if(!(h!=E.charAt(0)||p!=E.charAt(1))){for(var W=2;g!=E.charAt(W)&&(p!=E.charAt(W)||h!=E.charAt(W+1));)++W;if(W+=2,g===E.charAt(W-1))return F("End of comment missing");var G=E.slice(2,W-2);return O+=2,D(G),E=E.slice(W),O+=2,X({type:w,comment:G})}}function Q(){var X=I(),W=P(a);if(W){if(L(),!P(s))return F("property missing ':'");var G=P(o),se=X({type:x,property:j(W[0].replace(e,g)),value:G?j(G[0].replace(e,g)):g});return P(c),se}}function ce(){var X=[];z(X);for(var W;W=Q();)W!==!1&&(X.push(W),z(X));return X}return te(),ce()}function j(E){return E?E.replace(f,g):g}return xg=k,xg}var hk;function k$(){if(hk)return Gl;hk=1;var e=Gl&&Gl.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.default=n;const t=e(S$());function n(a,s){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof s=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:p}=m;f?s(h,p,m):p&&(o=o||{},o[h]=p)}),o}return Gl}var Fu={},mk;function j$(){if(mk)return Fu;mk=1,Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.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()},f=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,f):h=h.replace(a,f),h.replace(t,c))};return Fu.camelCase=m,Fu}var $u,pk;function E$(){if(pk)return $u;pk=1;var e=$u&&$u.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(k$()),n=j$();function a(s,o){var c={};return!s||typeof s!="string"||(0,t.default)(s,function(f,m){f&&m&&(c[(0,n.camelCase)(f,o)]=m)}),c}return a.default=a,$u=a,$u}var C$=E$();const N$=uh(C$),T_=A_("end"),hb=A_("start");function A_(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 _$(e){const t=hb(e),n=T_(e);if(t&&n)return{start:t,end:n}}function rc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?gk(e.position):"start"in e||"end"in e?gk(e):"line"in e||"column"in e?Vy(e):""}function Vy(e){return yk(e&&e.line)+":"+yk(e&&e.column)}function gk(e){return Vy(e&&e.start)+"-"+Vy(e&&e.end)}function yk(e){return e&&typeof e=="number"?e:1}class ar 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 f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=rc(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}}ar.prototype.file="";ar.prototype.name="";ar.prototype.reason="";ar.prototype.message="";ar.prototype.stack="";ar.prototype.column=void 0;ar.prototype.line=void 0;ar.prototype.ancestors=void 0;ar.prototype.cause=void 0;ar.prototype.fatal=void 0;ar.prototype.place=void 0;ar.prototype.ruleId=void 0;ar.prototype.source=void 0;const mb={}.hasOwnProperty,T$=new Map,A$=/[A-Z]/g,R$=new Set(["table","tbody","thead","tfoot","tr"]),O$=new Set(["td","th"]),R_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function M$(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=F$(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=B$(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"?fb:x$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=O_(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function O_(e,t,n){if(t.type==="element")return D$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return z$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return L$(e,t,n);if(t.type==="mdxjsEsm")return I$(e,t);if(t.type==="root")return P$(e,t,n);if(t.type==="text")return U$(e,t)}function D$(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=fb,e.schema=s),e.ancestors.push(t);const o=D_(e,t.tagName,!1),c=$$(e,t);let f=gb(e,t);return R$.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!c$(m):!0})),M_(e,c,o,t),pb(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function z$(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)}bc(e,t.position)}function I$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bc(e,t.position)}function L$(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=fb,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:D_(e,t.name,!0),c=H$(e,t),f=gb(e,t);return M_(e,c,o,t),pb(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function P$(e,t,n){const a={};return pb(a,gb(e,t)),e.create(t,e.Fragment,a,n)}function U$(e,t){return t.value}function M_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function pb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function B$(e,t,n){return a;function a(s,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function F$(e,t){return n;function n(a,s,o,c){const f=Array.isArray(o.children),m=hb(a);return t(s,o,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function $$(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&mb.call(t.properties,s)){const o=q$(e,s,t.properties[s]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&O$.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function H$(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else bc(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 f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else bc(e,t.position);else o=a.value===null?!0:a.value;n[s]=o}return n}function gb(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:T$;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 f=O_(e,o,c);f!==void 0&&n.push(f)}return n}function q$(e,t,n){const a=y$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?i$(n):w$(n)),a.property==="style"){let s=typeof n=="object"?n:Z$(e,String(n));return e.stylePropertyNameCase==="css"&&(s=G$(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?m$[a.property]||a.property:a.attribute,n]}}function Z$(e,t){try{return N$(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new ar("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=R_+"#cannot-parse-style-attribute",s}}function D_(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 f=ok(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=ok(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return mb.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);bc(e)}function bc(e,t){const n=new ar("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=R_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function G$(e){const t={};let n;for(n in e)mb.call(e,n)&&(t[V$(n)]=e[n]);return t}function V$(e){let t=e.replace(A$,Q$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Q$(e){return"-"+e.toLowerCase()}const wg={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"]},K$={};function yb(e,t){const n=K$,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return z_(e,a,s)}function z_(e,t,n){if(Y$(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 vk(e.children,t,n)}return Array.isArray(e)?vk(e,t,n):""}function vk(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=z_(e[s],t,n);return a.join("")}function Y$(e){return!!(e&&typeof e=="object")}const bk=document.createElement("i");function vb(e){const t="&"+e+";";bk.innerHTML=t;const n=bk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Hr(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 la(e,t){return e.length>0?(Hr(e,e.length,0,t),e):t}const xk={}.hasOwnProperty;function I_(e){const t={};let n=-1;for(;++n<e.length;)X$(t,e[n]);return t}function X$(e,t){let n;for(n in t){const s=(xk.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){xk.call(s,c)||(s[c]=[]);const f=o[c];W$(s[c],Array.isArray(f)?f:f?[f]:[])}}}function W$(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Hr(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 xa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cr=ks(/[A-Za-z]/),nr=ks(/[\dA-Za-z]/),J$=ks(/[#-'*+\--9=?A-Z^-~]/);function nh(e){return e!==null&&(e<32||e===127)}const Qy=ks(/\d/),e8=ks(/[\dA-Fa-f]/),t8=ks(/[!-/:-@[-`{-~]/);function Ze(e){return e!==null&&e<-2}function Bt(e){return e!==null&&(e<0||e===32)}function ft(e){return e===-2||e===-1||e===32}const Oh=ks(new RegExp("\\p{P}|\\p{S}","u")),al=ks(/\s/);function ks(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zo(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&nr(e.charCodeAt(n+1))&&nr(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 f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),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 kt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return ft(m)?(e.enter(n),f(m)):t(m)}function f(m){return ft(m)&&o++<s?(e.consume(m),f):(e.exit(n),t(m))}}const n8={tokenize:r8};function r8(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),kt(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ze(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const a8={tokenize:i8},wk={tokenize:s8};function i8(e){const t=this,n=[];let a=0,s,o,c;return f;function f(O){if(a<n.length){const D=n[a];return t.containerState=D[1],e.attempt(D[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const D=t.events.length;let I=D,R;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){R=t.events[I][1].end;break}C(a);let F=D;for(;F<t.events.length;)t.events[F][1].end={...R},F++;return Hr(t.events,I+1,0,t.events.slice(D)),t.events.length=F,h(O)}return f(O)}function h(O){if(a===n.length){if(!s)return w(O);if(s.currentConstruct&&s.currentConstruct.concrete)return k(O);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wk,p,g)(O)}function p(O){return s&&A(),C(a),w(O)}function g(O){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,k(O)}function w(O){return t.containerState={},e.attempt(wk,x,k)(O)}function x(O){return a++,n.push([t.currentConstruct,t.containerState]),w(O)}function k(O){if(O===null){s&&A(),C(0),e.consume(O);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(O);return}return Ze(O)?(e.consume(O),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,D){const I=t.sliceStream(O);if(D&&I.push(null),O.previous=o,o&&(o.next=O),o=O,s.defineSkip(O.start),s.write(I),t.parser.lazy[O.start.line]){let R=s.events.length;for(;R--;)if(s.events[R][1].start.offset<c&&(!s.events[R][1].end||s.events[R][1].end.offset>c))return;const F=t.events.length;let P=F,te,z;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(te){z=t.events[P][1].end;break}te=!0}for(C(a),R=F;R<t.events.length;)t.events[R][1].end={...z},R++;Hr(t.events,P+1,0,t.events.slice(F)),t.events.length=R}}function C(O){let D=n.length;for(;D-- >O;){const I=n[D];t.containerState=I[1],I[0].exit.call(t,e)}n.length=O}function A(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function s8(e,t,n){return kt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Co(e){if(e===null||Bt(e)||al(e))return 1;if(Oh(e))return 2}function Mh(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 Ky={name:"attention",resolveAll:l8,tokenize:o8};function l8(e,t){let n=-1,a,s,o,c,f,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},w={...e[n][1].start};Sk(g,-m),Sk(w,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:w},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:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=la(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=la(h,[["enter",s,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=la(h,Mh(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=la(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=la(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Hr(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 o8(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=Co(a);let o;return c;function c(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),p=Co(m),g=!p||p===2&&s||n.includes(m),w=!s||s===2&&p||n.includes(a);return h._open=!!(o===42?g:g&&(s||!w)),h._close=!!(o===42?w:w&&(p||!g)),t(m)}}function Sk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const u8={name:"autolink",tokenize:c8};function c8(e,t,n){let a=0;return s;function s(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return cr(x)?(e.consume(x),c):x===64?n(x):h(x)}function c(x){return x===43||x===45||x===46||nr(x)?(a=1,f(x)):h(x)}function f(x){return x===58?(e.consume(x),a=0,m):(x===43||x===45||x===46||nr(x))&&a++<32?(e.consume(x),f):(a=0,h(x))}function m(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||nh(x)?n(x):(e.consume(x),m)}function h(x){return x===64?(e.consume(x),p):J$(x)?(e.consume(x),h):n(x)}function p(x){return nr(x)?g(x):n(x)}function g(x){return x===46?(e.consume(x),a=0,p):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):w(x)}function w(x){if((x===45||nr(x))&&a++<63){const k=x===45?w:g;return e.consume(x),k}return n(x)}}const Zc={partial:!0,tokenize:d8};function d8(e,t,n){return a;function a(o){return ft(o)?kt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||Ze(o)?t(o):n(o)}}const P_={continuation:{tokenize:h8},exit:m8,name:"blockQuote",tokenize:f8};function f8(e,t,n){const a=this;return s;function s(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return ft(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function h8(e,t,n){const a=this;return s;function s(c){return ft(c)?kt(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(P_,t,n)(c)}}function m8(e){e.exit("blockQuote")}const U_={name:"characterEscape",tokenize:p8};function p8(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 t8(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const B_={name:"characterReference",tokenize:g8};function g8(e,t,n){const a=this;let s=0,o,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=nr,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=e8,p):(e.enter("characterReferenceValue"),o=7,c=Qy,p(g))}function p(g){if(g===59&&s){const w=e.exit("characterReferenceValue");return c===nr&&!vb(a.sliceSerialize(w))?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 kk={partial:!0,tokenize:v8},jk={concrete:!0,name:"codeFenced",tokenize:y8};function y8(e,t,n){const a=this,s={partial:!0,tokenize:I};let o=0,c=0,f;return m;function m(R){return h(R)}function h(R){const F=a.events[a.events.length-1];return o=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(R)}function p(R){return R===f?(c++,e.consume(R),p):c<3?n(R):(e.exit("codeFencedFenceSequence"),ft(R)?kt(e,g,"whitespace")(R):g(R))}function g(R){return R===null||Ze(R)?(e.exit("codeFencedFence"),a.interrupt?t(R):e.check(kk,j,D)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),w(R))}function w(R){return R===null||Ze(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(R)):ft(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),kt(e,x,"whitespace")(R)):R===96&&R===f?n(R):(e.consume(R),w)}function x(R){return R===null||Ze(R)?g(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||Ze(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(R)):R===96&&R===f?n(R):(e.consume(R),k)}function j(R){return e.attempt(s,D,E)(R)}function E(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),C}function C(R){return o>0&&ft(R)?kt(e,A,"linePrefix",o+1)(R):A(R)}function A(R){return R===null||Ze(R)?e.check(kk,j,D)(R):(e.enter("codeFlowValue"),O(R))}function O(R){return R===null||Ze(R)?(e.exit("codeFlowValue"),A(R)):(e.consume(R),O)}function D(R){return e.exit("codeFenced"),t(R)}function I(R,F,P){let te=0;return z;function z(W){return R.enter("lineEnding"),R.consume(W),R.exit("lineEnding"),L}function L(W){return R.enter("codeFencedFence"),ft(W)?kt(R,Q,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):Q(W)}function Q(W){return W===f?(R.enter("codeFencedFenceSequence"),ce(W)):P(W)}function ce(W){return W===f?(te++,R.consume(W),ce):te>=c?(R.exit("codeFencedFenceSequence"),ft(W)?kt(R,X,"whitespace")(W):X(W)):P(W)}function X(W){return W===null||Ze(W)?(R.exit("codeFencedFence"),F(W)):P(W)}}}function v8(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 Sg={name:"codeIndented",tokenize:x8},b8={partial:!0,tokenize:w8};function x8(e,t,n){const a=this;return s;function s(h){return e.enter("codeIndented"),kt(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):Ze(h)?e.attempt(b8,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Ze(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function w8(e,t,n){const a=this;return s;function s(c){return a.parser.lazy[a.now().line]?n(c):Ze(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):kt(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Ze(c)?s(c):n(c)}}const S8={name:"codeText",previous:j8,resolve:k8,tokenize:E8};function k8(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 j8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function E8(e,t,n){let a=0,s,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),s=0,p(g)):Ze(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Ze(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function 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 C8{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&&Hu(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),Hu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hu(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);Hu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Hu(this.left,n.reverse())}}}function Hu(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 F_(e){const t={};let n=-1,a,s,o,c,f,m,h;const p=new C8(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,N8(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},f=p.slice(s,n),f.unshift(a),p.splice(s,n-s+1,f))}}return Hr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function N8(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 f=c.events,m=[],h={};let p,g,w=-1,x=n,k=0,j=0;const E=[j];for(;x;){for(;e.get(++s)[1]!==x;);o.push(s),x._tokenizer||(p=a.sliceStream(x),x.next||p.push(null),g&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=x,x=x.next}for(x=n;++w<f.length;)f[w][0]==="exit"&&f[w-1][0]==="enter"&&f[w][1].type===f[w-1][1].type&&f[w][1].start.line!==f[w][1].end.line&&(j=w+1,E.push(j),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):E.pop(),w=E.length;w--;){const C=f.slice(E[w],E[w+1]),A=o.pop();m.push([A,A+C.length-1]),e.splice(A,2,C)}for(m.reverse(),w=-1;++w<m.length;)h[k+m[w][0]]=k+m[w][1],k+=m[w][1]-m[w][0]-1;return h}const _8={resolve:A8,tokenize:R8},T8={partial:!0,tokenize:O8};function A8(e){return F_(e),e}function R8(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):Ze(f)?e.check(T8,c,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function O8(e,t,n){const a=this;return s;function s(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),kt(e,o,"linePrefix")}function o(c){if(c===null||Ze(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function $_(e,t,n,a,s,o,c,f,m){const h=m||Number.POSITIVE_INFINITY;let p=0;return g;function g(C){return C===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(C),e.exit(o),w):C===null||C===32||C===41||nh(C)?n(C):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function w(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(s),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===62?(e.exit("chunkString"),e.exit(f),w(C)):C===null||C===60||Ze(C)?n(C):(e.consume(C),C===92?k:x)}function k(C){return C===60||C===62||C===92?(e.consume(C),x):x(C)}function j(C){return!p&&(C===null||C===41||Bt(C))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(C)):p<h&&C===40?(e.consume(C),p++,j):C===41?(e.consume(C),p--,j):C===null||C===32||C===40||nh(C)?n(C):(e.consume(C),C===92?E:j)}function E(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function H_(e,t,n,a,s,o){const c=this;let f=0,m;return h;function h(x){return e.enter(a),e.enter(s),e.consume(x),e.exit(s),e.enter(o),p}function p(x){return f>999||x===null||x===91||x===93&&!m||x===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(x):x===93?(e.exit(o),e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):Ze(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||Ze(x)||f++>999?(e.exit("chunkString"),p(x)):(e.consume(x),m||(m=!ft(x)),x===92?w:g)}function w(x){return x===91||x===92||x===93?(e.consume(x),f++,g):g(x)}}function q_(e,t,n,a,s,o){let c;return f;function f(w){return w===34||w===39||w===40?(e.enter(a),e.enter(s),e.consume(w),e.exit(s),c=w===40?41:w,m):n(w)}function m(w){return w===c?(e.enter(s),e.consume(w),e.exit(s),e.exit(a),t):(e.enter(o),h(w))}function h(w){return w===c?(e.exit(o),m(c)):w===null?n(w):Ze(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),kt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===c||w===null||Ze(w)?(e.exit("chunkString"),h(w)):(e.consume(w),w===92?g:p)}function g(w){return w===c||w===92?(e.consume(w),p):p(w)}}function ac(e,t){let n;return a;function a(s){return Ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):ft(s)?kt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const M8={name:"definition",tokenize:z8},D8={partial:!0,tokenize:I8};function z8(e,t,n){const a=this;let s;return o;function o(x){return e.enter("definition"),c(x)}function c(x){return H_.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function f(x){return s=xa(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),m):n(x)}function m(x){return Bt(x)?ac(e,h)(x):h(x)}function h(x){return $_(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function p(x){return e.attempt(D8,g,g)(x)}function g(x){return ft(x)?kt(e,w,"whitespace")(x):w(x)}function w(x){return x===null||Ze(x)?(e.exit("definition"),a.parser.defined.push(s),t(x)):n(x)}}function I8(e,t,n){return a;function a(f){return Bt(f)?ac(e,s)(f):n(f)}function s(f){return q_(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return ft(f)?kt(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Ze(f)?t(f):n(f)}}const L8={name:"hardBreakEscape",tokenize:P8};function P8(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const U8={name:"headingAtx",resolve:B8,tokenize:F8};function B8(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"},Hr(e,a,n-a+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function F8(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||Bt(p)?(e.exit("atxHeadingSequence"),f(p)):n(p)}function f(p){return p===35?(e.enter("atxHeadingSequence"),m(p)):p===null||Ze(p)?(e.exit("atxHeading"),t(p)):ft(p)?kt(e,f,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function m(p){return p===35?(e.consume(p),m):(e.exit("atxHeadingSequence"),f(p))}function h(p){return p===null||p===35||Bt(p)?(e.exit("atxHeadingText"),f(p)):(e.consume(p),h)}}const $8=["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"],Ek=["pre","script","style","textarea"],H8={concrete:!0,name:"htmlFlow",resolveTo:G8,tokenize:V8},q8={partial:!0,tokenize:K8},Z8={partial:!0,tokenize:Q8};function G8(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 V8(e,t,n){const a=this;let s,o,c,f,m;return h;function h(_){return p(_)}function p(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),g}function g(_){return _===33?(e.consume(_),w):_===47?(e.consume(_),o=!0,j):_===63?(e.consume(_),s=3,a.interrupt?t:M):cr(_)?(e.consume(_),c=String.fromCharCode(_),E):n(_)}function w(_){return _===45?(e.consume(_),s=2,x):_===91?(e.consume(_),s=5,f=0,k):cr(_)?(e.consume(_),s=4,a.interrupt?t:M):n(_)}function x(_){return _===45?(e.consume(_),a.interrupt?t:M):n(_)}function k(_){const V="CDATA[";return _===V.charCodeAt(f++)?(e.consume(_),f===V.length?a.interrupt?t:Q:k):n(_)}function j(_){return cr(_)?(e.consume(_),c=String.fromCharCode(_),E):n(_)}function E(_){if(_===null||_===47||_===62||Bt(_)){const V=_===47,Z=c.toLowerCase();return!V&&!o&&Ek.includes(Z)?(s=1,a.interrupt?t(_):Q(_)):$8.includes(c.toLowerCase())?(s=6,V?(e.consume(_),C):a.interrupt?t(_):Q(_)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(_):o?A(_):O(_))}return _===45||nr(_)?(e.consume(_),c+=String.fromCharCode(_),E):n(_)}function C(_){return _===62?(e.consume(_),a.interrupt?t:Q):n(_)}function A(_){return ft(_)?(e.consume(_),A):z(_)}function O(_){return _===47?(e.consume(_),z):_===58||_===95||cr(_)?(e.consume(_),D):ft(_)?(e.consume(_),O):z(_)}function D(_){return _===45||_===46||_===58||_===95||nr(_)?(e.consume(_),D):I(_)}function I(_){return _===61?(e.consume(_),R):ft(_)?(e.consume(_),I):O(_)}function R(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),m=_,F):ft(_)?(e.consume(_),R):P(_)}function F(_){return _===m?(e.consume(_),m=null,te):_===null||Ze(_)?n(_):(e.consume(_),F)}function P(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||Bt(_)?I(_):(e.consume(_),P)}function te(_){return _===47||_===62||ft(_)?O(_):n(_)}function z(_){return _===62?(e.consume(_),L):n(_)}function L(_){return _===null||Ze(_)?Q(_):ft(_)?(e.consume(_),L):n(_)}function Q(_){return _===45&&s===2?(e.consume(_),G):_===60&&s===1?(e.consume(_),se):_===62&&s===4?(e.consume(_),U):_===63&&s===3?(e.consume(_),M):_===93&&s===5?(e.consume(_),ve):Ze(_)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(q8,B,ce)(_)):_===null||Ze(_)?(e.exit("htmlFlowData"),ce(_)):(e.consume(_),Q)}function ce(_){return e.check(Z8,X,B)(_)}function X(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),W}function W(_){return _===null||Ze(_)?ce(_):(e.enter("htmlFlowData"),Q(_))}function G(_){return _===45?(e.consume(_),M):Q(_)}function se(_){return _===47?(e.consume(_),c="",ee):Q(_)}function ee(_){if(_===62){const V=c.toLowerCase();return Ek.includes(V)?(e.consume(_),U):Q(_)}return cr(_)&&c.length<8?(e.consume(_),c+=String.fromCharCode(_),ee):Q(_)}function ve(_){return _===93?(e.consume(_),M):Q(_)}function M(_){return _===62?(e.consume(_),U):_===45&&s===2?(e.consume(_),M):Q(_)}function U(_){return _===null||Ze(_)?(e.exit("htmlFlowData"),B(_)):(e.consume(_),U)}function B(_){return e.exit("htmlFlow"),t(_)}}function Q8(e,t,n){const a=this;return s;function s(c){return Ze(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function K8(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Zc,t,n)}}const Y8={name:"htmlText",tokenize:X8};function X8(e,t,n){const a=this;let s,o,c;return f;function f(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),I):M===63?(e.consume(M),O):cr(M)?(e.consume(M),P):n(M)}function h(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),o=0,k):cr(M)?(e.consume(M),A):n(M)}function p(M){return M===45?(e.consume(M),x):n(M)}function g(M){return M===null?n(M):M===45?(e.consume(M),w):Ze(M)?(c=g,se(M)):(e.consume(M),g)}function w(M){return M===45?(e.consume(M),x):g(M)}function x(M){return M===62?G(M):M===45?w(M):g(M)}function k(M){const U="CDATA[";return M===U.charCodeAt(o++)?(e.consume(M),o===U.length?j:k):n(M)}function j(M){return M===null?n(M):M===93?(e.consume(M),E):Ze(M)?(c=j,se(M)):(e.consume(M),j)}function E(M){return M===93?(e.consume(M),C):j(M)}function C(M){return M===62?G(M):M===93?(e.consume(M),C):j(M)}function A(M){return M===null||M===62?G(M):Ze(M)?(c=A,se(M)):(e.consume(M),A)}function O(M){return M===null?n(M):M===63?(e.consume(M),D):Ze(M)?(c=O,se(M)):(e.consume(M),O)}function D(M){return M===62?G(M):O(M)}function I(M){return cr(M)?(e.consume(M),R):n(M)}function R(M){return M===45||nr(M)?(e.consume(M),R):F(M)}function F(M){return Ze(M)?(c=F,se(M)):ft(M)?(e.consume(M),F):G(M)}function P(M){return M===45||nr(M)?(e.consume(M),P):M===47||M===62||Bt(M)?te(M):n(M)}function te(M){return M===47?(e.consume(M),G):M===58||M===95||cr(M)?(e.consume(M),z):Ze(M)?(c=te,se(M)):ft(M)?(e.consume(M),te):G(M)}function z(M){return M===45||M===46||M===58||M===95||nr(M)?(e.consume(M),z):L(M)}function L(M){return M===61?(e.consume(M),Q):Ze(M)?(c=L,se(M)):ft(M)?(e.consume(M),L):te(M)}function Q(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),s=M,ce):Ze(M)?(c=Q,se(M)):ft(M)?(e.consume(M),Q):(e.consume(M),X)}function ce(M){return M===s?(e.consume(M),s=void 0,W):M===null?n(M):Ze(M)?(c=ce,se(M)):(e.consume(M),ce)}function X(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Bt(M)?te(M):(e.consume(M),X)}function W(M){return M===47||M===62||Bt(M)?te(M):n(M)}function G(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function se(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),ee}function ee(M){return ft(M)?kt(e,ve,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):ve(M)}function ve(M){return e.enter("htmlTextData"),c(M)}}const bb={name:"labelEnd",resolveAll:tH,resolveTo:nH,tokenize:rH},W8={tokenize:aH},J8={tokenize:iH},eH={tokenize:sH};function tH(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&&Hr(e,0,e.length,n),e}function nH(e,t){let n=e.length,a=0,s,o,c,f;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 f=[["enter",m,t],["enter",h,t]],f=la(f,e.slice(o+1,o+a+3)),f=la(f,[["enter",p,t]]),f=la(f,Mh(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=la(f,[["exit",p,t],e[c-2],e[c-1],["exit",h,t]]),f=la(f,e.slice(c+1)),f=la(f,[["exit",m,t]]),Hr(e,o,e.length,f),e}function rH(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 f;function f(w){return o?o._inactive?g(w):(c=a.parser.defined.includes(xa(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(w),e.exit("labelMarker"),e.exit("labelEnd"),m):n(w)}function m(w){return w===40?e.attempt(W8,p,c?p:g)(w):w===91?e.attempt(J8,p,c?h:g)(w):c?p(w):g(w)}function h(w){return e.attempt(eH,p,g)(w)}function p(w){return t(w)}function g(w){return o._balanced=!0,n(w)}}function aH(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 Bt(g)?ac(e,o)(g):o(g)}function o(g){return g===41?p(g):$_(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return Bt(g)?ac(e,m)(g):p(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?q_(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function h(g){return Bt(g)?ac(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 iH(e,t,n){const a=this;return s;function s(f){return H_.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(xa(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function sH(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 lH={name:"labelStartImage",resolveAll:bb.resolveAll,tokenize:oH};function oH(e,t,n){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const uH={name:"labelStartLink",resolveAll:bb.resolveAll,tokenize:cH};function cH(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 kg={name:"lineEnding",tokenize:dH};function dH(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),kt(e,t,"linePrefix")}}const Bf={name:"thematicBreak",tokenize:fH};function fH(e,t,n){let a=0,s;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return s=h,f(h)}function f(h){return h===s?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||Ze(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===s?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),ft(h)?kt(e,f,"whitespace")(h):f(h))}}const kr={continuation:{tokenize:gH},exit:vH,name:"list",tokenize:pH},hH={partial:!0,tokenize:bH},mH={partial:!0,tokenize:yH};function pH(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 f;function f(x){const k=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:Qy(x)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Bf,n,h)(x):h(x);if(!a.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(x)}return n(x)}function m(x){return Qy(x)&&++c<10?(e.consume(x),m):(!a.interrupt||c<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),h(x)):n(x)}function h(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,e.check(Zc,a.interrupt?n:p,e.attempt(hH,w,g))}function p(x){return a.containerState.initialBlankLine=!0,o++,w(x)}function g(x){return ft(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),w):n(x)}function w(x){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function gH(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Zc,s,o);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,kt(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!ft(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(mH,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,kt(e,e.attempt(kr,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function yH(e,t,n){const a=this;return kt(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 vH(e){e.exit(this.containerState.type)}function bH(e,t,n){const a=this;return kt(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!ft(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Ck={name:"setextUnderline",resolveTo:xH,tokenize:wH};function xH(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 wH(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"),f(h)}function f(h){return h===s?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),ft(h)?kt(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Ze(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const SH={tokenize:kH};function kH(e){const t=this,n=e.attempt(Zc,a,e.attempt(this.parser.constructs.flowInitial,s,kt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(_8,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 jH={resolveAll:G_()},EH=Z_("string"),CH=Z_("text");function Z_(e){return{resolveAll:G_(e==="text"?NH:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],o=n.attempt(s,c,f);return c;function c(p){return h(p)?o(p):f(p)}function f(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 w=-1;if(g)for(;++w<g.length;){const x=g[w];if(!x.previous||x.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 NH(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,f=0,m;for(;o--;){const h=s[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const _H={42:kr,43:kr,45:kr,48:kr,49:kr,50:kr,51:kr,52:kr,53:kr,54:kr,55:kr,56:kr,57:kr,62:P_},TH={91:M8},AH={[-2]:Sg,[-1]:Sg,32:Sg},RH={35:U8,42:Bf,45:[Ck,Bf],60:H8,61:Ck,95:Bf,96:jk,126:jk},OH={38:B_,92:U_},MH={[-5]:kg,[-4]:kg,[-3]:kg,33:lH,38:B_,42:Ky,60:[u8,Y8],91:uH,92:[L8,U_],93:bb,95:Ky,96:S8},DH={null:[Ky,jH]},zH={null:[42,95]},IH={null:[]},LH=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:zH,contentInitial:TH,disable:IH,document:_H,flow:RH,flowInitial:AH,insideSpan:DH,string:OH,text:MH},Symbol.toStringTag,{value:"Module"}));function PH(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=[],f=[];const m={attempt:F(I),check:F(R),consume:A,enter:O,exit:D,interrupt:F(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:w,sliceStream:x,write:g};let p=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(L){return c=la(c,L),E(),c[c.length-1]!==null?[]:(P(t,0),h.events=Mh(o,h.events,h),h.events)}function w(L,Q){return BH(x(L),Q)}function x(L){return UH(c,L)}function k(){const{_bufferIndex:L,_index:Q,line:ce,column:X,offset:W}=a;return{_bufferIndex:L,_index:Q,line:ce,column:X,offset:W}}function j(L){s[L.line]=L.column,z()}function E(){let L;for(;a._index<c.length;){const Q=c[a._index];if(typeof Q=="string")for(L=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===L&&a._bufferIndex<Q.length;)C(Q.charCodeAt(a._bufferIndex));else C(Q)}}function C(L){p=p(L)}function A(L){Ze(L)?(a.line++,a.column=1,a.offset+=L===-3?2:1,z()):L!==-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=L}function O(L,Q){const ce=Q||{};return ce.type=L,ce.start=k(),h.events.push(["enter",ce,h]),f.push(ce),ce}function D(L){const Q=f.pop();return Q.end=k(),h.events.push(["exit",Q,h]),Q}function I(L,Q){P(L,Q.from)}function R(L,Q){Q.restore()}function F(L,Q){return ce;function ce(X,W,G){let se,ee,ve,M;return Array.isArray(X)?B(X):"tokenize"in X?B([X]):U(X);function U(re){return xe;function xe(Re){const Ee=Re!==null&&re[Re],He=Re!==null&&re.null,Le=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(He)?He:He?[He]:[]];return B(Le)(Re)}}function B(re){return se=re,ee=0,re.length===0?G:_(re[ee])}function _(re){return xe;function xe(Re){return M=te(),ve=re,re.partial||(h.currentConstruct=re),re.name&&h.parser.constructs.disable.null.includes(re.name)?Z():re.tokenize.call(Q?Object.assign(Object.create(h),Q):h,m,V,Z)(Re)}}function V(re){return L(ve,M),W}function Z(re){return M.restore(),++ee<se.length?_(se[ee]):G}}}function P(L,Q){L.resolveAll&&!o.includes(L)&&o.push(L),L.resolve&&Hr(h.events,Q,h.events.length-Q,L.resolve(h.events.slice(Q),h)),L.resolveTo&&(h.events=L.resolveTo(h.events,h))}function te(){const L=k(),Q=h.previous,ce=h.currentConstruct,X=h.events.length,W=Array.from(f);return{from:X,restore:G};function G(){a=L,h.previous=Q,h.currentConstruct=ce,h.events.length=X,f=W,z()}}function z(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function UH(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 f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[s].slice(0,o))}return c}function BH(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=`
|
|
384
|
+
`;break}case-3:{c=`\r
|
|
385
|
+
`;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 FH(e){const a={constructs:I_([LH,...(e||{}).extensions||[]]),content:s(n8),defined:[],document:s(a8),flow:s(SH),lazy:{},string:s(EH),text:s(CH)};return a;function s(o){return c;function c(f){return PH(a,o,f)}}}function $H(e){for(;!F_(e););return e}const Nk=/[\0\t\n\r]/g;function HH(){let e=1,t="",n=!0,a;return s;function s(o,c,f){const m=[];let h,p,g,w,x;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(Nk.lastIndex=g,h=Nk.exec(o),w=h&&h.index!==void 0?h.index:o.length,x=o.charCodeAt(w),!h){t=o.slice(g);break}if(x===10&&g===w&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<w&&(m.push(o.slice(g,w)),e+=w-g),x){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=w+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const qH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZH(e){return e.replace(qH,GH)}function GH(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 vb(n)||e}const V_={}.hasOwnProperty;function VH(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),QH(n)($H(FH(n).document().write(HH()(e,t,!0))))}function QH(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(At),autolinkProtocol:te,autolinkEmail:te,atxHeading:o(Y),blockQuote:o(He),characterEscape:te,characterReference:te,codeFenced:o(Le),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Le,c),codeText:o(Ke,c),codeTextData:te,data:te,codeFlowValue:te,definition:o(et),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(St),hardBreakEscape:o(ge),hardBreakTrailing:o(ge),htmlFlow:o(Ce,c),htmlFlowData:te,htmlText:o(Ce,c),htmlTextData:te,image:o(_e),label:c,link:o(At),listItem:o(Mn),listItemValue:w,listOrdered:o(qe,g),listUnordered:o(qe),paragraph:o(rn),reference:_,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Y),strong:o(La),thematicBreak:o(fa)},exit:{atxHeading:m(),atxHeadingSequence:I,autolink:m(),autolinkEmail:Ee,autolinkProtocol:Re,blockQuote:m(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:re,characterReference:xe,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:x,codeFencedFenceMeta:k,codeFlowValue:z,codeIndented:m(C),codeText:m(W),codeTextData:z,data:z,definition:m(),definitionDestinationString:D,definitionLabelString:A,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(Q),hardBreakTrailing:m(Q),htmlFlow:m(ce),htmlFlowData:z,htmlText:m(X),htmlTextData:z,image:m(se),label:ve,labelText:ee,lineEnding:L,link:m(G),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:V,resourceDestinationString:M,resourceTitleString:U,resource:B,setextHeading:m(P),setextHeadingLineSequence:F,setextHeadingText:R,strong:m(),thematicBreak:m()}};Q_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ue){let we={type:"root",children:[]};const Fe={stack:[we],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:p,data:n},Xe=[];let vt=-1;for(;++vt<ue.length;)if(ue[vt][1].type==="listOrdered"||ue[vt][1].type==="listUnordered")if(ue[vt][0]==="enter")Xe.push(vt);else{const _n=Xe.pop();vt=s(ue,_n,vt)}for(vt=-1;++vt<ue.length;){const _n=t[ue[vt][0]];V_.call(_n,ue[vt][1].type)&&_n[ue[vt][1].type].call(Object.assign({sliceSerialize:ue[vt][2].sliceSerialize},Fe),ue[vt][1])}if(Fe.tokenStack.length>0){const _n=Fe.tokenStack[Fe.tokenStack.length-1];(_n[1]||_k).call(Fe,void 0,_n[0])}for(we.position={start:Ji(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Ji(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},vt=-1;++vt<t.transforms.length;)we=t.transforms[vt](we)||we;return we}function s(ue,we,Fe){let Xe=we-1,vt=-1,_n=!1,mr,Gt,Ft,Lt;for(;++Xe<=Fe;){const ht=ue[Xe];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?vt++:vt--,Lt=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(mr&&!Lt&&!vt&&!Ft&&(Ft=Xe),Lt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Lt=void 0}if(!vt&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||vt===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(mr){let pr=Xe;for(Gt=void 0;pr--;){const Un=ue[pr];if(Un[1].type==="lineEnding"||Un[1].type==="lineEndingBlank"){if(Un[0]==="exit")continue;Gt&&(ue[Gt][1].type="lineEndingBlank",_n=!0),Un[1].type="lineEnding",Gt=pr}else if(!(Un[1].type==="linePrefix"||Un[1].type==="blockQuotePrefix"||Un[1].type==="blockQuotePrefixWhitespace"||Un[1].type==="blockQuoteMarker"||Un[1].type==="listItemIndent"))break}Ft&&(!Gt||Ft<Gt)&&(mr._spread=!0),mr.end=Object.assign({},Gt?ue[Gt][1].start:ht[1].end),ue.splice(Gt||Xe,0,["exit",mr,ht[2]]),Xe++,Fe++}if(ht[1].type==="listItemPrefix"){const pr={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};mr=pr,ue.splice(Xe,0,["enter",pr,ht[2]]),Xe++,Fe++,Ft=void 0,Lt=!0}}}return ue[we][1]._spread=_n,Fe}function o(ue,we){return Fe;function Fe(Xe){f.call(this,ue(Xe),Xe),we&&we.call(this,Xe)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(ue,we,Fe){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([we,Fe||void 0]),ue.position={start:Ji(we.start),end:void 0}}function m(ue){return we;function we(Fe){ue&&ue.call(this,Fe),h.call(this,Fe)}}function h(ue,we){const Fe=this.stack.pop(),Xe=this.tokenStack.pop();if(Xe)Xe[0].type!==ue.type&&(we?we.call(this,ue,Xe[0]):(Xe[1]||_k).call(this,ue,Xe[0]));else throw new Error("Cannot close `"+ue.type+"` ("+rc({start:ue.start,end:ue.end})+"): it’s not open");Fe.position.end=Ji(ue.end)}function p(){return yb(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function w(ue){if(this.data.expectingFirstListItemValue){const we=this.stack[this.stack.length-2];we.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.lang=ue}function k(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.meta=ue}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.value=ue.replace(/(\r?\n|\r)$/g,"")}function A(ue){const we=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=we,Fe.identifier=xa(this.sliceSerialize(ue)).toLowerCase()}function O(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.title=ue}function D(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.url=ue}function I(ue){const we=this.stack[this.stack.length-1];if(!we.depth){const Fe=this.sliceSerialize(ue).length;we.depth=Fe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function F(ue){const we=this.stack[this.stack.length-1];we.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function te(ue){const Fe=this.stack[this.stack.length-1].children;let Xe=Fe[Fe.length-1];(!Xe||Xe.type!=="text")&&(Xe=an(),Xe.position={start:Ji(ue.start),end:void 0},Fe.push(Xe)),this.stack.push(Xe)}function z(ue){const we=this.stack.pop();we.value+=this.sliceSerialize(ue),we.position.end=Ji(ue.end)}function L(ue){const we=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Fe=we.children[we.children.length-1];Fe.position.end=Ji(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(we.type)&&(te.call(this,ue),z.call(this,ue))}function Q(){this.data.atHardBreak=!0}function ce(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.value=ue}function X(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.value=ue}function W(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.value=ue}function G(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const we=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=we,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function se(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const we=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=we,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function ee(ue){const we=this.sliceSerialize(ue),Fe=this.stack[this.stack.length-2];Fe.label=ZH(we),Fe.identifier=xa(we).toLowerCase()}function ve(){const ue=this.stack[this.stack.length-1],we=this.resume(),Fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Fe.type==="link"){const Xe=ue.children;Fe.children=Xe}else Fe.alt=we}function M(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.url=ue}function U(){const ue=this.resume(),we=this.stack[this.stack.length-1];we.title=ue}function B(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function V(ue){const we=this.resume(),Fe=this.stack[this.stack.length-1];Fe.label=we,Fe.identifier=xa(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function Z(ue){this.data.characterReferenceType=ue.type}function re(ue){const we=this.sliceSerialize(ue),Fe=this.data.characterReferenceType;let Xe;Fe?(Xe=L_(we,Fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Xe=vb(we);const vt=this.stack[this.stack.length-1];vt.value+=Xe}function xe(ue){const we=this.stack.pop();we.position.end=Ji(ue.end)}function Re(ue){z.call(this,ue);const we=this.stack[this.stack.length-1];we.url=this.sliceSerialize(ue)}function Ee(ue){z.call(this,ue);const we=this.stack[this.stack.length-1];we.url="mailto:"+this.sliceSerialize(ue)}function He(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function Ke(){return{type:"inlineCode",value:""}}function et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function St(){return{type:"emphasis",children:[]}}function Y(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function _e(){return{type:"image",title:null,url:"",alt:null}}function At(){return{type:"link",title:null,url:"",children:[]}}function qe(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function Mn(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function rn(){return{type:"paragraph",children:[]}}function La(){return{type:"strong",children:[]}}function an(){return{type:"text",value:""}}function fa(){return{type:"thematicBreak"}}}function Ji(e){return{line:e.line,column:e.column,offset:e.offset}}function Q_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?Q_(e,a):KH(e,a)}}function KH(e,t){let n;for(n in t)if(V_.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 _k(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+rc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+rc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+rc({start:t.start,end:t.end})+") is still open")}function YH(e){const t=this;t.parser=n;function n(a){return VH(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function XH(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 WH(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
386
|
+
`}]}function JH(e,t){const n=t.value?t.value+`
|
|
387
|
+
`:"",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 eq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=zo(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,f+=1,e.footnoteCounts.set(a,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function rq(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 aq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function K_(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 iq(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return K_(e,t);const s={src:zo(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 sq(e,t){const n={src:zo(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 lq(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 oq(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return K_(e,t);const s={href:zo(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 uq(e,t){const n={href:zo(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 cq(e,t,n){const a=e.all(t),s=n?dq(n):Y_(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 f=-1;for(;++f<a.length;){const p=a[f];(s||f!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
388
|
+
`}),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:`
|
|
389
|
+
`});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function dq(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=Y_(n[a])}return t}function Y_(e){const t=e.spread;return t??e.children.length>1}function fq(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 hq(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mq(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function pq(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gq(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)},f=hb(t.children[1]),m=T_(t.children[t.children.length-1]);f&&m&&(c.position={start:f,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 yq(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,f=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],w={},x=c?c[m]:void 0;x&&(w.align=x);let k={type:"element",tagName:o,properties:w,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),h.push(k)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function vq(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Tk=9,Ak=32;function bq(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const o=[];for(;a;)o.push(Rk(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return o.push(Rk(t.slice(s),s>0,!1)),o.join("")}function Rk(e,t,n){let a=0,s=e.length;if(t){let o=e.codePointAt(a);for(;o===Tk||o===Ak;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(s-1);for(;o===Tk||o===Ak;)s--,o=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function xq(e,t){const n={type:"text",value:bq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function wq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Sq={blockquote:XH,break:WH,code:JH,delete:eq,emphasis:tq,footnoteReference:nq,heading:rq,html:aq,imageReference:iq,image:sq,inlineCode:lq,linkReference:oq,link:uq,listItem:cq,list:fq,paragraph:hq,root:mq,strong:pq,table:gq,tableCell:vq,tableRow:yq,text:xq,thematicBreak:wq,toml:Ef,yaml:Ef,definition:Ef,footnoteDefinition:Ef};function Ef(){}const X_=-1,Dh=0,ic=1,rh=2,xb=3,wb=4,Sb=5,kb=6,W_=7,J_=8,Ok=typeof self=="object"?self:globalThis,kq=(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 Dh:case X_:return n(c,s);case ic:{const f=n([],s);for(const m of c)f.push(a(m));return f}case rh:{const f=n({},s);for(const[m,h]of c)f[a(m)]=a(h);return f}case xb:return n(new Date(c),s);case wb:{const{source:f,flags:m}=c;return n(new RegExp(f,m),s)}case Sb:{const f=n(new Map,s);for(const[m,h]of c)f.set(a(m),a(h));return f}case kb:{const f=n(new Set,s);for(const m of c)f.add(a(m));return f}case W_:{const{name:f,message:m}=c;return n(new Ok[f](m),s)}case J_: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:f}=new Uint8Array(c);return n(new DataView(f),c)}}return n(new Ok[o](c),s)};return a},Mk=e=>kq(new Map,e)(0),Vl="",{toString:jq}={},{keys:Eq}=Object,qu=e=>{const t=typeof e;if(t!=="object"||!e)return[Dh,t];const n=jq.call(e).slice(8,-1);switch(n){case"Array":return[ic,Vl];case"Object":return[rh,Vl];case"Date":return[xb,Vl];case"RegExp":return[wb,Vl];case"Map":return[Sb,Vl];case"Set":return[kb,Vl];case"DataView":return[ic,n]}return n.includes("Array")?[ic,n]:n.includes("Error")?[W_,n]:[rh,n]},Cf=([e,t])=>e===Dh&&(t==="function"||t==="symbol"),Cq=(e,t,n,a)=>{const s=(c,f)=>{const m=a.push(c)-1;return n.set(f,m),m},o=c=>{if(n.has(c))return n.get(c);let[f,m]=qu(c);switch(f){case Dh:{let p=c;switch(m){case"bigint":f=J_,p=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);p=null;break;case"undefined":return s([X_],c)}return s([f,p],c)}case ic:{if(m){let w=c;return m==="DataView"?w=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(w=new Uint8Array(c)),s([m,[...w]],c)}const p=[],g=s([f,p],c);for(const w of c)p.push(o(w));return g}case rh:{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([f,p],c);for(const w of Eq(c))(e||!Cf(qu(c[w])))&&p.push([o(w),o(c[w])]);return g}case xb:return s([f,c.toISOString()],c);case wb:{const{source:p,flags:g}=c;return s([f,{source:p,flags:g}],c)}case Sb:{const p=[],g=s([f,p],c);for(const[w,x]of c)(e||!(Cf(qu(w))||Cf(qu(x))))&&p.push([o(w),o(x)]);return g}case kb:{const p=[],g=s([f,p],c);for(const w of c)(e||!Cf(qu(w)))&&p.push(o(w));return g}}const{message:h}=c;return s([f,{name:m,message:h}],c)};return o},Dk=(e,{json:t,lossy:n}={})=>{const a=[];return Cq(!(t||n),!!t,new Map,a)(e),a},ah=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Mk(Dk(e,t)):structuredClone(e):(e,t)=>Mk(Dk(e,t));function Nq(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 _q(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Tq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Nq,a=e.options.footnoteBackLabel||_q,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const p=e.all(h),g=String(h.identifier).toUpperCase(),w=zo(g.toLowerCase());let x=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++x<=j;){k.length>0&&k.push({type:"text",value:" "});let A=typeof n=="string"?n:n(m,x);typeof A=="string"&&(A={type:"text",value:A}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+w+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,x),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const E=p[p.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const A=E.children[E.children.length-1];A&&A.type==="text"?A.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else p.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+w},children:e.wrap(p,!0)};e.patch(h,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ah(c),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
390
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
391
|
+
`}]}}const zh=(function(e){if(e==null)return Mq;if(typeof e=="function")return Ih(e);if(typeof e=="object")return Array.isArray(e)?Aq(e):Rq(e);if(typeof e=="string")return Oq(e);throw new Error("Expected function, string, or object as test")});function Aq(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zh(e[n]);return Ih(a);function a(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function Rq(e){const t=e;return Ih(n);function n(a){const s=a;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function Oq(e){return Ih(t);function t(n){return n&&n.type===e}}function Ih(e){return t;function t(n,a,s){return!!(Dq(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function Mq(){return!0}function Dq(e){return e!==null&&typeof e=="object"&&"type"in e}const eT=[],zq=!0,Yy=!1,Iq="skip";function tT(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const o=zh(s),c=a?-1:1;f(e,void 0,[])();function f(m,h,p){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const x=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(m.type+(x?"<"+x+">":""))+")"})}return w;function w(){let x=eT,k,j,E;if((!t||o(m,h,p[p.length-1]||void 0))&&(x=Lq(n(m,p)),x[0]===Yy))return x;if("children"in m&&m.children){const C=m;if(C.children&&x[0]!==Iq)for(j=(a?C.children.length:-1)+c,E=p.concat(C);j>-1&&j<C.children.length;){const A=C.children[j];if(k=f(A,j,E)(),k[0]===Yy)return k;j=typeof k[1]=="number"?k[1]:j+c}}return x}}}function Lq(e){return Array.isArray(e)?e:typeof e=="number"?[zq,e]:e==null?eT:[e]}function jb(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),tT(e,o,f,s);function f(m,h){const p=h[h.length-1],g=p?p.children.indexOf(m):void 0;return c(m,g,p)}}const Xy={}.hasOwnProperty,Pq={};function Uq(e,t){const n=t||Pq,a=new Map,s=new Map,o=new Map,c={...Sq,...n.handlers},f={all:h,applyData:Fq,definitionById:a,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:Bq,wrap:Hq};return jb(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?a:s,w=String(p.identifier).toUpperCase();g.has(w)||g.set(w,p)}}),f;function m(p,g){const w=p.type,x=f.handlers[w];if(Xy.call(f.handlers,w)&&x)return x(f,p,g);if(f.options.passThrough&&f.options.passThrough.includes(w)){if("children"in p){const{children:j,...E}=p,C=ah(E);return C.children=f.all(p),C}return ah(p)}return(f.options.unknownHandler||$q)(f,p,g)}function h(p){const g=[];if("children"in p){const w=p.children;let x=-1;for(;++x<w.length;){const k=f.one(w[x],p);if(k){if(x&&w[x-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=zk(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=zk(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function Bq(e,t){e.position&&(t.position=_$(e))}function Fq(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,ah(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function $q(e,t){const n=t.data||{},a="value"in t&&!(Xy.call(n,"hProperties")||Xy.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 Hq(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
392
|
+
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
393
|
+
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
394
|
+
`}),n}function zk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ik(e,t){const n=Uq(e,t),a=n.one(e,void 0),s=Tq(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
395
|
+
`},s),o}function qq(e,t){return e&&"run"in e?async function(n,a){const s=Ik(n,{file:a,...t});await e.run(s,a)}:function(n,a){return Ik(n,{file:a,...e||t})}}function Lk(e){if(e)throw e}var jg,Pk;function Zq(){if(Pk)return jg;Pk=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 w;for(w in h);return typeof w>"u"||e.call(h,w)},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},f=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(a)return a(h,p).value}else return;return h[p]};return jg=function m(){var h,p,g,w,x,k,j=arguments[0],E=1,C=arguments.length,A=!1;for(typeof j=="boolean"&&(A=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<C;++E)if(h=arguments[E],h!=null)for(p in h)g=f(j,p),w=f(h,p),j!==w&&(A&&w&&(o(w)||(x=s(w)))?(x?(x=!1,k=g&&s(g)?g:[]):k=g&&o(g)?g:{},c(j,{name:p,newValue:m(A,k,w)})):typeof w<"u"&&c(j,{name:p,newValue:w}));return j},jg}var Gq=Zq();const Eg=uh(Gq);function Wy(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 Vq(){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);f(null,...s);function f(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?Qq(p,f)(...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 Qq(e,t){let n;return a;function a(...c){const f=e.length>c.length;let m;f&&c.push(s);try{m=e.apply(this,c)}catch(h){const p=h;if(f&&n)throw p;return s(p)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,s):m instanceof Error?s(m):o(m))}function s(c,...f){n||(n=!0,t(c,...f))}function o(c){s(null,c)}}const _a={basename:Kq,dirname:Yq,extname:Xq,join:Wq,sep:"/"};function Kq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Gc(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,f=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else c<0&&(o=!0,c=s+1),f>-1&&(e.codePointAt(s)===t.codePointAt(f--)?f<0&&(a=s):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function Yq(e){if(Gc(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 Xq(e){Gc(e);let t=e.length,n=-1,a=0,s=-1,o=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),f===46?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 Wq(...e){let t=-1,n;for(;++t<e.length;)Gc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Jq(n)}function Jq(e){Gc(e);const t=e.codePointAt(0)===47;let n=e7(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function e7(e,t){let n="",a=0,s=-1,o=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(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 f===46&&o>-1?o++:o=-1}return n}function Gc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const t7={cwd:n7};function n7(){return"/"}function Jy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function r7(e){if(typeof e=="string")e=new URL(e);else if(!Jy(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 a7(e)}function a7(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 Cg=["history","path","basename","stem","extname","dirname"];class nT{constructor(t){let n;t?Jy(t)?n={path:t}:typeof t=="string"||i7(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":t7.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Cg.length;){const o=Cg[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)Cg.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?_a.basename(this.path):void 0}set basename(t){_g(t,"basename"),Ng(t,"basename"),this.path=_a.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?_a.dirname(this.path):void 0}set dirname(t){Uk(this.basename,"dirname"),this.path=_a.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?_a.extname(this.path):void 0}set extname(t){if(Ng(t,"extname"),Uk(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=_a.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Jy(t)&&(t=r7(t)),_g(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?_a.basename(this.path,this.extname):void 0}set stem(t){_g(t,"stem"),Ng(t,"stem"),this.path=_a.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 ar(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 Ng(e,t){if(e&&e.includes(_a.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+_a.sep+"`")}function _g(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Uk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function i7(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const s7=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),l7={}.hasOwnProperty;class Eb extends s7{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=Vq()}copy(){const t=new Eb;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Eg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Rg("data",this.frozen),this.namespace[t]=n,this):l7.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rg("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=Nf(t),a=this.parser||this.Parser;return Tg("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Tg("process",this.parser||this.Parser),Ag("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,c){const f=Nf(t),m=a.parse(f);a.run(m,f,function(p,g,w){if(p||!g||!w)return h(p);const x=g,k=a.stringify(x,w);c7(k)?w.value=k:w.result=k,h(p,w)});function h(p,g){p||!g?c(p):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),Tg("processSync",this.parser||this.Parser),Ag("processSync",this.compiler||this.Compiler),this.process(t,s),Fk("processSync","process",n),a;function s(o,c){n=!0,Lk(o),a=c}}run(t,n,a){Bk(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,f){const m=Nf(n);s.run(t,m,h);function h(p,g,w){const x=g||t;p?f(p):c?c(x):a(void 0,x,w)}}}runSync(t,n){let a=!1,s;return this.run(t,n,o),Fk("runSync","run",a),s;function o(c,f){Lk(c),s=f,a=!0}}stringify(t,n){this.freeze();const a=Nf(n),s=this.compiler||this.Compiler;return Ag("stringify",s),Bk(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(Rg("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[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");f(h.plugins),h.settings&&(s.settings=Eg(!0,s.settings,h.settings))}function f(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,w=-1;for(;++g<a.length;)if(a[g][0]===h){w=g;break}if(w===-1)a.push([h,...p]);else if(p.length>0){let[x,...k]=p;const j=a[w][1];Wy(j)&&Wy(x)&&(x=Eg(!0,j,x)),a[w]=[h,x,...k]}}}}const o7=new Eb().freeze();function Tg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ag(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rg(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 Bk(e){if(!Wy(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Fk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Nf(e){return u7(e)?e:new nT(e)}function u7(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function c7(e){return typeof e=="string"||d7(e)}function d7(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const f7="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$k=[],Hk={allowDangerousHtml:!0},h7=/^(https?|ircs?|mailto|xmpp)$/i,m7=[{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 p7(e){const t=g7(e),n=y7(e);return v7(t.runSync(t.parse(n),n),e)}function g7(e){const t=e.rehypePlugins||$k,n=e.remarkPlugins||$k,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Hk}:Hk;return o7().use(YH).use(n).use(qq,a).use(t)}function y7(e){const t=e.children||"",n=new nT;return typeof t=="string"&&(n.value=t),n}function v7(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||b7;for(const p of m7)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+f7+p.id,void 0);return jb(e,h),M$(e,{Fragment:l.Fragment,components:s,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function h(p,g,w){if(p.type==="raw"&&w&&typeof g=="number")return c?w.children.splice(g,1):w.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let x;for(x in wg)if(Object.hasOwn(wg,x)&&Object.hasOwn(p.properties,x)){const k=p.properties[x],j=wg[x];(j===null||j.includes(p.tagName))&&(p.properties[x]=m(String(k||""),x,p))}}if(p.type==="element"){let x=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!x&&a&&typeof g=="number"&&(x=!a(p,g,w)),x&&w&&typeof g=="number")return f&&p.children?w.children.splice(g,1,...p.children):w.children.splice(g,1),g}}}function b7(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||h7.test(e.slice(0,t))?e:""}function x7(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function rT(e,t,n){const s=zh((n||{}).ignore||[]),o=w7(t);let c=-1;for(;++c<o.length;)tT(e,"text",f);function f(h,p){let g=-1,w;for(;++g<p.length;){const x=p[g],k=w?w.children:void 0;if(s(x,k?k.indexOf(x):void 0,w))return;w=x}if(w)return m(h,p)}function m(h,p){const g=p[p.length-1],w=o[c][0],x=o[c][1];let k=0;const E=g.children.indexOf(h);let C=!1,A=[];w.lastIndex=0;let O=w.exec(h.value);for(;O;){const D=O.index,I={index:O.index,input:O.input,stack:[...p,h]};let R=x(...O,I);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?w.lastIndex=D+1:(k!==D&&A.push({type:"text",value:h.value.slice(k,D)}),Array.isArray(R)?A.push(...R):R&&A.push(R),k=D+O[0].length,C=!0),!w.global)break;O=w.exec(h.value)}return C?(k<h.value.length&&A.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...A)):A=[h],E+A.length}}function w7(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([S7(s[0]),k7(s[1])])}return t}function S7(e){return typeof e=="string"?new RegExp(x7(e),"g"):e}function k7(e){return typeof e=="function"?e:function(){return e}}function j7(e){rT(e,[/\r?\n|\r/g,E7])}function E7(){return{type:"break"}}function C7(){return function(e){j7(e)}}function qk(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 Og="phrasing",Mg=["autolink","link","image","label"];function N7(){return{transforms:[D7],enter:{literalAutolink:T7,literalAutolinkEmail:Dg,literalAutolinkHttp:Dg,literalAutolinkWww:Dg},exit:{literalAutolink:M7,literalAutolinkEmail:O7,literalAutolinkHttp:A7,literalAutolinkWww:R7}}}function _7(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Og,notInConstruct:Mg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Og,notInConstruct:Mg},{character:":",before:"[ps]",after:"\\/",inConstruct:Og,notInConstruct:Mg}]}}function T7(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Dg(e){this.config.enter.autolinkProtocol.call(this,e)}function A7(e){this.config.exit.autolinkProtocol.call(this,e)}function R7(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 O7(e){this.config.exit.autolinkEmail.call(this,e)}function M7(e){this.exit(e)}function D7(e){rT(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,z7],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),I7]],{ignore:["link","linkReference"]})}function z7(e,t,n,a,s){let o="";if(!aT(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!L7(n)))return!1;const c=P7(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function I7(e,t,n,a){return!aT(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function L7(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 P7(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=qk(e,"(");let o=qk(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 aT(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||al(n)||Oh(n))&&(!t||n!==47)}iT.peek=V7;function U7(){this.buffer()}function B7(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function F7(){this.buffer()}function $7(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function H7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function q7(e){this.exit(e)}function Z7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function G7(e){this.exit(e)}function V7(){return"["}function iT(e,t,n,a){const s=n.createTracker(a);let o=s.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),c(),o+=s.move("]"),o}function Q7(){return{enter:{gfmFootnoteCallString:U7,gfmFootnoteCall:B7,gfmFootnoteDefinitionLabelString:F7,gfmFootnoteDefinition:$7},exit:{gfmFootnoteCallString:H7,gfmFootnoteCall:q7,gfmFootnoteDefinitionLabelString:Z7,gfmFootnoteDefinition:G7}}}function K7(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:iT},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,o,c){const f=o.createTracker(c);let m=f.move("[^");const h=o.enter("footnoteDefinition"),p=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),p(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
396
|
+
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?sT:Y7))),h(),m}}function Y7(e,t,n){return t===0?e:sT(e,t,n)}function sT(e,t,n){return(n?"":" ")+e}const X7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];lT.peek=nZ;function W7(){return{canContainEols:["delete"],enter:{strikethrough:eZ},exit:{strikethrough:tZ}}}function J7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:X7}],handlers:{delete:lT}}}function eZ(e){this.enter({type:"delete",children:[]},e)}function tZ(e){this.exit(e)}function lT(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 nZ(){return"~"}function rZ(e){return e.length}function aZ(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||rZ,o=[],c=[],f=[],m=[];let h=0,p=-1;for(;++p<e.length;){const j=[],E=[];let C=-1;for(e[p].length>h&&(h=e[p].length);++C<e[p].length;){const A=iZ(e[p][C]);if(n.alignDelimiters!==!1){const O=s(A);E[C]=O,(m[C]===void 0||O>m[C])&&(m[C]=O)}j.push(A)}c[p]=j,f[p]=E}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=Zk(a[g]);else{const j=Zk(a);for(;++g<h;)o[g]=j}g=-1;const w=[],x=[];for(;++g<h;){const j=o[g];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let A=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-C.length);const O=E+"-".repeat(A)+C;n.alignDelimiters!==!1&&(A=E.length+A+C.length,A>m[g]&&(m[g]=A),x[g]=A),w[g]=O}c.splice(1,0,w),f.splice(1,0,x),p=-1;const k=[];for(;++p<c.length;){const j=c[p],E=f[p];g=-1;const C=[];for(;++g<h;){const A=j[g]||"";let O="",D="";if(n.alignDelimiters!==!1){const I=m[g]-(E[g]||0),R=o[g];R===114?O=" ".repeat(I):R===99?I%2?(O=" ".repeat(I/2+.5),D=" ".repeat(I/2-.5)):(O=" ".repeat(I/2),D=O):D=" ".repeat(I)}n.delimiterStart!==!1&&!g&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||g)&&C.push(" "),n.alignDelimiters!==!1&&C.push(O),C.push(A),n.alignDelimiters!==!1&&C.push(D),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
|
|
397
|
+
`)}function iZ(e){return e==null?"":String(e)}function Zk(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 sZ(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()),lZ);return s(),c}function lZ(e,t,n){return">"+(n?"":" ")+e}function oZ(e,t){return Gk(e,t.inConstruct,!0)&&!Gk(e,t.notInConstruct,!1)}function Gk(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 Vk(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
398
|
+
`&&oZ(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
399
|
+
`}function uZ(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 cZ(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 dZ(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 fZ(e,t,n,a){const s=dZ(n),o=e.value||"",c=s==="`"?"GraveAccent":"Tilde";if(cZ(e,n)){const g=n.enter("codeIndented"),w=n.indentLines(o,hZ);return g(),w}const f=n.createTracker(a),m=s.repeat(Math.max(uZ(o,s)+1,3)),h=n.enter("codeFenced");let p=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${c}`);p+=f.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);p+=f.move(" "),p+=f.move(n.safe(e.meta,{before:p,after:`
|
|
400
|
+
`,encode:["`"],...f.current()})),g()}return p+=f.move(`
|
|
401
|
+
`),o&&(p+=f.move(o+`
|
|
402
|
+
`)),p+=f.move(m),h(),p}function hZ(e,t,n){return(n?"":" ")+e}function Cb(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 mZ(e,t,n,a){const s=Cb(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("definition");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
403
|
+
`,...m.current()}))),f(),e.title&&(f=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),f()),c(),h}function pZ(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 xc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ih(e,t,n){const a=Co(e),s=Co(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}}oT.peek=gZ;function oT(e,t,n,a){const s=pZ(n),o=n.enter("emphasis"),c=n.createTracker(a),f=c.move(s);let m=c.move(n.containerPhrasing(e,{after:s,before:f,...c.current()}));const h=m.charCodeAt(0),p=ih(a.before.charCodeAt(a.before.length-1),h,s);p.inside&&(m=xc(h)+m.slice(1));const g=m.charCodeAt(m.length-1),w=ih(a.after.charCodeAt(0),g,s);w.inside&&(m=m.slice(0,-1)+xc(g));const x=c.move(s);return o(),n.attentionEncodeSurroundingInfo={after:w.outside,before:p.outside},f+m+x}function gZ(e,t,n){return n.options.emphasis||"*"}function yZ(e,t){let n=!1;return jb(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Yy}),!!((!e.depth||e.depth<3)&&yb(e)&&(t.options.setext||n))}function vZ(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(yZ(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),w=n.containerPhrasing(e,{...o.current(),before:`
|
|
404
|
+
`,after:`
|
|
405
|
+
`});return g(),p(),w+`
|
|
406
|
+
`+(s===1?"=":"-").repeat(w.length-(Math.max(w.lastIndexOf("\r"),w.lastIndexOf(`
|
|
407
|
+
`))+1))}const c="#".repeat(s),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
408
|
+
`,...o.current()});return/^[\t ]/.test(h)&&(h=xc(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),f(),h}uT.peek=bZ;function uT(e){return e.value||""}function bZ(){return"<"}cT.peek=xZ;function cT(e,t,n,a){const s=Cb(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("image");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+s),h+=m.move(n.safe(e.title,{before:h,after:s,...m.current()})),h+=m.move(s),f()),h+=m.move(")"),c(),h}function xZ(){return"!"}dT.peek=wZ;function dT(e,t,n,a){const s=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=p,o(),s==="full"||!h||h!==g?m+=f.move(g+"]"):s==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function wZ(){return"!"}fT.peek=SZ;function fT(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],f=n.compilePattern(c);let m;if(c.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return s+a+s}function SZ(){return"`"}function hT(e,t){const n=yb(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))}mT.peek=kZ;function mT(e,t,n,a){const s=Cb(n),o=s==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,m;if(hT(e,n)){const p=n.stack;n.stack=[],f=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),n.stack=p,g}f=n.enter("link"),m=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=c.move(" "+s),h+=c.move(n.safe(e.title,{before:h,after:s,...c.current()})),h+=c.move(s),m()),h+=c.move(")"),f(),h}function kZ(e,t,n){return hT(e,n)?"<":"["}pT.peek=jZ;function pT(e,t,n,a){const s=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=p,o(),s==="full"||!h||h!==g?m+=f.move(g+"]"):s==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function jZ(){return"["}function Nb(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 EZ(e){const t=Nb(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 CZ(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 gT(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 NZ(e,t,n,a){const s=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?CZ(n):Nb(n);const f=e.ordered?c==="."?")":".":EZ(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),gT(n)===c&&p){let g=-1;for(;++g<e.children.length;){const w=e.children[g];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=f),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,s(),h}function _Z(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 TZ(e,t,n,a){const s=_Z(n);let o=n.bulletCurrent||Nb(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 f=n.createTracker(a);f.move(o+" ".repeat(c-o.length)),f.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),p);return m(),h;function p(g,w,x){return w?(x?"":" ".repeat(c))+g:(x?o:o+" ".repeat(c-o.length))+g}}function AZ(e,t,n,a){const s=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),s(),c}const RZ=zh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function OZ(e,t,n,a){return(e.children.some(function(c){return RZ(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function MZ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}yT.peek=DZ;function yT(e,t,n,a){const s=MZ(n),o=n.enter("strong"),c=n.createTracker(a),f=c.move(s+s);let m=c.move(n.containerPhrasing(e,{after:s,before:f,...c.current()}));const h=m.charCodeAt(0),p=ih(a.before.charCodeAt(a.before.length-1),h,s);p.inside&&(m=xc(h)+m.slice(1));const g=m.charCodeAt(m.length-1),w=ih(a.after.charCodeAt(0),g,s);w.inside&&(m=m.slice(0,-1)+xc(g));const x=c.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:w.outside,before:p.outside},f+m+x}function DZ(e,t,n){return n.options.strong||"*"}function zZ(e,t,n,a){return n.safe(e.value,a)}function IZ(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 LZ(e,t,n){const a=(gT(n)+(n.options.ruleSpaces?" ":"")).repeat(IZ(n));return n.options.ruleSpaces?a.slice(0,-1):a}const vT={blockquote:sZ,break:Vk,code:fZ,definition:mZ,emphasis:oT,hardBreak:Vk,heading:vZ,html:uT,image:cT,imageReference:dT,inlineCode:fT,link:mT,linkReference:pT,list:NZ,listItem:TZ,paragraph:AZ,root:OZ,strong:yT,text:zZ,thematicBreak:LZ};function PZ(){return{enter:{table:UZ,tableData:Qk,tableHeader:Qk,tableRow:FZ},exit:{codeText:$Z,table:BZ,tableData:zg,tableHeader:zg,tableRow:zg}}}function UZ(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 BZ(e){this.exit(e),this.data.inTable=void 0}function FZ(e){this.enter({type:"tableRow",children:[]},e)}function zg(e){this.exit(e)}function Qk(e){this.enter({type:"tableCell",children:[]},e)}function $Z(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,HZ));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function HZ(e,t){return t==="|"?t:e}function qZ(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
409
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:c,tableCell:m,tableRow:f}};function c(x,k,j,E){return h(p(x,j,E),x.align)}function f(x,k,j,E){const C=g(x,j,E),A=h([C]);return A.slice(0,A.indexOf(`
|
|
410
|
+
`))}function m(x,k,j,E){const C=j.enter("tableCell"),A=j.enter("phrasing"),O=j.containerPhrasing(x,{...E,before:o,after:o});return A(),C(),O}function h(x,k){return aZ(x,{align:k,alignDelimiters:a,padding:n,stringLength:s})}function p(x,k,j){const E=x.children;let C=-1;const A=[],O=k.enter("table");for(;++C<E.length;)A[C]=g(E[C],k,j);return O(),A}function g(x,k,j){const E=x.children;let C=-1;const A=[],O=k.enter("tableRow");for(;++C<E.length;)A[C]=m(E[C],x,k,j);return O(),A}function w(x,k,j){let E=vT.inlineCode(x,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function ZZ(){return{exit:{taskListCheckValueChecked:Kk,taskListCheckValueUnchecked:Kk,paragraph:VZ}}}function GZ(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:QZ}}}function Kk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function VZ(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 f=s[o];if(f.type==="paragraph"){c=f;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function QZ(e,t,n,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(c);let m=vT.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(p){return p+c}}function KZ(){return[N7(),Q7(),W7(),PZ(),ZZ()]}function YZ(e){return{extensions:[_7(),K7(e),J7(),qZ(e),GZ()]}}const XZ={tokenize:rG,partial:!0},bT={tokenize:aG,partial:!0},xT={tokenize:iG,partial:!0},wT={tokenize:sG,partial:!0},WZ={tokenize:lG,partial:!0},ST={name:"wwwAutolink",tokenize:tG,previous:jT},kT={name:"protocolAutolink",tokenize:nG,previous:ET},xi={name:"emailAutolink",tokenize:eG,previous:CT},Ia={};function JZ(){return{text:Ia}}let $s=48;for(;$s<123;)Ia[$s]=xi,$s++,$s===58?$s=65:$s===91&&($s=97);Ia[43]=xi;Ia[45]=xi;Ia[46]=xi;Ia[95]=xi;Ia[72]=[xi,kT];Ia[104]=[xi,kT];Ia[87]=[xi,ST];Ia[119]=[xi,ST];function eG(e,t,n){const a=this;let s,o;return c;function c(g){return!ev(g)||!CT.call(a,a.previous)||_b(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return ev(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(WZ,p,h)(g):g===45||g===95||nr(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&&cr(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function tG(e,t,n){const a=this;return s;function s(c){return c!==87&&c!==119||!jT.call(a,a.previous)||_b(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(XZ,e.attempt(bT,e.attempt(xT,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function nG(e,t,n){const a=this;let s="",o=!1;return c;function c(g){return(g===72||g===104)&&ET.call(a,a.previous)&&!_b(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(cr(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const w=s.toLowerCase();if(w==="http"||w==="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||nh(g)||Bt(g)||al(g)||Oh(g)?n(g):e.attempt(bT,e.attempt(xT,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function rG(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 aG(e,t,n){let a,s,o;return c;function c(h){return h===46||h===95?e.check(wT,m,f)(h):h===null||Bt(h)||al(h)||h!==45&&Oh(h)?m(h):(o=!0,e.consume(h),c)}function f(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 iG(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(wT,t,o)(c):c===null||Bt(c)||al(c)?t(c):(e.consume(c),s)}function o(c){return c===41&&a++,e.consume(c),s}}function sG(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),s):f===60||f===null||Bt(f)||al(f)?t(f):n(f)}function s(f){return f===null||f===40||f===91||Bt(f)||al(f)?t(f):a(f)}function o(f){return cr(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):cr(f)?(e.consume(f),c):n(f)}}function lG(e,t,n){return a;function a(o){return e.consume(o),s}function s(o){return nr(o)?n(o):t(o)}}function jT(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Bt(e)}function ET(e){return!cr(e)}function CT(e){return!(e===47||ev(e))}function ev(e){return e===43||e===45||e===46||e===95||nr(e)}function _b(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 oG={tokenize:gG,partial:!0};function uG(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hG,continuation:{tokenize:mG},exit:pG}},text:{91:{name:"gfmFootnoteCall",tokenize:fG},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:cG,resolveTo:dG}}}}function cG(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 f;function f(m){if(!c||!c._balanced)return n(m);const h=xa(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 dG(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)},f=[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,...f),e}function fG(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!c||g===null||g===91||Bt(g))return n(g);if(g===93){e.exit("chunkString");const w=e.exit("gfmFootnoteCallString");return s.includes(xa(a.sliceSerialize(w)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Bt(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 hG(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(k)}function p(k){if(c>999||k===93&&!f||k===null||k===91||Bt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=xa(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),w}return Bt(k)||(f=!0),c++,e.consume(k),k===92?g:p}function g(k){return k===91||k===92||k===93?(e.consume(k),c++,p):p(k)}function w(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),s.includes(o)||s.push(o),kt(e,x,"gfmFootnoteDefinitionWhitespace")):n(k)}function x(k){return t(k)}}function mG(e,t,n){return e.check(Zc,t,e.attempt(oG,t,n))}function pG(e){e.exit("gfmFootnoteDefinition")}function gG(e,t,n){const a=this;return kt(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 yG(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,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const 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)},w=[["enter",p,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",g,f]],x=f.parser.constructs.insideSpan.null;x&&Hr(w,w.length,0,Mh(x,c.slice(h+1,m),f)),Hr(w,w.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",p,f]]),Hr(c,h-1,m-h+3,w),m=h+w.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,f,m){const h=this.previous,p=this.events;let g=0;return w;function w(k){return h===126&&p[p.length-1][1].type!=="characterEscape"?m(k):(c.enter("strikethroughSequenceTemporary"),x(k))}function x(k){const j=Co(h);if(k===126)return g>1?m(k):(c.consume(k),g++,x);if(g<2&&!n)return m(k);const E=c.exit("strikethroughSequenceTemporary"),C=Co(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class vG{constructor(){this.map=[]}add(t,n,a){bG(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 bG(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 xG(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 wG(){return{flow:{null:{name:"table",tokenize:SG,resolveAll:kG}}}}function SG(e,t,n){const a=this;let s=0,o=0,c;return f;function f(z){let L=a.events.length-1;for(;L>-1;){const X=a.events[L][1].type;if(X==="lineEnding"||X==="linePrefix")L--;else break}const Q=L>-1?a.events[L][1].type:null,ce=Q==="tableHead"||Q==="tableRow"?R:m;return ce===R&&a.parser.lazy[a.now().line]?n(z):ce(z)}function m(z){return e.enter("tableHead"),e.enter("tableRow"),h(z)}function h(z){return z===124||(c=!0,o+=1),p(z)}function p(z){return z===null?n(z):Ze(z)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),x):n(z):ft(z)?kt(e,p,"whitespace")(z):(o+=1,c&&(c=!1,s+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),c=!0,p):(e.enter("data"),g(z)))}function g(z){return z===null||z===124||Bt(z)?(e.exit("data"),p(z)):(e.consume(z),z===92?w:g)}function w(z){return z===92||z===124?(e.consume(z),g):g(z)}function x(z){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(z):(e.enter("tableDelimiterRow"),c=!1,ft(z)?kt(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):k(z))}function k(z){return z===45||z===58?E(z):z===124?(c=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),j):I(z)}function j(z){return ft(z)?kt(e,E,"whitespace")(z):E(z)}function E(z){return z===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),C):z===45?(o+=1,C(z)):z===null||Ze(z)?D(z):I(z)}function C(z){return z===45?(e.enter("tableDelimiterFiller"),A(z)):I(z)}function A(z){return z===45?(e.consume(z),A):z===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(z))}function O(z){return ft(z)?kt(e,D,"whitespace")(z):D(z)}function D(z){return z===124?k(z):z===null||Ze(z)?!c||s!==o?I(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):I(z)}function I(z){return n(z)}function R(z){return e.enter("tableRow"),F(z)}function F(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),F):z===null||Ze(z)?(e.exit("tableRow"),t(z)):ft(z)?kt(e,F,"whitespace")(z):(e.enter("data"),P(z))}function P(z){return z===null||z===124||Bt(z)?(e.exit("data"),F(z)):(e.consume(z),z===92?te:P)}function te(z){return z===92||z===124?(e.consume(z),P):P(z)}}function kG(e,t){let n=-1,a=!0,s=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,p,g;const w=new vG;for(;++n<e.length;){const x=e[n],k=x[1];x[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(Yk(w,t,m,h,p),p=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},w.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,p={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},w.add(n,0,[["enter",p,t]])),s=k.type==="tableDelimiterRow"?2:p?3:1):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=_f(w,t,o,s,void 0,g),o=[0,0,0,0]),c[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=_f(w,t,o,s,void 0,g)),o=c,c=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],g=_f(w,t,o,s,n,g)):c[1]!==0&&(g=_f(w,t,c,s,n,g)),s=0):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&Yk(w,t,m,h,p),w.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=xG(t.events,n))}return e}function _f(e,t,n,a,s,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},Xl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=Xl(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=Xl(t.events,n[2]),p=Xl(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const w=t.events[n[2]],x=t.events[n[3]];if(w[1].end=Object.assign({},x[1].end),w[1].type="chunkText",w[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(o.end=Object.assign({},Xl(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function Yk(e,t,n,a,s){const o=[],c=Xl(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 Xl(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const jG={name:"tasklistCheck",tokenize:CG};function EG(){return{text:{91:jG}}}function CG(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 Bt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return Ze(m)?t(m):ft(m)?e.check({tokenize:NG},t,n)(m):n(m)}}function NG(e,t,n){return kt(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function _G(e){return I_([JZ(),uG(),yG(e),wG(),EG()])}const TG={};function AG(e){const t=this,n=e||TG,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(_G(n)),o.push(KZ()),c.push(YZ(n))}function Lh({children:e,className:t,components:n}){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(p7,{remarkPlugins:[AG,C7],components:{a:({node:a,...s})=>l.jsx("a",{...s,target:"_blank",rel:"noopener noreferrer"}),...n},children:e})})}function RG({value:e,baseline:t,onChange:n,onRevert:a,disabled:s}){const[o,c]=b.useState(!1),f=b.useRef(null),m=e!==t;return b.useEffect(()=>{var h;o&&((h=f.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(Da,{children:[l.jsxs(za,{children:["System prompt append",m&&l.jsx(OG,{})]}),!o&&!s&&l.jsxs(be,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[l.jsx(mh,{className:"h-3 w-3"})," Edit"]})]}),l.jsx(Zr,{children:o?l.jsxs("div",{className:"space-y-2",children:[l.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),c(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(be,{size:"xs",variant:"ghost",onClick:()=>{a(),c(!1)},disabled:!m,children:"Revert"}),l.jsx(be,{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(Lh,{children:e}):l.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function OG(){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 NT={"claude-code":"Claude Code",codex:"Codex"},MG=[eh.CLAUDE_CODE,eh.CODEX];function DG({open:e,onOpenChange:t,agent:n}){const a=gn(),s=n.clientId,o=n.runtimeProvider,[c,f]=b.useState(s),[m,h]=b.useState(o),[p,g]=b.useState(!1),x=Ye({queryKey:["clients-rebind"],queryFn:gi,enabled:e}).data??[],k=YR({queries:x.map(P=>({queryKey:["client-capabilities",P.id],queryFn:()=>ph(P.id),enabled:e}))}),j=b.useMemo(()=>{const P=new Map;return k.forEach((te,z)=>{const L=x[z];if(!L)return;const Q=te.data;Q!=null&&Q.capabilities&&P.set(L.id,Q.capabilities)}),P},[k,x]);b.useEffect(()=>{e||(f(s),h(o),g(!1))},[e,s,o]);const E=c?j.get(c)??null:null,C=(E==null?void 0:E[m])??null,A=!C||C.state==="missing"||C.state==="error",O=!!c&&(c!==s||m!==o)&&(!A||p),D=m!==o,I=c!==s,R=yt({mutationFn:()=>{if(!c)throw new Error("clientId required");return j4(n.uuid,{clientId:c,runtimeProvider:m,force:A&&p?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),F=R.error instanceof xs||R.error instanceof Error?R.error.message:null;return l.jsx(Cn,{open:e,onOpenChange:t,children:l.jsxs(yn,{className:"max-w-lg",children:[l.jsx(On,{children:l.jsx(Nn,{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:IG(s,x,o)})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{children:"Computer"}),l.jsx("select",{value:c??"",onChange:P=>f(P.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:x.map(P=>l.jsx("option",{value:P.id,children:zG(P)},P.id))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{children:"Runtime"}),l.jsx("div",{className:"space-y-2",children:MG.map(P=>{const te=(E==null?void 0:E[P])??null,z=!!te&&te.state!=="missing",L=m===P;return l.jsxs("label",{className:L?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":z?"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:L,onChange:()=>h(P),className:"mt-1"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-body font-medium",children:NT[P]}),l.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:PG(te,P)})]})]},P)})})]}),(I||D)&&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."]}),D&&l.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),A&&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:P=>g(P.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."})]}),F&&l.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:F})]}),l.jsxs(rr,{children:[l.jsx(be,{variant:"outline",onClick:()=>t(!1),disabled:R.isPending,children:"Cancel"}),l.jsx(be,{onClick:()=>R.mutate(),disabled:!O||R.isPending,children:R.isPending?"Re-binding…":"Re-bind"})]})]})})}function zG(e){return`${e.hostname??e.id} · ${e.status}`}function IG(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${NT[n]}`}const LG={"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 PG(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. ${LG[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const UG={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function BG(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length,n=e.summary.anyDirty||e.saving;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(nc,{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(a=>l.jsx("button",{type:"button",onClick:()=>e.onJumpTo(a),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:UG[a]},a))})]}),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(fr,{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(be,{variant:"outline",size:"sm",onClick:e.onReloadRemote,disabled:!!e.reloadingRemote,children:e.reloadingRemote?l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx(Zf,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Loading latest…"]}):"Discard mine, load latest"}),n&&l.jsxs(l.Fragment,{children:[l.jsx(be,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),l.jsx(be,{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(Zf,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})]})})}function sh(e){return`agent-cfg-${e}`}function Hs({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 FG(){return l.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const $G={"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 HG(e){const t=$G[e.runtimeProvider];return l.jsxs("div",{className:"space-y-3",children:[l.jsx(qG,{name:t.name,caption:t.caption,locked:!0}),l.jsx(ZG,{computerLabel:e.computerLabel,statusLoading:e.computerStatusLoading??!1,statusError:e.computerStatusError??null,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function qG({name:e,caption:t,locked:n}){return l.jsxs(Kn,{children:[l.jsx(Da,{children:l.jsxs(za,{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(hh,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),l.jsxs(Zr,{className:"space-y-1 text-body",children:[l.jsxs("div",{className:"inline-flex items-center gap-2",children:[l.jsx(ZE,{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 ZG(e){const t=!!e.computerLabel,n=!e.statusLoading&&!e.statusError;return l.jsxs(Kn,{children:[l.jsxs(Da,{children:[l.jsx(za,{children:"Bound computer"}),n&&e.canBindComputer&&e.onBindComputer&&!t&&l.jsxs(be,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,title:e.bindPending?"Binding computer…":"Pick a connected computer for this agent",children:[l.jsx(Ey,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),n&&t&&e.onRebind&&l.jsxs(be,{size:"xs",variant:"outline",onClick:e.onRebind,title:"Move this agent to another computer",children:[l.jsx(Ey,{className:"h-3 w-3"}),"Re-bind"]})]}),l.jsx(Zr,{className:"text-body",children:e.statusLoading?l.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Checking computer binding…"}):e.statusError?l.jsxs("p",{className:"text-caption",style:{color:"var(--state-error)"},children:["Could not verify computer binding: ",e.statusError]}):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 GG(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 VG(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function QG(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Ig(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function Xk(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:QG(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Lg(e,t){const n=e;return{add:a=>t(s=>{const o=s[e],c=new Set(o.map(h=>h.key)),f=VG(n,c),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...s,[e]:Xk(m)}}),update:(a,s)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:s}:m);return{...o,[e]:Xk(f)}}),remove:a=>t(s=>{const c=s[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...s,[e]:c}}),undo:a=>t(s=>{const c=s[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...s,[e]:c}})}}function Wk(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Ig(e.payload.mcpServers,"mcp"),env:Ig(e.payload.env,"env"),git:Ig(e.payload.gitRepos,"git")}}function KG(e){const[t,n]=b.useState(null),[a,s]=b.useState(null);b.useEffect(()=>{e&&a===null&&(n(e),s(Wk(e)))},[e,a]);const o=a??{promptAppend:"",model:"",mcp:[],env:[],git:[]},c=(t==null?void 0:t.payload.prompt.append)??"",f=(t==null?void 0:t.payload.model)??"",m=o.promptAppend!==c,h=o.model!==f,p=b.useMemo(()=>{const R=[],F=L=>L.reduce((Q,ce)=>ce.status==="unchanged"?Q:Q+1,0),P=F(o.mcp),te=F(o.env),z=F(o.git);return m&&R.push("prompt"),h&&R.push("model"),P>0&&R.push("mcp"),te>0&&R.push("env"),z>0&&R.push("git"),{anyDirty:R.length>0,dirtySections:R,counts:{prompt:m?1:0,model:h?1:0,mcp:P,env:te,git:z}}},[o,m,h]),g=b.useCallback(R=>{s(F=>F&&R(F))},[]),w=b.useCallback(R=>g(F=>({...F,promptAppend:R})),[g]),x=b.useCallback(()=>g(R=>({...R,promptAppend:c})),[g,c]),k=b.useCallback(R=>g(F=>({...F,model:R})),[g]),j=b.useCallback(()=>g(R=>({...R,model:f})),[g,f]),E=b.useMemo(()=>Lg("mcp",g),[g]),C=b.useMemo(()=>Lg("env",g),[g]),A=b.useMemo(()=>Lg("git",g),[g]),O=b.useCallback(()=>{n(null),s(null)},[]),D=b.useCallback(R=>{n(R),s(Wk(R))},[]),I=b.useCallback(()=>{if(!a||!t)return{};const R={};m&&(R.prompt={append:a.promptAppend}),h&&(R.model=a.model);const F=p.counts.mcp>0,P=p.counts.env>0,te=p.counts.git>0;return F&&(R.mcpServers=a.mcp.filter(z=>z.status!=="deleted").map(z=>z.value)),P&&(R.env=a.env.filter(z=>z.status!=="deleted").map(z=>{const L=z.value;return L.sensitive&&L.value===pc?{key:L.key,value:pc,sensitive:!0}:L})),te&&(R.gitRepos=a.git.filter(z=>z.status!=="deleted").map(z=>z.value)),R},[a,t,m,h,p]);return{draft:o,summary:p,promptDirty:m,modelDirty:h,setPromptAppend:w,revertPrompt:x,setModel:k,revertModel:j,addMcp:E.add,updateMcp:E.update,deleteMcp:E.remove,undoDeleteMcp:E.undo,addEnv:C.add,updateEnv:C.update,deleteEnv:C.remove,undoDeleteEnv:C.undo,addGit:A.add,updateGit:A.update,deleteGit:A.remove,undoDeleteGit:A.undo,resetAll:O,resetToConfig:D,buildPayloadPatch:I}}const tr={overview:"ad-overview",setup:"ad-setup",prompt:sh("prompt"),tools:sh("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function Jk(e){return e==="model"?tr.setup:e==="mcp"?tr.tools:e==="env"||e==="git"?tr.advanced:tr.prompt}function YG(e,t){const n=[{key:"overview",label:"Profile",anchor:tr.overview}];return!e&&t&&n.push({key:"setup",label:"Setup",anchor:tr.setup},{key:"prompt",label:"Prompt",anchor:tr.prompt},{key:"tools",label:"Tools",anchor:tr.tools},{key:"advanced",label:"Advanced",anchor:tr.advanced}),t&&n.push({key:"danger",label:"Danger zone",anchor:tr.danger,divider:!0,danger:!0}),n}function XG(){var Gr,wi,pa,Si,ki,ji,js,Dn,gr,Ei,Ci;const t=jE().uuid??"",n=Rn(),a=gn(),{memberId:s,role:o}=lt(),c=Ye({queryKey:["agent",t],queryFn:()=>w4(t),enabled:!!t}),f=SF(c.data,s,o),m=((Gr=c.data)==null?void 0:Gr.type)!=="human"&&f,h=Ye({queryKey:["agent-config",t],queryFn:()=>yc(t),enabled:!!t&&m}),p=Ye({queryKey:["agent-client-status",t],queryFn:()=>pF(t),enabled:!!t&&((wi=c.data)==null?void 0:wi.type)!=="human"}),g=Ye({queryKey:["agent-sessions-active",t],queryFn:()=>dC(t,{state:"active"}),enabled:!!t&&((pa=c.data)==null?void 0:pa.type)!=="human"}),w=Ye({queryKey:["clients"],queryFn:gi,enabled:!!t&&m,refetchInterval:3e4}),x=KG(h.data),[k,j]=b.useState(null),[E,C]=b.useState(null),[A,O]=b.useState(null),[D,I]=b.useState(!1),[R,F]=b.useState(!1),P=yt({mutationFn:async()=>{if(!h.data)throw new Error("config not loaded");const ye=x.buildPayloadPatch();return Rh(t,{expectedVersion:h.data.version,payload:ye})},onSuccess:ye=>{a.setQueryData(["agent-config",t],ye),x.resetToConfig(ye),j(null),C(null),F(!0)},onError:ye=>{if(F(!1),ye instanceof xs&&ye.status===409){C("Someone else saved a newer version while you were editing."),j(null);return}j(ye instanceof Error?ye.message:String(ye))}});b.useEffect(()=>{if(!R)return;const ye=setTimeout(()=>F(!1),2500);return()=>clearTimeout(ye)},[R]),b.useEffect(()=>{x.summary.anyDirty&&F(!1)},[x.summary.anyDirty]);const te=x.resetToConfig,z=b.useCallback(async()=>{j(null),I(!0);try{const ye=await a.fetchQuery({queryKey:["agent-config",t],queryFn:()=>yc(t),staleTime:0});te(ye)}catch(ye){j(ye instanceof Error?ye.message:String(ye))}finally{I(!1),C(null)}},[a,t,te]),L=b.useCallback(ye=>{const Ge=document.getElementById(ye);Ge&&Ge.scrollIntoView({behavior:"smooth",block:"start"})},[]),Q=yt({mutationFn:ye=>Oy(t,ye),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),ce=yt({mutationFn:()=>uN(t),onMutate:()=>O(null),onSuccess:()=>{O(null),a.invalidateQueries({queryKey:["agent",t]})},onError:ye=>O(ye instanceof Error?ye.message:String(ye))}),X=yt({mutationFn:()=>cN(t),onMutate:()=>O(null),onSuccess:()=>{O(null),a.invalidateQueries({queryKey:["agent",t]})},onError:ye=>O(ye instanceof Error?ye.message:String(ye))}),W=yt({mutationFn:()=>oN(t),onMutate:()=>O(null),onSuccess:()=>n("/team"),onError:ye=>O(ye instanceof Error?ye.message:String(ye))}),G=yt({mutationFn:()=>N4(t)}),[se,ee]=b.useState(!1),[ve,M]=b.useState(""),[U,B]=b.useState(null),[_,V]=b.useState(!1),Z=Ye({queryKey:["clients"],queryFn:gi,enabled:se}),re=yt({mutationFn:ye=>Oy(t,{clientId:ye}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),ee(!1),M(""),B(null)},onError:ye=>B(ye instanceof Error?ye.message:String(ye))}),[xe,Re]=b.useState(!1),[Ee,He]=b.useState(null),Le=yt({mutationFn:()=>mF(t,x.buildPayloadPatch()),onSuccess:ye=>{const Ge=ye.diff.length?ye.diff.map(mt=>`${mt.op} ${mt.path}`).join(`
|
|
411
|
+
`):"(no changes)";He(Ge)},onError:ye=>He(`Dry run failed: ${ye instanceof Error?ye.message:String(ye)}`)});b.useEffect(()=>{if(!x.summary.anyDirty)return;const ye=Ge=>{Ge.preventDefault(),Ge.returnValue=""};return window.addEventListener("beforeunload",ye),()=>window.removeEventListener("beforeunload",ye)},[x.summary.anyDirty]);const Ke=((Si=c.data)==null?void 0:Si.type)==="human",et=b.useMemo(()=>YG(Ke,f),[Ke,f]),St=b.useRef(null),[Y,ge]=b.useState(!1);b.useEffect(()=>{if(Ke)return;const ye=St.current;if(!ye||typeof IntersectionObserver>"u")return;const Ge=new IntersectionObserver(mt=>{const Fn=mt[0];Fn&&ge(!Fn.isIntersecting&&Fn.boundingClientRect.top<0)},{threshold:0});return Ge.observe(ye),()=>Ge.disconnect()},[Ke]);const[Ce,_e]=b.useState(tr.overview);b.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const ye=[];for(const Ge of et){const mt=document.getElementById(Ge.anchor);if(!mt)continue;const Fn=new IntersectionObserver(Ua=>{for(const $o of Ua)$o.isIntersecting&&_e(Ge.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});Fn.observe(mt),ye.push(Fn)}return()=>{for(const Ge of ye)Ge.disconnect()}},[et]);const At=b.useMemo(()=>{const ye=new Set;for(const Ge of x.summary.dirtySections)ye.add(Jk(Ge));return ye},[x.summary.dirtySections]);if(c.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(c.error)return l.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",c.error instanceof Error?c.error.message:"Unknown error"]});const qe=c.data;if(!qe)return l.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const Mn=qe.type==="human",rn=p.data,La=((ki=g.data)==null?void 0:ki.length)??0,an=!Mn&&!rn&&p.isLoading,fa=p.error instanceof Error?p.error.message:p.error?"Unknown":null,ue=!Mn&&p.isSuccess&&!(rn!=null&&rn.clientId),we=!Mn&&rn?!rn.online&&!!rn.clientId:!1,Fe=kF({agentStatus:qe.status,clientStatus:rn,clientStatusLoading:an,testPending:G.isPending}),Xe=qe,vt=Xe.runtimeState??null,_n=Xe.runtimeType??null,mr=Xe.totalSessions??null,Gt=qe.uuid.slice(0,8),Ft=GG({activeSessions:La,isUnclaimed:ue,isOffline:we}),Lt=x.draft.mcp.filter(ye=>ye.status!=="deleted"),ht=x.draft.env.filter(ye=>ye.status!=="deleted"),pr=x.draft.git.filter(ye=>ye.status!=="deleted"),Un=ye=>new Set(Lt.filter(Ge=>Ge.key!==ye).map(Ge=>Ge.value.name.toLowerCase())),Fo=ye=>new Set(ht.filter(Ge=>Ge.key!==ye).map(Ge=>Ge.value.key)),ka=ye=>new Set(pr.filter(Ge=>Ge.key!==ye).map(Ge=>{const{value:mt}=Ge;return mt.localPath?mt.localPath:((mt.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),ir={sessions:mr??"—",active:La,runtime:_n??(Mn?"human":"—"),model:((js=(ji=h.data)==null?void 0:ji.payload.model)==null?void 0:js.trim())||"—"},ha=(rn==null?void 0:rn.clientId)??null,Bn=ha?((Dn=w.data)==null?void 0:Dn.find(ye=>ye.id===ha))??null:null,Pa=ha&&m?(Bn==null?void 0:Bn.hostname)??ha:null,ma=qe.runtimeProvider??"claude-code",Jt=ma==="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(ob,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),et.map(ye=>l.jsxs("div",{children:[ye.divider&&l.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),l.jsx(JG,{label:ye.label,active:Ce===ye.anchor,danger:ye.danger??!1,dirty:At.has(ye.anchor),onClick:()=>L(ye.anchor)})]},ye.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(gF,{style:{marginBottom:"var(--sp-2)"},children:[l.jsx(yF,{onClick:()=>n("/team"),children:"Agents"}),l.jsx(vF,{}),l.jsx(bF,{mono:!0,children:qe.name??Gt})]}),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(Fc,{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_${Gt}`,children:qe.displayName}),l.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",qe.name??Gt]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[l.jsx(dr,{tone:qe.type==="autonomous_agent"?"accent":"neutral",children:qe.type}),qe.visibility&&l.jsx(dr,{tone:qe.visibility==="organization"?"accent":"outline",children:qe.visibility}),(rn==null?void 0:rn.offlineSince)&&l.jsxs("span",{className:"mono",children:["offline since ",cc(rn.offlineSince)]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(vc,{state:vt}),l.jsxs(be,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${qe.uuid}`),children:[l.jsx(Av,{className:"h-3 w-3"})," Open chat"]}),!Mn&&f&&qe.status==="active"&&l.jsxs(be,{variant:"outline",size:"xs",onClick:()=>{G.reset(),G.mutate()},disabled:Fe.disabled,title:Fe.title,children:[l.jsx(ZE,{className:"h-3 w-3"}),G.isPending?"Testing…":"Test"]})]})]}),l.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[l.jsx(kf,{label:"sessions",value:ir.sessions}),l.jsx(kf,{label:"active",value:ir.active,accent:typeof ir.active=="number"&&ir.active>0?"var(--accent)":void 0}),l.jsx(kf,{label:"runtime",value:ir.runtime}),l.jsx(kf,{label:"model",value:ir.model})]})]}),l.jsx("div",{ref:St,"aria-hidden":!0,style:{height:0}}),!Mn&&l.jsx(RF,{runtimeLabel:Jt,computerLabel:Pa,visible:Y}),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:[(G.data||G.error)&&l.jsx(iV,{result:G.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>G.reset()}),l.jsx(Hs,{anchorId:tr.overview,title:"Profile",right:f?l.jsxs(be,{variant:"outline",size:"xs",onClick:()=>n(`/settings/integrations?agent=${qe.uuid}`),title:"Manage platform bindings in Integrations",children:[l.jsx(Ey,{className:"h-3 w-3"}),"Manage bindings"]}):null,children:l.jsx(qF,{agent:qe,canEdit:f,onSave:async ye=>{await Q.mutateAsync(ye)}})}),l.jsx(Hs,{anchorId:"ad-appearance",title:"Appearance",children:l.jsx(_F,{agent:qe,canEdit:f,onSave:async ye=>{await Q.mutateAsync(ye)},onRefresh:async()=>{await a.invalidateQueries({queryKey:["agent",t]}),await a.invalidateQueries({queryKey:["agents"]}),await a.invalidateQueries({queryKey:["me","chats"]})}})}),!Mn&&!f&&l.jsx(WG,{}),m&&l.jsxs(l.Fragment,{children:[l.jsxs(Hs,{anchorId:tr.setup,title:"Setup",caption:((gr=h.data)==null?void 0:gr.version)!=null?l.jsxs("span",{className:"mono",children:["config v",h.data.version,x.summary.anyDirty&&l.jsxs(l.Fragment,{children:[" · ",l.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[h.isLoading&&l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),h.error&&l.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(h.error)]}),h.data&&l.jsx(HG,{runtimeProvider:ma,computerLabel:Pa,computerStatusLoading:an,computerStatusError:fa,canBindComputer:ue&&qe.status==="active",bindComputerPending:re.isPending,onBindComputer:()=>ee(!0),onRebind:qe.clientId?()=>V(!0):void 0,modelSlot:l.jsx(r$,{value:x.draft.model,baseline:((Ei=h.data)==null?void 0:Ei.payload.model)??"",onChange:x.setModel,onRevert:x.revertModel,disabled:qe.status!=="active",provider:ma})})]}),l.jsx(Hs,{anchorId:tr.prompt,title:"Prompt",children:h.data?l.jsx(RG,{value:x.draft.promptAppend,baseline:((Ci=h.data)==null?void 0:Ci.payload.prompt.append)??"",onChange:x.setPromptAppend,onRevert:x.revertPrompt,disabled:qe.status!=="active"}):null}),l.jsx(Hs,{anchorId:tr.tools,title:"Tools",caption:"MCP servers available to this agent",children:h.data?l.jsx(VF,{items:x.draft.mcp,otherNames:Un,onAdd:x.addMcp,onUpdate:x.updateMcp,onDelete:x.deleteMcp,onUndoDelete:x.undoDeleteMcp,disabled:qe.status!=="active"}):null}),l.jsx(Hs,{anchorId:tr.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:h.data&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{id:sh("env"),children:l.jsx(IF,{items:x.draft.env,otherKeys:Fo,onAdd:x.addEnv,onUpdate:x.updateEnv,onDelete:x.deleteEnv,onUndoDelete:x.undoDeleteEnv,disabled:qe.status!=="active"})}),l.jsx("div",{id:sh("git"),children:l.jsx(BF,{items:x.draft.git,otherPaths:ka,onAdd:x.addGit,onUpdate:x.updateGit,onDelete:x.deleteGit,onUndoDelete:x.undoDeleteGit,disabled:qe.status!=="active"})}),Ee&&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:Ee}),x.summary.anyDirty&&l.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:l.jsx("button",{type:"button",onClick:()=>Le.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:Le.isPending,children:Le.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),f&&l.jsxs(l.Fragment,{children:[l.jsx(FG,{}),l.jsx(OF,{agent:qe,suspendPending:ce.isPending,reactivatePending:X.isPending,deletePending:W.isPending,errorMessage:A,onSuspend:()=>ce.mutate(),onReactivate:()=>X.mutate(),onDelete:()=>W.mutate()})]})]}),m&&l.jsx(BG,{summary:x.summary,saveHint:Ft,conflictMessage:E,errorMessage:k,saving:P.isPending,reloadingRemote:D,justSaved:R,onSave:()=>P.mutate(),onDiscard:()=>{x.summary.anyDirty&&Re(!0)},onReloadRemote:()=>{z()},onJumpTo:ye=>L(Jk(ye))})]}),l.jsx(eV,{open:xe,onOpenChange:Re,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:()=>{x.resetAll(),j(null),C(null),Re(!1)}}),l.jsx(Cn,{open:se,onOpenChange:ye=>{ee(ye),ye||(M(""),B(null),re.reset())},children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{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(tV,{clients:Z.data??[],selected:ve,onSelect:M}),U&&l.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:U})]}),l.jsxs(rr,{children:[l.jsx(be,{variant:"outline",onClick:()=>ee(!1),children:"Cancel"}),l.jsx(be,{disabled:!ve||re.isPending,onClick:()=>{B(null),re.mutate(ve)},children:re.isPending?"Binding…":"Bind"})]})]})}),l.jsx(DG,{open:_,onOpenChange:V,agent:qe})]})}function WG(){return l.jsx(Hs,{anchorId:"ad-runtime-readonly",title:"Runtime configuration",children:l.jsx("div",{className:"text-body",style:{padding:"var(--sp-3)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-panel)",background:"var(--bg-raised)",color:"var(--fg-3)"},children:"You can view this shared agent profile. Runtime configuration, bindings, testing, and lifecycle controls are limited to the agent manager or an organization admin."})})}function JG({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 eV(e){return l.jsx(Cn,{open:e.open,onOpenChange:e.onOpenChange,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:e.title})}),l.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),l.jsxs(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),l.jsx(be,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function tV({clients:e,selected:t,onSelect:n}){const a=e.filter(rk);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 connect <token>"})," 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;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:rk(s)?"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 nV={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},rV={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},aV={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function iV({result:e,onDismiss:t}){const n=rV[e.status],a=aV[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(dr,{tone:a,children:nV[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(be,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function sV(e,t){const n=`?window=${encodeURIComponent(t)}`;return je.get(xy(e,`/context-tree/snapshot${n}`))}const ej="7d";function lV({previewSnapshot:e}={}){const{organizationId:t}=lt(),[n,a]=b.useState(null),s=e!==void 0,o=Ye({queryKey:["context-tree-snapshot",t,ej,s],queryFn:()=>{if(!t)throw new Error("No organization selected");return sV(t,ej)},enabled:!s&&!!t}),c=e??o.data,f=b.useMemo(()=>c?c.updates.find(h=>h.id===n)??c.updates[0]??null:null,[n,c]),m=(f==null?void 0:f.nodeId)??null;return b.useEffect(()=>{var h;c&&(n&&c.updates.some(p=>p.id===n)||a(((h=c.updates[0])==null?void 0:h.id)??null))},[n,c]),l.jsxs("div",{className:"context-live-page",style:{display:"flex",flexDirection:"column",gap:"var(--sp-10)"},children:[!s&&o.isLoading?l.jsx(dV,{}):null,!s&&o.error?l.jsx(fV,{message:o.error instanceof Error?o.error.message:"Failed to load"}):null,c&&(s||!o.isLoading)?c.snapshotStatus==="unavailable"?l.jsx(hV,{snapshot:c}):l.jsxs(l.Fragment,{children:[l.jsx(oV,{snapshot:c}),l.jsx(uV,{snapshot:c,selectedNodeId:m,onSelectNode:h=>{const p=c.updates.find(g=>g.nodeId===h);a((p==null?void 0:p.id)??null)}}),l.jsx(cV,{snapshot:c})]}):null]})}function oV({snapshot:e}){const t=EV(e.syncedAt)??"sync time unknown",n=kV(e.contextStatus.severity),a=e.contextStatus.severity==="ok"?null:e.contextStatus.detail??e.contextStatus.label;return l.jsxs("section",{className:"context-live-hero","aria-label":e.contextStatus.label,children:[l.jsxs("div",{className:"context-live-title-row",children:[l.jsx("span",{"aria-hidden":"true",className:"context-live-dot",style:{background:n,"--context-live-dot-color":n}}),l.jsx("h2",{className:"m-0 context-live-title",children:"Context tree is live"})]}),l.jsxs("div",{className:"text-lead context-live-subtitle",children:["Last updated at ",l.jsx("strong",{children:t})]}),a?l.jsx("div",{className:"text-body context-live-status-detail",children:a}):null]})}function uV({snapshot:e,selectedNodeId:t,onSelectNode:n}){const a=b.useMemo(()=>gV(e.nodes),[e.nodes]),s=b.useMemo(()=>bV(e.nodes,t),[e.nodes,t]),o=b.useMemo(()=>xV(a,s),[a,s]),c=Math.max(e.summary.changedNodeCount,e.updates.length);return l.jsxs("section",{className:"context-map-section","aria-label":"Context Tree update change map",children:[l.jsx("div",{className:"text-label context-map-kicker",children:"Past 7 days · Top updated domains"}),l.jsx("div",{className:"context-map-frame",children:o.length===0?l.jsx(mV,{}):l.jsxs("svg",{viewBox:"0 0 920 420",role:"img","aria-label":"Recent Context Tree update branches",preserveAspectRatio:"xMidYMid meet",className:"context-network-svg",children:[l.jsx("title",{children:"Update Change Map"}),l.jsx("circle",{className:"context-network-live-halo",cx:"460",cy:"210",r:"104"}),o.map(f=>l.jsx("path",{d:wV(f),fill:"none",stroke:f.selected?"var(--ok)":"var(--border-strong)",strokeDasharray:"5 8",strokeLinecap:"round",strokeOpacity:f.selected?.7:.36,strokeWidth:f.selected?2:1.4},`path:${f.id}`)),l.jsx("foreignObject",{x:"338",y:"122",width:"244",height:"176",className:"context-network-card-wrap",children:l.jsxs("div",{className:"context-network-summary-card",children:[l.jsx("span",{className:"context-network-summary-icon","aria-hidden":"true",children:l.jsx(UD,{size:30,strokeWidth:2.3})}),l.jsx("span",{className:"context-network-summary-title",children:"Context Tree"}),l.jsxs("span",{className:"context-network-summary-scale",children:[Pg(e.nodes.length),l.jsx("span",{children:"total nodes"})]}),l.jsxs("span",{className:"text-body context-network-summary-badge",children:["+",Pg(c)," updates"]})]})}),o.map(f=>l.jsx("foreignObject",{x:f.x,y:f.y,width:f.width,height:f.height,className:"context-network-card-wrap",children:l.jsxs("button",{type:"button",className:f.selected?"context-network-card is-live":"context-network-card",onClick:()=>n(f.representativeNodeId),children:[l.jsx("span",{className:"context-network-pin","aria-hidden":"true"}),l.jsx("span",{className:"text-subtitle context-network-title",children:f.title}),l.jsx("span",{className:"context-change-breakdown",children:vV(f.changeCounts).map(m=>l.jsxs("span",{"data-change-type":m.type,children:[Pg(m.count)," ",m.label]},m.type))})]})},f.id))]})})]})}function cV({snapshot:e}){const t=e.usage.windowDays===1?"1 day":`${e.usage.windowDays} days`,n=e.usage.agentCount===1?"1 agent":`${e.usage.agentCount} agents`,a=e.usage.usageCount===1?"1 time":`${e.usage.usageCount} times`;return l.jsxs("div",{className:"text-lead context-signal",style:{color:"var(--fg-3)"},children:[l.jsxs("span",{children:["In the last ",t,", ",l.jsx("mark",{children:n})]}),l.jsxs("span",{children:["used the tree ",l.jsx("mark",{children:a})," to make design decisions."]})]})}function dV(){return l.jsx(Kn,{children:l.jsx(Zr,{children:l.jsxs("div",{className:"flex items-center text-body",style:{color:"var(--fg-2)",gap:"var(--sp-2)"},children:[l.jsx(GD,{size:17}),"Loading team context..."]})})})}function fV({message:e}){return l.jsx(Kn,{children:l.jsx(Zr,{children:l.jsxs("div",{className:"flex items-center text-body",style:{color:"var(--danger)",gap:"var(--sp-2)"},children:[l.jsx(Lc,{size:17}),e]})})})}function hV({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?jV(e.repo):null;return l.jsx(Kn,{children:l.jsx(Zr,{children:l.jsxs("div",{className:"flex items-start text-body",style:{color:"var(--fg-2)",gap:"var(--sp-2)"},children:[l.jsx(Lc,{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 mV(){return l.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No context updates in the past 7 days."})}function pV(e){const t=new Map(e.map(a=>[a.id,a])),n=new Set;for(const a of e)a.changeType&&SV(a.id,t,n);return e.filter(a=>n.has(a.id))}function gV(e){const t=pV(e).filter(s=>s.changeType);if(t.length===0)return[];const n=new Map(e.map(s=>[s.id,s])),a=new Map;for(const s of t){const o=_T(s,n),c=a.get(o.id);if(c){a.set(o.id,{...c,updateCount:c.updateCount+1,changeCounts:tj(c.changeCounts,s.changeType),representativeNodeId:c.representativeNodeId===o.id?s.id:c.representativeNodeId});continue}a.set(o.id,{id:o.id,title:o.title,path:o.path,representativeNodeId:s.id,updateCount:1,changeCounts:tj(yV(),s.changeType)})}return[...a.values()].sort((s,o)=>o.updateCount-s.updateCount||s.path.localeCompare(o.path)).slice(0,4)}function yV(){return{added:0,edited:0,removed:0}}function tj(e,t){return t==="added"?{...e,added:e.added+1}:t==="edited"?{...e,edited:e.edited+1}:t==="removed"?{...e,removed:e.removed+1}:e}function vV(e){const t=[];return e.added>0&&t.push({type:"added",label:"added",count:e.added}),e.edited>0&&t.push({type:"edited",label:"edited",count:e.edited}),e.removed>0&&t.push({type:"removed",label:"removed",count:e.removed}),t}function bV(e,t){if(!t)return null;const n=new Map(e.map(s=>[s.id,s])),a=n.get(t);return a?_T(a,n).id:null}function xV(e,t){const n=[{x:96,y:34,width:196,height:98,anchorX:292,anchorY:83},{x:628,y:34,width:196,height:98,anchorX:628,anchorY:83},{x:96,y:286,width:196,height:98,anchorX:292,anchorY:335},{x:628,y:286,width:196,height:98,anchorX:628,anchorY:335}],a=n[n.length-1];return a?e.map((s,o)=>{const c=n[o]??a;return{...s,...c,selected:s.id===t||t===null&&o===0}}):[]}function wV(e){const s=460+(e.anchorX<460?-1:1)*124,o=210+(e.anchorY>210?48:-48),c=(s+e.anchorX)/2,f=e.anchorY>210?o+62:o-62;return`M ${s} ${o} Q ${c} ${f} ${e.anchorX} ${e.anchorY}`}function _T(e,t){let n=e,a=n.parentId?t.get(n.parentId):void 0;for(;a&&a.parentId!==null;)n=a,a=n.parentId?t.get(n.parentId):void 0;return n}function SV(e,t,n){let a=t.get(e);for(;a;)n.add(a.id),a=a.parentId?t.get(a.parentId):void 0}function kV(e){return e==="ok"?"var(--ok)":e==="warning"?"var(--warn)":"var(--danger)"}function jV(e){return e.replace(/(https?:\/\/)[^/@\s]+@/g,"$1[redacted]@")}function Pg(e){return new Intl.NumberFormat("en-US").format(e)}function EV(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(e)):null}const Io=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}));Io.displayName="Card";const Lo=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Lo.displayName="CardHeader";const Vc=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("text-subtitle leading-none",e),...t}));Vc.displayName="CardTitle";const TT=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("text-body text-muted-foreground",e),...t}));TT.displayName="CardDescription";const Po=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Po.displayName="CardContent";const CV=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));CV.displayName="CardFooter";function NV(){const{token:e}=jE(),t=Rn(),{isAuthenticated:n,adoptTokens:a}=lt(),[s,o]=b.useState(null),[c,f]=b.useState(null),[m,h]=b.useState(!1),[p,g]=b.useState(null);if(b.useEffect(()=>{e&&(async()=>{try{const E=await fetch(`/api/v1/invitations/${encodeURIComponent(e)}/preview`);if(!E.ok){f("This invitation is no longer valid");return}o(await E.json())}catch{f("Network error while loading invitation")}})()},[e]),b.useEffect(()=>{n&&(async()=>{try{const E=await je.get("/me/organizations"),C=await je.get("/me"),A=E.find(O=>O.id===C.member.organizationId);g((A==null?void 0:A.displayName)??null)}catch{}})()},[n]),!e)return l.jsx(nj,{message:"Bad invitation URL"});if(c)return l.jsx(nj,{message:"This invitation is no longer valid"});if(!s)return l.jsx(_V,{});const w=async()=>{h(!0);try{const E=await je.post("/me/organizations/join",{token:e});await a(E.tokens),IE("invite"),t("/",{replace:!0})}catch(E){f(E instanceof Error?E.message:"Failed to join team")}finally{h(!1)}},x=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,k=n&&p&&p!==s.organizationDisplayName,j=TV(s.expiresAt);return l.jsx(Tb,{children:l.jsxs(Io,{className:"w-full max-w-sm",children:[l.jsx(Lo,{className:"text-center",children:l.jsxs(Vc,{className:"text-title",children:["You're invited to join",l.jsx("br",{}),s.organizationDisplayName]})}),l.jsxs(Po,{className:"space-y-4",children:[k&&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(Lc,{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(be,{className:"w-full",disabled:m,onClick:w,children:m?"Joining…":`Join ${s.organizationDisplayName}`}):l.jsx(be,{asChild:!0,className:"w-full",children:l.jsxs("a",{href:x,children:[l.jsx(qE,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),j&&l.jsx("p",{className:"text-center text-label",style:{color:j.urgent?"var(--destructive)":"var(--fg-3)"},children:j.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 Tb({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(zc,{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(Nv,{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 _V(){return l.jsx(Tb,{children:l.jsxs(Io,{className:"w-full max-w-sm",children:[l.jsxs(Lo,{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(Po,{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 nj({message:e}){return l.jsx(Tb,{children:l.jsxs(Io,{className:"w-full max-w-sm",children:[l.jsxs(Lo,{className:"text-center",children:[l.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:l.jsx(Lc,{className:"h-6 w-6"})}),l.jsx(Vc,{className:"text-title",children:e})]}),l.jsxs(Po,{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(be,{asChild:!0,variant:"outline",className:"w-full",children:l.jsxs(zc,{to:"/",children:[l.jsx(Nv,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function TV(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 AV(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===W1&&s!==W1?null:o}function RV(){const{isAuthenticated:e}=lt(),t=Tr(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=AV(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(Jn,{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(zc,{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(Nv,{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(Io,{className:"w-full max-w-sm",children:[l.jsxs(Lo,{className:"text-center",children:[l.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:l.jsx(Fc,{width:28,height:32})}),l.jsxs(Vc,{className:"text-title",children:["First Tree ",l.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),l.jsxs(Po,{className:"space-y-4",children:[l.jsx(be,{asChild:!0,className:"w-full",children:l.jsxs("a",{href:s,children:[l.jsx(qE,{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(be,{asChild:!0,variant:"outline",className:"w-full",children:l.jsxs("a",{href:o,children:[l.jsx(i3,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function OV(){const e=Rn(),{adoptTokens:t}=lt(),[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"),f=o.get("refresh"),m=VN(o.get("next")),h=o.get("joinPath");if(!c||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&IE(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:c,refreshToken:f}),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 wc=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}));wc.displayName="DenseTable";const Sc=b.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:e,...t}));Sc.displayName="DenseTableHeader";const kc=b.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:e,...t}));kc.displayName="DenseTableBody";const _r=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}));_r.displayName="DenseTableRow";const Qt=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}));Qt.displayName="DenseTableHead";const at=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}));at.displayName="DenseTableCell";function Uo({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 MV=1500;function DV({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:f="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),MV))},w=t!==void 0?Math.max(1,Math.round(t/60)):null,x=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,w!==null&&l.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",w,"m"]})]}):"Generating token…"}),k=l.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:!e,style:{alignSelf:"flex-start"},children:[h?l.jsx(fr,{className:"h-3.5 w-3.5"}):l.jsx($E,{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:[x,k]}):l.jsxs(l.Fragment,{children:[x,k]}),f&&l.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:f}),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(zV,{}),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(fr,{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 zV(){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 IV=3e3,LV=1200;function PV({open:e,onOpenChange:t}){const n=gn(),{user:a}=lt(),[s,o]=b.useState("loading"),[c,f]=b.useState(null),[m,h]=b.useState(null),[p,g]=b.useState(null),w=b.useRef(new Set);return b.useEffect(()=>{if(!e){o("loading"),f(null),h(null),g(null),w.current=new Set;return}let x=!1;const k=(n.getQueryData(["clients"])??[]).map(j=>j.id);return w.current=new Set(k),(async()=>{try{const j=await W3();if(x)return;f(j),o("waiting")}catch(j){if(x)return;h(j instanceof Error?j.message:"Failed to generate connect token"),o("error")}})(),()=>{x=!0}},[e,n]),b.useEffect(()=>{if(!e||s!=="waiting"||!a)return;const k=setInterval(async()=>{try{const j=await n.fetchQuery({queryKey:["clients"],queryFn:gi}),E=w.current,C=j.find(A=>!E.has(A.id)&&A.status==="connected"&&A.userId===a.id);C&&(g(C.hostname??null),o("success"))}catch{}},IV);return()=>clearInterval(k)},[e,s,n,a]),b.useEffect(()=>{if(s!=="success")return;const x=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},LV);return()=>clearTimeout(x)},[s,t,n]),l.jsx(Cn,{open:e,onOpenChange:t,children:l.jsxs(yn,{children:[l.jsxs(On,{children:[l.jsx(Nn,{children:"Connect computer"}),l.jsx(Bv,{children:"Run this command on the machine you want to pair with this Hub."})]}),l.jsx(DV,{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(be,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function UV({embedded:e=!1}={}){const t=gn(),n=xh(),{role:a,user:s}=lt(),o=a==="admin",[c,f]=b.useState(()=>new Set),[m,h]=b.useState(null),[p,g]=b.useState(null),[w,x]=b.useState(null),[k,j]=b.useState(!1),E=Ye({queryKey:["clients","org"],queryFn:Y3,enabled:o,refetchInterval:1e4}),C=Ye({queryKey:["clients","me"],queryFn:gi,enabled:!o||E.isError,refetchInterval:1e4}),A=Ye({queryKey:["members"],queryFn:cb,enabled:o,staleTime:6e4}),O=o&&!E.isError,D=o&&E.isError,I=O?E.data:C.data,{data:R}=Ye({queryKey:["activity"],queryFn:Pc,refetchInterval:1e4}),F=yt({mutationFn:X3,onSuccess:()=>{h(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})}}),P=yt({mutationFn:K3,onSuccess:()=>{g(null),x(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})},onError:ee=>{ee instanceof xs?x(ee.message):x(ee instanceof Error?ee.message:String(ee))}}),te=b.useMemo(()=>{const ee=new Map;for(const ve of(R==null?void 0:R.agents)??[]){if(!ve.clientId)continue;const M=ee.get(ve.clientId)??[];M.push(ve),ee.set(ve.clientId,M)}return ee},[R==null?void 0:R.agents]),z=ee=>te.get(ee)??[],L=b.useMemo(()=>!O||!E.data||!s?[]:[...E.data].filter(ee=>ee.userId===s.id).sort((ee,ve)=>ee.lastSeenAt>ve.lastSeenAt?-1:ee.lastSeenAt<ve.lastSeenAt?1:0),[O,E.data,s]),Q=b.useMemo(()=>!O||!E.data||!s?[]:[...E.data].filter(ee=>ee.userId!==s.id).sort((ee,ve)=>ee.lastSeenAt>ve.lastSeenAt?-1:ee.lastSeenAt<ve.lastSeenAt?1:0),[O,E.data,s]),ce=b.useMemo(()=>{const ee=new Map;for(const ve of A.data??[])ee.set(ve.userId,ve.displayName);return ee},[A.data]),X=ee=>{if(ee.userId===null)return{text:"—"};if(ee.userId===(s==null?void 0:s.id)){const M=ce.get(ee.userId);return{text:M?`${M} (you)`:"you"}}const ve=ce.get(ee.userId);return ve?{text:ve}:{text:ee.userId.slice(0,8),title:ee.userId}},W=(I??[]).filter(ee=>ee.status==="connected").length,G=(I??[]).reduce((ee,ve)=>ee+ve.agentCount,0),se=(I??[]).filter(ee=>ee.authState!=="ok").length;return l.jsxs("div",{className:e?"":"-m-6",children:[l.jsx(Uo,{title:"Computers",subtitle:I&&I.length>0?l.jsxs(l.Fragment,{children:[I.length," total · ",W," connected · ",G," agents bound",se>0&&l.jsxs(l.Fragment,{children:[" · ",l.jsxs("span",{style:{color:"var(--state-error)"},children:[se," need re-auth"]})]})]}):null,right:l.jsx("div",{className:"flex items-center gap-1.5",children:l.jsxs(be,{size:"xs",onClick:()=>j(!0),children:[l.jsx(wa,{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(PV,{open:k,onOpenChange:j}),p&&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:p.hostname??p.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)."]}),z(p.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:z(p.id).map(ee=>l.jsx("li",{className:"font-medium",children:n(ee.agentId)},ee.agentId))})]}),w&&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:w}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(be,{variant:"outline",size:"sm",onClick:()=>{g(null),x(null)},children:"Cancel"}),l.jsx(be,{variant:"destructive",size:"sm",onClick:()=>P.mutate(p.id),disabled:P.isPending,children:P.isPending?"Retiring…":"Retire"})]})]})}),m&&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:m.hostname??m.id.slice(0,8)})," ","and affect all bound agents:"]}),l.jsx("ul",{className:"mb-4 space-y-1",children:z(m.id).length===0?l.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):z(m.id).map(ee=>l.jsxs("li",{className:"text-body flex items-center gap-2",children:[l.jsx("span",{className:"font-medium",children:n(ee.agentId)}),l.jsx(vc,{state:ee.runtimeState})]},ee.agentId))}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(be,{variant:"outline",size:"sm",onClick:()=>h(null),children:"Cancel"}),l.jsx(be,{variant:"destructive",size:"sm",onClick:()=>F.mutate(m.id),disabled:F.isPending,children:F.isPending?"Disconnecting…":"Disconnect"})]})]})}),!I||I.length===0?l.jsxs(Kn,{children:[D&&l.jsx(aj,{}),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:[D&&l.jsx(aj,{}),l.jsxs($y,{children:["Registered · ",I.length]}),l.jsxs(wc,{children:[l.jsx(Sc,{children:l.jsxs(_r,{children:[l.jsx(Qt,{style:{width:16}}),l.jsx(Qt,{children:"Hostname"}),O&&l.jsx(Qt,{children:"Owner"}),l.jsx(Qt,{children:"OS"}),l.jsx(Qt,{children:"SDK"}),l.jsx(Qt,{children:"Agents"}),l.jsx(Qt,{children:"Connected"}),l.jsx(Qt,{children:"Status"}),l.jsx(Qt,{"aria-hidden":!0})]})}),l.jsx(kc,{children:O?l.jsxs(l.Fragment,{children:[l.jsx(ij,{icon:Ov,title:"Your computers",count:L.length,colSpan:Ju}),L.length===0?l.jsx(sj,{colSpan:Ju,message:"No computers of your own."}):L.map(ee=>{const ve=!c.has(ee.id),M=z(ee.id);return l.jsx(Ug,{client:ee,boundAgents:M,isExpanded:ve,agentName:n,onToggle:()=>f(U=>{const B=new Set(U);return B.has(ee.id)?B.delete(ee.id):B.add(ee.id),B}),onDisconnect:()=>h(ee),onRetire:()=>{x(null),g(ee)},onReconnect:()=>j(!0),showOwner:!0,ownerLabel:X(ee)},ee.id)}),l.jsx(ij,{icon:VE,title:"Team computers",count:Q.length,colSpan:Ju}),Q.length===0?l.jsx(sj,{colSpan:Ju,message:"No other team computers."}):Q.map(ee=>{const ve=!c.has(ee.id),M=z(ee.id);return l.jsx(Ug,{client:ee,boundAgents:M,isExpanded:ve,agentName:n,onToggle:()=>f(U=>{const B=new Set(U);return B.has(ee.id)?B.delete(ee.id):B.add(ee.id),B}),onDisconnect:()=>{},onRetire:()=>{},onReconnect:()=>{},showOwner:!0,ownerLabel:X(ee),restricted:!0},ee.id)})]}):I.map(ee=>{const ve=!c.has(ee.id),M=z(ee.id);return l.jsx(Ug,{client:ee,boundAgents:M,isExpanded:ve,agentName:n,onToggle:()=>f(U=>{const B=new Set(U);return B.has(ee.id)?B.delete(ee.id):B.add(ee.id),B}),onDisconnect:()=>h(ee),onRetire:()=>{x(null),g(ee)},onReconnect:()=>j(!0)},ee.id)})})]})]})]})]})}const BV={"claude-code":"Claude Code",codex:"Codex"},FV=[eh.CLAUDE_CODE,eh.CODEX],rj={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},$V={"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 HV({clientId:e,enabled:t}){const{data:n,isLoading:a}=Ye({queryKey:["client-capabilities",e],queryFn:()=>ph(e),enabled:t}),s=(n==null?void 0:n.capabilities)??null;return l.jsxs(l.Fragment,{children:[l.jsx(ob,{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:FV.map(o=>l.jsx(qV,{provider:o,entry:s?s[o]??null:null},o))})]})}function qV({provider:e,entry:t}){const n=BV[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 · ",rj[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 ·"," ",$V[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 · ",rj[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 ZV(){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"]})}const AT=8,Ju=AT+1;function aj(){return l.jsx("div",{className:"text-body",style:{margin:"var(--sp-3) var(--sp-3) 0",padding:"var(--sp-2_5) var(--sp-3)",borderRadius:"var(--radius-panel)",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:"Failed to load team computers. Showing only your computers."})}function ij({icon:e,title:t,count:n,colSpan:a}){return l.jsx(_r,{children:l.jsx("td",{colSpan:a,style:{padding:"var(--sp-6) var(--sp-3_5) var(--sp-2) 0"},children:l.jsxs("span",{className:"inline-flex items-center",style:{gap:"var(--sp-2)"},children:[l.jsx(e,{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:t}),l.jsx(dr,{tone:"outline",children:n})]})})})}function sj({colSpan:e,message:t}){return l.jsx(_r,{children:l.jsx("td",{colSpan:e,className:"text-body",style:{padding:"var(--sp-3) var(--sp-3_5)",color:"var(--fg-4)"},children:t})})}function Ug({client:e,boundAgents:t,isExpanded:n,agentName:a,onToggle:s,onDisconnect:o,onRetire:c,onReconnect:f,showOwner:m=!1,ownerLabel:h,restricted:p=!1}){const g=m?Ju:AT,w=e.status!=="connected",x=p?!1:n,k=e.authState!=="ok",j=e.status==="connected"?"idle":"offline";return l.jsxs(l.Fragment,{children:[l.jsxs(_r,{interactive:!p,selected:x,onClick:p?void 0:s,children:[l.jsx(at,{style:{width:16},children:p?null:l.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:x?l.jsx(_v,{className:"h-3.5 w-3.5"}):l.jsx(yD,{className:"h-3.5 w-3.5"})})}),l.jsx(at,{className:"font-medium",children:e.hostname??"—"}),m&&l.jsx(at,{style:{color:"var(--fg-3)"},title:h==null?void 0:h.title,children:(h==null?void 0:h.text)??"—"}),l.jsx(at,{style:{color:"var(--fg-3)"},children:e.os??"—"}),l.jsx(at,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),l.jsx(at,{children:l.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),l.jsx(at,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?cc(e.connectedAt):"—"}),l.jsx(at,{children:k?l.jsx(ZV,{}):l.jsx(vc,{state:j})}),l.jsx(at,{style:{width:1,whiteSpace:"nowrap"},children:p?null:l.jsxs("div",{className:"flex items-center justify-end text-label",style:{gap:"var(--sp-3_5)"},children:[w&&l.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:k?"var(--state-error)":"var(--fg-2)"},onClick:E=>{E.stopPropagation(),f()},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:E=>{E.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:E=>{E.stopPropagation(),c()},children:"Retire"})]})})]}),x&&l.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[l.jsx(at,{}),l.jsxs(at,{colSpan:g-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[l.jsx(HV,{clientId:e.id,enabled:x}),t.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs(ob,{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(E=>l.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[l.jsx("span",{className:"font-medium",style:{minWidth:140},children:a(E.agentId)}),l.jsx(vc,{state:E.runtimeState}),E.activeSessions!==null&&l.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[E.activeSessions," / ",E.totalSessions??0," sessions"]})]},E.agentId))})]})]})]})]})}function GV(){return l.jsx(UV,{embedded:!0})}async function VV(e){try{return await je.get(`/orgs/${e}/github-app-installation`)}catch(t){if(t instanceof xs&&t.status===404)return null;throw t}}async function QV(e){const{installUrl:t}=await je.get(`/orgs/${e}/github-app-installation/install-url`);return t}function Qc({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 KV({isFirst:e=!1}){const{organizationId:t}=lt(),n=Ye({queryKey:["github-app-installation",t],queryFn:()=>t?VV(t):Promise.reject(new Error("no org")),enabled:!!t});return l.jsx(Qc,{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(YV,{organizationId:t}):l.jsx(XV,{data:n.data})})}function YV({organizationId:e}){const t=yt({mutationFn:()=>{if(!e)throw new Error("No organization selected");return QV(e)},onSuccess:o=>{window.location.assign(o)}}),n=t.error instanceof xs&&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(Tv,{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 XV({data:e}){const t=e.accountType==="Organization"?hD:Ov,n=Object.entries(e.permissions);return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[e.suspended&&l.jsx(WV,{}),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(Tv,{className:"h-3 w-3"})]}),l.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)"},children:["Installation #",e.installationId]})]})]})}function WV(){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(bD,{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 JV(){const{role:e}=lt();return e===null?l.jsx("div",{className:"text-body",style:{padding:"var(--sp-5)",color:"var(--fg-3)"},children:"Loading..."}):e!=="admin"?l.jsx(Jn,{to:"/settings/computers",replace:!0}):l.jsxs(l.Fragment,{children:[l.jsx(Uo,{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(KV,{isFirst:!0})})]})}function eQ(){return je.get(dn("/adapter-mappings"))}function tQ(e){return je.post(dn("/adapter-mappings"),e)}function nQ(e){return je.delete(`/adapter-mappings/${e}`)}function rQ(){return je.get(dn("/adapters/status"))}function aQ(){return je.get(dn("/adapters"))}function iQ(e){return je.post(dn("/adapters"),e)}function sQ(e,t){return je.patch(`/adapters/${e}`,t)}function lQ(e){return je.delete(`/adapters/${e}`)}const oQ=Object.values(oB),lj={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function oj(e){const[t,n]=b.useState(lj),[a,s]=b.useState("");b.useEffect(()=>{e.open&&(n({...lj,platform:e.initialPlatform??"feishu",status:e.initialStatus??"active"}),s(""))},[e.open,e.initialPlatform,e.initialStatus]);function o(f){if(f.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=uQ(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(Cn,{open:e.open,onOpenChange:e.onOpenChange,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:c})}),l.jsxs("form",{onSubmit:o,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"binding-platform",children:"Platform"}),l.jsx("select",{id:"binding-platform",value:t.platform,onChange:f=>n({...t,platform:f.target.value}),disabled:!!e.editingId,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:oQ.map(f=>l.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"binding-ext-id",children:"External user ID"}),l.jsx(Zt,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"binding-name",children:"Display name (optional)"}),l.jsx(Zt,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.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(dt,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),l.jsx(Zt,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(dt,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),l.jsx(Zt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs(dt,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),l.jsx(Zt,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(dt,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),l.jsx(Zt,{id:"kael-project-id",value:t.kaelProjectId,onChange:f=>n({...t,kaelProjectId:f.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!e.editingId&&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(dt,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),l.jsx("textarea",{id:"binding-creds",value:t.credentialsJson,onChange:f=>n({...t,credentialsJson:f.target.value}),rows:4,className:"flex w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),a&&l.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"binding-status",children:"Status"}),l.jsxs("select",{id:"binding-status",value:t.status,onChange:f=>n({...t,status:f.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[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(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),l.jsx(be,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function uQ(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 cQ(){var _;const e=Rn(),t=gn(),[n,a]=Oo(),s=n.get("agent"),o=xh(),c=Ye({queryKey:["adapters"],queryFn:aQ}),f=Ye({queryKey:["adapter-mappings"],queryFn:eQ}),m=Ye({queryKey:["adapter-statuses"],queryFn:rQ,refetchInterval:15e3}),p=((_=Ye({queryKey:["agents","name-map"],queryFn:()=>Bc({limit:100}),staleTime:3e4}).data)==null?void 0:_.items)??[],g=b.useMemo(()=>{const V=new Map;for(const Z of m.data??[])V.set(Z.configId,Z);return V},[m.data]),w=b.useMemo(()=>{const V=c.data??[];return s?V.filter(Z=>Z.agentId===s):V},[c.data,s]),x=b.useMemo(()=>{const V=f.data??[];return s?V.filter(Z=>Z.agentId===s):V},[f.data,s]),k=w.reduce((V,Z)=>{var re;return V+((re=g.get(Z.id))!=null&&re.connected?1:0)},0),j=w.length-k,E=c.isLoading||f.isLoading,[C,A]=b.useState(null),[O,D]=b.useState(""),[I,R]=b.useState(null),[F,P]=b.useState(null),[te,z]=b.useState(null),[L,Q]=b.useState(null),ce=yt({mutationFn:V=>iQ({platform:V.platform,agentId:V.agentId,credentials:V.credentials,status:V.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),R(null)}}),X=yt({mutationFn:V=>{const Z={status:V.status};return V.credentials&&(Z.credentials=V.credentials),sQ(V.id,Z)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),R(null)}}),W=yt({mutationFn:lQ,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),G=yt({mutationFn:V=>tQ({platform:V.platform,externalUserId:V.externalUserId,agentId:V.agentId,boundVia:"manual",displayName:V.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),P(null)}}),se=yt({mutationFn:nQ,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function ee(V){if(s){V==="bot"?R({agentId:s,editingId:null}):P({agentId:s});return}D(""),A({kind:V})}function ve(){!C||!O||(C.kind==="bot"?R({agentId:O,editingId:null}):P({agentId:O}),A(null))}function M(V){if(I){if(V.kind==="bot-create")ce.mutate({agentId:I.agentId,platform:V.draft.platform,status:V.draft.status,credentials:V.draft.credentials});else if(V.kind==="bot-update"){if(!I.editingId)return;X.mutate({id:I.editingId,status:V.status,credentials:V.credentials})}}}function U(V){!F||V.kind!=="user-create"||G.mutate({agentId:F.agentId,platform:V.draft.platform,externalUserId:V.draft.externalUserId,displayName:V.draft.displayName})}const B=s?p.find(V=>V.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:[(B==null?void 0:B.displayName)??s,l.jsx("button",{type:"button",onClick:()=>{const V=new URLSearchParams(n);V.delete("agent"),a(V,{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(pi,{className:"h-3 w-3"})})]})]}),l.jsxs(Kn,{className:"mb-3.5",children:[l.jsxs($y,{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(nc,{state:"idle",size:6})," ",k," online"]}),l.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[l.jsx(nc,{state:"offline",size:6})," ",j," offline"]})]}),l.jsxs(be,{size:"xs",variant:"outline",onClick:()=>ee("bot"),children:[l.jsx(wa,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",w.length]}),E?l.jsx(Tf,{children:"Loading…"}):w.length?l.jsxs(wc,{children:[l.jsx(Sc,{children:l.jsxs(_r,{children:[l.jsx(Qt,{children:"Agent"}),l.jsx(Qt,{children:"Platform"}),l.jsx(Qt,{children:"Status"}),l.jsx(Qt,{children:"Connection"}),l.jsx(Qt,{children:"Created"}),l.jsx(Qt,{style:{width:96,textAlign:"right"}})]})}),l.jsx(kc,{children:w.map(V=>{var re;const Z=((re=g.get(V.id))==null?void 0:re.connected)??!1;return l.jsxs(_r,{interactive:!0,onClick:()=>e(`/agents/${V.agentId}`),children:[l.jsx(at,{children:l.jsx("span",{className:"mono font-medium",children:o(V.agentId)})}),l.jsx(at,{children:l.jsx(dr,{children:V.platform})}),l.jsx(at,{children:l.jsx(dr,{tone:V.status==="active"?"accent":"outline",children:V.status})}),l.jsx(at,{children:l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[l.jsx(nc,{state:Z?"idle":"offline",size:7}),l.jsx("span",{style:{color:"var(--fg-3)"},children:Z?"Online":"Offline"})]})}),l.jsx(at,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:cc(V.createdAt)}),l.jsxs(at,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:xe=>xe.stopPropagation(),children:[l.jsx(be,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>R({agentId:V.agentId,editingId:V.id,initialPlatform:dQ(V.platform),initialStatus:fQ(V.status)}),children:"Edit"}),l.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>z(V.id),disabled:W.isPending,title:"Delete",children:l.jsx(Gf,{className:"h-3.5 w-3.5"})})]})]},V.id)})})]}):l.jsx(Tf,{children:s?"No bot bindings for this agent yet.":"No bot bindings"})]}),l.jsxs(Kn,{children:[l.jsxs($y,{right:l.jsxs(be,{size:"xs",variant:"outline",onClick:()=>ee("user"),children:[l.jsx(wa,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",x.length]}),E?l.jsx(Tf,{children:"Loading…"}):x.length?l.jsxs(wc,{children:[l.jsx(Sc,{children:l.jsxs(_r,{children:[l.jsx(Qt,{children:"Agent"}),l.jsx(Qt,{children:"Platform"}),l.jsx(Qt,{children:"External user ID"}),l.jsx(Qt,{children:"Display name"}),l.jsx(Qt,{children:"Bound via"}),l.jsx(Qt,{children:"Created"}),l.jsx(Qt,{style:{width:32}})]})}),l.jsx(kc,{children:x.map(V=>l.jsxs(_r,{interactive:!0,onClick:()=>e(`/agents/${V.agentId}`),children:[l.jsx(at,{children:l.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(V.agentId)})}),l.jsx(at,{children:l.jsx(dr,{children:V.platform})}),l.jsx(at,{children:l.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:V.externalUserId})}),l.jsx(at,{style:{color:"var(--fg-2)"},children:V.displayName??"—"}),l.jsx(at,{children:l.jsx(dr,{tone:"outline",children:V.boundVia??"—"})}),l.jsx(at,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:cc(V.createdAt)}),l.jsx(at,{onClick:Z=>Z.stopPropagation(),children:l.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Q(V.id),disabled:se.isPending,title:"Delete",children:l.jsx(Gf,{className:"h-3.5 w-3.5"})})})]},V.id))})]}):l.jsx(Tf,{children:s?"No user bindings for this agent yet.":"No user bindings"})]}),l.jsx(hQ,{open:C!=null,kind:(C==null?void 0:C.kind)??"bot",agents:p,agentId:O,onAgentChange:D,onCancel:()=>A(null),onConfirm:ve}),l.jsx(oj,{open:I!=null,kind:"bot",editingId:(I==null?void 0:I.editingId)??null,initialPlatform:I==null?void 0:I.initialPlatform,initialStatus:I==null?void 0:I.initialStatus,agentLabel:I?o(I.agentId):"",pending:ce.isPending||X.isPending,errorMessage:(ce.error??X.error)instanceof Error?(ce.error??X.error).message:null,onOpenChange:V=>{V||(R(null),ce.reset(),X.reset())},onSubmit:M}),l.jsx(oj,{open:F!=null,kind:"user",editingId:null,agentLabel:F?o(F.agentId):"",pending:G.isPending,errorMessage:G.error instanceof Error?G.error.message:null,onOpenChange:V=>{V||(P(null),G.reset())},onSubmit:U}),l.jsx(uj,{open:te!=null,onOpenChange:V=>!V&&z(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:W.isPending,onConfirm:()=>{te!=null&&(W.mutate(te),z(null))}}),l.jsx(uj,{open:L!=null,onOpenChange:V=>!V&&Q(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:se.isPending,onConfirm:()=>{L!=null&&(se.mutate(L),Q(null))}})]})}function dQ(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function fQ(e){return e==="inactive"?"inactive":"active"}function Tf({children:e}){return l.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function hQ(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(Cn,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{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(rr,{children:[l.jsx(be,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),l.jsx(be,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function uj(e){return l.jsx(Cn,{open:e.open,onOpenChange:e.onOpenChange,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:e.title})}),l.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),l.jsxs(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),l.jsx(be,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function mQ({embedded:e=!1}={}){return l.jsxs("div",{className:e?"":"-m-6",children:[l.jsx(Uo,{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(cQ,{})})]})}function pQ(){return l.jsx(mQ,{embedded:!0})}function gQ(){const{onboardingStep:e,onboardingDismissedAt:t,onboardingCompletedAt:n,dismissOnboarding:a,restoreOnboarding:s}=lt();if(n)return l.jsx(Jn,{to:"/settings/team",replace:!0});const o=!!t,c=e==="completed";return l.jsxs(l.Fragment,{children:[l.jsx(Uo,{title:"Onboarding",subtitle:"Guided setup controls"}),l.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:l.jsx(Qc,{title:"Onboarding guide",description:o?"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:o?null:l.jsx(yQ,{}),isFirst:!0,children:o?l.jsx(be,{type:"button",size:"sm",onClick:()=>void s(),children:"Resume onboarding"}):l.jsx(be,{type:"button",size:"sm",variant:"outline",onClick:()=>void a(),disabled:!c,title:c?void 0:"Finish setting up your agent first",children:"Hide onboarding guide"})})})]})}function yQ(){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(fr,{className:"h-3 w-3"}),"Active"]})}function vQ(){const{role:e,onboardingCompletedAt:t}=lt(),n=e==="admin",a=t!==null;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(Zu,{to:"/settings/team",label:"Team"}),l.jsx(Zu,{to:"/settings/computers",label:"Computers"}),n&&l.jsx(Zu,{to:"/settings/github",label:"GitHub"}),l.jsx(Zu,{to:"/settings/integrations",label:"Messaging"}),!a&&l.jsx(Zu,{to:"/settings/onboarding",label:"Onboarding"})]}),l.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:l.jsx(qf,{})})]})}function Zu({to:e,label:t}){return l.jsx(kv,{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 tv(e){return e.normalize("NFKD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,no)}const Bg=200;function bQ(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 xQ(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,no)}function RT(e){return e==="claude-code"||e==="codex"?e:null}function wQ(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=RT(a);if(o)return o}return null}function SQ(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function kQ(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 jQ({open:e,onOpenChange:t,onCreated:n}){const a=gn(),{refreshMe:s,organizationId:o}=lt(),[c,f]=b.useState(""),[m,h]=b.useState(""),[p,g]=b.useState(!1),[w,x]=b.useState("private"),[k,j]=b.useState("claude-code"),[E,C]=b.useState(!1),[A,O]=b.useState([]),[D,I]=b.useState(!1),[R,F]=b.useState(null),[P,te]=b.useState(null),[z,L]=b.useState(null),[Q,ce]=b.useState(null),[X,W]=b.useState(null),[G,se]=b.useState(null),[ee,ve]=b.useState(!1),[M,U]=b.useState({}),[B,_]=b.useState({status:"idle"});b.useEffect(()=>{e&&(f(""),h(""),g(!1),x("private"),j("claude-code"),C(!1),O([]),I(!1),F(null),te(null),L(null),ce(null),W(null),se(null),ve(!1),U({}),_({status:"idle"}))},[e]),b.useEffect(()=>{p||h(tv(c))},[c,p]);const V=b.useRef(0);b.useEffect(()=>{if(!e||!m){_({status:"idle"});return}if(!Py.test(m)){_({status:"bad",reason:"invalid"});return}if(Uy(m)){_({status:"bad",reason:"reserved"});return}const Y=++V.current;_({status:"checking"});const ge=window.setTimeout(()=>{k4(m).then(Ce=>{Y===V.current&&(Ce.available?_({status:"ok"}):_({status:"bad",reason:Ce.reason}))}).catch(()=>{Y===V.current&&_({status:"idle"})})},300);return()=>window.clearTimeout(ge)},[m,e]),b.useEffect(()=>{if(!e)return;let Y=!1;const ge=async()=>{try{const _e=await gi();if(Y)return;const At=_e.filter(qe=>qe.status==="connected").sort((qe,Mn)=>Mn.lastSeenAt.localeCompare(qe.lastSeenAt));O(At),I(!0)}catch{Y||I(!0)}};ge();const Ce=window.setInterval(ge,3e3);return()=>{Y=!0,window.clearInterval(Ce)}},[e]),b.useEffect(()=>{if(A.length===0){F(null);return}F(Y=>{var ge;return Y&&A.some(Ce=>Ce.id===Y)?Y:((ge=A[0])==null?void 0:ge.id)??null})},[A]),b.useEffect(()=>{if(!R){te(null),L(null);return}let Y=!1;const ge=async()=>{try{const _e=await ph(R);if(Y)return;te(_e.capabilities),L(R)}catch{}};ge();const Ce=window.setInterval(ge,3e3);return()=>{Y=!0,window.clearInterval(Ce)}},[R]),b.useEffect(()=>{if(!e||A.length>0)return;if(Q&&G&&G>Date.now()){const ge=Math.max(G-Date.now(),0),Ce=window.setTimeout(()=>{ce(null),se(null)},ge);return()=>window.clearTimeout(Ce)}Q&&(ce(null),W(null),se(null));let Y=!1;return(async()=>{try{const ge=await je.post("/me/connect-tokens",{});if(Y)return;ce(ge.token),W(ge.command),se(Date.now()+ge.expiresIn*1e3)}catch{}})(),()=>{Y=!0}},[e,A.length,Q,G]);const Z=R&&z===R?P:null,re=b.useMemo(()=>{if(!Z)return[];const Y=[];for(const[ge,Ce]of Object.entries(Z)){if(Ce.state!=="ok")continue;const _e=RT(ge);_e&&Y.push(_e)}return Y},[Z]);b.useEffect(()=>{Z&&j(Y=>{var ge;return((ge=Z[Y])==null?void 0:ge.state)==="ok"?Y:wQ(Z)??Y})},[Z]);const xe=yt({mutationFn:async Y=>{const ge=c.trim()||m.trim()||"Untitled assistant";return S4({name:m||void 0,type:"personal_assistant",displayName:ge,clientId:Y.clientId,runtimeProvider:k,visibility:w,...o?{organizationId:o}:{}})},onSuccess:Y=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),s(),n(Y,k)}}),Re=b.useMemo(()=>{const Y=xe.error;if(!Y)return{};if(Y instanceof xs){const ge=bQ(Y.issues);return Object.keys(ge).length>0?ge:Y.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:Y.message}}return Y instanceof Error?{_root:Y.message}:{}},[xe.error]),Ee=B.status==="bad"?kQ(B.reason):void 0,He={...Ee?{name:Ee}:{},...Re,...M};function Le(){const Y={};return m?m.length>no?Y.name=`Agent name must be at most ${no} characters (got ${m.length}).`:Py.test(m)?Uy(m)&&(Y.name="That agent name is reserved — pick a different one."):Y.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":c.trim().length>0&&(Y.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),c.length>Bg&&(Y.displayName=`Display name must be at most ${Bg} characters (got ${c.length}).`),Y}function Ke(Y){Y.preventDefault();const ge=Le();U(ge),!(Object.keys(ge).length>0)&&B.status!=="bad"&&R&&(re.length===0||!re.includes(k)||xe.mutate({clientId:R}))}const et=B.status==="bad",St=c.trim().length>0&&!et&&!xe.isPending&&!!R&&re.length>0&&re.includes(k);return l.jsx(Cn,{open:e,onOpenChange:t,children:l.jsxs(yn,{className:"max-w-lg",children:[l.jsx(On,{children:l.jsx(Nn,{children:"New Agent"})}),l.jsxs("form",{onSubmit:Ke,className:"space-y-5 min-w-0",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"new-agent-display-name",children:"Display name"}),l.jsx(Zt,{id:"new-agent-display-name",value:c,onChange:Y=>{f(Y.target.value),M.displayName&&U(ge=>({...ge,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:Bg,"aria-invalid":He.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."}),He.displayName&&l.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:He.displayName}),!E&&(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:()=>C(!0),className:"text-foreground underline underline-offset-2 hover:text-primary focus:outline-none focus-visible:text-primary",children:"Edit"})]}),!E&&He.name&&l.jsx("p",{className:"text-caption text-destructive",children:He.name})]}),E&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[l.jsx(dt,{htmlFor:"new-agent-name",children:"Agent name"}),l.jsx("button",{type:"button",onClick:()=>C(!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(Zt,{id:"new-agent-name",value:m,autoFocus:!0,onChange:Y=>{const ge=xQ(Y.target.value);h(ge),g(!0),M.name&&U(Ce=>({...Ce,name:void 0}))},onBlur:Y=>{const ge=tv(Y.target.value);ge!==m&&h(ge)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:no,"aria-invalid":He.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"," ",no," characters. Permanent after creation."]}),m&&!He.name&&B.status!=="idle"&&l.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:B.status==="ok"?"var(--state-idle)":B.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[B.status==="checking"&&"Checking availability…",B.status==="ok"&&"Available."]}),He.name&&l.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:He.name})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{children:"Visibility"}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:w==="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:w==="organization",onChange:()=>x("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:w==="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:w==="private",onChange:()=>x("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(dt,{children:"Where it runs"}),D?A.length===0?l.jsx(EQ,{command:X,copied:ee,onCopy:async()=>{X&&(await navigator.clipboard.writeText(X),ve(!0),window.setTimeout(()=>ve(!1),1500))}}):A.length===1?l.jsx(CQ,{client:A[0]}):l.jsx("div",{className:"space-y-2",children:A.map(Y=>{const ge=R===Y.id;return l.jsxs("label",{className:ge?"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:ge,onChange:()=>F(Y.id),className:"mt-1"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-body font-medium truncate",children:Y.hostname??Y.id}),l.jsxs("div",{className:"text-caption text-muted-foreground",children:[Y.os??"unknown OS"," · last seen ",new Date(Y.lastSeenAt).toLocaleString()]})]})]},Y.id)})}):l.jsx(NQ,{label:"Detecting connected computers…"}),(R||!D)&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-caption text-muted-foreground",children:"Powered by"}),!R||Z===null?l.jsx(_Q,{}):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(Y=>{const ge=k===Y;return l.jsxs("label",{className:ge?"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:ge,onChange:()=>j(Y)}),l.jsx("span",{className:"text-body",children:SQ(Y)})]},Y)})})]}),He.clientId&&l.jsx("p",{className:"text-caption text-destructive",children:He.clientId})]}),He._root&&l.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:He._root}),l.jsx(rr,{children:l.jsx(be,{type:"submit",disabled:!St,children:xe.isPending?"Creating…":"Create"})})]})]})})}function EQ({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 CQ({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 NQ({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 _Q(){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 Ff({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 TQ(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 AQ(){const{organizationId:e}=lt(),[t,n]=b.useState(null),[a,s]=b.useState(null),[o,c]=b.useState(!1),[f,m]=b.useState(!1);b.useEffect(()=>{e&&(async()=>{try{const p=await je.get(xy(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 je.post(xy(e,"/invitations/rotate"));n(p)}catch(p){s(p instanceof Error?p.message:"Failed to rotate invite link")}finally{c(!1)}}};return l.jsxs(Io,{children:[l.jsxs(Lo,{children:[l.jsx(Vc,{children:"Invite link"}),l.jsxs(TT,{children:["Anyone with this link can join your team as a member. Links expire after ",h9," days; rotating revokes the old link instantly and resets the timer."]})]}),l.jsxs(Po,{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(be,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),l.jsx(be,{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?` · ${TQ(t.expiresAt)}`:" · no expiry"]})]}):l.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}function Ab({actions:e,ariaLabel:t,triggerClassName:n,icon:a=SD}){const[s,o]=b.useState(!1),[c,f]=b.useState("down"),m=b.useRef(null),h=b.useRef(null);return b.useEffect(()=>{if(!s)return;const p=w=>{m.current&&!m.current.contains(w.target)&&o(!1)},g=w=>{w.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",g),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",g)}},[s]),b.useEffect(()=>{if(!s||!h.current)return;const p=32,g=8,w=h.current.getBoundingClientRect(),x=window.innerHeight-w.bottom,k=e.length*p+g;f(x>=k?"down":"up")},[s,e.length]),e.length===0?null:l.jsxs("div",{ref:m,className:"relative inline-flex",children:[l.jsx("button",{ref:h,type:"button","aria-label":t,"aria-haspopup":"menu","aria-expanded":s,onClick:p=>{p.stopPropagation(),o(g=>!g)},className:Me("inline-flex items-center justify-center",n),style:{width:28,height:28,borderRadius:4,background:"transparent",color:"var(--fg-3)",cursor:"pointer",border:0},children:l.jsx(a,{className:"h-3.5 w-3.5"})}),s&&l.jsx("div",{role:"menu",className:"absolute right-0 z-30 rounded-md border bg-popover shadow-md",onClick:p=>p.stopPropagation(),onKeyDown:p=>p.stopPropagation(),style:{minWidth:180,borderColor:"var(--border)",...c==="up"?{bottom:"100%",marginBottom:4}:{top:"100%",marginTop:4}},children:e.map(p=>l.jsx("button",{type:"button",role:"menuitem",disabled:p.disabled,onClick:g=>{g.stopPropagation(),o(!1),p.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:p.destructive?"var(--state-error)":"var(--fg)",background:"transparent",border:0,cursor:p.disabled?"not-allowed":"pointer"},children:p.label},p.key))})]})}const Rb=[{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 Nr(e,t){return e?{...t,borderBottom:0}:t}function RQ({groups:e,runtimeMap:t,clientHostMap:n,onAgentClick:a,getHumanActions:s,getAgentActions:o}){return l.jsxs(wc,{className:"table-fixed",children:[l.jsx(Sc,{children:l.jsx(_r,{children:Rb.map(c=>l.jsx(Qt,{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(OQ,{group:c,runtimeMap:t,clientHostMap:n,onAgentClick:a,getHumanActions:s,getAgentActions:o},c.key))]})}function OQ({group:e,runtimeMap:t,clientHostMap:n,onAgentClick:a,getHumanActions:s,getAgentActions:o}){const[c,f]=b.useState(!e.collapsible);return l.jsxs(kc,{children:[l.jsx(DQ,{group:e,open:c,onToggle:()=>f(m=>!m)}),c&&e.rows.length===0&&e.emptyMessage&&l.jsx(_r,{children:l.jsx(at,{colSpan:Rb.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(zQ,{row:m,actions:s(m),isLast:p},`h:${m.id}`):l.jsx(LQ,{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 Ov;case"yours":case"team":return FE;case"other-private":return hh;default:return null}}function DQ({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(dr,{tone:"outline",children:e.count})]});return l.jsx(_r,{children:l.jsx("td",{colSpan:Rb.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 zQ({row:e,actions:t,isLast:n}){return l.jsxs(_r,{children:[l.jsx(at,{style:Nr(n,{paddingLeft:"var(--sp-6)"}),children:l.jsx(OT,{displayName:e.displayName,handle:`@${e.username}`,selfTag:e.isSelf})}),l.jsx(at,{style:Nr(n),children:l.jsx(IQ,{row:e})}),l.jsx(at,{className:"text-label",style:Nr(n,{color:"var(--fg-4)"}),children:"—"}),l.jsx(at,{className:"text-label",style:Nr(n,{color:"var(--fg-4)"}),children:"—"}),l.jsx(at,{className:"text-label",style:Nr(n,{color:"var(--fg-4)"}),children:"—"}),l.jsx(at,{className:"mono text-caption",style:Nr(n,{color:"var(--fg-4)"}),children:cC(e.createdAt)}),l.jsx(at,{style:Nr(n,{padding:0,textAlign:"right"}),children:l.jsx(Ab,{actions:t,ariaLabel:`Actions for ${e.displayName}`})})]})}function IQ({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(x_,{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 LQ({row:e,runtime:t,clientHost:n,actions:a,onClick:s,isLast:o}){const{agent:c,managerLabel:f,isOwnedBySelf:m,showVisibilityChip:h}=e;return l.jsxs(_r,{interactive:!0,onClick:s,children:[l.jsx(at,{style:Nr(o,{paddingLeft:"var(--sp-6)"}),children:l.jsx(OT,{displayName:c.displayName,handle:c.name?`@${c.name}`:null,visibility:h?c.visibility:null})}),l.jsx(at,{className:"text-label",style:Nr(o,{color:"var(--fg-4)"}),children:"—"}),l.jsx(at,{className:"text-label",style:Nr(o,{color:"var(--fg-2)"}),children:f?l.jsxs("span",{className:"truncate inline-block max-w-full",title:f,children:[f,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(at,{className:"mono text-caption",style:Nr(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(at,{style:Nr(o),children:l.jsx(vc,{state:(t==null?void 0:t.runtimeState)??null})}),l.jsx(at,{className:"mono text-caption",style:Nr(o,{color:"var(--fg-4)"}),children:cC(c.createdAt)}),l.jsx(at,{style:Nr(o,{padding:0,textAlign:"right"}),onClick:p=>p.stopPropagation(),children:l.jsx(Ab,{actions:a,ariaLabel:`Actions for ${c.displayName}`})})]})}function OT({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(PQ,{visibility:a})]}),t&&l.jsx("div",{className:"mono text-caption truncate",style:{color:"var(--fg-4)"},title:t,children:t})]})}function PQ({visibility:e}){return e==="private"?l.jsxs(dr,{tone:"outline",title:"Private — only you can see this agent",className:"shrink-0",children:[l.jsx(hh,{className:"h-2.5 w-2.5","aria-hidden":!0,style:{marginRight:3}}),"Private"]}):l.jsxs(dr,{tone:"accent",title:"Shared — anyone in the team can @mention this agent",className:"shrink-0",children:[l.jsx(VE,{className:"h-2.5 w-2.5","aria-hidden":!0,style:{marginRight:3}}),"Shared"]})}const cj=100,dj=100;async function UQ(e){const t=[];let n;for(let a=0;a<dj;a++){const s=await e(n?{limit:cj,cursor:n}:{limit:cj});if(t.push(...s.items),!s.nextCursor)return t;n=s.nextCursor}throw new Error(`fetchAllAgents exceeded ${dj} pages; server cursor pagination may be broken`)}function BQ(){const{role:e,memberId:t}=lt(),n=e==="admin",a=Rn(),s=gn(),o=w_(),[c,f]=b.useState(!1),[m,h]=b.useState(!1),[p,g]=b.useState(null),[w,x]=b.useState(null),[k,j]=b.useState("all"),[E,C]=b.useState(""),A=Ye({queryKey:["members"],queryFn:cb}),O=Ye({queryKey:["agents","team-page",n?"admin":"member"],queryFn:()=>UQ(Z=>n?x4(Z):Bc(Z))}),{data:D}=Ye({queryKey:["activity"],queryFn:Pc,refetchInterval:1e4}),I=b.useMemo(()=>{const Z=new Map;for(const re of(D==null?void 0:D.agents)??[])Z.set(re.agentId,re);return Z},[D==null?void 0:D.agents]),{data:R}=Ye({queryKey:["clients","team-page"],queryFn:gi,staleTime:3e4}),F=b.useMemo(()=>{const Z=new Map;for(const re of R??[])re.hostname&&Z.set(re.id,re.hostname);return Z},[R]),P=b.useMemo(()=>A.data??[],[A.data]),te=b.useMemo(()=>O.data??[],[O.data]),z=b.useMemo(()=>{const Z=new Map;for(const re of te)Z.set(re.uuid,re);return Z},[te]),L=b.useMemo(()=>te.filter(Z=>Z.type!=="human"),[te]),Q=b.useMemo(()=>L.filter(Z=>Z.managerId===t),[L,t]),ce=b.useMemo(()=>L.filter(Z=>Z.visibility==="organization"&&Z.managerId!==t),[L,t]),X=b.useMemo(()=>L.filter(Z=>Z.visibility==="private"&&Z.managerId!==t),[L,t]),W=yt({mutationFn:async Z=>$F(Z.id,Z.patch),onSuccess:()=>s.invalidateQueries({queryKey:["members"]})}),G=yt({mutationFn:HF,onSuccess:()=>{s.invalidateQueries({queryKey:["members"]}),s.invalidateQueries({queryKey:["agents"]})}}),se=yt({mutationFn:oN,onSuccess:()=>{s.invalidateQueries({queryKey:["agents"]}),s.invalidateQueries({queryKey:["activity"]})}}),ee=yt({mutationFn:uN,onSuccess:()=>s.invalidateQueries({queryKey:["agents"]})}),ve=yt({mutationFn:cN,onSuccess:()=>s.invalidateQueries({queryKey:["agents"]})}),M=yt({mutationFn:async Z=>Oy(Z.humanAgentId,{delegateMention:Z.delegateMention}),onSuccess:()=>s.invalidateQueries({queryKey:["agents"]})}),U=E.trim().toLowerCase(),B=b.useMemo(()=>HQ({filter:k,search:U,isAdmin:n,selfMemberId:t,members:P,yourAgents:Q,teamAgents:ce,otherPrivateAgents:X,resolveMember:o,agentByUuid:z,openDelegate:(Z,re)=>{var xe;return x({humanAgentId:Z,humanDisplayName:re,currentDelegate:((xe=z.get(Z))==null?void 0:xe.delegateMention)??null})}}),[k,U,n,t,P,Q,ce,X,o,z]);function _(Z){const re=[];return n&&re.push({key:"edit",label:"Edit profile",onSelect:()=>g({id:Z.id,username:Z.username,displayName:Z.displayName,role:Z.role})}),n&&!Z.isSelf&&re.push({key:"remove",label:"Remove from org",destructive:!0,onSelect:()=>{window.confirm(`Remove ${Z.displayName} from the org? The human agent will be deactivated.`)&&G.mutate(Z.id)}}),re}function V(Z){const{agent:re,isOwnedBySelf:xe}=Z,Re=n||xe,Ee=[{key:"open",label:"Open",onSelect:()=>a(`/agents/${encodeURIComponent(re.uuid)}`)}];return Re&&(re.status==="suspended"?Ee.push({key:"reactivate",label:"Reactivate",onSelect:()=>ve.mutate(re.uuid)}):Ee.push({key:"suspend",label:"Suspend",onSelect:()=>ee.mutate(re.uuid)}),Ee.push({key:"delete",label:"Delete",destructive:!0,onSelect:()=>{window.confirm(`Delete agent ${re.displayName}? This cannot be undone.`)&&se.mutate(re.uuid)}})),Ee}return l.jsxs(l.Fragment,{children:[l.jsx(Uo,{title:"Team",right:l.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-2)"},children:[l.jsxs(be,{size:"xs",onClick:()=>h(!0),children:[l.jsx(wa,{className:"h-3 w-3"}),"New agent"]}),n&&l.jsxs(be,{size:"xs",variant:"ghost",onClick:()=>f(!0),children:[l.jsx(GE,{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($Q,{filter:k,onFilter:j,query:E,onQuery:C,counts:{yours:Q.length,humans:P.length,team:ce.length}}),O.isLoading||A.isLoading?l.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):O.error||A.error?l.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load: ",FQ(O.error??A.error)]}):l.jsx(RQ,{groups:B,runtimeMap:I,clientHostMap:F,onAgentClick:Z=>a(`/agents/${encodeURIComponent(Z)}`),getHumanActions:_,getAgentActions:V})]}),l.jsx(Cn,{open:c,onOpenChange:f,children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:"Invite link"})}),l.jsx(AQ,{})]})}),l.jsx(jQ,{open:m,onOpenChange:h,onCreated:(Z,re)=>{h(!1),s.invalidateQueries({queryKey:["agents"]}),s.invalidateQueries({queryKey:["activity"]})}}),l.jsx(GQ,{target:p,isAdmin:n,isSaving:W.isPending,onClose:()=>g(null),onSave:async Z=>{p&&(await W.mutateAsync({id:p.id,patch:Z}),g(null))}}),l.jsx(VQ,{target:w,candidates:qQ(te),isSaving:M.isPending,onClose:()=>x(null),onSave:async Z=>{w&&(await M.mutateAsync({humanAgentId:w.humanAgentId,delegateMention:Z}),x(null))}})]})}function FQ(e){return e instanceof Error?e.message:String(e)}function $Q({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(Ff,{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(Rv,{"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(Zt,{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 HQ(e){const{filter:t,search:n,isAdmin:a,selfMemberId:s,members:o,yourAgents:c,teamAgents:f,otherPrivateAgents:m,agentByUuid:h,openDelegate:p}=e,g=P=>{const te=h.get(P);if(!(te!=null&&te.delegateMention))return null;const z=h.get(te.delegateMention);return z?{name:z.name,displayName:z.displayName}:null},w=P=>!n||P.displayName.toLowerCase().includes(n)||P.username.toLowerCase().includes(n),x=P=>!n||P.displayName.toLowerCase().includes(n)||(P.name??"").toLowerCase().includes(n),k=t==="all"||t==="yours",j=t==="all"||t==="humans",E=t==="all"||t==="team",C=a&&t==="all",A=o.filter(w).map(P=>{const te=s===P.id;return{kind:"human",id:P.id,agentId:P.agentId,username:P.username,displayName:P.displayName,role:P.role,createdAt:P.createdAt,isSelf:te,delegate:g(P.agentId),canEditDelegate:te||a,onEditDelegate:()=>p(P.agentId,P.displayName)}}).sort((P,te)=>Number(te.isSelf)-Number(P.isSelf)),O=(P,te)=>({kind:"agent",agent:P,managerLabel:P.managerId?e.resolveMember(P.managerId):null,isOwnedBySelf:P.managerId===s,showVisibilityChip:(te==null?void 0:te.showVisibilityChip)??!1}),D=c.filter(x).map(P=>O(P,{showVisibilityChip:!0})).sort((P,te)=>{const z=P.agent.visibility==="private"?0:1,L=te.agent.visibility==="private"?0:1;return z!==L?z-L:P.agent.displayName.localeCompare(te.agent.displayName,void 0,{sensitivity:"base"})}),I=f.filter(x).map(P=>O(P)),R=m.filter(x).map(P=>O(P)),F=[];return k&&F.push({key:"yours",title:"Your agents",count:D.length,rows:D,emptyMessage:n?"No agents match this search.":"You haven't created any agents yet. Click New agent above to add one."}),j&&F.push({key:"humans",title:"Humans",count:A.length,rows:A,emptyMessage:n?"No humans match this search.":void 0}),E&&F.push({key:"team",title:"Team agents",count:I.length,rows:I,emptyMessage:n?"No team agents match this search.":"No shared agents from other team members yet."}),C&&R.length>0&&F.push({key:"other-private",title:"Other members' private agents",count:R.length,rows:R,collapsible:!0}),F}function qQ(e){return e.filter(t=>t.type==="personal_assistant"&&t.status==="active")}const ZQ=Object.values(E9);function GQ({target:e,isAdmin:t,isSaving:n,onClose:a,onSave:s}){const[o,c]=b.useState(""),[f,m]=b.useState("member"),[h,p]=b.useState(null);b.useEffect(()=>{e&&(c(e.displayName),m(e.role),p(null))},[e]);async function g(x){if(x.preventDefault(),!e)return;const k={};if(o.trim()&&o!==e.displayName&&(k.displayName=o.trim()),t&&f!==e.role&&(k.role=f),Object.keys(k).length===0){a();return}try{await s(k)}catch(j){p(j instanceof Error?j.message:String(j))}}const w=e!==null;return l.jsx(Cn,{open:w,onOpenChange:x=>x?void 0:a(),children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{children:"Edit profile"})}),e&&l.jsxs("form",{onSubmit:g,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{children:"Username"}),l.jsx(Zt,{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(dt,{htmlFor:"edit-member-display",children:"Display name"}),l.jsx(Zt,{id:"edit-member-display",value:o,onChange:x=>c(x.target.value),required:!0,maxLength:200})]}),t&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(dt,{htmlFor:"edit-member-role",children:"Role"}),l.jsx("select",{id:"edit-member-role",value:f,onChange:x=>m(x.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:ZQ.map(x=>l.jsx("option",{value:x,children:x},x))}),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(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:a,disabled:n,children:"Cancel"}),l.jsx(be,{type:"submit",disabled:n,children:n?"Saving…":"Save"})]})]})]})})}function VQ({target:e,candidates:t,isSaving:n,onClose:a,onSave:s}){const[o,c]=b.useState(""),[f,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(w){m(w instanceof Error?w.message:String(w))}}}const p=e!==null;return l.jsx(Cn,{open:p,onOpenChange:g=>g?void 0:a(),children:l.jsxs(yn,{children:[l.jsx(On,{children:l.jsx(Nn,{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(dt,{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."]})]}),f&&l.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),l.jsxs(rr,{children:[l.jsx(be,{type:"button",variant:"ghost",onClick:a,disabled:n,children:"Cancel"}),l.jsx(be,{type:"submit",disabled:n,children:n?"Saving…":"Save"})]})]})]})})}function Ph(e,t){return`/orgs/${encodeURIComponent(e)}/settings/${encodeURIComponent(t)}`}function Ob(e){return je.get(Ph(e,"context_tree"))}function MT(e,t){return je.put(Ph(e,"context_tree"),t)}function DT(e){return je.get(Ph(e,"source_repos"))}function zT(e,t){return je.put(Ph(e,"source_repos"),t)}function nv({label:e,hint:t,value:n,onChange:a,saved:s=!1,mono:o=!1,type:c="text",placeholder:f,rightSlot:m,readOnly:h=!1,pattern:p}){const g=b.useId(),w=`flex-1 min-w-0 outline-none text-body focus-visible:ring-1 focus-visible:ring-ring ${o?"mono":""}`,x={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(QQ,{})]}),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:w,style:{...x,color:"var(--fg-2)"}}):l.jsx("input",{id:g,value:n,onChange:k=>a==null?void 0:a(k.target.value),type:c,placeholder:f,pattern:p,className:w,style:x}),m]})]})}function QQ(){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(fr,{className:"h-3 w-3"}),"Saved"]})}function IT({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(Zf,{className:"h-4 w-4 animate-spin"}):l.jsx(fr,{className:"h-4 w-4"})})}function KQ({isFirst:e=!1}){const{organizationId:t}=lt(),n=gn(),a=Ye({queryKey:["org-setting",t,"context_tree"],queryFn:()=>t?Ob(t):Promise.reject(new Error("no org")),enabled:!!t}),[s,o]=b.useState(""),[c,f]=b.useState(""),[m,h]=b.useState(!1);b.useEffect(()=>{a.data&&(o(a.data.repo??""),f(a.data.branch??"main"))},[a.data]);const p=yt({mutationFn:()=>{if(!t)throw new Error("organization not loaded");return MT(t,{repo:s.trim()?s.trim():null,branch:c.trim()?c.trim():null})},onSuccess:w=>{n.setQueryData(["org-setting",t,"context_tree"],w),h(!0),setTimeout(()=>h(!1),2e3)}}),g=w=>{w.preventDefault(),p.mutate()};return l.jsx(Qc,{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(nv,{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(nv,{label:"Branch",hint:"Branch checked out by client agents on startup.",value:c,onChange:f,mono:!0,placeholder:"main",saved:m,rightSlot:l.jsx(IT,{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 YQ({isFirst:e=!1}){var h;const{organizationId:t,role:n}=lt(),a=n==="admin",s=gn(),o=Ye({queryKey:["org-setting",t,"source_repos"],queryFn:()=>t?DT(t):Promise.reject(new Error("no org")),enabled:!!t}),c=yt({mutationFn:async p=>{var x;if(!t)throw new Error("organization not loaded");const w=(((x=o.data)==null?void 0:x.repos)??[]).filter(k=>k.url!==p);return zT(t,{repos:w})},onSuccess:p=>{s.setQueryData(["org-setting",t,"source_repos"],p)}}),f=((h=o.data)==null?void 0:h.repos)??[],m=f.length>0?l.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:f.length}):null;return l.jsxs(Qc,{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"}):f.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:f.map(p=>l.jsx(XQ,{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 XQ({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(pi,{className:"h-3.5 w-3.5"})})]})}function WQ(e){return je.get(`/orgs/${encodeURIComponent(e)}`)}function JQ(e,t){return je.patch(`/orgs/${encodeURIComponent(e)}`,t)}function eK({isFirst:e=!1}){const{organizationId:t}=lt(),n=gn(),a=Ye({queryKey:["organization",t],queryFn:()=>t?WQ(t):Promise.reject(new Error("no org")),enabled:!!t}),[s,o]=b.useState(""),[c,f]=b.useState(!1);b.useEffect(()=>{a.data&&o(a.data.displayName)},[a.data]);const m=yt({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):JQ(t,{displayName:p})},onSuccess:p=>{n.setQueryData(["organization",t],p),n.invalidateQueries({queryKey:["me-organizations"]}),f(!0),setTimeout(()=>f(!1),2e3)}}),h=p=>{p.preventDefault(),m.mutate()};return l.jsx(Qc,{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(nv,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:s,onChange:o,saved:c,rightSlot:l.jsx(IT,{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 tK(){const{role:e}=lt(),t=e==="admin";return l.jsxs("div",{children:[t&&l.jsx(eK,{isFirst:!0}),t&&l.jsx(KQ,{}),l.jsx(YQ,{isFirst:!t})]})}function nK(){const{role:e}=lt();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(Uo,{title:"Team settings",subtitle:t}),l.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:l.jsx(tK,{})})]})}function rK(e,t){const n=new URLSearchParams({agentId:t.agentId,path:t.path});return t.basePath&&n.set("basePath",t.basePath),je.get(`/chats/${encodeURIComponent(e)}/docs/preview?${n.toString()}`)}const aK=/^[a-z][a-z0-9+.-]*:/i;function LT(e,t){const n=e.trim();if(!n||n.startsWith("#")||n.startsWith("//")||aK.test(n))return null;const a=n.split(/[?#]/,1).at(0)??"";if(!a.toLowerCase().endsWith(".md"))return null;let s=a.startsWith("/")?a.slice(1):a;if(t&&!a.startsWith("/")){const o=t.lastIndexOf("/");s=`${o>=0?t.slice(0,o+1):""}${a}`}return iK(s)}function iK(e){const t=[];for(const n of e.split("/"))if(!(!n||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n)}return t.length>0?t.join("/"):null}const fj=720,sK=.45,rv=360,lK=320,hj=24;function oK(){return typeof window>"u"?fj:Math.max(rv,Math.min(fj,Math.round(window.innerWidth*sK)))}function Fg(e){const t=Math.max(rv,window.innerWidth-lK);return Math.min(Math.max(e,rv),t)}function uK(){const[e,t]=b.useState(()=>typeof window>"u"?!1:window.matchMedia("(max-width: 47.999rem)").matches);return b.useEffect(()=>{const n=window.matchMedia("(max-width: 47.999rem)"),a=()=>t(n.matches);return a(),n.addEventListener("change",a),()=>n.removeEventListener("change",a)},[]),e}function cK(){var P,te;const[e,t]=Oo(),n=e.get("docChat"),a=e.get("docAgent"),s=e.get("docPath"),o=e.get("docBase")??void 0,c=!!(n&&a&&s),f=uK(),[m,h]=b.useState(oK),p=b.useRef(null),g=b.useRef(null),w=b.useRef(null),x=b.useCallback(()=>{const z=new URLSearchParams(e);z.delete("docChat"),z.delete("docAgent"),z.delete("docPath"),z.delete("docBase"),t(z,{replace:!0})},[e,t]);b.useEffect(()=>{if(!c)return;const z=L=>{L.key==="Escape"&&x()};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[x,c]),b.useEffect(()=>{if(!c||!f)return;w.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const z=window.setTimeout(()=>{var L;return(L=g.current)==null?void 0:L.focus()},0);return()=>{window.clearTimeout(z);const L=w.current;w.current=null,L&&document.contains(L)&&L.focus()}},[c,f]);const k=Ye({queryKey:["me","docs","preview",n,a,o,s],queryFn:()=>rK(n??"",{agentId:a??"",basePath:o,path:s??""}),enabled:c}),j=((P=k.data)==null?void 0:P.ref.path)??s,E=((te=k.data)==null?void 0:te.path)??s,C=b.useMemo(()=>{const z=E??"";return z.split("/").filter(Boolean).at(-1)??z},[E]),A=E&&E!==C?E:null,O=b.useCallback(z=>{const L=new URLSearchParams(e);L.set("docPath",z),t(L)},[e,t]),D=b.useMemo(()=>({a({href:z,children:L,...Q}){const ce=X=>{if(!z||X.defaultPrevented||X.button!==0||X.metaKey||X.altKey||X.ctrlKey||X.shiftKey)return;const W=LT(z,j);W&&(X.preventDefault(),O(W))};return l.jsx("a",{...Q,href:z,onClick:ce,target:"_blank",rel:"noopener noreferrer",children:L})}}),[O,j]),I=b.useCallback(z=>{z.preventDefault();const L=document.body.style.cursor,Q=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const ce=W=>{h(Fg(window.innerWidth-W.clientX))},X=()=>{document.body.style.cursor=L,document.body.style.userSelect=Q,window.removeEventListener("mousemove",ce),window.removeEventListener("mouseup",X)};window.addEventListener("mousemove",ce),window.addEventListener("mouseup",X)},[]),R=b.useCallback(z=>{z.key==="ArrowLeft"&&(z.preventDefault(),h(L=>Fg(L+hj))),z.key==="ArrowRight"&&(z.preventDefault(),h(L=>Fg(L-hj)))},[]),F=b.useCallback(z=>{var X;if(!f||z.key!=="Tab")return;const L=Array.from(((X=p.current)==null?void 0:X.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(W=>!W.hasAttribute("disabled")&&W.getAttribute("aria-hidden")!=="true"),Q=L.at(0),ce=L.at(-1);if(!Q||!ce){z.preventDefault();return}z.shiftKey&&document.activeElement===Q?(z.preventDefault(),ce.focus()):!z.shiftKey&&document.activeElement===ce&&(z.preventDefault(),Q.focus())},[f]);return c?l.jsxs("aside",{"aria-label":"Document preview","aria-modal":f,"data-doc-preview-drawer":"",className:Me("z-40 flex flex-col bg-surface-raised text-text-primary shadow-2xl","animate-in slide-in-from-right duration-200",f?"fixed inset-0 w-full border-l border-border":"relative my-3 mr-3 h-auto shrink-0 overflow-hidden rounded-[var(--radius-panel)] border border-border-faint max-w-[calc(100vw-var(--sp-8))]"),onKeyDown:F,ref:p,role:"dialog",style:f?void 0:{width:m},children:[f?null:l.jsx("button",{"aria-label":"Resize document preview",className:"group absolute top-0 left-0 h-full w-3 -translate-x-1/2 cursor-col-resize",onMouseDown:I,onKeyDown:R,type:"button",children:l.jsx("div",{className:"mx-auto h-full w-1 bg-accent opacity-0 transition-opacity group-hover:opacity-100"})}),l.jsxs("header",{className:"flex min-h-12 items-center gap-3 px-4 pt-3 pb-2",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate text-body font-medium",children:C}),A?l.jsx("div",{className:"truncate text-caption text-text-tertiary",children:A}):null]}),l.jsx(be,{"aria-label":"Close document preview",onClick:x,ref:g,size:"icon",type:"button",variant:"ghost",children:l.jsx(pi,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:[k.isLoading?l.jsxs("div",{className:"flex h-full items-center justify-center text-body text-text-secondary",children:[l.jsx(Zf,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),"Loading preview"]}):null,k.isError?l.jsx("div",{className:"rounded-[var(--radius-panel)] border border-error bg-error-soft p-4 text-body text-error",children:k.error instanceof Error?k.error.message:"Unable to load document"}):null,k.data?l.jsx(Lh,{components:D,children:k.data.content}):null]})]}):null}function lh(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),e!=null&&e.engagement&&t.set("engagement",e.engagement),e!=null&&e.source&&t.set("source",e.source);const n=t.toString();return je.get(dn(`/chats${n?`?${n}`:""}`))}function dK(e){const t=new URLSearchParams;e!=null&&e.engagement&&t.set("engagement",e.engagement);const n=t.toString();return je.get(dn(`/chats/source-counts${n?`?${n}`:""}`))}function fK(e){return je.post(dn("/chats"),e)}function hK(e){return je.post(`/chats/${encodeURIComponent(e)}/read`)}function PT(e,t){return je.post(`/chats/${encodeURIComponent(e)}/participants`,t)}function mK(e){return je.post(`/chats/${encodeURIComponent(e)}/workspace-join`)}const pK=1e3;function gK(e){if(e<0)return"0s";if(e<1e3)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),a=t%60;return`${n}m${a.toString().padStart(2,"0")}s`}function yK({activity:e}){const t=new Date(e.startedAt).getTime(),[n,a]=b.useState(()=>Date.now());b.useEffect(()=>{const o=setInterval(()=>a(Date.now()),pK);return()=>clearInterval(o)},[]);const s=gK(n-t);return l.jsxs("span",{role:"status","aria-label":`${e.label}, ${s}`,className:"mono text-caption shrink-0 inline-flex items-center",style:{gap:6,color:"var(--state-working)"},children:[l.jsx("span",{"aria-hidden":"true",className:"chat-row-live-chip__dot",style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--state-working)"}}),l.jsx("span",{className:"truncate",style:{maxWidth:96},children:e.label}),l.jsx("span",{style:{color:"var(--fg-4)"},children:s})]})}function UT(e){return je.get(`/chats/${encodeURIComponent(e)}`)}function vK(e,t){return je.patch(`/chats/${encodeURIComponent(e)}`,{topic:t})}function BT(e,t){return je.post(`/chats/${encodeURIComponent(e)}/engagement`,{status:t})}function No(e,t){return je.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function bK(e,t){return je.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function xK(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 Mb(e){return je.post(`/agents/${encodeURIComponent(e)}/chats`,{})}function wK(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 je.get(`/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const{ACTIVE:mj,ARCHIVED:pj,DELETED:gj}=By;function SK(e,t){return e===mj?[{key:"archive",label:"Archive",onSelect:()=>t(pj)},{key:"delete",label:"Delete",destructive:!0,onSelect:()=>t(gj)}]:e===pj?[{key:"unarchive",label:"Unarchive",onSelect:()=>t(mj)},{key:"delete",label:"Delete",destructive:!0,onSelect:()=>t(gj)}]:[]}const kK="opacity-0 group-hover:opacity-100 focus-visible:opacity-100 aria-expanded:opacity-100";function jK({chatId:e,status:t}){const n=gn(),a=yt({mutationFn:o=>BT(e,o),onSuccess:()=>{n.invalidateQueries({queryKey:["me","chats"]}),n.invalidateQueries({queryKey:["chat-detail",e]})}}),s=SK(t,o=>a.mutate(o));return l.jsx(Ab,{actions:s,ariaLabel:"Manage chat",triggerClassName:kK})}const oh="draft",EK=[{value:"active",label:"Active"},{value:"archived",label:"Archived"},{value:"all",label:"All"}],CK=[{value:"manual",label:"Manual"},{value:"github_pull_request",label:"PR"},{value:"github_issue",label:"Issue"},{value:"github_discussion",label:"Discussion"},{value:"github_commit",label:"Commit"},{value:"feishu",label:"Feishu"}];function NK(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 f;return((f=s.find(m=>m.type===c))==null?void 0:f.value)??""};return`${o("month")}/${o("day")} ${o("hour")}:${o("minute")}`}function _K(e){return e.membershipKind==="watching"?e.lastMessagePreview?`Watching · ${e.lastMessagePreview}`:"Watching":e.lastMessagePreview??""}function TK({selectedChatId:e,onSelectChat:t,onNewChat:n,engagement:a,onEngagementChange:s,source:o,onSourceChange:c}){const{agentId:f}=lt(),[m,h]=b.useState("all"),[p,g]=b.useState([]),[w,x]=b.useState(!1),[k,j]=b.useState(null),{data:E,isLoading:C}=Ye({queryKey:["me","chats",m,a,o],queryFn:()=>lh({filter:m,engagement:a,source:o}),refetchInterval:15e3}),{data:A}=Ye({queryKey:["me","chats","source-counts",a],queryFn:()=>dK({engagement:a}),refetchInterval:15e3}),O=()=>{p.length>0&&g([]),j(null)};b.useEffect(()=>{g(L=>L.length>0?[]:L),j(null)},[o,a]);const D=(E==null?void 0:E.rows)??[],I=b.useMemo(()=>[...D,...p],[D,p]),R=async()=>{if(w)return;const L=E==null?void 0:E.nextCursor;if(L){x(!0),j(null);try{const Q=await lh({filter:m,engagement:a,cursor:L,source:o});g(ce=>[...ce,...Q.rows]),P(Q.nextCursor)}catch(Q){j(Q instanceof Error?Q.message:"Failed to load more")}finally{x(!1)}}},[F,P]=b.useState(null),te=(E==null?void 0:E.nextCursor)??null;b.useEffect(()=>{P(te)},[te]);const z=b.useMemo(()=>I.reduce((L,Q)=>L+(Q.unreadMentionCount>0?1:0),0),[I]);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===oh?"var(--bg-active)":"transparent",color:e===oh?"var(--accent)":"var(--fg)",cursor:"pointer",fontWeight:500},title:"New chat",children:[l.jsx(wa,{className:"h-3.5 w-3.5",strokeWidth:2}),"New chat"]}),l.jsx("div",{className:"flex items-center flex-wrap",style:{gap:4},children:CK.map(L=>{const Q=A==null?void 0:A.counts[L.value];if(L.value!=="manual"&&(!Q||Q.chatCount===0))return null;const ce=(Q==null?void 0:Q.unreadChatCount)??0;return l.jsx(Ff,{active:o===L.value,count:ce>0?ce:void 0,warn:ce>0,onClick:()=>{o!==L.value&&(c(L.value),O())},children:L.label},L.value)})}),l.jsx("div",{className:"flex items-center",style:{gap:4},children:EK.map(L=>l.jsx(Ff,{active:a===L.value,onClick:()=>{a!==L.value&&(s(L.value),O())},children:L.label},L.value))}),z>0&&l.jsx("div",{className:"flex items-center gap-1 shrink-0",children:l.jsx(Ff,{active:m==="unread",count:z,onClick:()=>{h(m==="unread"?"all":"unread"),O()},children:"unread"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[C&&I.length===0&&l.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:"Loading…"}),!C&&I.length===0&&l.jsxs("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},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."})]}),I.map(L=>{const Q=e===L.chatId,ce=_K(L),X=ce&&ce!==L.title?ce:"",W=L.unreadMentionCount>0;return l.jsxs("div",{className:"group relative",style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[l.jsxs("button",{type:"button",onClick:()=>t(L.chatId),className:Me("w-full text-left transition-colors flex items-center","hover:bg-[var(--bg-hover)]"),style:{padding:"var(--sp-2) var(--sp-3)",gap:"var(--sp-2_5)",background:Q?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${Q?"var(--accent)":"transparent"}`},children:[l.jsx(X4,{title:L.title,type:L.type,participants:L.participants,selfAgentId:f??"",engagedAgentIds:L.engagedAgentIds,unreadCount:L.unreadMentionCount}),l.jsxs("div",{className:"flex flex-col",style:{flex:1,minWidth:0},children:[l.jsxs("div",{className:"flex items-baseline",style:{gap:6},children:[l.jsx("span",{className:"truncate text-subtitle",style:{color:W?"var(--fg)":"var(--fg-2)",fontWeight:W?700:500,flex:1,minWidth:0},children:L.title}),(()=>{const G=L.liveActivity?l.jsx(yK,{activity:L.liveActivity}):L.lastMessageAt?l.jsx("span",{className:"mono text-caption shrink-0",style:{color:"var(--fg-4)"},children:NK(L.lastMessageAt)}):null;return G?l.jsx("span",{className:"shrink-0 transition-opacity group-hover:opacity-0 group-has-aria-expanded:opacity-0",children:G}):null})()]}),l.jsx("div",{className:"truncate text-body",style:{color:W?"var(--fg-2)":"var(--fg-3)",marginTop:2},children:X||"—"})]})]}),l.jsx("div",{className:"absolute",style:{top:"var(--sp-2)",right:"var(--sp-3)"},children:l.jsx(jK,{chatId:L.chatId,status:L.engagementStatus})})]},L.chatId)}),F&&I.length>0&&l.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3)"},children:[l.jsx("button",{type:"button",onClick:R,disabled:w,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:w?"default":"pointer",opacity:w?.6:1},children:w?"Loading…":"Load more"}),k&&l.jsx("p",{className:"mono text-caption",style:{color:"var(--state-error)",marginTop:4},children:k})]})]})]})}function Db(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 AK(e,t){return!e.name||!e.displayName?!1:e.displayName!==e.name?!0:t.has(e.displayName)}function zb({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}),AK(e,t)&&l.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",e.name]})]})}function RK(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 yj(e,t){return(e.displayName??e.name??"").localeCompare(t.displayName??t.name??"")}function Ib(e){const t=e.filter(a=>a.managedByMe).sort(yj),n=e.filter(a=>!a.managedByMe).sort(yj);return t.length>0&&n.length>0?[...t,{divider:!0},...n]:[...t,...n]}function OK(e,t){if(!t)return Ib(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 MK(e,t,n,a){if(!a.name)return null;const s=e.slice(0,t.triggerIndex),o=e.slice(n),c=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${s}${c}${m}`,p=s.length+c.length+(f?1:0);return{text:h,cursor:p}}function FT({value:e,cursor:t,candidates:n,onSelect:a,disabled:s}){const[o,c]=b.useState(0),[f,m]=b.useState(null),h=b.useMemo(()=>s?null:RK(e,t),[e,t,s]),p=b.useMemo(()=>h?OK(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";b.useEffect(()=>{c(0)},[g]),b.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const w=f!==null&&h!==null&&f===h.triggerIndex,x=h!==null&&p.length>0&&!w;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(C){if(!h)return;const A=MK(e,h,t,C);A&&a(A)}return{trigger:x?h:null,results:x?p:[],highlightIndex:o,handleKey:C=>{if(!x||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),c(A=>p.length===0?0:(A+1)%p.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),c(A=>p.length===0?0:(A-1+p.length)%p.length),!0;if(C.key==="Enter"||C.key==="Tab"){const A=p[o]??p[0];return A?(C.preventDefault(),j(A),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function $T({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:s}){const o=b.useRef(null);return b.useEffect(()=>{var m;const f=(m=o.current)==null?void 0:m.querySelector(`[data-mention-index="${n}"]`);f==null||f.scrollIntoView({block:"nearest"})},[n]),!e||t.length===0||!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 f=Db(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(zb,{candidate:m,ambiguous:f})},m.agentId)})})()})}function HT(e,t){b.useLayoutEffect(()=>{const n=e.current;n&&(n.style.height="auto",n.style.height=`${n.scrollHeight}px`)},[e,t])}function DK({onCreated:e}){const t=gn(),{agentId:n}=lt(),a=$v(),[s,o]=b.useState([]),[c,f]=b.useState(""),[m,h]=b.useState(0),[p,g]=b.useState(null),[w,x]=b.useState(!1),[k,j]=b.useState(!1),E=b.useRef(null),C=b.useRef(!1),A=b.useRef(null);HT(E,c);const{data:O}=Ye({queryKey:["activity"],queryFn:Pc,refetchInterval:15e3}),D=b.useMemo(()=>{const X=(O==null?void 0:O.agents)??[],W=[];for(const G of X){if(n&&G.agentId===n)continue;const se=a(G.agentId);!se||!se.name||W.push({agentId:G.agentId,name:se.name,displayName:se.displayName,managedByMe:G.managedByMe})}return W},[O,a,n]);b.useEffect(()=>{if(C.current||s.length>0||D.length===0)return;const X=IK(D,(O==null?void 0:O.agents)??[]);X&&(o([X]),C.current=!0)},[D,O,s.length]);const I=b.useMemo(()=>{const X=D.map(W=>({agentId:W.agentId,name:W.name}));return GN(c,X)},[c,D]),R=FT({value:c,cursor:m,candidates:D,disabled:w,onSelect:X=>{f(X.text),h(X.cursor),requestAnimationFrame(()=>{const W=E.current;W&&(W.focus(),W.setSelectionRange(X.cursor,X.cursor))})}});b.useEffect(()=>{I.length!==0&&o(X=>{const W=new Set(X);let G=!1;for(const se of I)W.has(se)||(W.add(se),G=!0);return G?[...W]:X})},[I]),b.useEffect(()=>{if(!k)return;const X=W=>{A.current&&(A.current.contains(W.target)||j(!1))};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[k]);const F=yt({mutationFn:async({participantIds:X,text:W})=>{const G=await fK({participantIds:X}),se=W.trim();return se.length>0&&await No(G.chatId,se),G.chatId},onSuccess:X=>{f(""),o([]),C.current=!1,t.invalidateQueries({queryKey:["me","chats"]}),e(X)},onError:X=>{g(X instanceof Error?X.message:"Failed to create chat")}}),P=b.useMemo(()=>!(w||F.isPending||s.length===0||c.trim().length===0||s.length>=2&&I.length===0),[w,F.isPending,s.length,c,I.length]),te=b.useMemo(()=>s.length===0?"Add at least one participant":c.trim().length===0?null:s.length>=2&&I.length===0?"Group chats need an @ to wake at least one participant":null,[s.length,c,I.length]),z=async()=>{if(!P)return;const X=Array.from(new Set([...s,...I]));g(null),x(!0);try{await F.mutateAsync({participantIds:X,text:c})}finally{x(!1)}},L=X=>{o(W=>W.filter(G=>G!==X))},Q=X=>{o(W=>W.includes(X)?W:[...W,X]),j(!1)},ce=b.useMemo(()=>D.filter(X=>!s.includes(X.agentId)),[D,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(zK,{chips:s,candidates:D,chipCandidates:ce,pickerOpen:k,setPickerOpen:j,pickerContainerRef:A,onAdd:Q,onRemove:L}),l.jsxs("div",{style:{position:"relative"},children:[l.jsx($T,{trigger:R.trigger,results:R.results,highlightIndex:R.highlightIndex,anchorRef:E,onPick:R.pick}),l.jsx("textarea",{ref:E,value:c,onChange:X=>{f(X.target.value),h(X.target.selectionStart??X.target.value.length)},onSelect:X=>{h(X.currentTarget.selectionStart??c.length)},placeholder:s.length>=2?"Describe the task. Use @ to address one or more.":"Describe the task…",rows:1,onKeyDown:X=>{X.nativeEvent.isComposing||R.handleKey(X)||X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),z())},disabled:w||F.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&&I.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 z(),disabled:!P,title:te??"Send (Enter)","aria-label":"Send",className:Me("inline-flex items-center justify-center transition-opacity",!P&&"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(BE,{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 zK({chips:e,candidates:t,chipCandidates:n,pickerOpen:a,setPickerOpen:s,pickerContainerRef:o,onAdd:c,onRemove:f}){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:()=>f(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(pi,{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(wa,{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=Db(n);return Ib(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(zb,{candidate:h,ambiguous:m})},h.agentId))})()})]})]})}function IK(e,t){var c;const n=new Set(e.map(f=>f.agentId)),a=t.filter(f=>n.has(f.agentId)&&f.managedByMe);if(a.length===0)return null;const s=[...a].filter(f=>f.runtimeUpdatedAt).sort((f,m)=>(m.runtimeUpdatedAt??"").localeCompare(f.runtimeUpdatedAt??""))[0];if(s)return s.agentId;const o=a.find(f=>f.type==="personal_assistant");return o?o.agentId:((c=a[0])==null?void 0:c.agentId)??null}const LK="first-tree-hub-images",PK=1,_o="images";let Af=null;function qT(){return Af||(Af=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(LK,PK);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(_o)||n.createObjectStore(_o,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Af)}async function UK(e){const t=await qT();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const s=t.transaction(_o,"readwrite"),o=s.objectStore(_o),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 BK(e){const t=await qT();return t?new Promise(n=>{const o=t.transaction(_o,"readonly").objectStore(_o).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 FK(e,t,n){return je.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:ZT,setPrototypeOf:vj,isFrozen:$K,getPrototypeOf:HK,getOwnPropertyDescriptor:qK}=Object;let{freeze:hr,seal:ua,create:Wl}=Object,{apply:av,construct:iv}=typeof Reflect<"u"&&Reflect;hr||(hr=function(t){return t});ua||(ua=function(t){return t});av||(av=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)});iv||(iv=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 Gu=En(Array.prototype.forEach),ZK=En(Array.prototype.lastIndexOf),bj=En(Array.prototype.pop),Vu=En(Array.prototype.push),GK=En(Array.prototype.splice),or=Array.isArray,ec=En(String.prototype.toLowerCase),$g=En(String.prototype.toString),xj=En(String.prototype.match),Ql=En(String.prototype.replace),wj=En(String.prototype.indexOf),VK=En(String.prototype.trim),QK=En(Number.prototype.toString),KK=En(Boolean.prototype.toString),Sj=typeof BigInt>"u"?null:En(BigInt.prototype.toString),kj=typeof Symbol>"u"?null:En(Symbol.prototype.toString),on=En(Object.prototype.hasOwnProperty),Qu=En(Object.prototype.toString),Vn=En(RegExp.prototype.test),Rf=YK(TypeError);function En(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 av(e,t,a)}}function YK(e){return function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return iv(e,n)}}function nt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ec;if(vj&&vj(e,null),!or(t))return e;let a=t.length;for(;a--;){let s=t[a];if(typeof s=="string"){const o=n(s);o!==s&&($K(t)||(t[a]=o),s=o)}e[s]=!0}return e}function XK(e){for(let t=0;t<e.length;t++)on(e,t)||(e[t]=null);return e}function jr(e){const t=Wl(null);for(const[n,a]of ZT(e))on(e,n)&&(or(a)?t[n]=XK(a):a&&typeof a=="object"&&a.constructor===Object?t[n]=jr(a):t[n]=a);return t}function WK(e){switch(typeof e){case"string":return e;case"number":return QK(e);case"boolean":return KK(e);case"bigint":return Sj?Sj(e):"0";case"symbol":return kj?kj(e):"Symbol()";case"undefined":return Qu(e);case"function":case"object":{if(e===null)return Qu(e);const t=e,n=Jl(t,"toString");if(typeof n=="function"){const a=n(t);return typeof a=="string"?a:Qu(a)}return Qu(e)}default:return Qu(e)}}function Jl(e,t){for(;e!==null;){const a=qK(e,t);if(a){if(a.get)return En(a.get);if(typeof a.value=="function")return En(a.value)}e=HK(e)}function n(){return null}return n}function JK(e){try{return Vn(e,""),!0}catch{return!1}}const jj=hr(["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"]),Hg=hr(["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"]),qg=hr(["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"]),eY=hr(["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"]),Zg=hr(["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"]),tY=hr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ej=hr(["#text"]),Cj=hr(["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"]),Gg=hr(["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"]),Nj=hr(["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"]),Of=hr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nY=ua(/\{\{[\w\W]*|[\w\W]*\}\}/gm),rY=ua(/<%[\w\W]*|[\w\W]*%>/gm),aY=ua(/\$\{[\w\W]*/gm),iY=ua(/^data-[\-\w.\u00B7-\uFFFF]+$/),sY=ua(/^aria-[\-\w]+$/),GT=ua(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lY=ua(/^(?:\w+script|data):/i),oY=ua(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),VT=ua(/^html$/i),uY=ua(/^[a-z][.\w]*(-[.\w]+)+$/i);var _j=Object.freeze({__proto__:null,ARIA_ATTR:sY,ATTR_WHITESPACE:oY,CUSTOM_ELEMENT:uY,DATA_ATTR:iY,DOCTYPE_NAME:VT,ERB_EXPR:rY,IS_ALLOWED_URI:GT,IS_SCRIPT_OR_DATA:lY,MUSTACHE_EXPR:nY,TMPLIT_EXPR:aY});const Ku={element:1,text:3,progressingInstruction:7,comment:8,document:9},cY=function(){return typeof window>"u"?null:window},dY=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}},Tj=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function QT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cY();const t=Be=>QT(Be);if(t.version="3.4.2",t.removed=[],!e||!e.document||e.document.nodeType!==Ku.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const a=n,s=a.currentScript,{DocumentFragment:o,HTMLTemplateElement:c,Node:f,Element:m,NodeFilter:h,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:w,trustedTypes:x}=e,k=m.prototype,j=Jl(k,"cloneNode"),E=Jl(k,"remove"),C=Jl(k,"nextSibling"),A=Jl(k,"childNodes"),O=Jl(k,"parentNode");if(typeof c=="function"){const Be=n.createElement("template");Be.content&&Be.content.ownerDocument&&(n=Be.content.ownerDocument)}let D,I="";const{implementation:R,createNodeIterator:F,createDocumentFragment:P,getElementsByTagName:te}=n,{importNode:z}=a;let L=Tj();t.isSupported=typeof ZT=="function"&&typeof O=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Q,ERB_EXPR:ce,TMPLIT_EXPR:X,DATA_ATTR:W,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:se,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:ve}=_j;let{IS_ALLOWED_URI:M}=_j,U=null;const B=nt({},[...jj,...Hg,...qg,...Zg,...Ej]);let _=null;const V=nt({},[...Cj,...Gg,...Nj,...Of]);let Z=Object.seal(Wl(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 Re=Object.seal(Wl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ee=!0,He=!0,Le=!1,Ke=!0,et=!1,St=!0,Y=!1,ge=!1,Ce=!1,_e=!1,At=!1,qe=!1,Mn=!0,rn=!1;const La="user-content-";let an=!0,fa=!1,ue={},we=null;const Fe=nt({},["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 Xe=null;const vt=nt({},["audio","video","img","source","image","track"]);let _n=null;const mr=nt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Gt="http://www.w3.org/1998/Math/MathML",Ft="http://www.w3.org/2000/svg",Lt="http://www.w3.org/1999/xhtml";let ht=Lt,pr=!1,Un=null;const Fo=nt({},[Gt,Ft,Lt],$g);let ka=nt({},["mi","mo","mn","ms","mtext"]),ir=nt({},["annotation-xml"]);const ha=nt({},["title","style","font","a","script"]);let Bn=null;const Pa=["application/xhtml+xml","text/html"],ma="text/html";let Jt=null,Gr=null;const wi=n.createElement("form"),pa=function(H){return H instanceof RegExp||H instanceof Function},Si=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Gr&&Gr===H)return;(!H||typeof H!="object")&&(H={}),H=jr(H),Bn=Pa.indexOf(H.PARSER_MEDIA_TYPE)===-1?ma:H.PARSER_MEDIA_TYPE,Jt=Bn==="application/xhtml+xml"?$g:ec,U=on(H,"ALLOWED_TAGS")&&or(H.ALLOWED_TAGS)?nt({},H.ALLOWED_TAGS,Jt):B,_=on(H,"ALLOWED_ATTR")&&or(H.ALLOWED_ATTR)?nt({},H.ALLOWED_ATTR,Jt):V,Un=on(H,"ALLOWED_NAMESPACES")&&or(H.ALLOWED_NAMESPACES)?nt({},H.ALLOWED_NAMESPACES,$g):Fo,_n=on(H,"ADD_URI_SAFE_ATTR")&&or(H.ADD_URI_SAFE_ATTR)?nt(jr(mr),H.ADD_URI_SAFE_ATTR,Jt):mr,Xe=on(H,"ADD_DATA_URI_TAGS")&&or(H.ADD_DATA_URI_TAGS)?nt(jr(vt),H.ADD_DATA_URI_TAGS,Jt):vt,we=on(H,"FORBID_CONTENTS")&&or(H.FORBID_CONTENTS)?nt({},H.FORBID_CONTENTS,Jt):Fe,re=on(H,"FORBID_TAGS")&&or(H.FORBID_TAGS)?nt({},H.FORBID_TAGS,Jt):jr({}),xe=on(H,"FORBID_ATTR")&&or(H.FORBID_ATTR)?nt({},H.FORBID_ATTR,Jt):jr({}),ue=on(H,"USE_PROFILES")?H.USE_PROFILES&&typeof H.USE_PROFILES=="object"?jr(H.USE_PROFILES):H.USE_PROFILES:!1,Ee=H.ALLOW_ARIA_ATTR!==!1,He=H.ALLOW_DATA_ATTR!==!1,Le=H.ALLOW_UNKNOWN_PROTOCOLS||!1,Ke=H.ALLOW_SELF_CLOSE_IN_ATTR!==!1,et=H.SAFE_FOR_TEMPLATES||!1,St=H.SAFE_FOR_XML!==!1,Y=H.WHOLE_DOCUMENT||!1,_e=H.RETURN_DOM||!1,At=H.RETURN_DOM_FRAGMENT||!1,qe=H.RETURN_TRUSTED_TYPE||!1,Ce=H.FORCE_BODY||!1,Mn=H.SANITIZE_DOM!==!1,rn=H.SANITIZE_NAMED_PROPS||!1,an=H.KEEP_CONTENT!==!1,fa=H.IN_PLACE||!1,M=JK(H.ALLOWED_URI_REGEXP)?H.ALLOWED_URI_REGEXP:GT,ht=typeof H.NAMESPACE=="string"?H.NAMESPACE:Lt,ka=on(H,"MATHML_TEXT_INTEGRATION_POINTS")&&H.MATHML_TEXT_INTEGRATION_POINTS&&typeof H.MATHML_TEXT_INTEGRATION_POINTS=="object"?jr(H.MATHML_TEXT_INTEGRATION_POINTS):nt({},["mi","mo","mn","ms","mtext"]),ir=on(H,"HTML_INTEGRATION_POINTS")&&H.HTML_INTEGRATION_POINTS&&typeof H.HTML_INTEGRATION_POINTS=="object"?jr(H.HTML_INTEGRATION_POINTS):nt({},["annotation-xml"]);const pe=on(H,"CUSTOM_ELEMENT_HANDLING")&&H.CUSTOM_ELEMENT_HANDLING&&typeof H.CUSTOM_ELEMENT_HANDLING=="object"?jr(H.CUSTOM_ELEMENT_HANDLING):Wl(null);if(Z=Wl(null),on(pe,"tagNameCheck")&&pa(pe.tagNameCheck)&&(Z.tagNameCheck=pe.tagNameCheck),on(pe,"attributeNameCheck")&&pa(pe.attributeNameCheck)&&(Z.attributeNameCheck=pe.attributeNameCheck),on(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),et&&(He=!1),At&&(_e=!0),ue&&(U=nt({},Ej),_=Wl(null),ue.html===!0&&(nt(U,jj),nt(_,Cj)),ue.svg===!0&&(nt(U,Hg),nt(_,Gg),nt(_,Of)),ue.svgFilters===!0&&(nt(U,qg),nt(_,Gg),nt(_,Of)),ue.mathMl===!0&&(nt(U,Zg),nt(_,Nj),nt(_,Of))),Re.tagCheck=null,Re.attributeCheck=null,on(H,"ADD_TAGS")&&(typeof H.ADD_TAGS=="function"?Re.tagCheck=H.ADD_TAGS:or(H.ADD_TAGS)&&(U===B&&(U=jr(U)),nt(U,H.ADD_TAGS,Jt))),on(H,"ADD_ATTR")&&(typeof H.ADD_ATTR=="function"?Re.attributeCheck=H.ADD_ATTR:or(H.ADD_ATTR)&&(_===V&&(_=jr(_)),nt(_,H.ADD_ATTR,Jt))),on(H,"ADD_URI_SAFE_ATTR")&&or(H.ADD_URI_SAFE_ATTR)&&nt(_n,H.ADD_URI_SAFE_ATTR,Jt),on(H,"FORBID_CONTENTS")&&or(H.FORBID_CONTENTS)&&(we===Fe&&(we=jr(we)),nt(we,H.FORBID_CONTENTS,Jt)),on(H,"ADD_FORBID_CONTENTS")&&or(H.ADD_FORBID_CONTENTS)&&(we===Fe&&(we=jr(we)),nt(we,H.ADD_FORBID_CONTENTS,Jt)),an&&(U["#text"]=!0),Y&&nt(U,["html","head","body"]),U.table&&(nt(U,["tbody"]),delete re.tbody),H.TRUSTED_TYPES_POLICY){if(typeof H.TRUSTED_TYPES_POLICY.createHTML!="function")throw Rf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof H.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Rf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');D=H.TRUSTED_TYPES_POLICY,I=D.createHTML("")}else D===void 0&&(D=dY(x,s)),D!==null&&typeof I=="string"&&(I=D.createHTML(""));hr&&hr(H),Gr=H},ki=nt({},[...Hg,...qg,...eY]),ji=nt({},[...Zg,...tY]),js=function(H){let pe=O(H);(!pe||!pe.tagName)&&(pe={namespaceURI:ht,tagName:"template"});const Ne=ec(H.tagName),jt=ec(pe.tagName);return Un[H.namespaceURI]?H.namespaceURI===Ft?pe.namespaceURI===Lt?Ne==="svg":pe.namespaceURI===Gt?Ne==="svg"&&(jt==="annotation-xml"||ka[jt]):!!ki[Ne]:H.namespaceURI===Gt?pe.namespaceURI===Lt?Ne==="math":pe.namespaceURI===Ft?Ne==="math"&&ir[jt]:!!ji[Ne]:H.namespaceURI===Lt?pe.namespaceURI===Ft&&!ir[jt]||pe.namespaceURI===Gt&&!ka[jt]?!1:!ji[Ne]&&(ha[Ne]||!ki[Ne]):!!(Bn==="application/xhtml+xml"&&Un[H.namespaceURI]):!1},Dn=function(H){Vu(t.removed,{element:H});try{O(H).removeChild(H)}catch{E(H)}},gr=function(H,pe){try{Vu(t.removed,{attribute:pe.getAttributeNode(H),from:pe})}catch{Vu(t.removed,{attribute:null,from:pe})}if(pe.removeAttribute(H),H==="is")if(_e||At)try{Dn(pe)}catch{}else try{pe.setAttribute(H,"")}catch{}},Ei=function(H){let pe=null,Ne=null;if(Ce)H="<remove></remove>"+H;else{const en=xj(H,/^[\r\n\t ]+/);Ne=en&&en[0]}Bn==="application/xhtml+xml"&&ht===Lt&&(H='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+H+"</body></html>");const jt=D?D.createHTML(H):H;if(ht===Lt)try{pe=new w().parseFromString(jt,Bn)}catch{}if(!pe||!pe.documentElement){pe=R.createDocument(ht,"template",null);try{pe.documentElement.innerHTML=pr?I:jt}catch{}}const bt=pe.body||pe.documentElement;return H&&Ne&&bt.insertBefore(n.createTextNode(Ne),bt.childNodes[0]||null),ht===Lt?te.call(pe,Y?"html":"body")[0]:Y?pe.documentElement:bt},Ci=function(H){return F.call(H.ownerDocument||H,H,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},ye=function(H){return H instanceof g&&(typeof H.nodeName!="string"||typeof H.textContent!="string"||typeof H.removeChild!="function"||!(H.attributes instanceof p)||typeof H.removeAttribute!="function"||typeof H.setAttribute!="function"||typeof H.namespaceURI!="string"||typeof H.insertBefore!="function"||typeof H.hasChildNodes!="function")},Ge=function(H){return typeof f=="function"&&H instanceof f};function mt(Be,H,pe){Gu(Be,Ne=>{Ne.call(t,H,pe,Gr)})}const Fn=function(H){let pe=null;if(mt(L.beforeSanitizeElements,H,null),ye(H))return Dn(H),!0;const Ne=Jt(H.nodeName);if(mt(L.uponSanitizeElement,H,{tagName:Ne,allowedTags:U}),St&&H.hasChildNodes()&&!Ge(H.firstElementChild)&&Vn(/<[/\w!]/g,H.innerHTML)&&Vn(/<[/\w!]/g,H.textContent)||St&&H.namespaceURI===Lt&&Ne==="style"&&Ge(H.firstElementChild)||H.nodeType===Ku.progressingInstruction||St&&H.nodeType===Ku.comment&&Vn(/<[/\w]/g,H.data))return Dn(H),!0;if(re[Ne]||!(Re.tagCheck instanceof Function&&Re.tagCheck(Ne))&&!U[Ne]){if(!re[Ne]&&Kc(Ne)&&(Z.tagNameCheck instanceof RegExp&&Vn(Z.tagNameCheck,Ne)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(Ne)))return!1;if(an&&!we[Ne]){const jt=O(H)||H.parentNode,bt=A(H)||H.childNodes;if(bt&&jt){const en=bt.length;for(let $n=en-1;$n>=0;--$n){const vn=j(bt[$n],!0);jt.insertBefore(vn,C(H))}}}return Dn(H),!0}return H instanceof m&&!js(H)||(Ne==="noscript"||Ne==="noembed"||Ne==="noframes")&&Vn(/<\/no(script|embed|frames)/i,H.innerHTML)?(Dn(H),!0):(et&&H.nodeType===Ku.text&&(pe=H.textContent,Gu([Q,ce,X],jt=>{pe=Ql(pe,jt," ")}),H.textContent!==pe&&(Vu(t.removed,{element:H.cloneNode()}),H.textContent=pe)),mt(L.afterSanitizeElements,H,null),!1)},Ua=function(H,pe,Ne){if(xe[pe]||Mn&&(pe==="id"||pe==="name")&&(Ne in n||Ne in wi))return!1;const jt=_[pe]||Re.attributeCheck instanceof Function&&Re.attributeCheck(pe,H);if(!(He&&!xe[pe]&&Vn(W,pe))){if(!(Ee&&Vn(G,pe))){if(!jt||xe[pe]){if(!(Kc(H)&&(Z.tagNameCheck instanceof RegExp&&Vn(Z.tagNameCheck,H)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(H))&&(Z.attributeNameCheck instanceof RegExp&&Vn(Z.attributeNameCheck,pe)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(pe,H))||pe==="is"&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&Vn(Z.tagNameCheck,Ne)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(Ne))))return!1}else if(!_n[pe]){if(!Vn(M,Ql(Ne,ee,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&H!=="script"&&wj(Ne,"data:")===0&&Xe[H])){if(!(Le&&!Vn(se,Ql(Ne,ee,"")))){if(Ne)return!1}}}}}}return!0},$o=nt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Kc=function(H){return!$o[ec(H)]&&Vn(ve,H)},Ho=function(H){mt(L.beforeSanitizeAttributes,H,null);const{attributes:pe}=H;if(!pe||ye(H))return;const Ne={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let jt=pe.length;for(;jt--;){const bt=pe[jt],{name:en,namespaceURI:$n,value:vn}=bt,zn=Jt(en),qo=vn;let hn=en==="value"?qo:VK(qo);if(Ne.attrName=zn,Ne.attrValue=hn,Ne.keepAttr=!0,Ne.forceKeepAttr=void 0,mt(L.uponSanitizeAttribute,H,Ne),hn=Ne.attrValue,rn&&(zn==="id"||zn==="name")&&wj(hn,La)!==0&&(gr(en,H),hn=La+hn),St&&Vn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,hn)){gr(en,H);continue}if(zn==="attributename"&&xj(hn,"href")){gr(en,H);continue}if(Ne.forceKeepAttr)continue;if(!Ne.keepAttr){gr(en,H);continue}if(!Ke&&Vn(/\/>/i,hn)){gr(en,H);continue}et&&Gu([Q,ce,X],Yc=>{hn=Ql(hn,Yc," ")});const Zo=Jt(H.nodeName);if(!Ua(Zo,zn,hn)){gr(en,H);continue}if(D&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!$n)switch(x.getAttributeType(Zo,zn)){case"TrustedHTML":{hn=D.createHTML(hn);break}case"TrustedScriptURL":{hn=D.createScriptURL(hn);break}}if(hn!==qo)try{$n?H.setAttributeNS($n,en,hn):H.setAttribute(en,hn),ye(H)?Dn(H):bj(t.removed)}catch{gr(en,H)}}mt(L.afterSanitizeAttributes,H,null)},Ni=function(H){let pe=null;const Ne=Ci(H);for(mt(L.beforeSanitizeShadowDOM,H,null);pe=Ne.nextNode();)mt(L.uponSanitizeShadowNode,pe,null),Fn(pe),Ho(pe),pe.content instanceof o&&Ni(pe.content);mt(L.afterSanitizeShadowDOM,H,null)};return t.sanitize=function(Be){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,Ne=null,jt=null,bt=null;if(pr=!Be,pr&&(Be="<!-->"),typeof Be!="string"&&!Ge(Be)&&(Be=WK(Be),typeof Be!="string"))throw Rf("dirty is not a string, aborting");if(!t.isSupported)return Be;if(ge||Si(H),t.removed=[],typeof Be=="string"&&(fa=!1),fa){const vn=Be.nodeName;if(typeof vn=="string"){const zn=Jt(vn);if(!U[zn]||re[zn])throw Rf("root node is forbidden and cannot be sanitized in-place")}}else if(Be instanceof f)pe=Ei("<!---->"),Ne=pe.ownerDocument.importNode(Be,!0),Ne.nodeType===Ku.element&&Ne.nodeName==="BODY"||Ne.nodeName==="HTML"?pe=Ne:pe.appendChild(Ne);else{if(!_e&&!et&&!Y&&Be.indexOf("<")===-1)return D&&qe?D.createHTML(Be):Be;if(pe=Ei(Be),!pe)return _e?null:qe?I:""}pe&&Ce&&Dn(pe.firstChild);const en=Ci(fa?Be:pe);for(;jt=en.nextNode();)Fn(jt),Ho(jt),jt.content instanceof o&&Ni(jt.content);if(fa)return Be;if(_e){if(et){pe.normalize();let vn=pe.innerHTML;Gu([Q,ce,X],zn=>{vn=Ql(vn,zn," ")}),pe.innerHTML=vn}if(At)for(bt=P.call(pe.ownerDocument);pe.firstChild;)bt.appendChild(pe.firstChild);else bt=pe;return(_.shadowroot||_.shadowrootmode)&&(bt=z.call(a,bt,!0)),bt}let $n=Y?pe.outerHTML:pe.innerHTML;return Y&&U["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&Vn(VT,pe.ownerDocument.doctype.name)&&($n="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
|
|
412
|
+
`+$n),et&&Gu([Q,ce,X],vn=>{$n=Ql($n,vn," ")}),D&&qe?D.createHTML($n):$n},t.setConfig=function(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Si(Be),ge=!0},t.clearConfig=function(){Gr=null,ge=!1},t.isValidAttribute=function(Be,H,pe){Gr||Si({});const Ne=Jt(Be),jt=Jt(H);return Ua(Ne,jt,pe)},t.addHook=function(Be,H){typeof H=="function"&&Vu(L[Be],H)},t.removeHook=function(Be,H){if(H!==void 0){const pe=ZK(L[Be],H);return pe===-1?void 0:GK(L[Be],pe,1)[0]}return bj(L[Be])},t.removeHooks=function(Be){L[Be]=[]},t.removeAllHooks=function(){L=Tj()},t}var KT=QT();let Aj=!1;function fY(){Aj||(Aj=!0,KT.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer"))}))}function hY({option:e,previewFormat:t,selected:n,disabled:a,showCheckmark:s,onToggle:o}){const c=b.useMemo(()=>!e.preview||t!=="html"?null:(fY(),KT.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(Lh,{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 ro="__free_text__";function Yu(){return{picked:[],freeText:""}}function Rj(e,t){if(t.picked.includes(ro)){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 mY({chatId:e,questionMessageId:t,content:n,answer:a,status:s}){const o=s==="pending",c=s==="answered",f=s==="superseded",[m,h]=b.useState(()=>{const E={};for(const C of n.questions)E[C.question]=Yu();return E});b.useEffect(()=>{if(!a)return;const E={};for(const C of n.questions){const A=a.answers[C.question];if(!A){E[C.question]=Yu();continue}const O=new Set(C.options.map(R=>R.label)),D=C.multiSelect?A.split(/,\s*/u):[A],I=D.filter(R=>O.has(R));I.length===D.length&&I.length>0?E[C.question]={picked:I,freeText:""}:E[C.question]={picked:[ro],freeText:A}}h(E)},[a,n.questions]);const p=gn(),[g,w]=b.useState(null),x=yt({mutationFn:async E=>FK(e,n.correlationId,E),onSuccess:()=>{w(null),p.invalidateQueries({queryKey:["chat-messages",e]})},onError:E=>{w(E instanceof Error?E.message:String(E))}}),k=b.useCallback(()=>{w(null);const E={};for(const C of n.questions){const A=m[C.question]??Yu(),O=Rj(C,A);if(O===null){w(`Please answer "${C.question}" before submitting.`);return}E[C.question]=O}x.mutate(E)},[n.questions,m,x]),j=b.useMemo(()=>n.questions.every(E=>{const C=m[E.question]??Yu();return Rj(E,C)!==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,f?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(E=>l.jsx(pY,{question:E,previewFormat:n.previewFormat,selection:m[E.question]??Yu(),allowFreeText:n.allowFreeText,disabled:!o,showAnsweredCheck:c||f,onChange:C=>h(A=>({...A,[E.question]:C}))},E.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(be,{type:"button",disabled:!j||x.isPending,onClick:k,children:x.isPending?"Submitting…":"Submit answer"})]}):null]})}function pY({question:e,previewFormat:t,selection:n,allowFreeText:a,disabled:s,showAnsweredCheck:o,onChange:c}){const f=b.useRef(null),m=n.picked.includes(ro);b.useEffect(()=>{var p;m&&!s&&((p=f.current)==null||p.focus())},[m,s]);const h=b.useCallback(p=>{const g=n.picked.includes(p);let w;e.multiSelect?w=g?n.picked.filter(x=>x!==p):[...n.picked,p]:w=g?[]:[p],c({...n,picked:w})},[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(hY,{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!==ro):[...n.picked,ro]:m?[]:[ro],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:f,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 gY(e){return eF.safeParse(e).success}function YT(e){return tF.safeParse(e).success}function yY(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"||s.kind==="context_tree_usage"?!1:s.kind==="error"?!0:s.seq>t),a=new Map;for(const s of n){if(s.kind!=="tool_call")continue;const o=Oj(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=Oj(s.payload);return o?a.get(o)===s.seq:!0})}function Oj(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Bo(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 vY(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Mj(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function bY({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 xY({event:e}){const t=J3(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?Mj(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:["(",Mj(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:["· ",vY(t.durationMs)]}):null]})]})}function wY({event:e,agentNameFn:t,agentId:n}){const a=tz(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(Uh,{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:Bo(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 SY({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:Bo(e.createdAt)})]})}function kY({event:e}){const t=ez(e.payload),n=Bo(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 Uh({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(Fc,{width:9,height:10,style:{color:"var(--accent)"}})})}function jY({msg:e,myAgentId:t,agentNameFn:n}){const[a,s]=Oo(),o=n(e.senderId),c=t===e.senderId,f=EY(e.metadata),m=b.useMemo(()=>({a({href:h,children:p,...g}){const w=x=>{if(!h||x.defaultPrevented||x.button!==0||x.metaKey||x.altKey||x.ctrlKey||x.shiftKey)return;const k=LT(h);if(!k)return;x.preventDefault();const j=new URLSearchParams(a);j.set("docChat",e.chatId),j.set("docAgent",e.senderId),j.set("docPath",k),f?j.set("docBase",f):j.delete("docBase"),s(j)};return l.jsx("a",{...g,href:h,onClick:w,target:"_blank",rel:"noopener noreferrer",children:p})}}),[f,e.chatId,e.senderId,a,s]);return l.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[l.jsx(Uh,{name:o,isSelf:c}),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:c?"var(--fg)":"var(--accent)"},children:o}),l.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Bo(e.createdAt)}),l.jsx("span",{style:{marginLeft:"auto"},children:l.jsx(bY,{msg:e,myAgentId:t})})]}),l.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&CY(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"&&NY(e.content)?l.jsx(_Y,{content:e.content}):e.format==="text"||e.format==="markdown"?l.jsx(Lh,{components:m,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 EY(e){const t=k9.safeParse(e==null?void 0:e.documentContext);return t.success?t.data.basePath:void 0}function CY(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 NY(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 _Y({content:e}){const[t,n]=b.useState({kind:"loading"});return b.useEffect(()=>{let a=!1;return BK(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 TY({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(Uh,{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:Bo(e.createdAt)})]}),l.jsx(mY,{chatId:t,questionMessageId:e.id,content:n,answer:a,status:s})]})]})}function AY({msg:e,agentNameFn:t}){const n=YT(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(Uh,{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:Bo(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 RY({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(Tv,{className:"h-3.5 w-3.5"})}):null}function Dj({agentId:e,chatId:t,readOnly:n=!1,titleFallback:a,joinAction:s}){var St;const o=gn(),c=xh(),f=$v(),{agentId:m}=lt(),[h,p]=b.useState(""),[g,w]=b.useState(0),[x,k]=b.useState([]),[j,E]=b.useState(!1),[C,A]=b.useState(null),O=b.useRef(null),D=b.useRef(null),I=b.useRef(null);HT(D,h);const R=b.useRef(!1),F=b.useRef(new Set);b.useEffect(()=>{R.current=!1},[t]);const{data:P}=Ye({queryKey:["chat-messages",t],queryFn:()=>wK(t,{limit:50}),refetchInterval:5e3}),{data:te}=Ye({queryKey:["session-events",e,t],queryFn:()=>nz(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:z}=Ye({queryKey:["chat-detail",t],queryFn:()=>UT(t),enabled:!!t}),{data:L}=Ye({queryKey:["activity"],queryFn:Pc,refetchInterval:15e3}),Q=yt({mutationFn:Y=>No(t,Y),onSuccess:()=>{p(""),o.invalidateQueries({queryKey:["chat-messages",t]}),o.invalidateQueries({queryKey:d1(e)})}}),ce=b.useCallback(Y=>{const Ce=Y.filter(qe=>qe.type.startsWith("image/"));if(Ce.length===0)return;const _e=Ce.find(qe=>qe.size>5242880);if(_e){A(`Image too large (${(_e.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const At=Ce.map(qe=>({id:crypto.randomUUID(),file:qe,previewUrl:URL.createObjectURL(qe)}));k(qe=>[...qe,...At]),A(null)},[]),X=b.useCallback(Y=>{k(ge=>{const Ce=ge.find(_e=>_e.id===Y);return Ce&&URL.revokeObjectURL(Ce.previewUrl),ge.filter(_e=>_e.id!==Y)})},[]),W=async()=>{const Y=h.trim(),ge=x;if(!(!Y&&ge.length===0)&&!j&&!(He&&Le.length===0)){if(Ke.length>0)try{await PT(t,{participantIds:Ke}),await o.invalidateQueries({queryKey:["chat-detail",t]})}catch(Ce){A(Ce instanceof Error?Ce.message:"Failed to add participants");return}if(ge.length>0){E(!0),A(null);try{for(const Ce of ge){const _e=await xK(Ce.file),At=crypto.randomUUID();await UK({imageId:At,base64:_e,mimeType:Ce.file.type}),await bK(t,{data:_e,mimeType:Ce.file.type,filename:Ce.file.name,size:Ce.file.size,imageId:At}),URL.revokeObjectURL(Ce.previewUrl)}k([]),Y&&await No(t,Y),p(""),o.invalidateQueries({queryKey:["chat-messages",t]}),o.invalidateQueries({queryKey:d1(e)})}catch(Ce){A(Ce instanceof Error?Ce.message:"Failed to send image")}finally{E(!1)}return}Q.mutate(Y)}},[G,se]=b.useState(!1),[ee,ve]=b.useState(""),M=b.useRef(null);b.useEffect(()=>{var Y;G&&((Y=M.current)==null||Y.focus())},[G]);const U=yt({mutationFn:Y=>vK(t,Y),onSuccess:()=>{se(!1),o.invalidateQueries({queryKey:["chat-detail",t]}),o.invalidateQueries({queryKey:["agent-sessions",e]}),o.invalidateQueries({queryKey:["session",e,t]})}}),B=()=>{const Y=ee.trim();U.mutate(Y.length>0?Y:null)},_=yt({mutationFn:()=>BT(t,By.ACTIVE),onSuccess:()=>{o.invalidateQueries({queryKey:["me","chats"]}),o.invalidateQueries({queryKey:["chat-detail",t]})}}),V=b.useMemo(()=>{const Y=(P==null?void 0:P.items)??[],ge=yY((te==null?void 0:te.items)??[]),Ce=[...Y.map(_e=>({kind:"message",at:_e.createdAt,key:`m-${_e.id}`,data:_e})),...ge.map(_e=>({kind:"event",at:_e.createdAt,key:`e-${_e.id}`,data:_e}))];return Ce.sort((_e,At)=>_e.at.localeCompare(At.at)),Ce},[P,te]),Z=b.useMemo(()=>{const Y=new Map;for(const ge of(P==null?void 0:P.items)??[])ge.format==="question_answer"&&YT(ge.content)&&Y.set(ge.content.correlationId,ge.content);return Y},[P]),re=V.length;b.useEffect(()=>{var Y;re>0&&((Y=I.current)==null||Y.scrollIntoView({behavior:"smooth"}))},[re]);const xe=c(e),Re=b.useMemo(()=>{var Y;return new Set(((Y=z==null?void 0:z.participants)==null?void 0:Y.map(ge=>ge.agentId))??[])},[z==null?void 0:z.participants]),Ee=b.useMemo(()=>{const Y=new Set;for(const _e of(z==null?void 0:z.participants)??[])Y.add(_e.agentId);for(const _e of(L==null?void 0:L.agents)??[])Y.add(_e.agentId);Y.size===0&&Y.add(e);const ge=new Map;for(const _e of(L==null?void 0:L.agents)??[])ge.set(_e.agentId,_e.managedByMe);const Ce=[];for(const _e of Y){if(_e===m)continue;const At=f(_e);!At||!At.name||Ce.push({agentId:_e,name:At.name,displayName:At.displayName,managedByMe:ge.get(_e)??!1})}return Ce},[z==null?void 0:z.participants,L==null?void 0:L.agents,e,f,m]),He=b.useMemo(()=>{if(!z)return!1;if(z.type==="group")return!0;const Y=z.participants.some(ge=>ge.agentId===m);return z.type==="direct"&&!Y&&z.participants.length>=2},[z,m]);b.useEffect(()=>{if(n||F.current.has(t)||!P||!te||!z||V.length>0||h.length>0||He||xe===e)return;const Y=`Hi ${xe}! What can you help with?`;p(Y),w(Y.length),F.current.add(t),requestAnimationFrame(()=>{const ge=D.current;ge&&(ge.focus(),ge.setSelectionRange(Y.length,Y.length))})},[t,e,P,te,z,V.length,h.length,xe,He,n]);const Le=b.useMemo(()=>{const Y=Ee.map(ge=>({agentId:ge.agentId,name:ge.name}));return GN(h,Y)},[h,Ee]),Ke=b.useMemo(()=>Re.size===0?[]:Le.filter(Y=>!Re.has(Y)),[Le,Re]),et=FT({value:h,cursor:g,candidates:Ee,disabled:Q.isPending||j,onSelect:Y=>{p(Y.text),w(Y.cursor),requestAnimationFrame(()=>{const ge=D.current;ge&&(ge.focus(),ge.setSelectionRange(Y.cursor,Y.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:(z==null?void 0:z.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"})]}):G?l.jsxs(l.Fragment,{children:[l.jsx("input",{ref:M,value:ee,onChange:Y=>ve(Y.target.value),onKeyDown:Y=>{Y.nativeEvent.isComposing||(Y.key==="Enter"?(Y.preventDefault(),B()):Y.key==="Escape"&&(Y.preventDefault(),se(!1)))},disabled:U.isPending,maxLength:500,placeholder:(z==null?void 0:z.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:B,disabled:U.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:l.jsx(fr,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>se(!1),disabled:U.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:l.jsx(pi,{className:"h-3.5 w-3.5"})})]}):l.jsx("button",{type:"button",onClick:()=>{ve((z==null?void 0:z.topic)??""),se(!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:(z==null?void 0:z.title)??"…"}),l.jsx(RY,{metadata:z==null?void 0:z.metadata})]}),l.jsx(OY,{chatId:t,participantIds:((St=z==null?void 0:z.participants)==null?void 0:St.map(Y=>Y.agentId))??[e],candidates:Ee,agentIdentity:f,onAdded:()=>o.invalidateQueries({queryKey:["chat-detail",t]}),readOnly:n})]})}),(z==null?void 0:z.engagementStatus)===By.DELETED&&l.jsxs("div",{className:"shrink-0 flex items-center",style:{gap:"var(--sp-2)",padding:"var(--sp-1_5) var(--sp-6)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:[l.jsx("span",{className:"text-body",style:{flex:1},children:"This chat is deleted and won't appear in your conversation list."}),l.jsx("button",{type:"button",disabled:_.isPending,onClick:()=>_.mutate(),className:"text-body",style:{padding:"var(--sp-0_5) var(--sp-2)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-raised)",color:"var(--fg)",cursor:_.isPending?"default":"pointer",opacity:_.isPending?.6:1},children:_.isPending?"Restoring…":"Restore"})]}),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:[re===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(Av,{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:V.map(Y=>{if(Y.kind==="event"){const Ce=Y.data;switch(Ce.kind){case"tool_call":return l.jsx(xY,{event:Ce},Y.key);case"assistant_text":return l.jsx(wY,{event:Ce,agentId:e,agentNameFn:c},Y.key);case"thinking":return l.jsx(SY,{event:Ce},Y.key);case"error":return l.jsx(kY,{event:Ce},Y.key);default:return null}}const ge=Y.data;if(ge.format==="question"&&gY(ge.content)){const Ce=Z.get(ge.content.correlationId)??null,_e=Ce?"answered":"pending";return l.jsx(TY,{msg:ge,chatId:t,content:ge.content,answer:Ce,status:_e,agentNameFn:c},Y.key)}return ge.format==="question_answer"?l.jsx(AY,{msg:ge,agentNameFn:c},Y.key):l.jsx(jY,{msg:ge,myAgentId:m,agentNameFn:c},Y.key)})}),l.jsx("div",{ref:I})]})}),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(HE,{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(be,{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:Y=>Y.preventDefault(),onDrop:Y=>{Y.preventDefault(),ce(Array.from(Y.dataTransfer.files))},children:[x.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:x.map(Y=>l.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[l.jsx("img",{src:Y.previewUrl,alt:Y.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),l.jsx("button",{type:"button",onClick:()=>X(Y.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(pi,{className:"h-2 w-2"})})]},Y.id))}),l.jsxs("div",{style:{position:"relative"},children:[l.jsx($T,{trigger:et.trigger,results:et.results,highlightIndex:et.highlightIndex,anchorRef:D,onPick:et.pick}),l.jsx("textarea",{ref:D,value:h,onChange:Y=>{p(Y.target.value),w(Y.target.selectionStart??Y.target.value.length)},onSelect:Y=>{w(Y.currentTarget.selectionStart??h.length)},onFocus:()=>{He&&(R.current||h.length>0||Ee.length===0||(R.current=!0,p("@"),w(1),requestAnimationFrame(()=>{const Y=D.current;Y&&Y.setSelectionRange(1,1)})))},onPaste:Y=>{const ge=Array.from(Y.clipboardData.files);ge.length>0&&(Y.preventDefault(),ce(ge))},placeholder:He?"Type @ to pick a recipient, then your message":`Message @${xe} · / for commands · @ to mention`,rows:2,onKeyDown:Y=>{Y.nativeEvent.isComposing||et.handleKey(Y)||Y.key==="Enter"&&!Y.shiftKey&&(Y.preventDefault(),W())},disabled:Q.isPending||j,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 Y=D.current;if(!Y)return;const ge=Y.selectionStart??h.length,Ce=Y.selectionEnd??ge,_e=`${h.slice(0,ge)}@${h.slice(Ce)}`;p(_e),w(ge+1),requestAnimationFrame(()=>{Y.focus(),Y.setSelectionRange(ge+1,ge+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(oD,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",onClick:()=>{var Y;return(Y=O.current)==null?void 0:Y.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(FD,{className:"h-3.5 w-3.5"})}),l.jsx("input",{ref:O,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:Y=>{Y.target.files&&(ce(Array.from(Y.target.files)),Y.target.value="")}})]}),l.jsxs("span",{className:"flex items-center",style:{gap:8},children:[j&&l.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),l.jsx("button",{type:"button",onClick:W,disabled:Q.isPending||j||!h.trim()&&x.length===0||He&&Le.length===0,title:He&&Le.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",(Q.isPending||j||!h.trim()&&x.length===0||He&&Le.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(BE,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]})]}),(Q.isError||C)&&l.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:C??(Q.error instanceof Error?Q.error.message:"Failed to send")})]})})})]})}function OY({chatId:e,participantIds:t,candidates:n,agentIdentity:a,onAdded:s,readOnly:o=!1}){const[c,f]=b.useState(!1),m=b.useRef(null);b.useEffect(()=>{if(!c)return;const g=w=>{m.current&&(m.current.contains(w.target)||f(!1))};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[c]);const h=yt({mutationFn:g=>PT(e,{participantIds:[g]}),onSuccess:()=>{f(!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 w=a(g),x=(w==null?void 0:w.displayName)??(w==null?void 0:w.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:x},g)}),!o&&l.jsxs("div",{ref:m,style:{position:"relative"},children:[l.jsx("button",{type:"button",onClick:()=>f(!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(wa,{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=Db(p);return Ib(p).map(w=>"divider"in w?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:w.name?`@${w.name}`:void 0,onClick:()=>h.mutate(w.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(zb,{candidate:w,ambiguous:g})},w.agentId))})()})]})]})}function zj(e,t){return e?e.find(n=>n.chatId===t)??null:null}function MY(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 DY({chatId:e}){const t=gn(),{agentId:n}=lt(),a=b.useRef(new Map),{data:s}=Ye({queryKey:["chat-detail",e],queryFn:()=>UT(e),enabled:!!e}),{data:o}=Ye({queryKey:["me","chats","all"],queryFn:()=>lh({filter:"all"}),refetchInterval:3e4}),{data:c}=Ye({queryKey:["me","chats","watching"],queryFn:()=>lh({filter:"watching"}),refetchInterval:3e4}),f=b.useMemo(()=>zj(o==null?void 0:o.rows,e)??zj(c==null?void 0:c.rows,e)??null,[o,c,e]),m=b.useMemo(()=>f?f.participants.map(j=>({agentId:j.agentId,type:j.type})):s?s.participants.map(j=>({agentId:j.agentId,type:void 0})):[],[f,s]),h=b.useMemo(()=>MY(m,n),[m,n]),g=yt({mutationFn:()=>hK(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]})}}).mutate,w=(f==null?void 0:f.lastMessageAt)??"";b.useEffect(()=>{!f||a.current.get(e)===w||(a.current.set(e,w),g())},[e,f,w,g]);const x=yt({mutationFn:()=>mK(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]}),t.invalidateQueries({queryKey:["chat-detail",e]})}}),k=(f==null?void 0:f.membershipKind)==="watching";return h?k?l.jsx(Dj,{agentId:h,chatId:e,readOnly:!0,titleFallback:(f==null?void 0:f.title)??null,joinAction:{onJoin:()=>x.mutate(),joining:x.isPending,error:x.isError?x.error instanceof Error?x.error.message:"Failed to join":null}}):l.jsx(Dj,{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 zY(){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(Fc,{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."})]})})}function IY(e,t){return!e||!t?!1:e.toLowerCase()===`${t.toLowerCase()}'s team`}function LY({organizationId:e,onContinue:t}){const[n,a]=b.useState([]),[s,o]=b.useState(""),[c,f]=b.useState(""),[m,h]=b.useState(!1),[p,g]=b.useState(null),[w,x]=b.useState(!1),[k,j]=b.useState(null),E=b.useRef(null);b.useEffect(()=>{(async()=>{try{const D=await je.get("/me/organizations");a(D)}catch(D){j(D instanceof Error?D.message:"Failed to load your team")}finally{x(!0)}})()},[]),b.useEffect(()=>{var I;const D=((I=n.find(R=>R.id===e))==null?void 0:I.displayName)??"";o(D),f(D)},[n,e]),b.useEffect(()=>{const D=E.current;if(!D||!c)return;D.focus();const I=D.value.length;D.setSelectionRange(I,I)},[c]);const C=s.trim(),A=C.length>0&&!m&&w&&!k,O=b.useCallback(async D=>{if(D==null||D.preventDefault(),!(!A||!e)){g(null);try{C!==c.trim()&&(h(!0),await je.patch(`/orgs/${encodeURIComponent(e)}`,{displayName:C}),mi("team_renamed")),t()}catch(I){g(I instanceof Error?I.message:"Failed to rename team")}finally{h(!1)}}},[A,e,C,c,t]);return l.jsxs("form",{onSubmit:O,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:E,id:"onboarding-team-name","aria-label":"Team display name",value:s,onChange:D=>o(D.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:D=>{D.currentTarget.style.borderColor="var(--accent)"},onBlur:D=>{D.currentTarget.style.borderColor="var(--border)"}})]}),p||k?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 — ${k}. Refresh the page and try again.`}):null,l.jsx("div",{className:"flex justify-end",children:l.jsxs(be,{type:"submit",disabled:!A,children:[l.jsx("span",{children:"Continue"}),l.jsx(UE,{className:"h-4 w-4"})]})})]})}function Lb(){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 di({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(fr,{className:"h-3 w-3"}):e}),l.jsx("div",{style:{minHeight:"var(--sp-6)",paddingBottom:"var(--sp-1)"},children:n})]})}const PY=3e4,UY=1e3,BY=3e3;function FY(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function $Y({organizationId:e,memberId:t,orgHasOtherMembers:n,refreshMe:a}){var He;const s=Rn(),{user:o}=lt(),c=BM(e,t),f=$M(c),m=f!=null&&f.connectToken&&f.connectTokenExpiresAt&&f.connectTokenExpiresAt>Date.now()?f.connectToken:null,h=m?(f==null?void 0:f.connectTokenExpiresAt)??null:null,[p,g]=b.useState(()=>(f==null?void 0:f.displayName)??(o!=null&&o.username?`${o.username}'s assistant`:"Assistant")),[w,x]=b.useState(()=>(f==null?void 0:f.visibility)??"organization"),[k,j]=b.useState(()=>(f==null?void 0:f.selectedRuntime)??null),[E,C]=b.useState(null),[A,O]=b.useState(null),[D,I]=b.useState(null),[R,F]=b.useState(()=>m),[P,te]=b.useState(()=>h),[z,L]=b.useState([]),[Q,ce]=b.useState("form"),[X,W]=b.useState(null),G=b.useRef(null),se=b.useRef(null),ee=b.useRef(null),ve=b.useRef(0);b.useEffect(()=>()=>{se.current&&(se.current.cancelled=!0)},[]),b.useEffect(()=>{HM(c,{displayName:p,selectedRuntime:k,connectToken:R,connectTokenExpiresAt:P,visibility:w})},[c,p,k,R,P,w]),b.useEffect(()=>{(async()=>{try{const Le=await je.get("/me/organizations");L(Le)}catch{}})()},[]),b.useEffect(()=>{if(Q!=="form")return;let Le=!1;const Ke=async()=>{const St=++ve.current;try{const Y=await gi();if(Le||St!==ve.current)return;const Ce=Y.filter(_e=>_e.status==="connected").sort((_e,At)=>At.lastSeenAt.localeCompare(_e.lastSeenAt))[0]??null;if(C(_e=>(_e==null?void 0:_e.id)===(Ce==null?void 0:Ce.id)?_e:Ce),Ce){ee.current!==Ce.id&&(ee.current=null,I(null),O(null));try{const _e=await ph(Ce.id);if(Le||St!==ve.current)return;ee.current=Ce.id,I(Ce.id),O(_e.capabilities)}catch{}}else ee.current=null,I(null),O(null)}catch{}};Ke();const et=setInterval(Ke,BY);return()=>{Le=!0,clearInterval(et)}},[Q]),b.useEffect(()=>{if(E)return;if(R&&P&&P>Date.now()){const Ke=Math.max(P-Date.now(),0),et=window.setTimeout(()=>{F(null),te(null)},Ke);return()=>window.clearTimeout(et)}R&&(F(null),te(null));let Le=!1;return(async()=>{try{const Ke=await je.post("/me/connect-tokens",{});Le||(F(Ke.token),te(Date.now()+Ke.expiresIn*1e3))}catch(Ke){Le||W(Ke instanceof Error?Ke.message:"Failed to generate connect token")}})(),()=>{Le=!0}},[E,R,P]);const M=E&&D===E.id?A:null;b.useEffect(()=>{j(Le=>{var et;if(!M)return Le;const Ke=HY(M);return Le&&Ke&&Object.keys(M).includes(Le)&&((et=M[Le])==null?void 0:et.state)==="ok"?Le:Ke})},[M]);const U=M?Object.entries(M).filter(([,Le])=>Le.state==="ok").map(([Le])=>Le):[],B=((He=z.find(Le=>Le.id===e))==null?void 0:He.displayName)??"",_=p.trim(),V=_||"your agent",Z=R?`npm install -g @agent-team-foundation/first-tree-hub
|
|
413
|
+
first-tree-hub connect ${R}`:null,re=b.useCallback(async Le=>{se.current&&(se.current.cancelled=!0);const Ke={cancelled:!1};se.current=Ke;const et=Date.now();for(;!Ke.cancelled;){let St=!1;try{const Y=await je.get(`/agents/${encodeURIComponent(Le)}/client-status`);if(Ke.cancelled)return;St=Y.online===!0}catch{if(Ke.cancelled)return}if(St){qM(c);try{await a()}catch{}if(Ke.cancelled)return;s("/",{replace:!0});return}if(Date.now()-et>PY){Ke.cancelled||ce("timeout");return}await new Promise(Y=>setTimeout(Y,UY))}},[c,a,s]),xe=!!(_&&E&&k&&U.includes(k)&&Q==="form"),Re=b.useCallback(async()=>{if(!E||!k||!_)return;W(null),ce("creating");const Le=tv(_);let Ke;try{Ke=(await je.post(dn("/agents"),{type:"personal_assistant",displayName:_,...Le?{name:Le}:{},clientId:E.id,runtimeProvider:k,visibility:w,...e?{organizationId:e}:{}})).uuid,G.current=Ke,LM(Ke),mi("agent_created",{runtimeProvider:k})}catch(et){W(et instanceof Error?et.message:"Failed to create agent"),ce("form");return}await re(Ke)},[_,E,k,w,re,e]),Ee=b.useCallback(async()=>{const Le=G.current;Le&&(W(null),ce("creating"),await re(Le))},[re]);return Q==="creating"?l.jsx(XY,{nameOrFallback:V}):Q==="timeout"?l.jsx(WY,{nameOrFallback:V,hostname:(E==null?void 0:E.hostname)??null,error:X,onRetry:Ee}):l.jsx(qY,{orgHasOtherMembers:n,teamName:B,displayName:p,setDisplayName:g,trimmedName:_,connectedClient:E,cliCommand:Z,capabilitiesLoaded:M!==null,okRuntimes:U,selectedRuntime:k,setSelectedRuntime:j,visibility:w,setVisibility:x,error:X,canCreate:xe,onCreate:Re})}function HY(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 qY({orgHasOtherMembers:e,teamName:t,displayName:n,setDisplayName:a,trimmedName:s,connectedClient:o,cliCommand:c,capabilitiesLoaded:f,okRuntimes:m,selectedRuntime:h,setSelectedRuntime:p,visibility:g,setVisibility:w,error:x,canCreate:k,onCreate:j}){const E=b.useRef(null),C=e&&!!t,A=!!o&&!!h&&f&&m.includes(h),O=f&&m.length===0&&!!o,D=s?o?O?"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 I;s||(I=E.current)==null||I.focus()},[s]),l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-body",style:{margin:0,color:"var(--fg-3)",maxWidth:720},children:C?l.jsxs(l.Fragment,{children:["You've joined"," ",l.jsx("span",{className:"font-semibold",style:{color:"var(--fg-2)"},children:t}),". Let's set up your first agent."]}):l.jsx(l.Fragment,{children:"Let's set up your first agent."})}),l.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[l.jsx(Lb,{}),l.jsx(di,{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:E,id:"onboarding-name","aria-label":"Agent display name",value:n,onChange:I=>a(I.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:I=>{I.currentTarget.style.borderBottomColor="var(--accent)"},onBlur:I=>{I.currentTarget.style.borderBottomColor="var(--border-faint)"}})]})}),l.jsx(di,{number:"02",state:A?"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(KY,{hostname:o.hostname??o.id}),l.jsx(VY,{runtimes:m,selected:h,onSelect:p,capabilitiesLoaded:f})]}):l.jsxs(l.Fragment,{children:[l.jsx(ZY,{command:c}),l.jsx(GY,{})]})]}):null]})}),l.jsx(di,{number:"03",state:A?"active":"idle",children:l.jsxs("div",{style:{animation:A?"subtle-fade 200ms ease-out":void 0},children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{color:A?"var(--fg)":"var(--fg-4)",fontWeight:A?600:500},children:"Pick who can use it"}),A?l.jsx(QY,{value:g,onChange:w}):null]})})]}),x&&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:x}),s&&l.jsxs("div",{style:{marginTop:k?"var(--sp-4)":"var(--sp-5)",marginLeft:"calc(var(--sp-5) + var(--sp-3))",animation:"subtle-fade 180ms ease-out"},children:[!k&&l.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-4)"},children:D}),k&&l.jsxs(be,{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:j,onMouseEnter:I=>{I.currentTarget.style.transform="scale(1.01)",I.currentTarget.style.boxShadow="var(--shadow-md)"},onMouseLeave:I=>{I.currentTarget.style.transform="scale(1)",I.currentTarget.style.boxShadow="var(--shadow-md)"},children:[l.jsxs("span",{children:["Create ",s]}),l.jsx(UE,{className:"h-4 w-4"})]}),l.jsx("p",{className:"text-caption",style:{margin:k?"var(--sp-2) 0 0":"var(--sp-0_5) 0 0",color:"var(--fg-4)"},children:"You can customize this agent after setup."})]})]})}function ZY({command:e}){const[t,n]=b.useState(!1),s=(e?e.split(`
|
|
414
|
+
`):[]).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,f=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(be,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:!e,style:{alignSelf:"stretch",background:"color-mix(in oklch, var(--bg-raised) 48%, transparent)",borderColor:"color-mix(in oklch, var(--border) 58%, transparent)",boxShadow:"none",height:"auto",minHeight:38},children:[t?l.jsx(fr,{className:"h-3.5 w-3.5"}):l.jsx($E,{className:"h-3.5 w-3.5"}),t?"Copied":"Copy"]})]})})}function GY(){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(YY,{}),l.jsx("span",{children:"Waiting for your computer…"})]})}function VY({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)"}})}),FY(s)]},s)})]})]})}function QY({value:e,onChange:t}){const n=[{value:"organization",title:"Shared with team",description:"Anyone in your org can @mention and chat with this agent."},{value:"private",title:"Private to you",description:"Only you can see this agent and chat with it. Others on the team won't see it listed."}];return l.jsxs("fieldset",{className:"flex flex-col",style:{gap:"var(--sp-2)",margin:"var(--sp-2) 0 0",padding:0,border:0},children:[l.jsx("legend",{className:"sr-only",children:"Agent visibility"}),n.map(a=>{const s=e===a.value;return l.jsxs("label",{className:"text-body",style:{display:"flex",alignItems:"flex-start",gap:"var(--sp-2)",padding:"var(--sp-2) var(--sp-3)",background:s?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:s?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",cursor:"pointer",color:s?"var(--fg)":"var(--fg-2)",transition:"background 120ms ease, border-color 120ms ease"},children:[l.jsx("input",{type:"radio",name:"onboarding-visibility",value:a.value,checked:s,onChange:()=>t(a.value),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)",marginTop:"var(--sp-0_5)",borderRadius:"50%",border:s?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-strong)",background:s?"color-mix(in oklch, var(--accent) 8%, transparent)":"transparent",flexShrink:0,transition:"border-color 160ms ease, background 160ms ease"},children:s&&l.jsx("span",{style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--accent)"}})}),l.jsxs("span",{className:"flex flex-col",style:{gap:"var(--sp-0_5)",minWidth:0},children:[l.jsx("span",{className:"font-medium",style:{color:s?"var(--fg)":"var(--fg-2)"},children:a.title}),l.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:a.description})]})]},a.value)})]})}function KY({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(fr,{className:"h-3.5 w-3.5"}),l.jsxs("span",{children:[l.jsx("span",{className:"mono font-semibold",children:e})," connected"]})]})}function YY(){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 XY({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(JY,{}),l.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Usually takes ~10 seconds"})]})}function WY({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(be,{onClick:a,children:"Try again"})})]})}function JY(){return l.jsxs("span",{className:"flex items-center",style:{gap:6},children:[l.jsx(Vg,{delayMs:0}),l.jsx(Vg,{delayMs:160}),l.jsx(Vg,{delayMs:320})]})}function Vg({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 XT(){return(await je.get("/me/github/repos")).repos}const WT="https://github.com/agent-team-foundation/first-tree";function JT(e){return e.length===1?[`Source repo: ${e[0]}`]:["Source repos:",...e.map(t=>`- ${t}`)]}function Pb(e,t){const n=JT(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: ${WT}`].join(`
|
|
415
|
+
`)}function eX(e){const t=JT(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: ${WT}`].join(`
|
|
416
|
+
`)}function tX(){const{role:e}=lt();return e==="admin"?l.jsx(oX,{}):l.jsx(nX,{})}function nX(){var f,m;const{organizationId:e}=lt(),[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([Ob(e),DT(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(aX,{});if(t.kind==="error")return l.jsx(rX,{message:t.message,onRetry:()=>s(h=>h+1)});const o=((f=t.tree)==null?void 0:f.repo)??"",c=((m=t.repos)==null?void 0:m.repos)??[];return o&&c.length>0?l.jsx(iX,{treeUrl:o,teamRepos:c}):o?l.jsx(sX,{treeUrl:o}):l.jsx(lX,{})}function rX({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(be,{type:"button",onClick:t,children:"Try again"})})]})}function aX(){return l.jsx("p",{className:"text-body",style:{margin:0,color:"var(--fg-3)"},children:"Checking your team's setup…"})}function iX({treeUrl:e,teamRepos:t}){var E;const n=Rn(),{dismissOnboarding:a,markOnboardingCompleted:s}=lt(),{addToast:o}=Hc(),[c,f]=b.useState(!1),[m,h]=b.useState(null),[p,g]=b.useState(()=>t.map(C=>C.url)),w=p.length>0,x=b.useCallback(C=>{g(A=>A.includes(C)?A.filter(O=>O!==C):[...A,C])},[]),k=b.useCallback(async()=>{if(p.length!==0){f(!0),h(null);try{const C=await Ub(),A=await yc(C.uuid);await Rh(C.uuid,{expectedVersion:A.version,payload:{gitRepos:p.map(I=>({url:I}))}});const O=await Mb(C.uuid),D=Pb(p,e);try{await No(O.id,D)}catch{}mi("tree_chat_started",{agentUuid:C.uuid,chatId:O.id,treeMode:"existing",joinPath:"invite"}),a(),s(),n(`/?c=${encodeURIComponent(O.id)}`,{replace:!1})}catch(C){h(C instanceof Error?C.message:"Failed to start the chat"),f(!1)}}},[p,e,n,a,s]),j=b.useCallback(()=>{mi("tree_intro_dismissed",{joinPath:"invite"}),a(),o(Bb(n))},[a,o,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(sv,{label:"Tree",value:e}),t.length===1?l.jsx(sv,{label:"Source repo",value:((E=t[0])==null?void 0:E.url)??""}):l.jsxs("fieldset",{disabled:c,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 A=p.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:A?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:A?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",cursor:c?"not-allowed":"pointer",color:A?"var(--fg)":"var(--fg-2)",fontWeight:A?600:400},children:[l.jsx("input",{type:"checkbox",value:C.url,checked:A,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:A?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)",background:A?"var(--accent)":"transparent",color:"var(--bg)",transition:"background 120ms ease, border-color 120ms ease"},children:A?l.jsx(fr,{className:"h-3 w-3",strokeWidth:3}):null}),l.jsx("span",{className:"mono truncate",style:{minWidth:0,flex:1},children:C.url})]},C.url)})]}),m?l.jsx(Fb,{children:m}):null,l.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)"},children:[l.jsx(be,{type:"button",disabled:!w||c,onClick:()=>void k(),children:c?"Starting…":"Confirm"}),l.jsx(be,{type:"button",variant:"outline",onClick:j,disabled:c,children:"I'll do it later"})]})]})]})}function sX({treeUrl:e}){const t=Rn(),{dismissOnboarding:n,markOnboardingCompleted:a}=lt(),{addToast:s}=Hc(),[o,c]=b.useState(!1),[f,m]=b.useState(null),[h,p]=b.useState(null),[g,w]=b.useState(null),[x,k]=b.useState([]),j=x.length>0,E=b.useCallback(O=>{k(D=>D.includes(O)?D.filter(I=>I!==O):[...D,O])},[]);b.useEffect(()=>{let O=!1;return(async()=>{try{const D=await XT();if(O)return;p(D)}catch(D){O||w(D instanceof Error?D.message:"Failed to list GitHub repositories")}})(),()=>{O=!0}},[]);const C=b.useCallback(async()=>{if(x.length!==0){c(!0),m(null);try{const O=await Ub(),D=await yc(O.uuid);await Rh(O.uuid,{expectedVersion:D.version,payload:{gitRepos:x.map(F=>({url:F}))}});const I=await Mb(O.uuid),R=Pb(x,e);try{await No(I.id,R)}catch{}mi("tree_chat_started",{agentUuid:O.uuid,chatId:I.id,treeMode:"existing",joinPath:"invite"}),n(),a(),t(`/?c=${encodeURIComponent(I.id)}`,{replace:!1})}catch(O){m(O instanceof Error?O.message:"Failed to start the chat"),c(!1)}}},[x,e,t,n,a]),A=b.useCallback(()=>{mi("tree_intro_dismissed",{joinPath:"invite"}),n(),s(Bb(t))},[n,s,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(Lb,{}),l.jsx(di,{number:"01",state:"complete",children:l.jsx(sv,{label:"Tree",value:e})}),l.jsx(di,{number:"02",state:j?"complete":"active",children:l.jsx(eA,{disabled:o,repos:h,error:g,selectedRepoUrls:x,onToggle:E})}),l.jsxs(di,{number:"03",state:j?"active":"idle",children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{margin:0,color:j?"var(--fg)":"var(--fg-4)",fontWeight:j?600:500},children:"Let your agent join the tree"}),j?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."]}),f?l.jsx(Fb,{style:{marginTop:"var(--sp-3)"},children:f}):null,l.jsxs("div",{className:"flex",style:{marginTop:"var(--sp-3)",gap:"var(--sp-2)"},children:[l.jsx(be,{type:"button",disabled:!j||o,onClick:()=>void C(),children:o?"Starting…":"Continue"}),l.jsx(be,{type:"button",variant:"outline",onClick:A,disabled:o,children:"I'll do it later"})]})]}):null]})]})]})}function lX(){const{dismissOnboarding:e}=lt(),{addToast:t}=Hc(),n=b.useRef(!1);return b.useEffect(()=>{n.current||(n.current=!0,mi("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 oX(){const e=Rn(),{dismissOnboarding:t,markOnboardingCompleted:n,organizationId:a}=lt(),{addToast:s}=Hc(),[o,c]=b.useState(!1),[f,m]=b.useState(null),[h,p]=b.useState(null),[g,w]=b.useState(""),[x,k]=b.useState([]),[j,E]=b.useState(null),[C,A]=b.useState(null),O=b.useCallback(L=>{k(Q=>Q.includes(L)?Q.filter(ce=>ce!==L):[...Q,L])},[]);b.useEffect(()=>{let L=!1;return(async()=>{try{const Q=await XT();if(L)return;E(Q)}catch(Q){L||A(Q instanceof Error?Q.message:"Failed to list GitHub repositories")}})(),()=>{L=!0}},[]),b.useEffect(()=>{if(!a)return;let L=!1;return(async()=>{try{const Q=await Ob(a);if(L)return;Q.repo&&(w(Q.repo),p(ce=>ce??"existing"))}catch{}})(),()=>{L=!0}},[a]);const D=g.trim(),I=(()=>{if(h!=="existing")return!0;if(!D)return!1;try{return new URL(D).protocol==="https:"}catch{return!1}})(),R=b.useCallback(()=>{mi("tree_intro_dismissed"),t(),s(Bb(e))},[t,s,e]),F=b.useCallback(async()=>{if(x.length!==0&&h&&!(h==="existing"&&!I)){m(null),c(!0);try{const L=await Ub(),Q=await yc(L.uuid),ce=x.map(G=>({url:G}));await Rh(L.uuid,{expectedVersion:Q.version,payload:{gitRepos:ce}}),a&&await zT(a,{repos:ce}),h==="existing"&&a&&await MT(a,{repo:D});const X=await Mb(L.uuid),W=h==="existing"?Pb(x,D):eX(x);try{await No(X.id,W)}catch{}mi("tree_chat_started",{agentUuid:L.uuid,chatId:X.id,treeMode:h}),t(),n(),e(`/?c=${encodeURIComponent(X.id)}`,{replace:!1})}catch(L){m(L instanceof Error?L.message:"Failed to start the tree-init chat"),c(!1)}}},[x,h,I,D,a,e,t,n]),P=x.length>0,te=P&&h!==null&&!o&&(h==="new"||I),z=!!h&&(h==="new"||I);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(Lb,{}),l.jsx(di,{number:"01",state:P?"complete":"active",children:l.jsx(eA,{disabled:o,repos:j,error:C,selectedRepoUrls:x,onToggle:O})}),l.jsxs(di,{number:"02",state:z?"complete":P?"active":"idle",children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{margin:0,color:P?"var(--fg)":"var(--fg-4)",fontWeight:P?600:500},children:"Bind or create the tree"}),P?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:o,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(L=>{const Q=h===L.value;return l.jsxs("label",{className:"text-body transition-colors",style:{padding:"var(--sp-1_5) var(--sp-3)",background:Q?"var(--bg)":"transparent",borderRadius:"calc(var(--radius-input) - var(--sp-0_5))",color:Q?"var(--fg)":"var(--fg-3)",fontWeight:Q?600:400,boxShadow:Q?"var(--shadow-sm)":"none",cursor:o?"not-allowed":"pointer",userSelect:"none"},children:[l.jsx("input",{type:"radio",name:"tree-mode",value:L.value,checked:Q,onChange:()=>p(L.value),className:"sr-only"}),L.label]},L.value)})]}),h==="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:g,onChange:L=>w(L.target.value),placeholder:"https://github.com/your-org/your-tree",disabled:o,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,h==="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(di,{number:"03",state:z?"active":"idle",children:[l.jsx("h2",{className:"text-subtitle font-semibold",style:{margin:0,color:z?"var(--fg)":"var(--fg-4)",fontWeight:z?600:500},children:"Let your agent build it"}),z?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","."]}),f?l.jsx(Fb,{style:{marginTop:"var(--sp-3)"},children:f}):null,l.jsxs("div",{className:"flex",style:{marginTop:"var(--sp-3)",gap:"var(--sp-2)"},children:[l.jsx(be,{type:"button",disabled:!te,onClick:()=>void F(),children:o?"Starting…":"Continue"}),l.jsx(be,{type:"button",variant:"outline",onClick:R,disabled:o,children:"I'll do it later"})]})]}):null]})]})]})}async function Ub(){const e=IM(),t=await Fv(),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 Bb(e){return{title:"Setup hidden",description:"Your agent isn't bound to a source repo yet. Resume from Settings → Onboarding any time to finish.",action:{label:"Resume setup",onClick:()=>e("/settings/onboarding")}}}function sv({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 Fb({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 eA({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(be,{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(uX,{repos:t,selectedRepoUrls:a,onToggle:s})]})}function uX({repos:e,selectedRepoUrls:t,onToggle:n}){const[a,s]=b.useState(!1),o=b.useRef(null);b.useEffect(()=>{if(!a)return;const p=w=>{o.current&&!o.current.contains(w.target)&&s(!1)},g=w=>{w.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 w=g.fullName.split("/")[0]??"",x=p.get(w);x?x.push(g):p.set(w,[g])}return[...p.entries()].sort(([g],[w])=>g.localeCompare(w))},[e]),f=b.useMemo(()=>new Set(t),[t]),m=b.useMemo(()=>e.filter(p=>f.has(p.cloneUrl)),[e,f]),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(cX,{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(_v,{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],w)=>l.jsxs("div",{children:[l.jsx("div",{className:"text-eyebrow",style:{paddingTop:w>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(x=>{const k=f.has(x.cloneUrl),j=x.fullName.slice(p.length+1);return l.jsxs("button",{type:"button",role:"option","aria-selected":k,onClick:()=>n(x.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:k?"var(--accent-bg)":"transparent",color:k?"var(--accent)":"var(--fg)",border:"none",cursor:"pointer",textAlign:"left"},onMouseEnter:E=>{k||(E.currentTarget.style.background="var(--surface-1)")},onMouseLeave:E=>{k||(E.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:k?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)",background:k?"var(--accent)":"transparent",color:"var(--bg)",transition:"background 120ms ease, border-color 120ms ease"},children:k?l.jsx(fr,{className:"h-3 w-3",strokeWidth:3}):null}),l.jsx("span",{className:"truncate",style:{minWidth:0,flex:1},children:j}),x.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"})]},x.cloneUrl)})]},p))})]})}function cX({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(pi,{className:"h-3 w-3"})})]})}function dX(){const{onboardingStep:e,refreshMe:t,organizationId:n,memberId:a,role:s,user:o,teamDisplayName:c,orgHasOtherMembers:f}=lt(),[m,h]=Oo(),p=m.get("step"),[g,w]=b.useState(()=>zE()),x=b.useCallback(O=>{zM(O),w(O)},[]),k=s==="admin",j=(o==null?void 0:o.username)??null,E=IY(c,j),C=b.useMemo(()=>p==="team"&&k?"step1":p==="agent"?"step2":p==="tree"||e==="completed"?"step3-intro":e==="connect"&&!g&&k&&E?"step1":"step2",[p,e,g,k,E]),A=b.useCallback(()=>{x(!0);const O=new URLSearchParams(m);O.delete("step"),h(O,{replace:!0})},[x,m,h]);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:C==="step1"?l.jsx(LY,{organizationId:n,onContinue:A}):C==="step2"?l.jsx($Y,{organizationId:n,memberId:a,orgHasOtherMembers:f,refreshMe:t}):l.jsx(tX,{})})})}function fX({selectedChatId:e,onSelectChat:t}){const{onboardingStep:n,onboardingDismissedAt:a}=lt();return e===oh?l.jsx(DK,{onCreated:t}):e?l.jsx(DY,{chatId:e}):n!==null&&!a?l.jsx(dX,{}):l.jsx(zY,{})}const hX={1:"Name your team",2:"Set up your agent",3:"Build your context-tree"};function mX(){const{onboardingStep:e,onboardingDismissedAt:t,dismissOnboarding:n}=lt(),{addToast:a}=Hc(),s=Rn(),[o,c]=Oo(),f=o.get("c"),m=o.get("step"),h=zE(),g=PM()==="invite",w=b.useMemo(()=>m==="team"?1:m==="agent"?2:m==="tree"||f||e==="completed"?3:e==="create_agent"?2:e==="connect"&&!h&&!g?1:2,[m,f,e,h,g]);if(e===null||t)return null;const x=e==="completed",k=()=>{n(),a({title:"Setup hidden",description:"Resume any time in Settings → Onboarding.",action:{label:"Open settings",onClick:()=>s("/settings/onboarding")}})},j={1:Qg(1,w,e),2:Qg(2,w,e),3:Qg(3,w,e)},E=C=>{if(C!==3)return;const A=new URLSearchParams(o);A.delete("c"),A.set("step","tree"),c(A,{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((C,A)=>{const O=j[C],D=[1,2,3][A+1],I=D?Ij(O)&&Ij(j[D]):!1;return l.jsxs("li",{className:"flex items-center",style:{minWidth:0},children:[l.jsx(pX,{index:C,state:O,label:hX[C],onClick:C===3&&O==="active"?()=>E(C):void 0}),D?l.jsx(yX,{solid:I}):null]},C)})}),l.jsx("button",{type:"button",onClick:k,disabled:!x,title:x?"Hide setup steps":"Finish setting up your agent first","aria-label":"Hide setup steps",className:x?"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:x?"var(--fg-2)":"var(--fg-4)",fontSize:14,lineHeight:1,opacity:x?1:.5},onMouseEnter:C=>{x&&(C.currentTarget.style.background="var(--surface-2)")},onMouseLeave:C=>{C.currentTarget.style.background="transparent"},children:"✕"})]})}function Qg(e,t,n){return e===t?"active":e===1||e===2&&n==="completed"?"completed":"pending"}function Ij(e){return e==="active"||e==="completed"}function pX({index:e,state:t,label:n,onClick:a}){const s=!!a,o=gX(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 gX(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 yX({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)"}})}const vX=ib.catch("active"),bX=eb.catch("manual");function xX(){const[e,t]=Oo(),n=e.get("c"),a=e.get("a"),s=vX.parse(e.get("engagement")),o=bX.parse(e.get("source"));v_(),b.useEffect(()=>{if(a&&n){const p=new URLSearchParams(e);p.delete("a"),p.set("c",n),t(p,{replace:!0});return}if(a&&!n){const p=new URLSearchParams(e);p.delete("a"),p.delete("c"),t(p,{replace:!0})}},[a,e,n,t]);const c=b.useCallback(p=>{const g=new URLSearchParams(e);g.set("c",p),Lj(g),t(g)},[e,t]),f=b.useCallback(()=>{const p=new URLSearchParams(e);p.set("c",oh),Lj(p),t(p)},[e,t]),m=b.useCallback(p=>{const g=new URLSearchParams(e);p==="active"?g.delete("engagement"):g.set("engagement",p),t(g,{replace:!0})},[e,t]),h=b.useCallback(p=>{const g=new URLSearchParams(e);p==="manual"?g.delete("source"):g.set("source",p),t(g,{replace:!0})},[e,t]);return l.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[l.jsx(TK,{selectedChatId:n,onSelectChat:c,onNewChat:f,engagement:s,onEngagementChange:m,source:o,onSourceChange:h}),l.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:[l.jsx(mX,{}),l.jsx(fX,{selectedChatId:n,onSelectChat:c})]}),l.jsx(cK,{})]})}function Lj(e){e.delete("docChat"),e.delete("docAgent"),e.delete("docPath"),e.delete("docBase")}const wX=new ZR({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function SX(){return l.jsx(GR,{client:wX,children:l.jsx(VM,{children:l.jsx(m5,{children:l.jsx(wM,{children:l.jsxs(YO,{children:[l.jsx(Ut,{path:"/login",element:l.jsx(RV,{})}),l.jsx(Ut,{path:"/signup",element:l.jsx(Jn,{to:"/login",replace:!0})}),l.jsx(Ut,{path:"/auth/github/complete",element:l.jsx(OV,{})}),l.jsx(Ut,{path:"/invite/:token",element:l.jsx(NV,{})}),null,null,l.jsx(Ut,{element:l.jsx(WM,{}),children:l.jsxs(Ut,{element:l.jsx(hF,{children:l.jsx(f5,{})}),children:[l.jsx(Ut,{index:!0,element:l.jsx(xX,{})}),l.jsx(Ut,{path:"context",element:l.jsx(lV,{})}),l.jsx(Ut,{path:"agents/:uuid",element:l.jsx(XG,{})}),l.jsx(Ut,{path:"team",element:l.jsx(BQ,{})}),l.jsxs(Ut,{path:"settings",element:l.jsx(vQ,{}),children:[l.jsx(Ut,{index:!0,element:l.jsx(Jn,{to:"computers",replace:!0})}),l.jsx(Ut,{path:"team",element:l.jsx(nK,{})}),l.jsx(Ut,{path:"computers",element:l.jsx(GV,{})}),l.jsx(Ut,{path:"github",element:l.jsx(JV,{})}),l.jsx(Ut,{path:"integrations",element:l.jsx(pQ,{})}),l.jsx(Ut,{path:"onboarding",element:l.jsx(gQ,{})}),l.jsx(Ut,{path:"setup",element:l.jsx(Jn,{to:"/settings/onboarding",replace:!0})})]}),l.jsx(Ut,{path:"agents",element:l.jsx(Jn,{to:"/team",replace:!0})}),l.jsx(Ut,{path:"clients",element:l.jsx(Jn,{to:"/settings/computers",replace:!0})}),l.jsx(Ut,{path:"integrations",element:l.jsx(Jn,{to:"/settings/integrations",replace:!0})}),l.jsx(Ut,{path:"team/members",element:l.jsx(Jn,{to:"/team",replace:!0})}),l.jsx(Ut,{path:"team/agents",element:l.jsx(Jn,{to:"/team",replace:!0})}),l.jsx(Ut,{path:"team/invite",element:l.jsx(Jn,{to:"/team",replace:!0})}),l.jsx(Ut,{path:"team/settings",element:l.jsx(Jn,{to:"/settings/team",replace:!0})}),l.jsx(Ut,{path:"admin",element:l.jsx(kX,{})})]})})]})})})})})}function kX(){const e=Tr();return e.hash==="#bindings"?l.jsx(Jn,{to:`/settings/integrations${e.search}`,replace:!0}):l.jsx(Jn,{to:`/team${e.hash}`,replace:!0})}const tA=document.getElementById("root");if(!tA)throw new Error("Root element not found");bR.createRoot(tA).render(l.jsx(b.StrictMode,{children:l.jsx(SX,{})}));export{UE as A,Fc as F,zc as L,VE as U,it as c,l as j,b as r};
|