@openscout/scout 0.2.35 → 0.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,94 @@
1
+ function _j(e,l){for(var a=0;a<l.length;a++){const i=l[a];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(i,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();function Pu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dm={exports:{}},oo={};var ab;function Bj(){if(ab)return oo;ab=1;var e=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(i,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:i,key:d,ref:o!==void 0?o:null,props:u}}return oo.Fragment=l,oo.jsx=a,oo.jsxs=a,oo}var rb;function Ij(){return rb||(rb=1,dm.exports=Bj()),dm.exports}var r=Ij(),fm={exports:{}},rt={};var ib;function Pj(){if(ib)return rt;ib=1;var e=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function j(_){return _===null||typeof _!="object"?null:(_=v&&_[v]||_["@@iterator"],typeof _=="function"?_:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function M(_,le,R){this.props=_,this.context=le,this.refs=N,this.updater=R||C}M.prototype.isReactComponent={},M.prototype.setState=function(_,le){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,le,"setState")},M.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function L(){}L.prototype=M.prototype;function H(_,le,R){this.props=_,this.context=le,this.refs=N,this.updater=R||C}var X=H.prototype=new L;X.constructor=H,E(X,M.prototype),X.isPureReactComponent=!0;var q=Array.isArray;function D(){}var B={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function Z(_,le,R){var pe=R.ref;return{$$typeof:e,type:_,key:le,ref:pe!==void 0?pe:null,props:R}}function O(_,le){return Z(_.type,le,_.props)}function P(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function Q(_){var le={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(R){return le[R]})}var oe=/\/+/g;function J(_,le){return typeof _=="object"&&_!==null&&_.key!=null?Q(""+_.key):le.toString(36)}function ee(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(D,D):(_.status="pending",_.then(function(le){_.status==="pending"&&(_.status="fulfilled",_.value=le)},function(le){_.status==="pending"&&(_.status="rejected",_.reason=le)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function w(_,le,R,pe,xe){var ce=typeof _;(ce==="undefined"||ce==="boolean")&&(_=null);var Re=!1;if(_===null)Re=!0;else switch(ce){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(_.$$typeof){case e:case l:Re=!0;break;case y:return Re=_._init,w(Re(_._payload),le,R,pe,xe)}}if(Re)return xe=xe(_),Re=pe===""?"."+J(_,0):pe,q(xe)?(R="",Re!=null&&(R=Re.replace(oe,"$&/")+"/"),w(xe,le,R,"",function(He){return He})):xe!=null&&(P(xe)&&(xe=O(xe,R+(xe.key==null||_&&_.key===xe.key?"":(""+xe.key).replace(oe,"$&/")+"/")+Re)),le.push(xe)),1;Re=0;var Te=pe===""?".":pe+":";if(q(_))for(var Ne=0;Ne<_.length;Ne++)pe=_[Ne],ce=Te+J(pe,Ne),Re+=w(pe,le,R,ce,xe);else if(Ne=j(_),typeof Ne=="function")for(_=Ne.call(_),Ne=0;!(pe=_.next()).done;)pe=pe.value,ce=Te+J(pe,Ne++),Re+=w(pe,le,R,ce,xe);else if(ce==="object"){if(typeof _.then=="function")return w(ee(_),le,R,pe,xe);throw le=String(_),Error("Objects are not valid as a React child (found: "+(le==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":le)+"). If you meant to render a collection of children, use an array instead.")}return Re}function Y(_,le,R){if(_==null)return _;var pe=[],xe=0;return w(_,pe,"","",function(ce){return le.call(R,ce,xe++)}),pe}function $(_){if(_._status===-1){var le=_._result;le=le(),le.then(function(R){(_._status===0||_._status===-1)&&(_._status=1,_._result=R)},function(R){(_._status===0||_._status===-1)&&(_._status=2,_._result=R)}),_._status===-1&&(_._status=0,_._result=le)}if(_._status===1)return _._result.default;throw _._result}var ye=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var le=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(le))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},T={map:Y,forEach:function(_,le,R){Y(_,function(){le.apply(this,arguments)},R)},count:function(_){var le=0;return Y(_,function(){le++}),le},toArray:function(_){return Y(_,function(le){return le})||[]},only:function(_){if(!P(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return rt.Activity=b,rt.Children=T,rt.Component=M,rt.Fragment=a,rt.Profiler=o,rt.PureComponent=H,rt.StrictMode=i,rt.Suspense=p,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,rt.__COMPILER_RUNTIME={__proto__:null,c:function(_){return B.H.useMemoCache(_)}},rt.cache=function(_){return function(){return _.apply(null,arguments)}},rt.cacheSignal=function(){return null},rt.cloneElement=function(_,le,R){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var pe=E({},_.props),xe=_.key;if(le!=null)for(ce in le.key!==void 0&&(xe=""+le.key),le)!F.call(le,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&le.ref===void 0||(pe[ce]=le[ce]);var ce=arguments.length-2;if(ce===1)pe.children=R;else if(1<ce){for(var Re=Array(ce),Te=0;Te<ce;Te++)Re[Te]=arguments[Te+2];pe.children=Re}return Z(_.type,xe,pe)},rt.createContext=function(_){return _={$$typeof:d,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:u,_context:_},_},rt.createElement=function(_,le,R){var pe,xe={},ce=null;if(le!=null)for(pe in le.key!==void 0&&(ce=""+le.key),le)F.call(le,pe)&&pe!=="key"&&pe!=="__self"&&pe!=="__source"&&(xe[pe]=le[pe]);var Re=arguments.length-2;if(Re===1)xe.children=R;else if(1<Re){for(var Te=Array(Re),Ne=0;Ne<Re;Ne++)Te[Ne]=arguments[Ne+2];xe.children=Te}if(_&&_.defaultProps)for(pe in Re=_.defaultProps,Re)xe[pe]===void 0&&(xe[pe]=Re[pe]);return Z(_,ce,xe)},rt.createRef=function(){return{current:null}},rt.forwardRef=function(_){return{$$typeof:f,render:_}},rt.isValidElement=P,rt.lazy=function(_){return{$$typeof:y,_payload:{_status:-1,_result:_},_init:$}},rt.memo=function(_,le){return{$$typeof:h,type:_,compare:le===void 0?null:le}},rt.startTransition=function(_){var le=B.T,R={};B.T=R;try{var pe=_(),xe=B.S;xe!==null&&xe(R,pe),typeof pe=="object"&&pe!==null&&typeof pe.then=="function"&&pe.then(D,ye)}catch(ce){ye(ce)}finally{le!==null&&R.types!==null&&(le.types=R.types),B.T=le}},rt.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},rt.use=function(_){return B.H.use(_)},rt.useActionState=function(_,le,R){return B.H.useActionState(_,le,R)},rt.useCallback=function(_,le){return B.H.useCallback(_,le)},rt.useContext=function(_){return B.H.useContext(_)},rt.useDebugValue=function(){},rt.useDeferredValue=function(_,le){return B.H.useDeferredValue(_,le)},rt.useEffect=function(_,le){return B.H.useEffect(_,le)},rt.useEffectEvent=function(_){return B.H.useEffectEvent(_)},rt.useId=function(){return B.H.useId()},rt.useImperativeHandle=function(_,le,R){return B.H.useImperativeHandle(_,le,R)},rt.useInsertionEffect=function(_,le){return B.H.useInsertionEffect(_,le)},rt.useLayoutEffect=function(_,le){return B.H.useLayoutEffect(_,le)},rt.useMemo=function(_,le){return B.H.useMemo(_,le)},rt.useOptimistic=function(_,le){return B.H.useOptimistic(_,le)},rt.useReducer=function(_,le,R){return B.H.useReducer(_,le,R)},rt.useRef=function(_){return B.H.useRef(_)},rt.useState=function(_){return B.H.useState(_)},rt.useSyncExternalStore=function(_,le,R){return B.H.useSyncExternalStore(_,le,R)},rt.useTransition=function(){return B.H.useTransition()},rt.version="19.2.3",rt}var sb;function vp(){return sb||(sb=1,fm.exports=Pj()),fm.exports}var A=vp();const z=Pu(A),Uu=_j({__proto__:null,default:z},[A]);var mm={exports:{}},co={},pm={exports:{}},hm={};var ob;function Uj(){return ob||(ob=1,(function(e){function l(w,Y){var $=w.length;w.push(Y);e:for(;0<$;){var ye=$-1>>>1,T=w[ye];if(0<o(T,Y))w[ye]=Y,w[$]=T,$=ye;else break e}}function a(w){return w.length===0?null:w[0]}function i(w){if(w.length===0)return null;var Y=w[0],$=w.pop();if($!==Y){w[0]=$;e:for(var ye=0,T=w.length,_=T>>>1;ye<_;){var le=2*(ye+1)-1,R=w[le],pe=le+1,xe=w[pe];if(0>o(R,$))pe<T&&0>o(xe,R)?(w[ye]=xe,w[pe]=$,ye=pe):(w[ye]=R,w[le]=$,ye=le);else if(pe<T&&0>o(xe,$))w[ye]=xe,w[pe]=$,ye=pe;else break e}}return Y}function o(w,Y){var $=w.sortIndex-Y.sortIndex;return $!==0?$:w.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],h=[],y=1,b=null,v=3,j=!1,C=!1,E=!1,N=!1,M=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function X(w){for(var Y=a(h);Y!==null;){if(Y.callback===null)i(h);else if(Y.startTime<=w)i(h),Y.sortIndex=Y.expirationTime,l(p,Y);else break;Y=a(h)}}function q(w){if(E=!1,X(w),!C)if(a(p)!==null)C=!0,D||(D=!0,Q());else{var Y=a(h);Y!==null&&ee(q,Y.startTime-w)}}var D=!1,B=-1,F=5,Z=-1;function O(){return N?!0:!(e.unstable_now()-Z<F)}function P(){if(N=!1,D){var w=e.unstable_now();Z=w;var Y=!0;try{e:{C=!1,E&&(E=!1,L(B),B=-1),j=!0;var $=v;try{t:{for(X(w),b=a(p);b!==null&&!(b.expirationTime>w&&O());){var ye=b.callback;if(typeof ye=="function"){b.callback=null,v=b.priorityLevel;var T=ye(b.expirationTime<=w);if(w=e.unstable_now(),typeof T=="function"){b.callback=T,X(w),Y=!0;break t}b===a(p)&&i(p),X(w)}else i(p);b=a(p)}if(b!==null)Y=!0;else{var _=a(h);_!==null&&ee(q,_.startTime-w),Y=!1}}break e}finally{b=null,v=$,j=!1}Y=void 0}}finally{Y?Q():D=!1}}}var Q;if(typeof H=="function")Q=function(){H(P)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,J=oe.port2;oe.port1.onmessage=P,Q=function(){J.postMessage(null)}}else Q=function(){M(P,0)};function ee(w,Y){B=M(function(){w(e.unstable_now())},Y)}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(w){w.callback=null},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(w){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var $=v;v=Y;try{return w()}finally{v=$}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(w,Y){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var $=v;v=w;try{return Y()}finally{v=$}},e.unstable_scheduleCallback=function(w,Y,$){var ye=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ye+$:ye):$=ye,w){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=$+T,w={id:y++,callback:Y,priorityLevel:w,startTime:$,expirationTime:T,sortIndex:-1},$>ye?(w.sortIndex=$,l(h,w),a(p)===null&&w===a(h)&&(E?(L(B),B=-1):E=!0,ee(q,$-ye))):(w.sortIndex=T,l(p,w),C||j||(C=!0,D||(D=!0,Q()))),w},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(w){var Y=v;return function(){var $=v;v=Y;try{return w.apply(this,arguments)}finally{v=$}}}})(hm)),hm}var cb;function Hj(){return cb||(cb=1,pm.exports=Uj()),pm.exports}var xm={exports:{}},On={};var ub;function Fj(){if(ub)return On;ub=1;var e=vp();function l(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(l(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(p,h,y){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:p,containerInfo:h,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return On.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,On.createPortal=function(p,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return u(p,h,null,y)},On.flushSync=function(p){var h=d.T,y=i.p;try{if(d.T=null,i.p=2,p)return p()}finally{d.T=h,i.p=y,i.d.f()}},On.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(p,h))},On.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},On.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var y=h.as,b=f(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,j=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:j}):y==="script"&&i.d.X(p,{crossOrigin:b,integrity:v,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},On.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);i.d.M(p,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(p)},On.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,b=f(y,h.crossOrigin);i.d.L(p,y,{crossOrigin:b,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})}},On.preloadModule=function(p,h){if(typeof p=="string")if(h){var y=f(h.as,h.crossOrigin);i.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(p)},On.requestFormReset=function(p){i.d.r(p)},On.unstable_batchedUpdates=function(p,h){return p(h)},On.useFormState=function(p,h,y){return d.H.useFormState(p,h,y)},On.useFormStatus=function(){return d.H.useHostTransitionStatus()},On.version="19.2.3",On}var db;function u1(){if(db)return xm.exports;db=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(l){console.error(l)}}return e(),xm.exports=Fj(),xm.exports}var fb;function qj(){if(fb)return co;fb=1;var e=Hj(),l=vp(),a=u1();function i(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(u(t)!==t)throw Error(i(188))}function h(t){var n=t.alternate;if(!n){if(n=u(t),n===null)throw Error(i(188));return n!==t?null:t}for(var s=t,c=n;;){var m=s.return;if(m===null)break;var x=m.alternate;if(x===null){if(c=m.return,c!==null){s=c;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===s)return p(m),t;if(x===c)return p(m),n;x=x.sibling}throw Error(i(188))}if(s.return!==c.return)s=m,c=x;else{for(var k=!1,S=m.child;S;){if(S===s){k=!0,s=m,c=x;break}if(S===c){k=!0,c=m,s=x;break}S=S.sibling}if(!k){for(S=x.child;S;){if(S===s){k=!0,s=x,c=m;break}if(S===c){k=!0,c=x,s=m;break}S=S.sibling}if(!k)throw Error(i(189))}}if(s.alternate!==c)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?t:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),H=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function Q(t){return t===null||typeof t!="object"?null:(t=P&&t[P]||t["@@iterator"],typeof t=="function"?t:null)}var oe=Symbol.for("react.client.reference");function J(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case M:return"Profiler";case N:return"StrictMode";case q:return"Suspense";case D:return"SuspenseList";case Z:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case H:return t.displayName||"Context";case L:return(t._context.displayName||"Context")+".Consumer";case X:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B:return n=t.displayName||null,n!==null?n:J(t.type)||"Memo";case F:n=t._payload,t=t._init;try{return J(t(n))}catch{}}return null}var ee=Array.isArray,w=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},ye=[],T=-1;function _(t){return{current:t}}function le(t){0>T||(t.current=ye[T],ye[T]=null,T--)}function R(t,n){T++,ye[T]=t.current,t.current=n}var pe=_(null),xe=_(null),ce=_(null),Re=_(null);function Te(t,n){switch(R(ce,n),R(xe,t),R(pe,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Tg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Tg(n),t=Ag(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}le(pe),R(pe,t)}function Ne(){le(pe),le(xe),le(ce)}function He(t){t.memoizedState!==null&&R(Re,t);var n=pe.current,s=Ag(n,t.type);n!==s&&(R(xe,t),R(pe,s))}function Le(t){xe.current===t&&(le(pe),le(xe)),Re.current===t&&(le(Re),ao._currentValue=$)}var Ue,it;function tt(t){if(Ue===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Ue=n&&n[1]||"",it=-1<s.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Ue+t+it}var st=!1;function ot(t,n){if(!t||st)return"";st=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(ie){var ae=ie}Reflect.construct(t,[],he)}else{try{he.call()}catch(ie){ae=ie}t.call(he.prototype)}}else{try{throw Error()}catch(ie){ae=ie}(he=t())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ie){if(ie&&ae&&typeof ie.stack=="string")return[ie.stack,ae.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),k=x[0],S=x[1];if(k&&S){var U=k.split(`
4
+ `),ne=S.split(`
5
+ `);for(m=c=0;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;for(;m<ne.length&&!ne[m].includes("DetermineComponentFrameRoot");)m++;if(c===U.length||m===ne.length)for(c=U.length-1,m=ne.length-1;1<=c&&0<=m&&U[c]!==ne[m];)m--;for(;1<=c&&0<=m;c--,m--)if(U[c]!==ne[m]){if(c!==1||m!==1)do if(c--,m--,0>m||U[c]!==ne[m]){var de=`
6
+ `+U[c].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=c&&0<=m);break}}}finally{st=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?tt(s):""}function bt(t,n){switch(t.tag){case 26:case 27:case 5:return tt(t.type);case 16:return tt("Lazy");case 13:return t.child!==n&&n!==null?tt("Suspense Fallback"):tt("Suspense");case 19:return tt("SuspenseList");case 0:case 15:return ot(t.type,!1);case 11:return ot(t.type.render,!1);case 1:return ot(t.type,!0);case 31:return tt("Activity");default:return""}}function Ye(t){try{var n="",s=null;do n+=bt(t,s),s=t,t=t.return;while(t);return n}catch(c){return`
7
+ Error generating stack: `+c.message+`
8
+ `+c.stack}}var Ge=Object.prototype.hasOwnProperty,We=e.unstable_scheduleCallback,we=e.unstable_cancelCallback,et=e.unstable_shouldYield,Se=e.unstable_requestPaint,Ze=e.unstable_now,mt=e.unstable_getCurrentPriorityLevel,re=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,Ce=e.unstable_NormalPriority,_e=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Ae=e.log,ue=e.unstable_setDisableYieldValue,Ee=null,V=null;function me(t){if(typeof Ae=="function"&&ue(t),V&&typeof V.setStrictMode=="function")try{V.setStrictMode(Ee,t)}catch{}}var je=Math.clz32?Math.clz32:qe,Fe=Math.log,Je=Math.LN2;function qe(t){return t>>>=0,t===0?32:31-(Fe(t)/Je|0)|0}var St=256,Qt=262144,Gt=4194304;function Ut(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function yt(t,n,s){var c=t.pendingLanes;if(c===0)return 0;var m=0,x=t.suspendedLanes,k=t.pingedLanes;t=t.warmLanes;var S=c&134217727;return S!==0?(c=S&~x,c!==0?m=Ut(c):(k&=S,k!==0?m=Ut(k):s||(s=S&~t,s!==0&&(m=Ut(s))))):(S=c&~x,S!==0?m=Ut(S):k!==0?m=Ut(k):s||(s=c&~t,s!==0&&(m=Ut(s)))),m===0?0:n!==0&&n!==m&&(n&x)===0&&(x=m&-m,s=n&-n,x>=s||x===32&&(s&4194048)!==0)?n:m}function Jt(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function se(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Me(){var t=Gt;return Gt<<=1,(Gt&62914560)===0&&(Gt=4194304),t}function ze(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function nt(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Xt(t,n,s,c,m,x){var k=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var S=t.entanglements,U=t.expirationTimes,ne=t.hiddenUpdates;for(s=k&~s;0<s;){var de=31-je(s),he=1<<de;S[de]=0,U[de]=-1;var ae=ne[de];if(ae!==null)for(ne[de]=null,de=0;de<ae.length;de++){var ie=ae[de];ie!==null&&(ie.lane&=-536870913)}s&=~he}c!==0&&bn(t,c,0),x!==0&&m===0&&t.tag!==0&&(t.suspendedLanes|=x&~(k&~n))}function bn(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var c=31-je(n);t.entangledLanes|=n,t.entanglements[c]=t.entanglements[c]|1073741824|s&261930}function xr(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var c=31-je(s),m=1<<c;m&n|t[c]&n&&(t[c]|=n),s&=~m}}function $l(t,n){var s=n&-n;return s=(s&42)!==0?1:gr(s),(s&(t.suspendedLanes|n))!==0?0:s}function gr(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function yn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Jr(){var t=Y.p;return t!==0?t:(t=window.event,t===void 0?32:Zg(t.type))}function br(t,n){var s=Y.p;try{return Y.p=t,n()}finally{Y.p=s}}var Hn=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Hn,fn="__reactProps$"+Hn,Ft="__reactContainer$"+Hn,Yl="__reactEvents$"+Hn,Ol="__reactListeners$"+Hn,Ql="__reactHandles$"+Hn,ls="__reactResources$"+Hn,Jn="__reactMarker$"+Hn;function Ll(t){delete t[Yt],delete t[fn],delete t[Yl],delete t[Ol],delete t[Ql]}function ml(t){var n=t[Yt];if(n)return n;for(var s=t.parentNode;s;){if(n=s[Ft]||s[Yt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Dg(t);t!==null;){if(s=t[Yt])return s;t=Dg(t)}return n}t=s,s=t.parentNode}return null}function Dl(t){if(t=t[Yt]||t[Ft]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Ca(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(i(33))}function _l(t){var n=t[ls];return n||(n=t[ls]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function qt(t){t[Jn]=!0}var yr=new Set,vr={};function Bl(t,n){Xl(t,n),Xl(t+"Capture",n)}function Xl(t,n){for(vr[t]=n,t=0;t<n.length;t++)yr.add(n[t])}var Do=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]*$"),as={},ei={};function rs(t){return Ge.call(ei,t)?!0:Ge.call(as,t)?!1:Do.test(t)?ei[t]=!0:(as[t]=!0,!1)}function Kl(t,n,s){if(rs(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function Il(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function Fn(t,n,s,c){if(c===null)t.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+c)}}function Kt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ti(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ve(t,n,s){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,x=c.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return m.call(this)},set:function(k){s=""+k,x.call(this,k)}}),Object.defineProperty(t,n,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(k){s=""+k},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Ke(t){if(!t._valueTracker){var n=ti(t)?"checked":"value";t._valueTracker=ve(t,n,""+t[n])}}function Ot(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),c="";return t&&(c=ti(t)?t.checked?"true":"false":t.value),t=c,t!==s?(n.setValue(t),!0):!1}function vn(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ni=/[\n"\\]/g;function kn(t){return t.replace(ni,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ta(t,n,s,c,m,x,k,S){t.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.type=k:t.removeAttribute("type"),n!=null?k==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Kt(n)):t.value!==""+Kt(n)&&(t.value=""+Kt(n)):k!=="submit"&&k!=="reset"||t.removeAttribute("value"),n!=null?Aa(t,k,Kt(n)):s!=null?Aa(t,k,Kt(s)):c!=null&&t.removeAttribute("value"),m==null&&x!=null&&(t.defaultChecked=!!x),m!=null&&(t.checked=m&&typeof m!="function"&&typeof m!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+Kt(S):t.removeAttribute("name")}function Bn(t,n,s,c,m,x,k,S){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),n!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||n!=null)){Ke(t);return}s=s!=null?""+Kt(s):"",n=n!=null?""+Kt(n):s,S||n===t.value||(t.value=n),t.defaultValue=n}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=S?t.checked:!!c,t.defaultChecked=!!c,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.name=k),Ke(t)}function Aa(t,n,s){n==="number"&&vn(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function kr(t,n,s,c){if(t=t.options,n){n={};for(var m=0;m<s.length;m++)n["$"+s[m]]=!0;for(s=0;s<t.length;s++)m=n.hasOwnProperty("$"+t[s].value),t[s].selected!==m&&(t[s].selected=m),m&&c&&(t[s].defaultSelected=!0)}else{for(s=""+Kt(s),n=null,m=0;m<t.length;m++){if(t[m].value===s){t[m].selected=!0,c&&(t[m].defaultSelected=!0);return}n!==null||t[m].disabled||(n=t[m])}n!==null&&(n.selected=!0)}}function Zu(t,n,s){if(n!=null&&(n=""+Kt(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Kt(s):""}function _o(t,n,s,c){if(n==null){if(c!=null){if(s!=null)throw Error(i(92));if(ee(c)){if(1<c.length)throw Error(i(93));c=c[0]}s=c}s==null&&(s=""),n=s}s=Kt(n),t.defaultValue=s,c=t.textContent,c===s&&c!==""&&c!==null&&(t.value=c),Ke(t)}function Zl(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var oh=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 Wu(t,n,s){var c=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":c?t.setProperty(n,s):typeof s!="number"||s===0||oh.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function Bo(t,n,s){if(n!=null&&typeof n!="object")throw Error(i(62));if(t=t.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var m in n)c=n[m],n.hasOwnProperty(m)&&s[m]!==c&&Wu(t,m,c)}else for(var x in n)n.hasOwnProperty(x)&&Wu(t,x,n[x])}function is(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Ju=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"]]),ed=/^[\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 li(t){return ed.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function wl(){}var ss=null;function os(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ea=null,Ra=null;function Io(t){var n=Dl(t);if(n&&(t=n.stateNode)){var s=t[fn]||null;e:switch(t=n.stateNode,n.type){case"input":if(Ta(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+kn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var c=s[n];if(c!==t&&c.form===t.form){var m=c[fn]||null;if(!m)throw Error(i(90));Ta(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(n=0;n<s.length;n++)c=s[n],c.form===t.form&&Ot(c)}break e;case"textarea":Zu(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&kr(t,!!s.multiple,n,!1)}}}var Po=!1;function cs(t,n,s){if(Po)return t(n,s);Po=!0;try{var c=t(n);return c}finally{if(Po=!1,(Ea!==null||Ra!==null)&&(Bc(),Ea&&(n=Ea,t=Ra,Ra=Ea=null,Io(n),t)))for(n=0;n<t.length;n++)Io(t[n])}}function Wl(t,n){var s=t.stateNode;if(s===null)return null;var c=s[fn]||null;if(c===null)return null;s=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(i(231,n,typeof s));return s}var el=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jr=!1;if(el)try{var Jl={};Object.defineProperty(Jl,"passive",{get:function(){jr=!0}}),window.addEventListener("test",Jl,Jl),window.removeEventListener("test",Jl,Jl)}catch{jr=!1}var Rn=null,ea=null,ai=null;function Uo(){if(ai)return ai;var t,n=ea,s=n.length,c,m="value"in Rn?Rn.value:Rn.textContent,x=m.length;for(t=0;t<s&&n[t]===m[t];t++);var k=s-t;for(c=1;c<=k&&n[s-c]===m[x-c];c++);return ai=m.slice(t,1<c?1-c:void 0)}function us(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function jn(){return!0}function Nr(){return!1}function Nn(t){function n(s,c,m,x,k){this._reactName=s,this._targetInst=m,this.type=c,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var S in t)t.hasOwnProperty(S)&&(s=t[S],this[S]=s?s(x):x[S]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?jn:Nr,this.isPropagationStopped=Nr,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=jn)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=jn)},persist:function(){},isPersistent:jn}),n}var ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ma=Nn(ta),za=b({},ta,{view:0,detail:0}),Ho=Nn(za),ds,fs,wr,ri=b({},za,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hs,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==wr&&(wr&&t.type==="mousemove"?(ds=t.screenX-wr.screenX,fs=t.screenY-wr.screenY):fs=ds=0,wr=t),ds)},movementY:function(t){return"movementY"in t?t.movementY:fs}}),Fo=Nn(ri),td=b({},ri,{dataTransfer:0}),ii=Nn(td),nd=b({},za,{relatedTarget:0}),ms=Nn(nd),ld=b({},ta,{animationName:0,elapsedTime:0,pseudoElement:0}),ad=Nn(ld),ps=b({},ta,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),rd=Nn(ps),id=b({},ta,{data:0}),si=Nn(id),sd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},od={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"},cd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ud(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=cd[t])?!!n[t]:!1}function hs(){return ud}var dd=b({},za,{key:function(t){if(t.key){var n=sd[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=us(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?od[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hs,charCode:function(t){return t.type==="keypress"?us(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?us(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),fd=Nn(dd),md=b({},ri,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qo=Nn(md),pd=b({},za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hs}),hd=Nn(pd),Vo=b({},ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),xd=Nn(Vo),gd=b({},ri,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),bd=Nn(gd),yd=b({},ta,{newState:0,oldState:0}),vd=Nn(yd),xs=[9,13,27,32],hn=el&&"CompositionEvent"in window,Oa=null;el&&"documentMode"in document&&(Oa=document.documentMode);var gs=el&&"TextEvent"in window&&!Oa,qn=el&&(!hn||Oa&&8<Oa&&11>=Oa),bs=" ",tl=!1;function na(t,n){switch(t){case"keyup":return xs.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sr(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var La=!1;function kd(t,n){switch(t){case"compositionend":return Sr(n);case"keypress":return n.which!==32?null:(tl=!0,bs);case"textInput":return t=n.data,t===bs&&tl?null:t;default:return null}}function jd(t,n){if(La)return t==="compositionend"||!hn&&na(t,n)?(t=Uo(),ai=ea=Rn=null,La=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return qn&&n.locale!=="ko"?null:n.data;default:return null}}var Nd={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 Go(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Nd[t.type]:n==="textarea"}function $o(t,n,s,c){Ea?Ra?Ra.push(c):Ra=[c]:Ea=c,n=Vc(n,"onChange"),0<n.length&&(s=new Ma("onChange","change",null,s,c),t.push({event:s,listeners:n}))}var Cr=null,Tr=null;function ch(t){kg(t,0)}function oi(t){var n=Ca(t);if(Ot(n))return t}function Yo(t,n){if(t==="change")return n}var Qo=!1;if(el){var ys;if(el){var vs="oninput"in document;if(!vs){var Xo=document.createElement("div");Xo.setAttribute("oninput","return;"),vs=typeof Xo.oninput=="function"}ys=vs}else ys=!1;Qo=ys&&(!document.documentMode||9<document.documentMode)}function Ko(){Cr&&(Cr.detachEvent("onpropertychange",Zo),Tr=Cr=null)}function Zo(t){if(t.propertyName==="value"&&oi(Tr)){var n=[];$o(n,Tr,t,os(t)),cs(ch,n)}}function wd(t,n,s){t==="focusin"?(Ko(),Cr=n,Tr=s,Cr.attachEvent("onpropertychange",Zo)):t==="focusout"&&Ko()}function Sd(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return oi(Tr)}function Cd(t,n){if(t==="click")return oi(n)}function Td(t,n){if(t==="input"||t==="change")return oi(n)}function Ad(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Vn=typeof Object.is=="function"?Object.is:Ad;function Ar(t,n){if(Vn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),c=Object.keys(n);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var m=s[c];if(!Ge.call(n,m)||!Vn(t[m],n[m]))return!1}return!0}function Pl(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Wo(t,n){var s=Pl(t);t=0;for(var c;s;){if(s.nodeType===3){if(c=t+s.textContent.length,t<=n&&c>=n)return{node:s,offset:n-t};t=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Pl(s)}}function ks(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?ks(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Jo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=vn(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=vn(t.document)}return n}function ci(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var Ed=el&&"documentMode"in document&&11>=document.documentMode,Da=null,js=null,Er=null,Ns=!1;function ec(t,n,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ns||Da==null||Da!==vn(c)||(c=Da,"selectionStart"in c&&ci(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Er&&Ar(Er,c)||(Er=c,c=Vc(js,"onSelect"),0<c.length&&(n=new Ma("onSelect","select",null,n,s),t.push({event:n,listeners:c}),n.target=Da)))}function Sl(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var _a={animationend:Sl("Animation","AnimationEnd"),animationiteration:Sl("Animation","AnimationIteration"),animationstart:Sl("Animation","AnimationStart"),transitionrun:Sl("Transition","TransitionRun"),transitionstart:Sl("Transition","TransitionStart"),transitioncancel:Sl("Transition","TransitionCancel"),transitionend:Sl("Transition","TransitionEnd")},ws={},tc={};el&&(tc=document.createElement("div").style,"AnimationEvent"in window||(delete _a.animationend.animation,delete _a.animationiteration.animation,delete _a.animationstart.animation),"TransitionEvent"in window||delete _a.transitionend.transition);function pl(t){if(ws[t])return ws[t];if(!_a[t])return t;var n=_a[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in tc)return ws[t]=n[s];return t}var nc=pl("animationend"),lc=pl("animationiteration"),Rr=pl("animationstart"),Rd=pl("transitionrun"),ui=pl("transitionstart"),Md=pl("transitioncancel"),di=pl("transitionend"),ac=new Map,Ss="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(" ");Ss.push("scrollEnd");function nl(t,n){ac.set(t,n),Bl(n,[t])}var Mr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Mn=[],Ba=0,zn=0;function fi(){for(var t=Ba,n=zn=Ba=0;n<t;){var s=Mn[n];Mn[n++]=null;var c=Mn[n];Mn[n++]=null;var m=Mn[n];Mn[n++]=null;var x=Mn[n];if(Mn[n++]=null,c!==null&&m!==null){var k=c.pending;k===null?m.next=m:(m.next=k.next,k.next=m),c.pending=m}x!==0&&rc(s,m,x)}}function mi(t,n,s,c){Mn[Ba++]=t,Mn[Ba++]=n,Mn[Ba++]=s,Mn[Ba++]=c,zn|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function hl(t,n,s,c){return mi(t,n,s,c),pi(t)}function la(t,n){return mi(t,null,null,n),pi(t)}function rc(t,n,s){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s);for(var m=!1,x=t.return;x!==null;)x.childLanes|=s,c=x.alternate,c!==null&&(c.childLanes|=s),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(m=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,m&&n!==null&&(m=31-je(s),t=x.hiddenUpdates,c=t[m],c===null?t[m]=[n]:c.push(n),n.lane=s|536870912),x):null}function pi(t){if(50<Zs)throw Zs=0,Df=null,Error(i(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Ia={};function Cs(t,n,s,c){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(t,n,s,c){return new Cs(t,n,s,c)}function Ts(t){return t=t.prototype,!(!t||!t.isReactComponent)}function en(t,n){var s=t.alternate;return s===null?(s=In(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function As(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function xl(t,n,s,c,m,x){var k=0;if(c=t,typeof t=="function")Ts(t)&&(k=1);else if(typeof t=="string")k=wj(t,s,pe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Z:return t=In(31,s,n,m),t.elementType=Z,t.lanes=x,t;case E:return aa(s.children,m,x,n);case N:k=8,m|=24;break;case M:return t=In(12,s,n,m|2),t.elementType=M,t.lanes=x,t;case q:return t=In(13,s,n,m),t.elementType=q,t.lanes=x,t;case D:return t=In(19,s,n,m),t.elementType=D,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case H:k=10;break e;case L:k=9;break e;case X:k=11;break e;case B:k=14;break e;case F:k=16,c=null;break e}k=29,s=Error(i(130,t===null?"null":typeof t,"")),c=null}return n=In(k,s,n,m),n.elementType=t,n.type=c,n.lanes=x,n}function aa(t,n,s,c){return t=In(7,t,c,n),t.lanes=s,t}function Pa(t,n,s){return t=In(6,t,null,n),t.lanes=s,t}function ic(t){var n=In(18,null,null,0);return n.stateNode=t,n}function Es(t,n,s){return n=In(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Ua=new WeakMap;function wn(t,n){if(typeof t=="object"&&t!==null){var s=Ua.get(t);return s!==void 0?s:(n={value:t,source:n,stack:Ye(n)},Ua.set(t,n),n)}return{value:t,source:n,stack:Ye(n)}}var ra=[],Ha=0,hi=null,Fa=0,Sn=[],Gn=0,Cl=null,gl=1,ll="";function bl(t,n){ra[Ha++]=Fa,ra[Ha++]=hi,hi=t,Fa=n}function sc(t,n,s){Sn[Gn++]=gl,Sn[Gn++]=ll,Sn[Gn++]=Cl,Cl=t;var c=gl;t=ll;var m=32-je(c)-1;c&=~(1<<m),s+=1;var x=32-je(n)+m;if(30<x){var k=m-m%5;x=(c&(1<<k)-1).toString(32),c>>=k,m-=k,gl=1<<32-je(n)+m|s<<m|c,ll=x+t}else gl=1<<x|s<<m|c,ll=t}function xi(t){t.return!==null&&(bl(t,1),sc(t,1,0))}function Rs(t){for(;t===hi;)hi=ra[--Ha],ra[Ha]=null,Fa=ra[--Ha],ra[Ha]=null;for(;t===Cl;)Cl=Sn[--Gn],Sn[Gn]=null,ll=Sn[--Gn],Sn[Gn]=null,gl=Sn[--Gn],Sn[Gn]=null}function vt(t,n){Sn[Gn++]=gl,Sn[Gn++]=ll,Sn[Gn++]=Cl,gl=n.id,ll=n.overflow,Cl=t}var ln=null,Bt=null,ft=!1,I=null,W=!1,be=Error(i(519));function At(t){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ms(wn(n,t)),be}function gi(t){var n=t.stateNode,s=t.type,c=t.memoizedProps;switch(n[Yt]=t,n[fn]=c,s){case"dialog":xt("cancel",n),xt("close",n);break;case"iframe":case"object":case"embed":xt("load",n);break;case"video":case"audio":for(s=0;s<Js.length;s++)xt(Js[s],n);break;case"source":xt("error",n);break;case"img":case"image":case"link":xt("error",n),xt("load",n);break;case"details":xt("toggle",n);break;case"input":xt("invalid",n),Bn(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":xt("invalid",n);break;case"textarea":xt("invalid",n),_o(n,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||c.suppressHydrationWarning===!0||Sg(n.textContent,s)?(c.popover!=null&&(xt("beforetoggle",n),xt("toggle",n)),c.onScroll!=null&&xt("scroll",n),c.onScrollEnd!=null&&xt("scrollend",n),c.onClick!=null&&(n.onclick=wl),n=!0):n=!1,n||At(t,!0)}function oc(t){for(ln=t.return;ln;)switch(ln.tag){case 5:case 31:case 13:W=!1;return;case 27:case 3:W=!0;return;default:ln=ln.return}}function bi(t){if(t!==ln)return!1;if(!ft)return oc(t),ft=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Kf(t.type,t.memoizedProps)),s=!s),s&&Bt&&At(t),oc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));Bt=Lg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));Bt=Lg(t)}else n===27?(n=Bt,nr(t.type)?(t=tm,tm=null,Bt=t):Bt=n):Bt=ln?vl(t.stateNode.nextSibling):null;return!0}function zr(){Bt=ln=null,ft=!1}function zd(){var t=I;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),I=null),t}function Ms(t){I===null?I=[t]:I.push(t)}var Od=_(null),Or=null,ia=null;function qa(t,n,s){R(Od,n._currentValue),n._currentValue=s}function sa(t){t._currentValue=Od.current,le(Od)}function Ld(t,n,s){for(;t!==null;){var c=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),t===s)break;t=t.return}}function Dd(t,n,s,c){var m=t.child;for(m!==null&&(m.return=t);m!==null;){var x=m.dependencies;if(x!==null){var k=m.child;x=x.firstContext;e:for(;x!==null;){var S=x;x=m;for(var U=0;U<n.length;U++)if(S.context===n[U]){x.lanes|=s,S=x.alternate,S!==null&&(S.lanes|=s),Ld(x.return,s,t),c||(k=null);break e}x=S.next}}else if(m.tag===18){if(k=m.return,k===null)throw Error(i(341));k.lanes|=s,x=k.alternate,x!==null&&(x.lanes|=s),Ld(k,s,t),k=null}else k=m.child;if(k!==null)k.return=m;else for(k=m;k!==null;){if(k===t){k=null;break}if(m=k.sibling,m!==null){m.return=k.return,k=m;break}k=k.return}m=k}}function yi(t,n,s,c){t=null;for(var m=n,x=!1;m!==null;){if(!x){if((m.flags&524288)!==0)x=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var k=m.alternate;if(k===null)throw Error(i(387));if(k=k.memoizedProps,k!==null){var S=m.type;Vn(m.pendingProps.value,k.value)||(t!==null?t.push(S):t=[S])}}else if(m===Re.current){if(k=m.alternate,k===null)throw Error(i(387));k.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(t!==null?t.push(ao):t=[ao])}m=m.return}t!==null&&Dd(n,t,s,c),n.flags|=262144}function cc(t){for(t=t.firstContext;t!==null;){if(!Vn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Lr(t){Or=t,ia=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return uh(Or,t)}function uc(t,n){return Or===null&&Lr(t),uh(t,n)}function uh(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},ia===null){if(t===null)throw Error(i(308));ia=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else ia=ia.next=n;return s}var vk=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,c){t.push(c)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},kk=e.unstable_scheduleCallback,jk=e.unstable_NormalPriority,an={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _d(){return{controller:new vk,data:new Map,refCount:0}}function zs(t){t.refCount--,t.refCount===0&&kk(jk,function(){t.controller.abort()})}var Os=null,Bd=0,vi=0,ki=null;function Nk(t,n){if(Os===null){var s=Os=[];Bd=0,vi=Hf(),ki={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Bd++,n.then(dh,dh),n}function dh(){if(--Bd===0&&Os!==null){ki!==null&&(ki.status="fulfilled");var t=Os;Os=null,vi=0,ki=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function wk(t,n){var s=[],c={status:"pending",value:null,reason:null,then:function(m){s.push(m)}};return t.then(function(){c.status="fulfilled",c.value=n;for(var m=0;m<s.length;m++)(0,s[m])(n)},function(m){for(c.status="rejected",c.reason=m,m=0;m<s.length;m++)(0,s[m])(void 0)}),c}var fh=w.S;w.S=function(t,n){Xx=Ze(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Nk(t,n),fh!==null&&fh(t,n)};var Dr=_(null);function Id(){var t=Dr.current;return t!==null?t:It.pooledCache}function dc(t,n){n===null?R(Dr,Dr.current):R(Dr,n.pool)}function mh(){var t=Id();return t===null?null:{parent:an._currentValue,pool:t}}var ji=Error(i(460)),Pd=Error(i(474)),fc=Error(i(542)),mc={then:function(){}};function ph(t){return t=t.status,t==="fulfilled"||t==="rejected"}function hh(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(wl,wl),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,gh(t),t;default:if(typeof n.status=="string")n.then(wl,wl);else{if(t=It,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=n,t.status="pending",t.then(function(c){if(n.status==="pending"){var m=n;m.status="fulfilled",m.value=c}},function(c){if(n.status==="pending"){var m=n;m.status="rejected",m.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,gh(t),t}throw Br=n,ji}}function _r(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Br=s,ji):s}}var Br=null;function xh(){if(Br===null)throw Error(i(459));var t=Br;return Br=null,t}function gh(t){if(t===ji||t===fc)throw Error(i(483))}var Ni=null,Ls=0;function pc(t){var n=Ls;return Ls+=1,Ni===null&&(Ni=[]),hh(Ni,t,n)}function Ds(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function hc(t,n){throw n.$$typeof===v?Error(i(525)):(t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function bh(t){function n(K,G){if(t){var te=K.deletions;te===null?(K.deletions=[G],K.flags|=16):te.push(G)}}function s(K,G){if(!t)return null;for(;G!==null;)n(K,G),G=G.sibling;return null}function c(K){for(var G=new Map;K!==null;)K.key!==null?G.set(K.key,K):G.set(K.index,K),K=K.sibling;return G}function m(K,G){return K=en(K,G),K.index=0,K.sibling=null,K}function x(K,G,te){return K.index=te,t?(te=K.alternate,te!==null?(te=te.index,te<G?(K.flags|=67108866,G):te):(K.flags|=67108866,G)):(K.flags|=1048576,G)}function k(K){return t&&K.alternate===null&&(K.flags|=67108866),K}function S(K,G,te,fe){return G===null||G.tag!==6?(G=Pa(te,K.mode,fe),G.return=K,G):(G=m(G,te),G.return=K,G)}function U(K,G,te,fe){var Ve=te.type;return Ve===E?de(K,G,te.props.children,fe,te.key):G!==null&&(G.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===F&&_r(Ve)===G.type)?(G=m(G,te.props),Ds(G,te),G.return=K,G):(G=xl(te.type,te.key,te.props,null,K.mode,fe),Ds(G,te),G.return=K,G)}function ne(K,G,te,fe){return G===null||G.tag!==4||G.stateNode.containerInfo!==te.containerInfo||G.stateNode.implementation!==te.implementation?(G=Es(te,K.mode,fe),G.return=K,G):(G=m(G,te.children||[]),G.return=K,G)}function de(K,G,te,fe,Ve){return G===null||G.tag!==7?(G=aa(te,K.mode,fe,Ve),G.return=K,G):(G=m(G,te),G.return=K,G)}function he(K,G,te){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Pa(""+G,K.mode,te),G.return=K,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case j:return te=xl(G.type,G.key,G.props,null,K.mode,te),Ds(te,G),te.return=K,te;case C:return G=Es(G,K.mode,te),G.return=K,G;case F:return G=_r(G),he(K,G,te)}if(ee(G)||Q(G))return G=aa(G,K.mode,te,null),G.return=K,G;if(typeof G.then=="function")return he(K,pc(G),te);if(G.$$typeof===H)return he(K,uc(K,G),te);hc(K,G)}return null}function ae(K,G,te,fe){var Ve=G!==null?G.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ve!==null?null:S(K,G,""+te,fe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case j:return te.key===Ve?U(K,G,te,fe):null;case C:return te.key===Ve?ne(K,G,te,fe):null;case F:return te=_r(te),ae(K,G,te,fe)}if(ee(te)||Q(te))return Ve!==null?null:de(K,G,te,fe,null);if(typeof te.then=="function")return ae(K,G,pc(te),fe);if(te.$$typeof===H)return ae(K,G,uc(K,te),fe);hc(K,te)}return null}function ie(K,G,te,fe,Ve){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return K=K.get(te)||null,S(G,K,""+fe,Ve);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case j:return K=K.get(fe.key===null?te:fe.key)||null,U(G,K,fe,Ve);case C:return K=K.get(fe.key===null?te:fe.key)||null,ne(G,K,fe,Ve);case F:return fe=_r(fe),ie(K,G,te,fe,Ve)}if(ee(fe)||Q(fe))return K=K.get(te)||null,de(G,K,fe,Ve,null);if(typeof fe.then=="function")return ie(K,G,te,pc(fe),Ve);if(fe.$$typeof===H)return ie(K,G,te,uc(G,fe),Ve);hc(G,fe)}return null}function Oe(K,G,te,fe){for(var Ve=null,Ct=null,Pe=G,ut=G=0,jt=null;Pe!==null&&ut<te.length;ut++){Pe.index>ut?(jt=Pe,Pe=null):jt=Pe.sibling;var Tt=ae(K,Pe,te[ut],fe);if(Tt===null){Pe===null&&(Pe=jt);break}t&&Pe&&Tt.alternate===null&&n(K,Pe),G=x(Tt,G,ut),Ct===null?Ve=Tt:Ct.sibling=Tt,Ct=Tt,Pe=jt}if(ut===te.length)return s(K,Pe),ft&&bl(K,ut),Ve;if(Pe===null){for(;ut<te.length;ut++)Pe=he(K,te[ut],fe),Pe!==null&&(G=x(Pe,G,ut),Ct===null?Ve=Pe:Ct.sibling=Pe,Ct=Pe);return ft&&bl(K,ut),Ve}for(Pe=c(Pe);ut<te.length;ut++)jt=ie(Pe,K,ut,te[ut],fe),jt!==null&&(t&&jt.alternate!==null&&Pe.delete(jt.key===null?ut:jt.key),G=x(jt,G,ut),Ct===null?Ve=jt:Ct.sibling=jt,Ct=jt);return t&&Pe.forEach(function(sr){return n(K,sr)}),ft&&bl(K,ut),Ve}function Qe(K,G,te,fe){if(te==null)throw Error(i(151));for(var Ve=null,Ct=null,Pe=G,ut=G=0,jt=null,Tt=te.next();Pe!==null&&!Tt.done;ut++,Tt=te.next()){Pe.index>ut?(jt=Pe,Pe=null):jt=Pe.sibling;var sr=ae(K,Pe,Tt.value,fe);if(sr===null){Pe===null&&(Pe=jt);break}t&&Pe&&sr.alternate===null&&n(K,Pe),G=x(sr,G,ut),Ct===null?Ve=sr:Ct.sibling=sr,Ct=sr,Pe=jt}if(Tt.done)return s(K,Pe),ft&&bl(K,ut),Ve;if(Pe===null){for(;!Tt.done;ut++,Tt=te.next())Tt=he(K,Tt.value,fe),Tt!==null&&(G=x(Tt,G,ut),Ct===null?Ve=Tt:Ct.sibling=Tt,Ct=Tt);return ft&&bl(K,ut),Ve}for(Pe=c(Pe);!Tt.done;ut++,Tt=te.next())Tt=ie(Pe,K,ut,Tt.value,fe),Tt!==null&&(t&&Tt.alternate!==null&&Pe.delete(Tt.key===null?ut:Tt.key),G=x(Tt,G,ut),Ct===null?Ve=Tt:Ct.sibling=Tt,Ct=Tt);return t&&Pe.forEach(function(Dj){return n(K,Dj)}),ft&&bl(K,ut),Ve}function _t(K,G,te,fe){if(typeof te=="object"&&te!==null&&te.type===E&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case j:e:{for(var Ve=te.key;G!==null;){if(G.key===Ve){if(Ve=te.type,Ve===E){if(G.tag===7){s(K,G.sibling),fe=m(G,te.props.children),fe.return=K,K=fe;break e}}else if(G.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===F&&_r(Ve)===G.type){s(K,G.sibling),fe=m(G,te.props),Ds(fe,te),fe.return=K,K=fe;break e}s(K,G);break}else n(K,G);G=G.sibling}te.type===E?(fe=aa(te.props.children,K.mode,fe,te.key),fe.return=K,K=fe):(fe=xl(te.type,te.key,te.props,null,K.mode,fe),Ds(fe,te),fe.return=K,K=fe)}return k(K);case C:e:{for(Ve=te.key;G!==null;){if(G.key===Ve)if(G.tag===4&&G.stateNode.containerInfo===te.containerInfo&&G.stateNode.implementation===te.implementation){s(K,G.sibling),fe=m(G,te.children||[]),fe.return=K,K=fe;break e}else{s(K,G);break}else n(K,G);G=G.sibling}fe=Es(te,K.mode,fe),fe.return=K,K=fe}return k(K);case F:return te=_r(te),_t(K,G,te,fe)}if(ee(te))return Oe(K,G,te,fe);if(Q(te)){if(Ve=Q(te),typeof Ve!="function")throw Error(i(150));return te=Ve.call(te),Qe(K,G,te,fe)}if(typeof te.then=="function")return _t(K,G,pc(te),fe);if(te.$$typeof===H)return _t(K,G,uc(K,te),fe);hc(K,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,G!==null&&G.tag===6?(s(K,G.sibling),fe=m(G,te),fe.return=K,K=fe):(s(K,G),fe=Pa(te,K.mode,fe),fe.return=K,K=fe),k(K)):s(K,G)}return function(K,G,te,fe){try{Ls=0;var Ve=_t(K,G,te,fe);return Ni=null,Ve}catch(Pe){if(Pe===ji||Pe===fc)throw Pe;var Ct=In(29,Pe,null,K.mode);return Ct.lanes=fe,Ct.return=K,Ct}}}var Ir=bh(!0),yh=bh(!1),Va=!1;function Ud(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ga(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function $a(t,n,s){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(Et&2)!==0){var m=c.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),c.pending=n,n=pi(t),rc(t,null,s),n}return mi(t,c,n,s),pi(t)}function _s(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,xr(t,s)}}function Fd(t,n){var s=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var m=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var k={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?m=x=k:x=x.next=k,s=s.next}while(s!==null);x===null?m=x=n:x=x.next=n}else m=x=n;s={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var qd=!1;function Bs(){if(qd){var t=ki;if(t!==null)throw t}}function Is(t,n,s,c){qd=!1;var m=t.updateQueue;Va=!1;var x=m.firstBaseUpdate,k=m.lastBaseUpdate,S=m.shared.pending;if(S!==null){m.shared.pending=null;var U=S,ne=U.next;U.next=null,k===null?x=ne:k.next=ne,k=U;var de=t.alternate;de!==null&&(de=de.updateQueue,S=de.lastBaseUpdate,S!==k&&(S===null?de.firstBaseUpdate=ne:S.next=ne,de.lastBaseUpdate=U))}if(x!==null){var he=m.baseState;k=0,de=ne=U=null,S=x;do{var ae=S.lane&-536870913,ie=ae!==S.lane;if(ie?(kt&ae)===ae:(c&ae)===ae){ae!==0&&ae===vi&&(qd=!0),de!==null&&(de=de.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Oe=t,Qe=S;ae=n;var _t=s;switch(Qe.tag){case 1:if(Oe=Qe.payload,typeof Oe=="function"){he=Oe.call(_t,he,ae);break e}he=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Qe.payload,ae=typeof Oe=="function"?Oe.call(_t,he,ae):Oe,ae==null)break e;he=b({},he,ae);break e;case 2:Va=!0}}ae=S.callback,ae!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[ae]:ie.push(ae))}else ie={lane:ae,tag:S.tag,payload:S.payload,callback:S.callback,next:null},de===null?(ne=de=ie,U=he):de=de.next=ie,k|=ae;if(S=S.next,S===null){if(S=m.shared.pending,S===null)break;ie=S,S=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);de===null&&(U=he),m.baseState=U,m.firstBaseUpdate=ne,m.lastBaseUpdate=de,x===null&&(m.shared.lanes=0),Za|=k,t.lanes=k,t.memoizedState=he}}function vh(t,n){if(typeof t!="function")throw Error(i(191,t));t.call(n)}function kh(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)vh(s[t],n)}var wi=_(null),xc=_(0);function jh(t,n){t=xa,R(xc,t),R(wi,n),xa=t|n.baseLanes}function Vd(){R(xc,xa),R(wi,wi.current)}function Gd(){xa=xc.current,le(wi),le(xc)}var al=_(null),yl=null;function Ya(t){var n=t.alternate;R(tn,tn.current&1),R(al,t),yl===null&&(n===null||wi.current!==null||n.memoizedState!==null)&&(yl=t)}function $d(t){R(tn,tn.current),R(al,t),yl===null&&(yl=t)}function Nh(t){t.tag===22?(R(tn,tn.current),R(al,t),yl===null&&(yl=t)):Qa()}function Qa(){R(tn,tn.current),R(al,al.current)}function rl(t){le(al),yl===t&&(yl=null),le(tn)}var tn=_(0);function gc(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Jf(s)||em(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var oa=0,ct=null,Lt=null,rn=null,bc=!1,Si=!1,Pr=!1,yc=0,Ps=0,Ci=null,Sk=0;function Zt(){throw Error(i(321))}function Yd(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Vn(t[s],n[s]))return!1;return!0}function Qd(t,n,s,c,m,x){return oa=x,ct=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,w.H=t===null||t.memoizedState===null?ix:uf,Pr=!1,x=s(c,m),Pr=!1,Si&&(x=Sh(n,s,c,m)),wh(t),x}function wh(t){w.H=Fs;var n=Lt!==null&&Lt.next!==null;if(oa=0,rn=Lt=ct=null,bc=!1,Ps=0,Ci=null,n)throw Error(i(300));t===null||sn||(t=t.dependencies,t!==null&&cc(t)&&(sn=!0))}function Sh(t,n,s,c){ct=t;var m=0;do{if(Si&&(Ci=null),Ps=0,Si=!1,25<=m)throw Error(i(301));if(m+=1,rn=Lt=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}w.H=sx,x=n(s,c)}while(Si);return x}function Ck(){var t=w.H,n=t.useState()[0];return n=typeof n.then=="function"?Us(n):n,t=t.useState()[0],(Lt!==null?Lt.memoizedState:null)!==t&&(ct.flags|=1024),n}function Xd(){var t=yc!==0;return yc=0,t}function Kd(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function Zd(t){if(bc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}bc=!1}oa=0,rn=Lt=ct=null,Si=!1,Ps=yc=0,Ci=null}function Pn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?ct.memoizedState=rn=t:rn=rn.next=t,rn}function nn(){if(Lt===null){var t=ct.alternate;t=t!==null?t.memoizedState:null}else t=Lt.next;var n=rn===null?ct.memoizedState:rn.next;if(n!==null)rn=n,Lt=t;else{if(t===null)throw ct.alternate===null?Error(i(467)):Error(i(310));Lt=t,t={memoizedState:Lt.memoizedState,baseState:Lt.baseState,baseQueue:Lt.baseQueue,queue:Lt.queue,next:null},rn===null?ct.memoizedState=rn=t:rn=rn.next=t}return rn}function vc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Us(t){var n=Ps;return Ps+=1,Ci===null&&(Ci=[]),t=hh(Ci,t,n),n=ct,(rn===null?n.memoizedState:rn.next)===null&&(n=n.alternate,w.H=n===null||n.memoizedState===null?ix:uf),t}function kc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Us(t);if(t.$$typeof===H)return Cn(t)}throw Error(i(438,String(t)))}function Wd(t){var n=null,s=ct.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var c=ct.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(m){return m.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=vc(),ct.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),c=0;c<t;c++)s[c]=O;return n.index++,s}function ca(t,n){return typeof n=="function"?n(t):n}function jc(t){var n=nn();return Jd(n,Lt,t)}function Jd(t,n,s){var c=t.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=s;var m=t.baseQueue,x=c.pending;if(x!==null){if(m!==null){var k=m.next;m.next=x.next,x.next=k}n.baseQueue=m=x,c.pending=null}if(x=t.baseState,m===null)t.memoizedState=x;else{n=m.next;var S=k=null,U=null,ne=n,de=!1;do{var he=ne.lane&-536870913;if(he!==ne.lane?(kt&he)===he:(oa&he)===he){var ae=ne.revertLane;if(ae===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),he===vi&&(de=!0);else if((oa&ae)===ae){ne=ne.next,ae===vi&&(de=!0);continue}else he={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},U===null?(S=U=he,k=x):U=U.next=he,ct.lanes|=ae,Za|=ae;he=ne.action,Pr&&s(x,he),x=ne.hasEagerState?ne.eagerState:s(x,he)}else ae={lane:he,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},U===null?(S=U=ae,k=x):U=U.next=ae,ct.lanes|=he,Za|=he;ne=ne.next}while(ne!==null&&ne!==n);if(U===null?k=x:U.next=S,!Vn(x,t.memoizedState)&&(sn=!0,de&&(s=ki,s!==null)))throw s;t.memoizedState=x,t.baseState=k,t.baseQueue=U,c.lastRenderedState=x}return m===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function ef(t){var n=nn(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var c=s.dispatch,m=s.pending,x=n.memoizedState;if(m!==null){s.pending=null;var k=m=m.next;do x=t(x,k.action),k=k.next;while(k!==m);Vn(x,n.memoizedState)||(sn=!0),n.memoizedState=x,n.baseQueue===null&&(n.baseState=x),s.lastRenderedState=x}return[x,c]}function Ch(t,n,s){var c=ct,m=nn(),x=ft;if(x){if(s===void 0)throw Error(i(407));s=s()}else s=n();var k=!Vn((Lt||m).memoizedState,s);if(k&&(m.memoizedState=s,sn=!0),m=m.queue,lf(Eh.bind(null,c,m,t),[t]),m.getSnapshot!==n||k||rn!==null&&rn.memoizedState.tag&1){if(c.flags|=2048,Ti(9,{destroy:void 0},Ah.bind(null,c,m,s,n),null),It===null)throw Error(i(349));x||(oa&127)!==0||Th(c,n,s)}return s}function Th(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=ct.updateQueue,n===null?(n=vc(),ct.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function Ah(t,n,s,c){n.value=s,n.getSnapshot=c,Rh(n)&&Mh(t)}function Eh(t,n,s){return s(function(){Rh(n)&&Mh(t)})}function Rh(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Vn(t,s)}catch{return!0}}function Mh(t){var n=la(t,2);n!==null&&Kn(n,t,2)}function tf(t){var n=Pn();if(typeof t=="function"){var s=t;if(t=s(),Pr){me(!0);try{s()}finally{me(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:t},n}function zh(t,n,s,c){return t.baseState=s,Jd(t,Lt,typeof c=="function"?c:ca)}function Tk(t,n,s,c,m){if(Sc(t))throw Error(i(485));if(t=n.action,t!==null){var x={payload:m,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){x.listeners.push(k)}};w.T!==null?s(!0):x.isTransition=!1,c(x),s=n.pending,s===null?(x.next=n.pending=x,Oh(n,x)):(x.next=s.next,n.pending=s.next=x)}}function Oh(t,n){var s=n.action,c=n.payload,m=t.state;if(n.isTransition){var x=w.T,k={};w.T=k;try{var S=s(m,c),U=w.S;U!==null&&U(k,S),Lh(t,n,S)}catch(ne){nf(t,n,ne)}finally{x!==null&&k.types!==null&&(x.types=k.types),w.T=x}}else try{x=s(m,c),Lh(t,n,x)}catch(ne){nf(t,n,ne)}}function Lh(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Dh(t,n,c)},function(c){return nf(t,n,c)}):Dh(t,n,s)}function Dh(t,n,s){n.status="fulfilled",n.value=s,_h(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,Oh(t,s)))}function nf(t,n,s){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=s,_h(n),n=n.next;while(n!==c)}t.action=null}function _h(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Bh(t,n){return n}function Ih(t,n){if(ft){var s=It.formState;if(s!==null){e:{var c=ct;if(ft){if(Bt){t:{for(var m=Bt,x=W;m.nodeType!==8;){if(!x){m=null;break t}if(m=vl(m.nextSibling),m===null){m=null;break t}}x=m.data,m=x==="F!"||x==="F"?m:null}if(m){Bt=vl(m.nextSibling),c=m.data==="F!";break e}}At(c)}c=!1}c&&(n=s[0])}}return s=Pn(),s.memoizedState=s.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bh,lastRenderedState:n},s.queue=c,s=lx.bind(null,ct,c),c.dispatch=s,c=tf(!1),x=cf.bind(null,ct,!1,c.queue),c=Pn(),m={state:n,dispatch:null,action:t,pending:null},c.queue=m,s=Tk.bind(null,ct,m,x,s),m.dispatch=s,c.memoizedState=t,[n,s,!1]}function Ph(t){var n=nn();return Uh(n,Lt,t)}function Uh(t,n,s){if(n=Jd(t,n,Bh)[0],t=jc(ca)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=Us(n)}catch(k){throw k===ji?fc:k}else c=n;n=nn();var m=n.queue,x=m.dispatch;return s!==n.memoizedState&&(ct.flags|=2048,Ti(9,{destroy:void 0},Ak.bind(null,m,s),null)),[c,x,t]}function Ak(t,n){t.action=n}function Hh(t){var n=nn(),s=Lt;if(s!==null)return Uh(n,s,t);nn(),n=n.memoizedState,s=nn();var c=s.queue.dispatch;return s.memoizedState=t,[n,c,!1]}function Ti(t,n,s,c){return t={tag:t,create:s,deps:c,inst:n,next:null},n=ct.updateQueue,n===null&&(n=vc(),ct.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(c=s.next,s.next=t,t.next=c,n.lastEffect=t),t}function Fh(){return nn().memoizedState}function Nc(t,n,s,c){var m=Pn();ct.flags|=t,m.memoizedState=Ti(1|n,{destroy:void 0},s,c===void 0?null:c)}function wc(t,n,s,c){var m=nn();c=c===void 0?null:c;var x=m.memoizedState.inst;Lt!==null&&c!==null&&Yd(c,Lt.memoizedState.deps)?m.memoizedState=Ti(n,x,s,c):(ct.flags|=t,m.memoizedState=Ti(1|n,x,s,c))}function qh(t,n){Nc(8390656,8,t,n)}function lf(t,n){wc(2048,8,t,n)}function Ek(t){ct.flags|=4;var n=ct.updateQueue;if(n===null)n=vc(),ct.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function Vh(t){var n=nn().memoizedState;return Ek({ref:n,nextImpl:t}),function(){if((Et&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Gh(t,n){return wc(4,2,t,n)}function $h(t,n){return wc(4,4,t,n)}function Yh(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Qh(t,n,s){s=s!=null?s.concat([t]):null,wc(4,4,Yh.bind(null,n,t),s)}function af(){}function Xh(t,n){var s=nn();n=n===void 0?null:n;var c=s.memoizedState;return n!==null&&Yd(n,c[1])?c[0]:(s.memoizedState=[t,n],t)}function Kh(t,n){var s=nn();n=n===void 0?null:n;var c=s.memoizedState;if(n!==null&&Yd(n,c[1]))return c[0];if(c=t(),Pr){me(!0);try{t()}finally{me(!1)}}return s.memoizedState=[c,n],c}function rf(t,n,s){return s===void 0||(oa&1073741824)!==0&&(kt&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=Zx(),ct.lanes|=t,Za|=t,s)}function Zh(t,n,s,c){return Vn(s,n)?s:wi.current!==null?(t=rf(t,s,c),Vn(t,n)||(sn=!0),t):(oa&42)===0||(oa&1073741824)!==0&&(kt&261930)===0?(sn=!0,t.memoizedState=s):(t=Zx(),ct.lanes|=t,Za|=t,n)}function Wh(t,n,s,c,m){var x=Y.p;Y.p=x!==0&&8>x?x:8;var k=w.T,S={};w.T=S,cf(t,!1,n,s);try{var U=m(),ne=w.S;if(ne!==null&&ne(S,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var de=wk(U,c);Hs(t,n,de,ol(t))}else Hs(t,n,c,ol(t))}catch(he){Hs(t,n,{then:function(){},status:"rejected",reason:he},ol())}finally{Y.p=x,k!==null&&S.types!==null&&(k.types=S.types),w.T=k}}function Rk(){}function sf(t,n,s,c){if(t.tag!==5)throw Error(i(476));var m=Jh(t).queue;Wh(t,m,n,$,s===null?Rk:function(){return ex(t),s(c)})}function Jh(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:$},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ex(t){var n=Jh(t);n.next===null&&(n=t.alternate.memoizedState),Hs(t,n.next.queue,{},ol())}function of(){return Cn(ao)}function tx(){return nn().memoizedState}function nx(){return nn().memoizedState}function Mk(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=ol();t=Ga(s);var c=$a(n,t,s);c!==null&&(Kn(c,n,s),_s(c,n,s)),n={cache:_d()},t.payload=n;return}n=n.return}}function zk(t,n,s){var c=ol();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Sc(t)?ax(n,s):(s=hl(t,n,s,c),s!==null&&(Kn(s,t,c),rx(s,n,c)))}function lx(t,n,s){var c=ol();Hs(t,n,s,c)}function Hs(t,n,s,c){var m={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Sc(t))ax(n,m);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=n.lastRenderedReducer,x!==null))try{var k=n.lastRenderedState,S=x(k,s);if(m.hasEagerState=!0,m.eagerState=S,Vn(S,k))return mi(t,n,m,0),It===null&&fi(),!1}catch{}if(s=hl(t,n,m,c),s!==null)return Kn(s,t,c),rx(s,n,c),!0}return!1}function cf(t,n,s,c){if(c={lane:2,revertLane:Hf(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Sc(t)){if(n)throw Error(i(479))}else n=hl(t,s,c,2),n!==null&&Kn(n,t,2)}function Sc(t){var n=t.alternate;return t===ct||n!==null&&n===ct}function ax(t,n){Si=bc=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function rx(t,n,s){if((s&4194048)!==0){var c=n.lanes;c&=t.pendingLanes,s|=c,n.lanes=s,xr(t,s)}}var Fs={readContext:Cn,use:kc,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};Fs.useEffectEvent=Zt;var ix={readContext:Cn,use:kc,useCallback:function(t,n){return Pn().memoizedState=[t,n===void 0?null:n],t},useContext:Cn,useEffect:qh,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,Nc(4194308,4,Yh.bind(null,n,t),s)},useLayoutEffect:function(t,n){return Nc(4194308,4,t,n)},useInsertionEffect:function(t,n){Nc(4,2,t,n)},useMemo:function(t,n){var s=Pn();n=n===void 0?null:n;var c=t();if(Pr){me(!0);try{t()}finally{me(!1)}}return s.memoizedState=[c,n],c},useReducer:function(t,n,s){var c=Pn();if(s!==void 0){var m=s(n);if(Pr){me(!0);try{s(n)}finally{me(!1)}}}else m=n;return c.memoizedState=c.baseState=m,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:m},c.queue=t,t=t.dispatch=zk.bind(null,ct,t),[c.memoizedState,t]},useRef:function(t){var n=Pn();return t={current:t},n.memoizedState=t},useState:function(t){t=tf(t);var n=t.queue,s=lx.bind(null,ct,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:af,useDeferredValue:function(t,n){var s=Pn();return rf(s,t,n)},useTransition:function(){var t=tf(!1);return t=Wh.bind(null,ct,t.queue,!0,!1),Pn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var c=ct,m=Pn();if(ft){if(s===void 0)throw Error(i(407));s=s()}else{if(s=n(),It===null)throw Error(i(349));(kt&127)!==0||Th(c,n,s)}m.memoizedState=s;var x={value:s,getSnapshot:n};return m.queue=x,qh(Eh.bind(null,c,x,t),[t]),c.flags|=2048,Ti(9,{destroy:void 0},Ah.bind(null,c,x,s,n),null),s},useId:function(){var t=Pn(),n=It.identifierPrefix;if(ft){var s=ll,c=gl;s=(c&~(1<<32-je(c)-1)).toString(32)+s,n="_"+n+"R_"+s,s=yc++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=Sk++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:of,useFormState:Ih,useActionState:Ih,useOptimistic:function(t){var n=Pn();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=cf.bind(null,ct,!0,s),s.dispatch=n,[t,n]},useMemoCache:Wd,useCacheRefresh:function(){return Pn().memoizedState=Mk.bind(null,ct)},useEffectEvent:function(t){var n=Pn(),s={impl:t};return n.memoizedState=s,function(){if((Et&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},uf={readContext:Cn,use:kc,useCallback:Xh,useContext:Cn,useEffect:lf,useImperativeHandle:Qh,useInsertionEffect:Gh,useLayoutEffect:$h,useMemo:Kh,useReducer:jc,useRef:Fh,useState:function(){return jc(ca)},useDebugValue:af,useDeferredValue:function(t,n){var s=nn();return Zh(s,Lt.memoizedState,t,n)},useTransition:function(){var t=jc(ca)[0],n=nn().memoizedState;return[typeof t=="boolean"?t:Us(t),n]},useSyncExternalStore:Ch,useId:tx,useHostTransitionStatus:of,useFormState:Ph,useActionState:Ph,useOptimistic:function(t,n){var s=nn();return zh(s,Lt,t,n)},useMemoCache:Wd,useCacheRefresh:nx};uf.useEffectEvent=Vh;var sx={readContext:Cn,use:kc,useCallback:Xh,useContext:Cn,useEffect:lf,useImperativeHandle:Qh,useInsertionEffect:Gh,useLayoutEffect:$h,useMemo:Kh,useReducer:ef,useRef:Fh,useState:function(){return ef(ca)},useDebugValue:af,useDeferredValue:function(t,n){var s=nn();return Lt===null?rf(s,t,n):Zh(s,Lt.memoizedState,t,n)},useTransition:function(){var t=ef(ca)[0],n=nn().memoizedState;return[typeof t=="boolean"?t:Us(t),n]},useSyncExternalStore:Ch,useId:tx,useHostTransitionStatus:of,useFormState:Hh,useActionState:Hh,useOptimistic:function(t,n){var s=nn();return Lt!==null?zh(s,Lt,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Wd,useCacheRefresh:nx};sx.useEffectEvent=Vh;function df(t,n,s,c){n=t.memoizedState,s=s(c,n),s=s==null?n:b({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var ff={enqueueSetState:function(t,n,s){t=t._reactInternals;var c=ol(),m=Ga(c);m.payload=n,s!=null&&(m.callback=s),n=$a(t,m,c),n!==null&&(Kn(n,t,c),_s(n,t,c))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var c=ol(),m=Ga(c);m.tag=1,m.payload=n,s!=null&&(m.callback=s),n=$a(t,m,c),n!==null&&(Kn(n,t,c),_s(n,t,c))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=ol(),c=Ga(s);c.tag=2,n!=null&&(c.callback=n),n=$a(t,c,s),n!==null&&(Kn(n,t,s),_s(n,t,s))}};function ox(t,n,s,c,m,x,k){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,x,k):n.prototype&&n.prototype.isPureReactComponent?!Ar(s,c)||!Ar(m,x):!0}function cx(t,n,s,c){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,c),n.state!==t&&ff.enqueueReplaceState(n,n.state,null)}function Ur(t,n){var s=n;if("ref"in n){s={};for(var c in n)c!=="ref"&&(s[c]=n[c])}if(t=t.defaultProps){s===n&&(s=b({},s));for(var m in t)s[m]===void 0&&(s[m]=t[m])}return s}function ux(t){Mr(t)}function dx(t){console.error(t)}function fx(t){Mr(t)}function Cc(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function mx(t,n,s){try{var c=t.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function mf(t,n,s){return s=Ga(s),s.tag=3,s.payload={element:null},s.callback=function(){Cc(t,n)},s}function px(t){return t=Ga(t),t.tag=3,t}function hx(t,n,s,c){var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var x=c.value;t.payload=function(){return m(x)},t.callback=function(){mx(n,s,c)}}var k=s.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(t.callback=function(){mx(n,s,c),typeof m!="function"&&(Wa===null?Wa=new Set([this]):Wa.add(this));var S=c.stack;this.componentDidCatch(c.value,{componentStack:S!==null?S:""})})}function Ok(t,n,s,c,m){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=s.alternate,n!==null&&yi(n,s,m,!0),s=al.current,s!==null){switch(s.tag){case 31:case 13:return yl===null?Ic():s.alternate===null&&Wt===0&&(Wt=3),s.flags&=-257,s.flags|=65536,s.lanes=m,c===mc?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([c]):n.add(c),If(t,c,m)),!1;case 22:return s.flags|=65536,c===mc?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([c]):s.add(c)),If(t,c,m)),!1}throw Error(i(435,s.tag))}return If(t,c,m),Ic(),!1}if(ft)return n=al.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=m,c!==be&&(t=Error(i(422),{cause:c}),Ms(wn(t,s)))):(c!==be&&(n=Error(i(423),{cause:c}),Ms(wn(n,s))),t=t.current.alternate,t.flags|=65536,m&=-m,t.lanes|=m,c=wn(c,s),m=mf(t.stateNode,c,m),Fd(t,m),Wt!==4&&(Wt=2)),!1;var x=Error(i(520),{cause:c});if(x=wn(x,s),Ks===null?Ks=[x]:Ks.push(x),Wt!==4&&(Wt=2),n===null)return!0;c=wn(c,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=m&-m,s.lanes|=t,t=mf(s.stateNode,c,t),Fd(s,t),!1;case 1:if(n=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Wa===null||!Wa.has(x))))return s.flags|=65536,m&=-m,s.lanes|=m,m=px(m),hx(m,t,s,c),Fd(s,m),!1}s=s.return}while(s!==null);return!1}var pf=Error(i(461)),sn=!1;function Tn(t,n,s,c){n.child=t===null?yh(n,null,s,c):Ir(n,t.child,s,c)}function xx(t,n,s,c,m){s=s.render;var x=n.ref;if("ref"in c){var k={};for(var S in c)S!=="ref"&&(k[S]=c[S])}else k=c;return Lr(n),c=Qd(t,n,s,k,x,m),S=Xd(),t!==null&&!sn?(Kd(t,n,m),ua(t,n,m)):(ft&&S&&xi(n),n.flags|=1,Tn(t,n,c,m),n.child)}function gx(t,n,s,c,m){if(t===null){var x=s.type;return typeof x=="function"&&!Ts(x)&&x.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=x,bx(t,n,x,c,m)):(t=xl(s.type,null,c,n,n.mode,m),t.ref=n.ref,t.return=n,n.child=t)}if(x=t.child,!jf(t,m)){var k=x.memoizedProps;if(s=s.compare,s=s!==null?s:Ar,s(k,c)&&t.ref===n.ref)return ua(t,n,m)}return n.flags|=1,t=en(x,c),t.ref=n.ref,t.return=n,n.child=t}function bx(t,n,s,c,m){if(t!==null){var x=t.memoizedProps;if(Ar(x,c)&&t.ref===n.ref)if(sn=!1,n.pendingProps=c=x,jf(t,m))(t.flags&131072)!==0&&(sn=!0);else return n.lanes=t.lanes,ua(t,n,m)}return hf(t,n,s,c,m)}function yx(t,n,s,c){var m=c.children,x=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((n.flags&128)!==0){if(x=x!==null?x.baseLanes|s:s,t!==null){for(c=n.child=t.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~x}else c=0,n.child=null;return vx(t,n,x,s,c)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&dc(n,x!==null?x.cachePool:null),x!==null?jh(n,x):Vd(),Nh(n);else return c=n.lanes=536870912,vx(t,n,x!==null?x.baseLanes|s:s,s,c)}else x!==null?(dc(n,x.cachePool),jh(n,x),Qa(),n.memoizedState=null):(t!==null&&dc(n,null),Vd(),Qa());return Tn(t,n,m,s),n.child}function qs(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function vx(t,n,s,c,m){var x=Id();return x=x===null?null:{parent:an._currentValue,pool:x},n.memoizedState={baseLanes:s,cachePool:x},t!==null&&dc(n,null),Vd(),Nh(n),t!==null&&yi(t,n,c,!0),n.childLanes=m,null}function Tc(t,n){return n=Ec({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function kx(t,n,s){return Ir(n,t.child,null,s),t=Tc(n,n.pendingProps),t.flags|=2,rl(n),n.memoizedState=null,t}function Lk(t,n,s){var c=n.pendingProps,m=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(ft){if(c.mode==="hidden")return t=Tc(n,c),n.lanes=536870912,qs(null,t);if($d(n),(t=Bt)?(t=Og(t,W),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Cl!==null?{id:gl,overflow:ll}:null,retryLane:536870912,hydrationErrors:null},s=ic(t),s.return=n,n.child=s,ln=n,Bt=null)):t=null,t===null)throw At(n);return n.lanes=536870912,null}return Tc(n,c)}var x=t.memoizedState;if(x!==null){var k=x.dehydrated;if($d(n),m)if(n.flags&256)n.flags&=-257,n=kx(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(i(558));else if(sn||yi(t,n,s,!1),m=(s&t.childLanes)!==0,sn||m){if(c=It,c!==null&&(k=$l(c,s),k!==0&&k!==x.retryLane))throw x.retryLane=k,la(t,k),Kn(c,t,k),pf;Ic(),n=kx(t,n,s)}else t=x.treeContext,Bt=vl(k.nextSibling),ln=n,ft=!0,I=null,W=!1,t!==null&&vt(n,t),n=Tc(n,c),n.flags|=4096;return n}return t=en(t.child,{mode:c.mode,children:c.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Ac(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function hf(t,n,s,c,m){return Lr(n),s=Qd(t,n,s,c,void 0,m),c=Xd(),t!==null&&!sn?(Kd(t,n,m),ua(t,n,m)):(ft&&c&&xi(n),n.flags|=1,Tn(t,n,s,m),n.child)}function jx(t,n,s,c,m,x){return Lr(n),n.updateQueue=null,s=Sh(n,c,s,m),wh(t),c=Xd(),t!==null&&!sn?(Kd(t,n,x),ua(t,n,x)):(ft&&c&&xi(n),n.flags|=1,Tn(t,n,s,x),n.child)}function Nx(t,n,s,c,m){if(Lr(n),n.stateNode===null){var x=Ia,k=s.contextType;typeof k=="object"&&k!==null&&(x=Cn(k)),x=new s(c,x),n.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=ff,n.stateNode=x,x._reactInternals=n,x=n.stateNode,x.props=c,x.state=n.memoizedState,x.refs={},Ud(n),k=s.contextType,x.context=typeof k=="object"&&k!==null?Cn(k):Ia,x.state=n.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(df(n,s,k,c),x.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(k=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),k!==x.state&&ff.enqueueReplaceState(x,x.state,null),Is(n,c,x,m),Bs(),x.state=n.memoizedState),typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(t===null){x=n.stateNode;var S=n.memoizedProps,U=Ur(s,S);x.props=U;var ne=x.context,de=s.contextType;k=Ia,typeof de=="object"&&de!==null&&(k=Cn(de));var he=s.getDerivedStateFromProps;de=typeof he=="function"||typeof x.getSnapshotBeforeUpdate=="function",S=n.pendingProps!==S,de||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(S||ne!==k)&&cx(n,x,c,k),Va=!1;var ae=n.memoizedState;x.state=ae,Is(n,c,x,m),Bs(),ne=n.memoizedState,S||ae!==ne||Va?(typeof he=="function"&&(df(n,s,he,c),ne=n.memoizedState),(U=Va||ox(n,s,U,c,ae,ne,k))?(de||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(n.flags|=4194308)):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=ne),x.props=c,x.state=ne,x.context=k,c=U):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{x=n.stateNode,Hd(t,n),k=n.memoizedProps,de=Ur(s,k),x.props=de,he=n.pendingProps,ae=x.context,ne=s.contextType,U=Ia,typeof ne=="object"&&ne!==null&&(U=Cn(ne)),S=s.getDerivedStateFromProps,(ne=typeof S=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==he||ae!==U)&&cx(n,x,c,U),Va=!1,ae=n.memoizedState,x.state=ae,Is(n,c,x,m),Bs();var ie=n.memoizedState;k!==he||ae!==ie||Va||t!==null&&t.dependencies!==null&&cc(t.dependencies)?(typeof S=="function"&&(df(n,s,S,c),ie=n.memoizedState),(de=Va||ox(n,s,de,c,ae,ie,U)||t!==null&&t.dependencies!==null&&cc(t.dependencies))?(ne||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,ie,U),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,ie,U)),typeof x.componentDidUpdate=="function"&&(n.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===t.memoizedProps&&ae===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&ae===t.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=ie),x.props=c,x.state=ie,x.context=U,c=de):(typeof x.componentDidUpdate!="function"||k===t.memoizedProps&&ae===t.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&ae===t.memoizedState||(n.flags|=1024),c=!1)}return x=c,Ac(t,n),c=(n.flags&128)!==0,x||c?(x=n.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:x.render(),n.flags|=1,t!==null&&c?(n.child=Ir(n,t.child,null,m),n.child=Ir(n,null,s,m)):Tn(t,n,s,m),n.memoizedState=x.state,t=n.child):t=ua(t,n,m),t}function wx(t,n,s,c){return zr(),n.flags|=256,Tn(t,n,s,c),n.child}var xf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gf(t){return{baseLanes:t,cachePool:mh()}}function bf(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=sl),t}function Sx(t,n,s){var c=n.pendingProps,m=!1,x=(n.flags&128)!==0,k;if((k=x)||(k=t!==null&&t.memoizedState===null?!1:(tn.current&2)!==0),k&&(m=!0,n.flags&=-129),k=(n.flags&32)!==0,n.flags&=-33,t===null){if(ft){if(m?Ya(n):Qa(),(t=Bt)?(t=Og(t,W),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Cl!==null?{id:gl,overflow:ll}:null,retryLane:536870912,hydrationErrors:null},s=ic(t),s.return=n,n.child=s,ln=n,Bt=null)):t=null,t===null)throw At(n);return em(t)?n.lanes=32:n.lanes=536870912,null}var S=c.children;return c=c.fallback,m?(Qa(),m=n.mode,S=Ec({mode:"hidden",children:S},m),c=aa(c,m,s,null),S.return=n,c.return=n,S.sibling=c,n.child=S,c=n.child,c.memoizedState=gf(s),c.childLanes=bf(t,k,s),n.memoizedState=xf,qs(null,c)):(Ya(n),yf(n,S))}var U=t.memoizedState;if(U!==null&&(S=U.dehydrated,S!==null)){if(x)n.flags&256?(Ya(n),n.flags&=-257,n=vf(t,n,s)):n.memoizedState!==null?(Qa(),n.child=t.child,n.flags|=128,n=null):(Qa(),S=c.fallback,m=n.mode,c=Ec({mode:"visible",children:c.children},m),S=aa(S,m,s,null),S.flags|=2,c.return=n,S.return=n,c.sibling=S,n.child=c,Ir(n,t.child,null,s),c=n.child,c.memoizedState=gf(s),c.childLanes=bf(t,k,s),n.memoizedState=xf,n=qs(null,c));else if(Ya(n),em(S)){if(k=S.nextSibling&&S.nextSibling.dataset,k)var ne=k.dgst;k=ne,c=Error(i(419)),c.stack="",c.digest=k,Ms({value:c,source:null,stack:null}),n=vf(t,n,s)}else if(sn||yi(t,n,s,!1),k=(s&t.childLanes)!==0,sn||k){if(k=It,k!==null&&(c=$l(k,s),c!==0&&c!==U.retryLane))throw U.retryLane=c,la(t,c),Kn(k,t,c),pf;Jf(S)||Ic(),n=vf(t,n,s)}else Jf(S)?(n.flags|=192,n.child=t.child,n=null):(t=U.treeContext,Bt=vl(S.nextSibling),ln=n,ft=!0,I=null,W=!1,t!==null&&vt(n,t),n=yf(n,c.children),n.flags|=4096);return n}return m?(Qa(),S=c.fallback,m=n.mode,U=t.child,ne=U.sibling,c=en(U,{mode:"hidden",children:c.children}),c.subtreeFlags=U.subtreeFlags&65011712,ne!==null?S=en(ne,S):(S=aa(S,m,s,null),S.flags|=2),S.return=n,c.return=n,c.sibling=S,n.child=c,qs(null,c),c=n.child,S=t.child.memoizedState,S===null?S=gf(s):(m=S.cachePool,m!==null?(U=an._currentValue,m=m.parent!==U?{parent:U,pool:U}:m):m=mh(),S={baseLanes:S.baseLanes|s,cachePool:m}),c.memoizedState=S,c.childLanes=bf(t,k,s),n.memoizedState=xf,qs(t.child,c)):(Ya(n),s=t.child,t=s.sibling,s=en(s,{mode:"visible",children:c.children}),s.return=n,s.sibling=null,t!==null&&(k=n.deletions,k===null?(n.deletions=[t],n.flags|=16):k.push(t)),n.child=s,n.memoizedState=null,s)}function yf(t,n){return n=Ec({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Ec(t,n){return t=In(22,t,null,n),t.lanes=0,t}function vf(t,n,s){return Ir(n,t.child,null,s),t=yf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Cx(t,n,s){t.lanes|=n;var c=t.alternate;c!==null&&(c.lanes|=n),Ld(t.return,n,s)}function kf(t,n,s,c,m,x){var k=t.memoizedState;k===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:m,treeForkCount:x}:(k.isBackwards=n,k.rendering=null,k.renderingStartTime=0,k.last=c,k.tail=s,k.tailMode=m,k.treeForkCount=x)}function Tx(t,n,s){var c=n.pendingProps,m=c.revealOrder,x=c.tail;c=c.children;var k=tn.current,S=(k&2)!==0;if(S?(k=k&1|2,n.flags|=128):k&=1,R(tn,k),Tn(t,n,c,s),c=ft?Fa:0,!S&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Cx(t,s,n);else if(t.tag===19)Cx(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(m){case"forwards":for(s=n.child,m=null;s!==null;)t=s.alternate,t!==null&&gc(t)===null&&(m=s),s=s.sibling;s=m,s===null?(m=n.child,n.child=null):(m=s.sibling,s.sibling=null),kf(n,!1,m,s,x,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,m=n.child,n.child=null;m!==null;){if(t=m.alternate,t!==null&&gc(t)===null){n.child=m;break}t=m.sibling,m.sibling=s,s=m,m=t}kf(n,!0,s,null,x,c);break;case"together":kf(n,!1,null,null,void 0,c);break;default:n.memoizedState=null}return n.child}function ua(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),Za|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(yi(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,s=en(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=en(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function jf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&cc(t)))}function Dk(t,n,s){switch(n.tag){case 3:Te(n,n.stateNode.containerInfo),qa(n,an,t.memoizedState.cache),zr();break;case 27:case 5:He(n);break;case 4:Te(n,n.stateNode.containerInfo);break;case 10:qa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,$d(n),null;break;case 13:var c=n.memoizedState;if(c!==null)return c.dehydrated!==null?(Ya(n),n.flags|=128,null):(s&n.child.childLanes)!==0?Sx(t,n,s):(Ya(n),t=ua(t,n,s),t!==null?t.sibling:null);Ya(n);break;case 19:var m=(t.flags&128)!==0;if(c=(s&n.childLanes)!==0,c||(yi(t,n,s,!1),c=(s&n.childLanes)!==0),m){if(c)return Tx(t,n,s);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),R(tn,tn.current),c)break;return null;case 22:return n.lanes=0,yx(t,n,s,n.pendingProps);case 24:qa(n,an,t.memoizedState.cache)}return ua(t,n,s)}function Ax(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)sn=!0;else{if(!jf(t,s)&&(n.flags&128)===0)return sn=!1,Dk(t,n,s);sn=(t.flags&131072)!==0}else sn=!1,ft&&(n.flags&1048576)!==0&&sc(n,Fa,n.index);switch(n.lanes=0,n.tag){case 16:e:{var c=n.pendingProps;if(t=_r(n.elementType),n.type=t,typeof t=="function")Ts(t)?(c=Ur(t,c),n.tag=1,n=Nx(null,n,t,c,s)):(n.tag=0,n=hf(null,n,t,c,s));else{if(t!=null){var m=t.$$typeof;if(m===X){n.tag=11,n=xx(null,n,t,c,s);break e}else if(m===B){n.tag=14,n=gx(null,n,t,c,s);break e}}throw n=J(t)||t,Error(i(306,n,""))}}return n;case 0:return hf(t,n,n.type,n.pendingProps,s);case 1:return c=n.type,m=Ur(c,n.pendingProps),Nx(t,n,c,m,s);case 3:e:{if(Te(n,n.stateNode.containerInfo),t===null)throw Error(i(387));c=n.pendingProps;var x=n.memoizedState;m=x.element,Hd(t,n),Is(n,c,null,s);var k=n.memoizedState;if(c=k.cache,qa(n,an,c),c!==x.cache&&Dd(n,[an],s,!0),Bs(),c=k.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:k.cache},n.updateQueue.baseState=x,n.memoizedState=x,n.flags&256){n=wx(t,n,c,s);break e}else if(c!==m){m=wn(Error(i(424)),n),Ms(m),n=wx(t,n,c,s);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Bt=vl(t.firstChild),ln=n,ft=!0,I=null,W=!0,s=yh(n,null,c,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(zr(),c===m){n=ua(t,n,s);break e}Tn(t,n,c,s)}n=n.child}return n;case 26:return Ac(t,n),t===null?(s=Pg(n.type,null,n.pendingProps,null))?n.memoizedState=s:ft||(s=n.type,t=n.pendingProps,c=Gc(ce.current).createElement(s),c[Yt]=n,c[fn]=t,An(c,s,t),qt(c),n.stateNode=c):n.memoizedState=Pg(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return He(n),t===null&&ft&&(c=n.stateNode=_g(n.type,n.pendingProps,ce.current),ln=n,W=!0,m=Bt,nr(n.type)?(tm=m,Bt=vl(c.firstChild)):Bt=m),Tn(t,n,n.pendingProps.children,s),Ac(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&ft&&((m=c=Bt)&&(c=dj(c,n.type,n.pendingProps,W),c!==null?(n.stateNode=c,ln=n,Bt=vl(c.firstChild),W=!1,m=!0):m=!1),m||At(n)),He(n),m=n.type,x=n.pendingProps,k=t!==null?t.memoizedProps:null,c=x.children,Kf(m,x)?c=null:k!==null&&Kf(m,k)&&(n.flags|=32),n.memoizedState!==null&&(m=Qd(t,n,Ck,null,null,s),ao._currentValue=m),Ac(t,n),Tn(t,n,c,s),n.child;case 6:return t===null&&ft&&((t=s=Bt)&&(s=fj(s,n.pendingProps,W),s!==null?(n.stateNode=s,ln=n,Bt=null,t=!0):t=!1),t||At(n)),null;case 13:return Sx(t,n,s);case 4:return Te(n,n.stateNode.containerInfo),c=n.pendingProps,t===null?n.child=Ir(n,null,c,s):Tn(t,n,c,s),n.child;case 11:return xx(t,n,n.type,n.pendingProps,s);case 7:return Tn(t,n,n.pendingProps,s),n.child;case 8:return Tn(t,n,n.pendingProps.children,s),n.child;case 12:return Tn(t,n,n.pendingProps.children,s),n.child;case 10:return c=n.pendingProps,qa(n,n.type,c.value),Tn(t,n,c.children,s),n.child;case 9:return m=n.type._context,c=n.pendingProps.children,Lr(n),m=Cn(m),c=c(m),n.flags|=1,Tn(t,n,c,s),n.child;case 14:return gx(t,n,n.type,n.pendingProps,s);case 15:return bx(t,n,n.type,n.pendingProps,s);case 19:return Tx(t,n,s);case 31:return Lk(t,n,s);case 22:return yx(t,n,s,n.pendingProps);case 24:return Lr(n),c=Cn(an),t===null?(m=Id(),m===null&&(m=It,x=_d(),m.pooledCache=x,x.refCount++,x!==null&&(m.pooledCacheLanes|=s),m=x),n.memoizedState={parent:c,cache:m},Ud(n),qa(n,an,m)):((t.lanes&s)!==0&&(Hd(t,n),Is(n,null,null,s),Bs()),m=t.memoizedState,x=n.memoizedState,m.parent!==c?(m={parent:c,cache:c},n.memoizedState=m,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=m),qa(n,an,c)):(c=x.cache,qa(n,an,c),c!==m.cache&&Dd(n,[an],s,!0))),Tn(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function da(t){t.flags|=4}function Nf(t,n,s,c,m){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(m&335544128)===m)if(t.stateNode.complete)t.flags|=8192;else if(tg())t.flags|=8192;else throw Br=mc,Pd}else t.flags&=-16777217}function Ex(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Vg(n))if(tg())t.flags|=8192;else throw Br=mc,Pd}function Rc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Me():536870912,t.lanes|=n,Mi|=n)}function Vs(t,n){if(!ft)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function Vt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,c=0;if(n)for(var m=t.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=c,t.childLanes=s,n}function _k(t,n,s){var c=n.pendingProps;switch(Rs(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(n),null;case 1:return Vt(n),null;case 3:return s=n.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),sa(an),Ne(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(bi(n)?da(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,zd())),Vt(n),null;case 26:var m=n.type,x=n.memoizedState;return t===null?(da(n),x!==null?(Vt(n),Ex(n,x)):(Vt(n),Nf(n,m,null,c,s))):x?x!==t.memoizedState?(da(n),Vt(n),Ex(n,x)):(Vt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==c&&da(n),Vt(n),Nf(n,m,t,c,s)),null;case 27:if(Le(n),s=ce.current,m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&da(n);else{if(!c){if(n.stateNode===null)throw Error(i(166));return Vt(n),null}t=pe.current,bi(n)?gi(n):(t=_g(m,c,s),n.stateNode=t,da(n))}return Vt(n),null;case 5:if(Le(n),m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&da(n);else{if(!c){if(n.stateNode===null)throw Error(i(166));return Vt(n),null}if(x=pe.current,bi(n))gi(n);else{var k=Gc(ce.current);switch(x){case 1:x=k.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:x=k.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":x=k.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":x=k.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":x=k.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?k.createElement("select",{is:c.is}):k.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?k.createElement(m,{is:c.is}):k.createElement(m)}}x[Yt]=n,x[fn]=c;e:for(k=n.child;k!==null;){if(k.tag===5||k.tag===6)x.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===n)break e;for(;k.sibling===null;){if(k.return===null||k.return===n)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}n.stateNode=x;e:switch(An(x,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&da(n)}}return Vt(n),Nf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==c&&da(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(i(166));if(t=ce.current,bi(n)){if(t=n.stateNode,s=n.memoizedProps,c=null,m=ln,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}t[Yt]=n,t=!!(t.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||Sg(t.nodeValue,s)),t||At(n,!0)}else t=Gc(t).createTextNode(c),t[Yt]=n,n.stateNode=t}return Vt(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(c=bi(n),s!==null){if(t===null){if(!c)throw Error(i(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[Yt]=n}else zr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Vt(n),t=!1}else s=zd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(rl(n),n):(rl(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Vt(n),null;case 13:if(c=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(m=bi(n),c!==null&&c.dehydrated!==null){if(t===null){if(!m)throw Error(i(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(i(317));m[Yt]=n}else zr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Vt(n),m=!1}else m=zd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=m),m=!0;if(!m)return n.flags&256?(rl(n),n):(rl(n),null)}return rl(n),(n.flags&128)!==0?(n.lanes=s,n):(s=c!==null,t=t!==null&&t.memoizedState!==null,s&&(c=n.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==m&&(c.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),Rc(n,n.updateQueue),Vt(n),null);case 4:return Ne(),t===null&&Gf(n.stateNode.containerInfo),Vt(n),null;case 10:return sa(n.type),Vt(n),null;case 19:if(le(tn),c=n.memoizedState,c===null)return Vt(n),null;if(m=(n.flags&128)!==0,x=c.rendering,x===null)if(m)Vs(c,!1);else{if(Wt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(x=gc(t),x!==null){for(n.flags|=128,Vs(c,!1),t=x.updateQueue,n.updateQueue=t,Rc(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)As(s,t),s=s.sibling;return R(tn,tn.current&1|2),ft&&bl(n,c.treeForkCount),n.child}t=t.sibling}c.tail!==null&&Ze()>Dc&&(n.flags|=128,m=!0,Vs(c,!1),n.lanes=4194304)}else{if(!m)if(t=gc(x),t!==null){if(n.flags|=128,m=!0,t=t.updateQueue,n.updateQueue=t,Rc(n,t),Vs(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!ft)return Vt(n),null}else 2*Ze()-c.renderingStartTime>Dc&&s!==536870912&&(n.flags|=128,m=!0,Vs(c,!1),n.lanes=4194304);c.isBackwards?(x.sibling=n.child,n.child=x):(t=c.last,t!==null?t.sibling=x:n.child=x,c.last=x)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Ze(),t.sibling=null,s=tn.current,R(tn,m?s&1|2:s&1),ft&&bl(n,c.treeForkCount),t):(Vt(n),null);case 22:case 23:return rl(n),Gd(),c=n.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(s&536870912)!==0&&(n.flags&128)===0&&(Vt(n),n.subtreeFlags&6&&(n.flags|=8192)):Vt(n),s=n.updateQueue,s!==null&&Rc(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==s&&(n.flags|=2048),t!==null&&le(Dr),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),sa(an),Vt(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function Bk(t,n){switch(Rs(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return sa(an),Ne(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Le(n),null;case 31:if(n.memoizedState!==null){if(rl(n),n.alternate===null)throw Error(i(340));zr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(rl(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));zr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return le(tn),null;case 4:return Ne(),null;case 10:return sa(n.type),null;case 22:case 23:return rl(n),Gd(),t!==null&&le(Dr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return sa(an),null;case 25:return null;default:return null}}function Rx(t,n){switch(Rs(n),n.tag){case 3:sa(an),Ne();break;case 26:case 27:case 5:Le(n);break;case 4:Ne();break;case 31:n.memoizedState!==null&&rl(n);break;case 13:rl(n);break;case 19:le(tn);break;case 10:sa(n.type);break;case 22:case 23:rl(n),Gd(),t!==null&&le(Dr);break;case 24:sa(an)}}function Gs(t,n){try{var s=n.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var m=c.next;s=m;do{if((s.tag&t)===t){c=void 0;var x=s.create,k=s.inst;c=x(),k.destroy=c}s=s.next}while(s!==m)}}catch(S){zt(n,n.return,S)}}function Xa(t,n,s){try{var c=n.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var x=m.next;c=x;do{if((c.tag&t)===t){var k=c.inst,S=k.destroy;if(S!==void 0){k.destroy=void 0,m=n;var U=s,ne=S;try{ne()}catch(de){zt(m,U,de)}}}c=c.next}while(c!==x)}}catch(de){zt(n,n.return,de)}}function Mx(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{kh(n,s)}catch(c){zt(t,t.return,c)}}}function zx(t,n,s){s.props=Ur(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(c){zt(t,n,c)}}function $s(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof s=="function"?t.refCleanup=s(c):s.current=c}}catch(m){zt(t,n,m)}}function Ul(t,n){var s=t.ref,c=t.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(m){zt(t,n,m)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(m){zt(t,n,m)}else s.current=null}function Ox(t){var n=t.type,s=t.memoizedProps,c=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(m){zt(t,t.return,m)}}function wf(t,n,s){try{var c=t.stateNode;rj(c,t.type,s,n),c[fn]=n}catch(m){zt(t,t.return,m)}}function Lx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&nr(t.type)||t.tag===4}function Sf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Lx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&nr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Cf(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=wl));else if(c!==4&&(c===27&&nr(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(Cf(t,n,s),t=t.sibling;t!==null;)Cf(t,n,s),t=t.sibling}function Mc(t,n,s){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(c!==4&&(c===27&&nr(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Mc(t,n,s),t=t.sibling;t!==null;)Mc(t,n,s),t=t.sibling}function Dx(t){var n=t.stateNode,s=t.memoizedProps;try{for(var c=t.type,m=n.attributes;m.length;)n.removeAttributeNode(m[0]);An(n,c,s),n[Yt]=t,n[fn]=s}catch(x){zt(t,t.return,x)}}var fa=!1,on=!1,Tf=!1,_x=typeof WeakSet=="function"?WeakSet:Set,xn=null;function Ik(t,n){if(t=t.containerInfo,Qf=Wc,t=Jo(t),ci(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var m=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var k=0,S=-1,U=-1,ne=0,de=0,he=t,ae=null;t:for(;;){for(var ie;he!==s||m!==0&&he.nodeType!==3||(S=k+m),he!==x||c!==0&&he.nodeType!==3||(U=k+c),he.nodeType===3&&(k+=he.nodeValue.length),(ie=he.firstChild)!==null;)ae=he,he=ie;for(;;){if(he===t)break t;if(ae===s&&++ne===m&&(S=k),ae===x&&++de===c&&(U=k),(ie=he.nextSibling)!==null)break;he=ae,ae=he.parentNode}he=ie}s=S===-1||U===-1?null:{start:S,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(Xf={focusedElem:t,selectionRange:s},Wc=!1,xn=n;xn!==null;)if(n=xn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,xn=t;else for(;xn!==null;){switch(n=xn,x=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)m=t[s],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,s=n,m=x.memoizedProps,x=x.memoizedState,c=s.stateNode;try{var Oe=Ur(s.type,m);t=c.getSnapshotBeforeUpdate(Oe,x),c.__reactInternalSnapshotBeforeUpdate=t}catch(Qe){zt(s,s.return,Qe)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)Wf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Wf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=n.sibling,t!==null){t.return=n.return,xn=t;break}xn=n.return}}function Bx(t,n,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:pa(t,s),c&4&&Gs(5,s);break;case 1:if(pa(t,s),c&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(k){zt(s,s.return,k)}else{var m=Ur(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(m,n,t.__reactInternalSnapshotBeforeUpdate)}catch(k){zt(s,s.return,k)}}c&64&&Mx(s),c&512&&$s(s,s.return);break;case 3:if(pa(t,s),c&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{kh(t,n)}catch(k){zt(s,s.return,k)}}break;case 27:n===null&&c&4&&Dx(s);case 26:case 5:pa(t,s),n===null&&c&4&&Ox(s),c&512&&$s(s,s.return);break;case 12:pa(t,s);break;case 31:pa(t,s),c&4&&Ux(t,s);break;case 13:pa(t,s),c&4&&Hx(t,s),c&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Yk.bind(null,s),mj(t,s))));break;case 22:if(c=s.memoizedState!==null||fa,!c){n=n!==null&&n.memoizedState!==null||on,m=fa;var x=on;fa=c,(on=n)&&!x?ha(t,s,(s.subtreeFlags&8772)!==0):pa(t,s),fa=m,on=x}break;case 30:break;default:pa(t,s)}}function Ix(t){var n=t.alternate;n!==null&&(t.alternate=null,Ix(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Ll(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var $t=null,$n=!1;function ma(t,n,s){for(s=s.child;s!==null;)Px(t,n,s),s=s.sibling}function Px(t,n,s){if(V&&typeof V.onCommitFiberUnmount=="function")try{V.onCommitFiberUnmount(Ee,s)}catch{}switch(s.tag){case 26:on||Ul(s,n),ma(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:on||Ul(s,n);var c=$t,m=$n;nr(s.type)&&($t=s.stateNode,$n=!1),ma(t,n,s),to(s.stateNode),$t=c,$n=m;break;case 5:on||Ul(s,n);case 6:if(c=$t,m=$n,$t=null,ma(t,n,s),$t=c,$n=m,$t!==null)if($n)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(s.stateNode)}catch(x){zt(s,n,x)}else try{$t.removeChild(s.stateNode)}catch(x){zt(s,n,x)}break;case 18:$t!==null&&($n?(t=$t,Mg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Pi(t)):Mg($t,s.stateNode));break;case 4:c=$t,m=$n,$t=s.stateNode.containerInfo,$n=!0,ma(t,n,s),$t=c,$n=m;break;case 0:case 11:case 14:case 15:Xa(2,s,n),on||Xa(4,s,n),ma(t,n,s);break;case 1:on||(Ul(s,n),c=s.stateNode,typeof c.componentWillUnmount=="function"&&zx(s,n,c)),ma(t,n,s);break;case 21:ma(t,n,s);break;case 22:on=(c=on)||s.memoizedState!==null,ma(t,n,s),on=c;break;default:ma(t,n,s)}}function Ux(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Pi(t)}catch(s){zt(n,n.return,s)}}}function Hx(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Pi(t)}catch(s){zt(n,n.return,s)}}function Pk(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new _x),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new _x),n;default:throw Error(i(435,t.tag))}}function zc(t,n){var s=Pk(t);n.forEach(function(c){if(!s.has(c)){s.add(c);var m=Qk.bind(null,t,c);c.then(m,m)}})}function Yn(t,n){var s=n.deletions;if(s!==null)for(var c=0;c<s.length;c++){var m=s[c],x=t,k=n,S=k;e:for(;S!==null;){switch(S.tag){case 27:if(nr(S.type)){$t=S.stateNode,$n=!1;break e}break;case 5:$t=S.stateNode,$n=!1;break e;case 3:case 4:$t=S.stateNode.containerInfo,$n=!0;break e}S=S.return}if($t===null)throw Error(i(160));Px(x,k,m),$t=null,$n=!1,x=m.alternate,x!==null&&(x.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Fx(n,t),n=n.sibling}var Tl=null;function Fx(t,n){var s=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Yn(n,t),Qn(t),c&4&&(Xa(3,t,t.return),Gs(3,t),Xa(5,t,t.return));break;case 1:Yn(n,t),Qn(t),c&512&&(on||s===null||Ul(s,s.return)),c&64&&fa&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var m=Tl;if(Yn(n,t),Qn(t),c&512&&(on||s===null||Ul(s,s.return)),c&4){var x=s!==null?s.memoizedState:null;if(c=t.memoizedState,s===null)if(c===null)if(t.stateNode===null){e:{c=t.type,s=t.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":x=m.getElementsByTagName("title")[0],(!x||x[Jn]||x[Yt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=m.createElement(c),m.head.insertBefore(x,m.querySelector("head > title"))),An(x,c,s),x[Yt]=t,qt(x),c=x;break e;case"link":var k=Fg("link","href",m).get(c+(s.href||""));if(k){for(var S=0;S<k.length;S++)if(x=k[S],x.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&x.getAttribute("rel")===(s.rel==null?null:s.rel)&&x.getAttribute("title")===(s.title==null?null:s.title)&&x.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){k.splice(S,1);break t}}x=m.createElement(c),An(x,c,s),m.head.appendChild(x);break;case"meta":if(k=Fg("meta","content",m).get(c+(s.content||""))){for(S=0;S<k.length;S++)if(x=k[S],x.getAttribute("content")===(s.content==null?null:""+s.content)&&x.getAttribute("name")===(s.name==null?null:s.name)&&x.getAttribute("property")===(s.property==null?null:s.property)&&x.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&x.getAttribute("charset")===(s.charSet==null?null:s.charSet)){k.splice(S,1);break t}}x=m.createElement(c),An(x,c,s),m.head.appendChild(x);break;default:throw Error(i(468,c))}x[Yt]=t,qt(x),c=x}t.stateNode=c}else qg(m,t.type,t.stateNode);else t.stateNode=Hg(m,c,t.memoizedProps);else x!==c?(x===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):x.count--,c===null?qg(m,t.type,t.stateNode):Hg(m,c,t.memoizedProps)):c===null&&t.stateNode!==null&&wf(t,t.memoizedProps,s.memoizedProps)}break;case 27:Yn(n,t),Qn(t),c&512&&(on||s===null||Ul(s,s.return)),s!==null&&c&4&&wf(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Yn(n,t),Qn(t),c&512&&(on||s===null||Ul(s,s.return)),t.flags&32){m=t.stateNode;try{Zl(m,"")}catch(Oe){zt(t,t.return,Oe)}}c&4&&t.stateNode!=null&&(m=t.memoizedProps,wf(t,m,s!==null?s.memoizedProps:m)),c&1024&&(Tf=!0);break;case 6:if(Yn(n,t),Qn(t),c&4){if(t.stateNode===null)throw Error(i(162));c=t.memoizedProps,s=t.stateNode;try{s.nodeValue=c}catch(Oe){zt(t,t.return,Oe)}}break;case 3:if(Qc=null,m=Tl,Tl=$c(n.containerInfo),Yn(n,t),Tl=m,Qn(t),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Pi(n.containerInfo)}catch(Oe){zt(t,t.return,Oe)}Tf&&(Tf=!1,qx(t));break;case 4:c=Tl,Tl=$c(t.stateNode.containerInfo),Yn(n,t),Qn(t),Tl=c;break;case 12:Yn(n,t),Qn(t);break;case 31:Yn(n,t),Qn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,zc(t,c)));break;case 13:Yn(n,t),Qn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Lc=Ze()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,zc(t,c)));break;case 22:m=t.memoizedState!==null;var U=s!==null&&s.memoizedState!==null,ne=fa,de=on;if(fa=ne||m,on=de||U,Yn(n,t),on=de,fa=ne,Qn(t),c&8192)e:for(n=t.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,m&&(s===null||U||fa||on||Hr(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){U=s=n;try{if(x=U.stateNode,m)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{S=U.stateNode;var he=U.memoizedProps.style,ae=he!=null&&he.hasOwnProperty("display")?he.display:null;S.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Oe){zt(U,U.return,Oe)}}}else if(n.tag===6){if(s===null){U=n;try{U.stateNode.nodeValue=m?"":U.memoizedProps}catch(Oe){zt(U,U.return,Oe)}}}else if(n.tag===18){if(s===null){U=n;try{var ie=U.stateNode;m?zg(ie,!0):zg(U.stateNode,!1)}catch(Oe){zt(U,U.return,Oe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}c&4&&(c=t.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,zc(t,s))));break;case 19:Yn(n,t),Qn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,zc(t,c)));break;case 30:break;case 21:break;default:Yn(n,t),Qn(t)}}function Qn(t){var n=t.flags;if(n&2){try{for(var s,c=t.return;c!==null;){if(Lx(c)){s=c;break}c=c.return}if(s==null)throw Error(i(160));switch(s.tag){case 27:var m=s.stateNode,x=Sf(t);Mc(t,x,m);break;case 5:var k=s.stateNode;s.flags&32&&(Zl(k,""),s.flags&=-33);var S=Sf(t);Mc(t,S,k);break;case 3:case 4:var U=s.stateNode.containerInfo,ne=Sf(t);Cf(t,ne,U);break;default:throw Error(i(161))}}catch(de){zt(t,t.return,de)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function qx(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;qx(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function pa(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Bx(t,n.alternate,n),n=n.sibling}function Hr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Xa(4,n,n.return),Hr(n);break;case 1:Ul(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&zx(n,n.return,s),Hr(n);break;case 27:to(n.stateNode);case 26:case 5:Ul(n,n.return),Hr(n);break;case 22:n.memoizedState===null&&Hr(n);break;case 30:Hr(n);break;default:Hr(n)}t=t.sibling}}function ha(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var c=n.alternate,m=t,x=n,k=x.flags;switch(x.tag){case 0:case 11:case 15:ha(m,x,s),Gs(4,x);break;case 1:if(ha(m,x,s),c=x,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ne){zt(c,c.return,ne)}if(c=x,m=c.updateQueue,m!==null){var S=c.stateNode;try{var U=m.shared.hiddenCallbacks;if(U!==null)for(m.shared.hiddenCallbacks=null,m=0;m<U.length;m++)vh(U[m],S)}catch(ne){zt(c,c.return,ne)}}s&&k&64&&Mx(x),$s(x,x.return);break;case 27:Dx(x);case 26:case 5:ha(m,x,s),s&&c===null&&k&4&&Ox(x),$s(x,x.return);break;case 12:ha(m,x,s);break;case 31:ha(m,x,s),s&&k&4&&Ux(m,x);break;case 13:ha(m,x,s),s&&k&4&&Hx(m,x);break;case 22:x.memoizedState===null&&ha(m,x,s),$s(x,x.return);break;case 30:break;default:ha(m,x,s)}n=n.sibling}}function Af(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&zs(s))}function Ef(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&zs(t))}function Al(t,n,s,c){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Vx(t,n,s,c),n=n.sibling}function Vx(t,n,s,c){var m=n.flags;switch(n.tag){case 0:case 11:case 15:Al(t,n,s,c),m&2048&&Gs(9,n);break;case 1:Al(t,n,s,c);break;case 3:Al(t,n,s,c),m&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&zs(t)));break;case 12:if(m&2048){Al(t,n,s,c),t=n.stateNode;try{var x=n.memoizedProps,k=x.id,S=x.onPostCommit;typeof S=="function"&&S(k,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){zt(n,n.return,U)}}else Al(t,n,s,c);break;case 31:Al(t,n,s,c);break;case 13:Al(t,n,s,c);break;case 23:break;case 22:x=n.stateNode,k=n.alternate,n.memoizedState!==null?x._visibility&2?Al(t,n,s,c):Ys(t,n):x._visibility&2?Al(t,n,s,c):(x._visibility|=2,Ai(t,n,s,c,(n.subtreeFlags&10256)!==0||!1)),m&2048&&Af(k,n);break;case 24:Al(t,n,s,c),m&2048&&Ef(n.alternate,n);break;default:Al(t,n,s,c)}}function Ai(t,n,s,c,m){for(m=m&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var x=t,k=n,S=s,U=c,ne=k.flags;switch(k.tag){case 0:case 11:case 15:Ai(x,k,S,U,m),Gs(8,k);break;case 23:break;case 22:var de=k.stateNode;k.memoizedState!==null?de._visibility&2?Ai(x,k,S,U,m):Ys(x,k):(de._visibility|=2,Ai(x,k,S,U,m)),m&&ne&2048&&Af(k.alternate,k);break;case 24:Ai(x,k,S,U,m),m&&ne&2048&&Ef(k.alternate,k);break;default:Ai(x,k,S,U,m)}n=n.sibling}}function Ys(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,c=n,m=c.flags;switch(c.tag){case 22:Ys(s,c),m&2048&&Af(c.alternate,c);break;case 24:Ys(s,c),m&2048&&Ef(c.alternate,c);break;default:Ys(s,c)}n=n.sibling}}var Qs=8192;function Ei(t,n,s){if(t.subtreeFlags&Qs)for(t=t.child;t!==null;)Gx(t,n,s),t=t.sibling}function Gx(t,n,s){switch(t.tag){case 26:Ei(t,n,s),t.flags&Qs&&t.memoizedState!==null&&Sj(s,Tl,t.memoizedState,t.memoizedProps);break;case 5:Ei(t,n,s);break;case 3:case 4:var c=Tl;Tl=$c(t.stateNode.containerInfo),Ei(t,n,s),Tl=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Qs,Qs=16777216,Ei(t,n,s),Qs=c):Ei(t,n,s));break;default:Ei(t,n,s)}}function $x(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Xs(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];xn=c,Qx(c,t)}$x(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yx(t),t=t.sibling}function Yx(t){switch(t.tag){case 0:case 11:case 15:Xs(t),t.flags&2048&&Xa(9,t,t.return);break;case 3:Xs(t);break;case 12:Xs(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Oc(t)):Xs(t);break;default:Xs(t)}}function Oc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];xn=c,Qx(c,t)}$x(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Xa(8,n,n.return),Oc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Oc(n));break;default:Oc(n)}t=t.sibling}}function Qx(t,n){for(;xn!==null;){var s=xn;switch(s.tag){case 0:case 11:case 15:Xa(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:zs(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,xn=c;else e:for(s=t;xn!==null;){c=xn;var m=c.sibling,x=c.return;if(Ix(c),c===s){xn=null;break e}if(m!==null){m.return=x,xn=m;break e}xn=x}}}var Uk={getCacheForType:function(t){var n=Cn(an),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return Cn(an).controller.signal}},Hk=typeof WeakMap=="function"?WeakMap:Map,Et=0,It=null,ht=null,kt=0,Mt=0,il=null,Ka=!1,Ri=!1,Rf=!1,xa=0,Wt=0,Za=0,Fr=0,Mf=0,sl=0,Mi=0,Ks=null,Xn=null,zf=!1,Lc=0,Xx=0,Dc=1/0,_c=null,Wa=null,mn=0,Ja=null,zi=null,ga=0,Of=0,Lf=null,Kx=null,Zs=0,Df=null;function ol(){return(Et&2)!==0&&kt!==0?kt&-kt:w.T!==null?Hf():Jr()}function Zx(){if(sl===0)if((kt&536870912)===0||ft){var t=Qt;Qt<<=1,(Qt&3932160)===0&&(Qt=262144),sl=t}else sl=536870912;return t=al.current,t!==null&&(t.flags|=32),sl}function Kn(t,n,s){(t===It&&(Mt===2||Mt===9)||t.cancelPendingCommit!==null)&&(Oi(t,0),er(t,kt,sl,!1)),nt(t,s),((Et&2)===0||t!==It)&&(t===It&&((Et&2)===0&&(Fr|=s),Wt===4&&er(t,kt,sl,!1)),Hl(t))}function Wx(t,n,s){if((Et&6)!==0)throw Error(i(327));var c=!s&&(n&127)===0&&(n&t.expiredLanes)===0||Jt(t,n),m=c?Vk(t,n):Bf(t,n,!0),x=c;do{if(m===0){Ri&&!c&&er(t,n,0,!1);break}else{if(s=t.current.alternate,x&&!Fk(s)){m=Bf(t,n,!1),x=!1;continue}if(m===2){if(x=n,t.errorRecoveryDisabledLanes&x)var k=0;else k=t.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){n=k;e:{var S=t;m=Ks;var U=S.current.memoizedState.isDehydrated;if(U&&(Oi(S,k).flags|=256),k=Bf(S,k,!1),k!==2){if(Rf&&!U){S.errorRecoveryDisabledLanes|=x,Fr|=x,m=4;break e}x=Xn,Xn=m,x!==null&&(Xn===null?Xn=x:Xn.push.apply(Xn,x))}m=k}if(x=!1,m!==2)continue}}if(m===1){Oi(t,0),er(t,n,0,!0);break}e:{switch(c=t,x=m,x){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:er(c,n,sl,!Ka);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(m=Lc+300-Ze(),10<m)){if(er(c,n,sl,!Ka),yt(c,0,!0)!==0)break e;ga=n,c.timeoutHandle=Eg(Jx.bind(null,c,s,Xn,_c,zf,n,sl,Fr,Mi,Ka,x,"Throttled",-0,0),m);break e}Jx(c,s,Xn,_c,zf,n,sl,Fr,Mi,Ka,x,null,-0,0)}}break}while(!0);Hl(t)}function Jx(t,n,s,c,m,x,k,S,U,ne,de,he,ae,ie){if(t.timeoutHandle=-1,he=n.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wl},Gx(n,x,he);var Oe=(x&62914560)===x?Lc-Ze():(x&4194048)===x?Xx-Ze():0;if(Oe=Cj(he,Oe),Oe!==null){ga=x,t.cancelPendingCommit=Oe(sg.bind(null,t,n,x,s,c,m,k,S,U,de,he,null,ae,ie)),er(t,x,k,!ne);return}}sg(t,n,x,s,c,m,k,S,U)}function Fk(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var m=s[c],x=m.getSnapshot;m=m.value;try{if(!Vn(x(),m))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function er(t,n,s,c){n&=~Mf,n&=~Fr,t.suspendedLanes|=n,t.pingedLanes&=~n,c&&(t.warmLanes|=n),c=t.expirationTimes;for(var m=n;0<m;){var x=31-je(m),k=1<<x;c[x]=-1,m&=~k}s!==0&&bn(t,s,n)}function Bc(){return(Et&6)===0?(Ws(0),!1):!0}function _f(){if(ht!==null){if(Mt===0)var t=ht.return;else t=ht,ia=Or=null,Zd(t),Ni=null,Ls=0,t=ht;for(;t!==null;)Rx(t.alternate,t),t=t.return;ht=null}}function Oi(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,oj(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),ga=0,_f(),It=t,ht=s=en(t.current,null),kt=n,Mt=0,il=null,Ka=!1,Ri=Jt(t,n),Rf=!1,Mi=sl=Mf=Fr=Za=Wt=0,Xn=Ks=null,zf=!1,(n&8)!==0&&(n|=n&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=n;0<c;){var m=31-je(c),x=1<<m;n|=t[m],c&=~x}return xa=n,fi(),s}function eg(t,n){ct=null,w.H=Fs,n===ji||n===fc?(n=xh(),Mt=3):n===Pd?(n=xh(),Mt=4):Mt=n===pf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,il=n,ht===null&&(Wt=1,Cc(t,wn(n,t.current)))}function tg(){var t=al.current;return t===null?!0:(kt&4194048)===kt?yl===null:(kt&62914560)===kt||(kt&536870912)!==0?t===yl:!1}function ng(){var t=w.H;return w.H=Fs,t===null?Fs:t}function lg(){var t=w.A;return w.A=Uk,t}function Ic(){Wt=4,Ka||(kt&4194048)!==kt&&al.current!==null||(Ri=!0),(Za&134217727)===0&&(Fr&134217727)===0||It===null||er(It,kt,sl,!1)}function Bf(t,n,s){var c=Et;Et|=2;var m=ng(),x=lg();(It!==t||kt!==n)&&(_c=null,Oi(t,n)),n=!1;var k=Wt;e:do try{if(Mt!==0&&ht!==null){var S=ht,U=il;switch(Mt){case 8:_f(),k=6;break e;case 3:case 2:case 9:case 6:al.current===null&&(n=!0);var ne=Mt;if(Mt=0,il=null,Li(t,S,U,ne),s&&Ri){k=0;break e}break;default:ne=Mt,Mt=0,il=null,Li(t,S,U,ne)}}qk(),k=Wt;break}catch(de){eg(t,de)}while(!0);return n&&t.shellSuspendCounter++,ia=Or=null,Et=c,w.H=m,w.A=x,ht===null&&(It=null,kt=0,fi()),k}function qk(){for(;ht!==null;)ag(ht)}function Vk(t,n){var s=Et;Et|=2;var c=ng(),m=lg();It!==t||kt!==n?(_c=null,Dc=Ze()+500,Oi(t,n)):Ri=Jt(t,n);e:do try{if(Mt!==0&&ht!==null){n=ht;var x=il;t:switch(Mt){case 1:Mt=0,il=null,Li(t,n,x,1);break;case 2:case 9:if(ph(x)){Mt=0,il=null,rg(n);break}n=function(){Mt!==2&&Mt!==9||It!==t||(Mt=7),Hl(t)},x.then(n,n);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:ph(x)?(Mt=0,il=null,rg(n)):(Mt=0,il=null,Li(t,n,x,7));break;case 5:var k=null;switch(ht.tag){case 26:k=ht.memoizedState;case 5:case 27:var S=ht;if(k?Vg(k):S.stateNode.complete){Mt=0,il=null;var U=S.sibling;if(U!==null)ht=U;else{var ne=S.return;ne!==null?(ht=ne,Pc(ne)):ht=null}break t}}Mt=0,il=null,Li(t,n,x,5);break;case 6:Mt=0,il=null,Li(t,n,x,6);break;case 8:_f(),Wt=6;break e;default:throw Error(i(462))}}Gk();break}catch(de){eg(t,de)}while(!0);return ia=Or=null,w.H=c,w.A=m,Et=s,ht!==null?0:(It=null,kt=0,fi(),Wt)}function Gk(){for(;ht!==null&&!et();)ag(ht)}function ag(t){var n=Ax(t.alternate,t,xa);t.memoizedProps=t.pendingProps,n===null?Pc(t):ht=n}function rg(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=jx(s,n,n.pendingProps,n.type,void 0,kt);break;case 11:n=jx(s,n,n.pendingProps,n.type.render,n.ref,kt);break;case 5:Zd(n);default:Rx(s,n),n=ht=As(n,xa),n=Ax(s,n,xa)}t.memoizedProps=t.pendingProps,n===null?Pc(t):ht=n}function Li(t,n,s,c){ia=Or=null,Zd(n),Ni=null,Ls=0;var m=n.return;try{if(Ok(t,m,n,s,kt)){Wt=1,Cc(t,wn(s,t.current)),ht=null;return}}catch(x){if(m!==null)throw ht=m,x;Wt=1,Cc(t,wn(s,t.current)),ht=null;return}n.flags&32768?(ft||c===1?t=!0:Ri||(kt&536870912)!==0?t=!1:(Ka=t=!0,(c===2||c===9||c===3||c===6)&&(c=al.current,c!==null&&c.tag===13&&(c.flags|=16384))),ig(n,t)):Pc(n)}function Pc(t){var n=t;do{if((n.flags&32768)!==0){ig(n,Ka);return}t=n.return;var s=_k(n.alternate,n,xa);if(s!==null){ht=s;return}if(n=n.sibling,n!==null){ht=n;return}ht=n=t}while(n!==null);Wt===0&&(Wt=5)}function ig(t,n){do{var s=Bk(t.alternate,t);if(s!==null){s.flags&=32767,ht=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){ht=t;return}ht=t=s}while(t!==null);Wt=6,ht=null}function sg(t,n,s,c,m,x,k,S,U){t.cancelPendingCommit=null;do Uc();while(mn!==0);if((Et&6)!==0)throw Error(i(327));if(n!==null){if(n===t.current)throw Error(i(177));if(x=n.lanes|n.childLanes,x|=zn,Xt(t,s,x,k,S,U),t===It&&(ht=It=null,kt=0),zi=n,Ja=t,ga=s,Of=x,Lf=m,Kx=c,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Xk(Ce,function(){return fg(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=w.T,w.T=null,m=Y.p,Y.p=2,k=Et,Et|=4;try{Ik(t,n,s)}finally{Et=k,Y.p=m,w.T=c}}mn=1,og(),cg(),ug()}}function og(){if(mn===1){mn=0;var t=Ja,n=zi,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=w.T,w.T=null;var c=Y.p;Y.p=2;var m=Et;Et|=4;try{Fx(n,t);var x=Xf,k=Jo(t.containerInfo),S=x.focusedElem,U=x.selectionRange;if(k!==S&&S&&S.ownerDocument&&ks(S.ownerDocument.documentElement,S)){if(U!==null&&ci(S)){var ne=U.start,de=U.end;if(de===void 0&&(de=ne),"selectionStart"in S)S.selectionStart=ne,S.selectionEnd=Math.min(de,S.value.length);else{var he=S.ownerDocument||document,ae=he&&he.defaultView||window;if(ae.getSelection){var ie=ae.getSelection(),Oe=S.textContent.length,Qe=Math.min(U.start,Oe),_t=U.end===void 0?Qe:Math.min(U.end,Oe);!ie.extend&&Qe>_t&&(k=_t,_t=Qe,Qe=k);var K=Wo(S,Qe),G=Wo(S,_t);if(K&&G&&(ie.rangeCount!==1||ie.anchorNode!==K.node||ie.anchorOffset!==K.offset||ie.focusNode!==G.node||ie.focusOffset!==G.offset)){var te=he.createRange();te.setStart(K.node,K.offset),ie.removeAllRanges(),Qe>_t?(ie.addRange(te),ie.extend(G.node,G.offset)):(te.setEnd(G.node,G.offset),ie.addRange(te))}}}}for(he=[],ie=S;ie=ie.parentNode;)ie.nodeType===1&&he.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<he.length;S++){var fe=he[S];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Wc=!!Qf,Xf=Qf=null}finally{Et=m,Y.p=c,w.T=s}}t.current=n,mn=2}}function cg(){if(mn===2){mn=0;var t=Ja,n=zi,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=w.T,w.T=null;var c=Y.p;Y.p=2;var m=Et;Et|=4;try{Bx(t,n.alternate,n)}finally{Et=m,Y.p=c,w.T=s}}mn=3}}function ug(){if(mn===4||mn===3){mn=0,Se();var t=Ja,n=zi,s=ga,c=Kx;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?mn=5:(mn=0,zi=Ja=null,dg(t,t.pendingLanes));var m=t.pendingLanes;if(m===0&&(Wa=null),yn(s),n=n.stateNode,V&&typeof V.onCommitFiberRoot=="function")try{V.onCommitFiberRoot(Ee,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=w.T,m=Y.p,Y.p=2,w.T=null;try{for(var x=t.onRecoverableError,k=0;k<c.length;k++){var S=c[k];x(S.value,{componentStack:S.stack})}}finally{w.T=n,Y.p=m}}(ga&3)!==0&&Uc(),Hl(t),m=t.pendingLanes,(s&261930)!==0&&(m&42)!==0?t===Df?Zs++:(Zs=0,Df=t):Zs=0,Ws(0)}}function dg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,zs(n)))}function Uc(){return og(),cg(),ug(),fg()}function fg(){if(mn!==5)return!1;var t=Ja,n=Of;Of=0;var s=yn(ga),c=w.T,m=Y.p;try{Y.p=32>s?32:s,w.T=null,s=Lf,Lf=null;var x=Ja,k=ga;if(mn=0,zi=Ja=null,ga=0,(Et&6)!==0)throw Error(i(331));var S=Et;if(Et|=4,Yx(x.current),Vx(x,x.current,k,s),Et=S,Ws(0,!1),V&&typeof V.onPostCommitFiberRoot=="function")try{V.onPostCommitFiberRoot(Ee,x)}catch{}return!0}finally{Y.p=m,w.T=c,dg(t,n)}}function mg(t,n,s){n=wn(s,n),n=mf(t.stateNode,n,2),t=$a(t,n,2),t!==null&&(nt(t,2),Hl(t))}function zt(t,n,s){if(t.tag===3)mg(t,t,s);else for(;n!==null;){if(n.tag===3){mg(n,t,s);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Wa===null||!Wa.has(c))){t=wn(s,t),s=px(2),c=$a(n,s,2),c!==null&&(hx(s,c,n,t),nt(c,2),Hl(c));break}}n=n.return}}function If(t,n,s){var c=t.pingCache;if(c===null){c=t.pingCache=new Hk;var m=new Set;c.set(n,m)}else m=c.get(n),m===void 0&&(m=new Set,c.set(n,m));m.has(s)||(Rf=!0,m.add(s),t=$k.bind(null,t,n,s),n.then(t,t))}function $k(t,n,s){var c=t.pingCache;c!==null&&c.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,It===t&&(kt&s)===s&&(Wt===4||Wt===3&&(kt&62914560)===kt&&300>Ze()-Lc?(Et&2)===0&&Oi(t,0):Mf|=s,Mi===kt&&(Mi=0)),Hl(t)}function pg(t,n){n===0&&(n=Me()),t=la(t,n),t!==null&&(nt(t,n),Hl(t))}function Yk(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),pg(t,s)}function Qk(t,n){var s=0;switch(t.tag){case 31:case 13:var c=t.stateNode,m=t.memoizedState;m!==null&&(s=m.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(n),pg(t,s)}function Xk(t,n){return We(t,n)}var Hc=null,Di=null,Pf=!1,Fc=!1,Uf=!1,tr=0;function Hl(t){t!==Di&&t.next===null&&(Di===null?Hc=Di=t:Di=Di.next=t),Fc=!0,Pf||(Pf=!0,Zk())}function Ws(t,n){if(!Uf&&Fc){Uf=!0;do for(var s=!1,c=Hc;c!==null;){if(t!==0){var m=c.pendingLanes;if(m===0)var x=0;else{var k=c.suspendedLanes,S=c.pingedLanes;x=(1<<31-je(42|t)+1)-1,x&=m&~(k&~S),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,bg(c,x))}else x=kt,x=yt(c,c===It?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||Jt(c,x)||(s=!0,bg(c,x));c=c.next}while(s);Uf=!1}}function Kk(){hg()}function hg(){Fc=Pf=!1;var t=0;tr!==0&&sj()&&(t=tr);for(var n=Ze(),s=null,c=Hc;c!==null;){var m=c.next,x=xg(c,n);x===0?(c.next=null,s===null?Hc=m:s.next=m,m===null&&(Di=s)):(s=c,(t!==0||(x&3)!==0)&&(Fc=!0)),c=m}mn!==0&&mn!==5||Ws(t),tr!==0&&(tr=0)}function xg(t,n){for(var s=t.suspendedLanes,c=t.pingedLanes,m=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var k=31-je(x),S=1<<k,U=m[k];U===-1?((S&s)===0||(S&c)!==0)&&(m[k]=se(S,n)):U<=n&&(t.expiredLanes|=S),x&=~S}if(n=It,s=kt,s=yt(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,s===0||t===n&&(Mt===2||Mt===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&we(c),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Jt(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(c!==null&&we(c),yn(s)){case 2:case 8:s=ge;break;case 32:s=Ce;break;case 268435456:s=Xe;break;default:s=Ce}return c=gg.bind(null,t),s=We(s,c),t.callbackPriority=n,t.callbackNode=s,n}return c!==null&&c!==null&&we(c),t.callbackPriority=2,t.callbackNode=null,2}function gg(t,n){if(mn!==0&&mn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Uc()&&t.callbackNode!==s)return null;var c=kt;return c=yt(t,t===It?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Wx(t,c,n),xg(t,Ze()),t.callbackNode!=null&&t.callbackNode===s?gg.bind(null,t):null)}function bg(t,n){if(Uc())return null;Wx(t,n,!0)}function Zk(){cj(function(){(Et&6)!==0?We(re,Kk):hg()})}function Hf(){if(tr===0){var t=vi;t===0&&(t=St,St<<=1,(St&261888)===0&&(St=256)),tr=t}return tr}function yg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:li(""+t)}function vg(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function Wk(t,n,s,c,m){if(n==="submit"&&s&&s.stateNode===m){var x=yg((m[fn]||null).action),k=c.submitter;k&&(n=(n=k[fn]||null)?yg(n.formAction):k.getAttribute("formAction"),n!==null&&(x=n,k=null));var S=new Ma("action","action",null,c,m);t.push({event:S,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(tr!==0){var U=k?vg(m,k):new FormData(m);sf(s,{pending:!0,data:U,method:m.method,action:x},null,U)}}else typeof x=="function"&&(S.preventDefault(),U=k?vg(m,k):new FormData(m),sf(s,{pending:!0,data:U,method:m.method,action:x},x,U))},currentTarget:m}]})}}for(var Ff=0;Ff<Ss.length;Ff++){var qf=Ss[Ff],Jk=qf.toLowerCase(),ej=qf[0].toUpperCase()+qf.slice(1);nl(Jk,"on"+ej)}nl(nc,"onAnimationEnd"),nl(lc,"onAnimationIteration"),nl(Rr,"onAnimationStart"),nl("dblclick","onDoubleClick"),nl("focusin","onFocus"),nl("focusout","onBlur"),nl(Rd,"onTransitionRun"),nl(ui,"onTransitionStart"),nl(Md,"onTransitionCancel"),nl(di,"onTransitionEnd"),Xl("onMouseEnter",["mouseout","mouseover"]),Xl("onMouseLeave",["mouseout","mouseover"]),Xl("onPointerEnter",["pointerout","pointerover"]),Xl("onPointerLeave",["pointerout","pointerover"]),Bl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Js="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(" "),tj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Js));function kg(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var c=t[s],m=c.event;c=c.listeners;e:{var x=void 0;if(n)for(var k=c.length-1;0<=k;k--){var S=c[k],U=S.instance,ne=S.currentTarget;if(S=S.listener,U!==x&&m.isPropagationStopped())break e;x=S,m.currentTarget=ne;try{x(m)}catch(de){Mr(de)}m.currentTarget=null,x=U}else for(k=0;k<c.length;k++){if(S=c[k],U=S.instance,ne=S.currentTarget,S=S.listener,U!==x&&m.isPropagationStopped())break e;x=S,m.currentTarget=ne;try{x(m)}catch(de){Mr(de)}m.currentTarget=null,x=U}}}}function xt(t,n){var s=n[Yl];s===void 0&&(s=n[Yl]=new Set);var c=t+"__bubble";s.has(c)||(jg(n,t,2,!1),s.add(c))}function Vf(t,n,s){var c=0;n&&(c|=4),jg(s,t,c,n)}var qc="_reactListening"+Math.random().toString(36).slice(2);function Gf(t){if(!t[qc]){t[qc]=!0,yr.forEach(function(s){s!=="selectionchange"&&(tj.has(s)||Vf(s,!1,t),Vf(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[qc]||(n[qc]=!0,Vf("selectionchange",!1,n))}}function jg(t,n,s,c){switch(Zg(n)){case 2:var m=Ej;break;case 8:m=Rj;break;default:m=im}s=m.bind(null,n,s,t),m=void 0,!jr||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),c?m!==void 0?t.addEventListener(n,s,{capture:!0,passive:m}):t.addEventListener(n,s,!0):m!==void 0?t.addEventListener(n,s,{passive:m}):t.addEventListener(n,s,!1)}function $f(t,n,s,c,m){var x=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var k=c.tag;if(k===3||k===4){var S=c.stateNode.containerInfo;if(S===m)break;if(k===4)for(k=c.return;k!==null;){var U=k.tag;if((U===3||U===4)&&k.stateNode.containerInfo===m)return;k=k.return}for(;S!==null;){if(k=ml(S),k===null)return;if(U=k.tag,U===5||U===6||U===26||U===27){c=x=k;continue e}S=S.parentNode}}c=c.return}cs(function(){var ne=x,de=os(s),he=[];e:{var ae=ac.get(t);if(ae!==void 0){var ie=Ma,Oe=t;switch(t){case"keypress":if(us(s)===0)break e;case"keydown":case"keyup":ie=fd;break;case"focusin":Oe="focus",ie=ms;break;case"focusout":Oe="blur",ie=ms;break;case"beforeblur":case"afterblur":ie=ms;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Fo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=ii;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=hd;break;case nc:case lc:case Rr:ie=ad;break;case di:ie=xd;break;case"scroll":case"scrollend":ie=Ho;break;case"wheel":ie=bd;break;case"copy":case"cut":case"paste":ie=rd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=qo;break;case"toggle":case"beforetoggle":ie=vd}var Qe=(n&4)!==0,_t=!Qe&&(t==="scroll"||t==="scrollend"),K=Qe?ae!==null?ae+"Capture":null:ae;Qe=[];for(var G=ne,te;G!==null;){var fe=G;if(te=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||te===null||K===null||(fe=Wl(G,K),fe!=null&&Qe.push(eo(G,fe,te))),_t)break;G=G.return}0<Qe.length&&(ae=new ie(ae,Oe,null,s,de),he.push({event:ae,listeners:Qe}))}}if((n&7)===0){e:{if(ae=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",ae&&s!==ss&&(Oe=s.relatedTarget||s.fromElement)&&(ml(Oe)||Oe[Ft]))break e;if((ie||ae)&&(ae=de.window===de?de:(ae=de.ownerDocument)?ae.defaultView||ae.parentWindow:window,ie?(Oe=s.relatedTarget||s.toElement,ie=ne,Oe=Oe?ml(Oe):null,Oe!==null&&(_t=u(Oe),Qe=Oe.tag,Oe!==_t||Qe!==5&&Qe!==27&&Qe!==6)&&(Oe=null)):(ie=null,Oe=ne),ie!==Oe)){if(Qe=Fo,fe="onMouseLeave",K="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(Qe=qo,fe="onPointerLeave",K="onPointerEnter",G="pointer"),_t=ie==null?ae:Ca(ie),te=Oe==null?ae:Ca(Oe),ae=new Qe(fe,G+"leave",ie,s,de),ae.target=_t,ae.relatedTarget=te,fe=null,ml(de)===ne&&(Qe=new Qe(K,G+"enter",Oe,s,de),Qe.target=te,Qe.relatedTarget=_t,fe=Qe),_t=fe,ie&&Oe)t:{for(Qe=nj,K=ie,G=Oe,te=0,fe=K;fe;fe=Qe(fe))te++;fe=0;for(var Ve=G;Ve;Ve=Qe(Ve))fe++;for(;0<te-fe;)K=Qe(K),te--;for(;0<fe-te;)G=Qe(G),fe--;for(;te--;){if(K===G||G!==null&&K===G.alternate){Qe=K;break t}K=Qe(K),G=Qe(G)}Qe=null}else Qe=null;ie!==null&&Ng(he,ae,ie,Qe,!1),Oe!==null&&_t!==null&&Ng(he,_t,Oe,Qe,!0)}}e:{if(ae=ne?Ca(ne):window,ie=ae.nodeName&&ae.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ae.type==="file")var Ct=Yo;else if(Go(ae))if(Qo)Ct=Td;else{Ct=Sd;var Pe=wd}else ie=ae.nodeName,!ie||ie.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&is(ne.elementType)&&(Ct=Yo):Ct=Cd;if(Ct&&(Ct=Ct(t,ne))){$o(he,Ct,s,de);break e}Pe&&Pe(t,ae,ne),t==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&Aa(ae,"number",ae.value)}switch(Pe=ne?Ca(ne):window,t){case"focusin":(Go(Pe)||Pe.contentEditable==="true")&&(Da=Pe,js=ne,Er=null);break;case"focusout":Er=js=Da=null;break;case"mousedown":Ns=!0;break;case"contextmenu":case"mouseup":case"dragend":Ns=!1,ec(he,s,de);break;case"selectionchange":if(Ed)break;case"keydown":case"keyup":ec(he,s,de)}var ut;if(hn)e:{switch(t){case"compositionstart":var jt="onCompositionStart";break e;case"compositionend":jt="onCompositionEnd";break e;case"compositionupdate":jt="onCompositionUpdate";break e}jt=void 0}else La?na(t,s)&&(jt="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(jt="onCompositionStart");jt&&(qn&&s.locale!=="ko"&&(La||jt!=="onCompositionStart"?jt==="onCompositionEnd"&&La&&(ut=Uo()):(Rn=de,ea="value"in Rn?Rn.value:Rn.textContent,La=!0)),Pe=Vc(ne,jt),0<Pe.length&&(jt=new si(jt,t,null,s,de),he.push({event:jt,listeners:Pe}),ut?jt.data=ut:(ut=Sr(s),ut!==null&&(jt.data=ut)))),(ut=gs?kd(t,s):jd(t,s))&&(jt=Vc(ne,"onBeforeInput"),0<jt.length&&(Pe=new si("onBeforeInput","beforeinput",null,s,de),he.push({event:Pe,listeners:jt}),Pe.data=ut)),Wk(he,t,ne,s,de)}kg(he,n)})}function eo(t,n,s){return{instance:t,listener:n,currentTarget:s}}function Vc(t,n){for(var s=n+"Capture",c=[];t!==null;){var m=t,x=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||x===null||(m=Wl(t,s),m!=null&&c.unshift(eo(t,m,x)),m=Wl(t,n),m!=null&&c.push(eo(t,m,x))),t.tag===3)return c;t=t.return}return[]}function nj(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ng(t,n,s,c,m){for(var x=n._reactName,k=[];s!==null&&s!==c;){var S=s,U=S.alternate,ne=S.stateNode;if(S=S.tag,U!==null&&U===c)break;S!==5&&S!==26&&S!==27||ne===null||(U=ne,m?(ne=Wl(s,x),ne!=null&&k.unshift(eo(s,ne,U))):m||(ne=Wl(s,x),ne!=null&&k.push(eo(s,ne,U)))),s=s.return}k.length!==0&&t.push({event:n,listeners:k})}var lj=/\r\n?/g,aj=/\u0000|\uFFFD/g;function wg(t){return(typeof t=="string"?t:""+t).replace(lj,`
9
+ `).replace(aj,"")}function Sg(t,n){return n=wg(n),wg(t)===n}function Dt(t,n,s,c,m,x){switch(s){case"children":typeof c=="string"?n==="body"||n==="textarea"&&c===""||Zl(t,c):(typeof c=="number"||typeof c=="bigint")&&n!=="body"&&Zl(t,""+c);break;case"className":Il(t,"class",c);break;case"tabIndex":Il(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Il(t,s,c);break;case"style":Bo(t,c,x);break;case"data":if(n!=="object"){Il(t,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=li(""+c),t.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(s==="formAction"?(n!=="input"&&Dt(t,n,"name",m.name,m,null),Dt(t,n,"formEncType",m.formEncType,m,null),Dt(t,n,"formMethod",m.formMethod,m,null),Dt(t,n,"formTarget",m.formTarget,m,null)):(Dt(t,n,"encType",m.encType,m,null),Dt(t,n,"method",m.method,m,null),Dt(t,n,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(s);break}c=li(""+c),t.setAttribute(s,c);break;case"onClick":c!=null&&(t.onclick=wl);break;case"onScroll":c!=null&&xt("scroll",t);break;case"onScrollEnd":c!=null&&xt("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}s=li(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""+c):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":c===!0?t.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(s,c):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(s,c):t.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(s):t.setAttribute(s,c);break;case"popover":xt("beforetoggle",t),xt("toggle",t),Kl(t,"popover",c);break;case"xlinkActuate":Fn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Fn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Fn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Fn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Fn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Fn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Kl(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ju.get(s)||s,Kl(t,s,c))}}function Yf(t,n,s,c,m,x){switch(s){case"style":Bo(t,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(i(60));t.innerHTML=s}}break;case"children":typeof c=="string"?Zl(t,c):(typeof c=="number"||typeof c=="bigint")&&Zl(t,""+c);break;case"onScroll":c!=null&&xt("scroll",t);break;case"onScrollEnd":c!=null&&xt("scrollend",t);break;case"onClick":c!=null&&(t.onclick=wl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vr.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(m=s.endsWith("Capture"),n=s.slice(2,m?s.length-7:void 0),x=t[fn]||null,x=x!=null?x[s]:null,typeof x=="function"&&t.removeEventListener(n,x,m),typeof c=="function")){typeof x!="function"&&x!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,c,m);break e}s in t?t[s]=c:c===!0?t.setAttribute(s,""):Kl(t,s,c)}}}function An(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xt("error",t),xt("load",t);var c=!1,m=!1,x;for(x in s)if(s.hasOwnProperty(x)){var k=s[x];if(k!=null)switch(x){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Dt(t,n,x,k,s,null)}}m&&Dt(t,n,"srcSet",s.srcSet,s,null),c&&Dt(t,n,"src",s.src,s,null);return;case"input":xt("invalid",t);var S=x=k=m=null,U=null,ne=null;for(c in s)if(s.hasOwnProperty(c)){var de=s[c];if(de!=null)switch(c){case"name":m=de;break;case"type":k=de;break;case"checked":U=de;break;case"defaultChecked":ne=de;break;case"value":x=de;break;case"defaultValue":S=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(i(137,n));break;default:Dt(t,n,c,de,s,null)}}Bn(t,x,S,U,ne,k,m,!1);return;case"select":xt("invalid",t),c=k=x=null;for(m in s)if(s.hasOwnProperty(m)&&(S=s[m],S!=null))switch(m){case"value":x=S;break;case"defaultValue":k=S;break;case"multiple":c=S;default:Dt(t,n,m,S,s,null)}n=x,s=k,t.multiple=!!c,n!=null?kr(t,!!c,n,!1):s!=null&&kr(t,!!c,s,!0);return;case"textarea":xt("invalid",t),x=m=c=null;for(k in s)if(s.hasOwnProperty(k)&&(S=s[k],S!=null))switch(k){case"value":c=S;break;case"defaultValue":m=S;break;case"children":x=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:Dt(t,n,k,S,s,null)}_o(t,c,m,x);return;case"option":for(U in s)s.hasOwnProperty(U)&&(c=s[U],c!=null)&&(U==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":Dt(t,n,U,c,s,null));return;case"dialog":xt("beforetoggle",t),xt("toggle",t),xt("cancel",t),xt("close",t);break;case"iframe":case"object":xt("load",t);break;case"video":case"audio":for(c=0;c<Js.length;c++)xt(Js[c],t);break;case"image":xt("error",t),xt("load",t);break;case"details":xt("toggle",t);break;case"embed":case"source":case"link":xt("error",t),xt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in s)if(s.hasOwnProperty(ne)&&(c=s[ne],c!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Dt(t,n,ne,c,s,null)}return;default:if(is(n)){for(de in s)s.hasOwnProperty(de)&&(c=s[de],c!==void 0&&Yf(t,n,de,c,s,void 0));return}}for(S in s)s.hasOwnProperty(S)&&(c=s[S],c!=null&&Dt(t,n,S,c,s,null))}function rj(t,n,s,c){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,x=null,k=null,S=null,U=null,ne=null,de=null;for(ie in s){var he=s[ie];if(s.hasOwnProperty(ie)&&he!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":U=he;default:c.hasOwnProperty(ie)||Dt(t,n,ie,null,c,he)}}for(var ae in c){var ie=c[ae];if(he=s[ae],c.hasOwnProperty(ae)&&(ie!=null||he!=null))switch(ae){case"type":x=ie;break;case"name":m=ie;break;case"checked":ne=ie;break;case"defaultChecked":de=ie;break;case"value":k=ie;break;case"defaultValue":S=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,n));break;default:ie!==he&&Dt(t,n,ae,ie,c,he)}}Ta(t,k,S,U,ne,de,x,m);return;case"select":ie=k=S=ae=null;for(x in s)if(U=s[x],s.hasOwnProperty(x)&&U!=null)switch(x){case"value":break;case"multiple":ie=U;default:c.hasOwnProperty(x)||Dt(t,n,x,null,c,U)}for(m in c)if(x=c[m],U=s[m],c.hasOwnProperty(m)&&(x!=null||U!=null))switch(m){case"value":ae=x;break;case"defaultValue":S=x;break;case"multiple":k=x;default:x!==U&&Dt(t,n,m,x,c,U)}n=S,s=k,c=ie,ae!=null?kr(t,!!s,ae,!1):!!c!=!!s&&(n!=null?kr(t,!!s,n,!0):kr(t,!!s,s?[]:"",!1));return;case"textarea":ie=ae=null;for(S in s)if(m=s[S],s.hasOwnProperty(S)&&m!=null&&!c.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Dt(t,n,S,null,c,m)}for(k in c)if(m=c[k],x=s[k],c.hasOwnProperty(k)&&(m!=null||x!=null))switch(k){case"value":ae=m;break;case"defaultValue":ie=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(i(91));break;default:m!==x&&Dt(t,n,k,m,c,x)}Zu(t,ae,ie);return;case"option":for(var Oe in s)ae=s[Oe],s.hasOwnProperty(Oe)&&ae!=null&&!c.hasOwnProperty(Oe)&&(Oe==="selected"?t.selected=!1:Dt(t,n,Oe,null,c,ae));for(U in c)ae=c[U],ie=s[U],c.hasOwnProperty(U)&&ae!==ie&&(ae!=null||ie!=null)&&(U==="selected"?t.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":Dt(t,n,U,ae,c,ie));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 Qe in s)ae=s[Qe],s.hasOwnProperty(Qe)&&ae!=null&&!c.hasOwnProperty(Qe)&&Dt(t,n,Qe,null,c,ae);for(ne in c)if(ae=c[ne],ie=s[ne],c.hasOwnProperty(ne)&&ae!==ie&&(ae!=null||ie!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,n));break;default:Dt(t,n,ne,ae,c,ie)}return;default:if(is(n)){for(var _t in s)ae=s[_t],s.hasOwnProperty(_t)&&ae!==void 0&&!c.hasOwnProperty(_t)&&Yf(t,n,_t,void 0,c,ae);for(de in c)ae=c[de],ie=s[de],!c.hasOwnProperty(de)||ae===ie||ae===void 0&&ie===void 0||Yf(t,n,de,ae,c,ie);return}}for(var K in s)ae=s[K],s.hasOwnProperty(K)&&ae!=null&&!c.hasOwnProperty(K)&&Dt(t,n,K,null,c,ae);for(he in c)ae=c[he],ie=s[he],!c.hasOwnProperty(he)||ae===ie||ae==null&&ie==null||Dt(t,n,he,ae,c,ie)}function Cg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ij(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var m=s[c],x=m.transferSize,k=m.initiatorType,S=m.duration;if(x&&S&&Cg(k)){for(k=0,S=m.responseEnd,c+=1;c<s.length;c++){var U=s[c],ne=U.startTime;if(ne>S)break;var de=U.transferSize,he=U.initiatorType;de&&Cg(he)&&(U=U.responseEnd,k+=de*(U<S?1:(S-ne)/(U-ne)))}if(--c,n+=8*(x+k)/(m.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Qf=null,Xf=null;function Gc(t){return t.nodeType===9?t:t.ownerDocument}function Tg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ag(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Kf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Zf=null;function sj(){var t=window.event;return t&&t.type==="popstate"?t===Zf?!1:(Zf=t,!0):(Zf=null,!1)}var Eg=typeof setTimeout=="function"?setTimeout:void 0,oj=typeof clearTimeout=="function"?clearTimeout:void 0,Rg=typeof Promise=="function"?Promise:void 0,cj=typeof queueMicrotask=="function"?queueMicrotask:typeof Rg<"u"?function(t){return Rg.resolve(null).then(t).catch(uj)}:Eg;function uj(t){setTimeout(function(){throw t})}function nr(t){return t==="head"}function Mg(t,n){var s=n,c=0;do{var m=s.nextSibling;if(t.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"||s==="/&"){if(c===0){t.removeChild(m),Pi(n);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")to(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,to(s);for(var x=s.firstChild;x;){var k=x.nextSibling,S=x.nodeName;x[Jn]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=k}}else s==="body"&&to(t.ownerDocument.body);s=m}while(s);Pi(n)}function zg(t,n){var s=t;t=0;do{var c=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=c}while(s)}function Wf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Wf(s),Ll(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function dj(t,n,s,c){for(;t.nodeType===1;){var m=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Jn])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==m.rel||t.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||t.getAttribute("title")!==(m.title==null?null:m.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(m.src==null?null:m.src)||t.getAttribute("type")!==(m.type==null?null:m.type)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var x=m.name==null?null:""+m.name;if(m.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=vl(t.nextSibling),t===null)break}return null}function fj(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=vl(t.nextSibling),t===null))return null;return t}function Og(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=vl(t.nextSibling),t===null))return null;return t}function Jf(t){return t.data==="$?"||t.data==="$~"}function em(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function mj(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var c=function(){n(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function vl(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var tm=null;function Lg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return vl(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function Dg(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function _g(t,n,s){switch(n=Gc(s),t){case"html":if(t=n.documentElement,!t)throw Error(i(452));return t;case"head":if(t=n.head,!t)throw Error(i(453));return t;case"body":if(t=n.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function to(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ll(t)}var kl=new Map,Bg=new Set;function $c(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ba=Y.d;Y.d={f:pj,r:hj,D:xj,C:gj,L:bj,m:yj,X:kj,S:vj,M:jj};function pj(){var t=ba.f(),n=Bc();return t||n}function hj(t){var n=Dl(t);n!==null&&n.tag===5&&n.type==="form"?ex(n):ba.r(t)}var _i=typeof document>"u"?null:document;function Ig(t,n,s){var c=_i;if(c&&typeof n=="string"&&n){var m=kn(n);m='link[rel="'+t+'"][href="'+m+'"]',typeof s=="string"&&(m+='[crossorigin="'+s+'"]'),Bg.has(m)||(Bg.add(m),t={rel:t,crossOrigin:s,href:n},c.querySelector(m)===null&&(n=c.createElement("link"),An(n,"link",t),qt(n),c.head.appendChild(n)))}}function xj(t){ba.D(t),Ig("dns-prefetch",t,null)}function gj(t,n){ba.C(t,n),Ig("preconnect",t,n)}function bj(t,n,s){ba.L(t,n,s);var c=_i;if(c&&t&&n){var m='link[rel="preload"][as="'+kn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(m+='[imagesrcset="'+kn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(m+='[imagesizes="'+kn(s.imageSizes)+'"]')):m+='[href="'+kn(t)+'"]';var x=m;switch(n){case"style":x=Bi(t);break;case"script":x=Ii(t)}kl.has(x)||(t=b({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),kl.set(x,t),c.querySelector(m)!==null||n==="style"&&c.querySelector(no(x))||n==="script"&&c.querySelector(lo(x))||(n=c.createElement("link"),An(n,"link",t),qt(n),c.head.appendChild(n)))}}function yj(t,n){ba.m(t,n);var s=_i;if(s&&t){var c=n&&typeof n.as=="string"?n.as:"script",m='link[rel="modulepreload"][as="'+kn(c)+'"][href="'+kn(t)+'"]',x=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ii(t)}if(!kl.has(x)&&(t=b({rel:"modulepreload",href:t},n),kl.set(x,t),s.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(lo(x)))return}c=s.createElement("link"),An(c,"link",t),qt(c),s.head.appendChild(c)}}}function vj(t,n,s){ba.S(t,n,s);var c=_i;if(c&&t){var m=_l(c).hoistableStyles,x=Bi(t);n=n||"default";var k=m.get(x);if(!k){var S={loading:0,preload:null};if(k=c.querySelector(no(x)))S.loading=5;else{t=b({rel:"stylesheet",href:t,"data-precedence":n},s),(s=kl.get(x))&&nm(t,s);var U=k=c.createElement("link");qt(U),An(U,"link",t),U._p=new Promise(function(ne,de){U.onload=ne,U.onerror=de}),U.addEventListener("load",function(){S.loading|=1}),U.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Yc(k,n,c)}k={type:"stylesheet",instance:k,count:1,state:S},m.set(x,k)}}}function kj(t,n){ba.X(t,n);var s=_i;if(s&&t){var c=_l(s).hoistableScripts,m=Ii(t),x=c.get(m);x||(x=s.querySelector(lo(m)),x||(t=b({src:t,async:!0},n),(n=kl.get(m))&&lm(t,n),x=s.createElement("script"),qt(x),An(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function jj(t,n){ba.M(t,n);var s=_i;if(s&&t){var c=_l(s).hoistableScripts,m=Ii(t),x=c.get(m);x||(x=s.querySelector(lo(m)),x||(t=b({src:t,async:!0,type:"module"},n),(n=kl.get(m))&&lm(t,n),x=s.createElement("script"),qt(x),An(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function Pg(t,n,s,c){var m=(m=ce.current)?$c(m):null;if(!m)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=Bi(s.href),s=_l(m).hoistableStyles,c=s.get(n),c||(c={type:"style",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Bi(s.href);var x=_l(m).hoistableStyles,k=x.get(t);if(k||(m=m.ownerDocument||m,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,k),(x=m.querySelector(no(t)))&&!x._p&&(k.instance=x,k.state.loading=5),kl.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},kl.set(t,s),x||Nj(m,t,s,k.state))),n&&c===null)throw Error(i(528,""));return k}if(n&&c!==null)throw Error(i(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ii(s),s=_l(m).hoistableScripts,c=s.get(n),c||(c={type:"script",instance:null,count:0,state:null},s.set(n,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Bi(t){return'href="'+kn(t)+'"'}function no(t){return'link[rel="stylesheet"]['+t+"]"}function Ug(t){return b({},t,{"data-precedence":t.precedence,precedence:null})}function Nj(t,n,s,c){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?c.loading=1:(n=t.createElement("link"),c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2}),An(n,"link",s),qt(n),t.head.appendChild(n))}function Ii(t){return'[src="'+kn(t)+'"]'}function lo(t){return"script[async]"+t}function Hg(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var c=t.querySelector('style[data-href~="'+kn(s.href)+'"]');if(c)return n.instance=c,qt(c),c;var m=b({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),qt(c),An(c,"style",m),Yc(c,s.precedence,t),n.instance=c;case"stylesheet":m=Bi(s.href);var x=t.querySelector(no(m));if(x)return n.state.loading|=4,n.instance=x,qt(x),x;c=Ug(s),(m=kl.get(m))&&nm(c,m),x=(t.ownerDocument||t).createElement("link"),qt(x);var k=x;return k._p=new Promise(function(S,U){k.onload=S,k.onerror=U}),An(x,"link",c),n.state.loading|=4,Yc(x,s.precedence,t),n.instance=x;case"script":return x=Ii(s.src),(m=t.querySelector(lo(x)))?(n.instance=m,qt(m),m):(c=s,(m=kl.get(x))&&(c=b({},s),lm(c,m)),t=t.ownerDocument||t,m=t.createElement("script"),qt(m),An(m,"link",c),t.head.appendChild(m),n.instance=m);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(c=n.instance,n.state.loading|=4,Yc(c,s.precedence,t));return n.instance}function Yc(t,n,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,x=m,k=0;k<c.length;k++){var S=c[k];if(S.dataset.precedence===n)x=S;else if(x!==m)break}x?x.parentNode.insertBefore(t,x.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function nm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function lm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Qc=null;function Fg(t,n,s){if(Qc===null){var c=new Map,m=Qc=new Map;m.set(s,c)}else m=Qc,c=m.get(s),c||(c=new Map,m.set(s,c));if(c.has(t))return c;for(c.set(t,null),s=s.getElementsByTagName(t),m=0;m<s.length;m++){var x=s[m];if(!(x[Jn]||x[Yt]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var k=x.getAttribute(n)||"";k=t+k;var S=c.get(k);S?S.push(x):c.set(k,[x])}}return c}function qg(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function wj(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Vg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Sj(t,n,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var m=Bi(c.href),x=n.querySelector(no(m));if(x){n=x._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Xc.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=x,qt(x);return}x=n.ownerDocument||n,c=Ug(c),(m=kl.get(m))&&nm(c,m),x=x.createElement("link"),qt(x);var k=x;k._p=new Promise(function(S,U){k.onload=S,k.onerror=U}),An(x,"link",c),s.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Xc.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var am=0;function Cj(t,n){return t.stylesheets&&t.count===0&&Zc(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var c=setTimeout(function(){if(t.stylesheets&&Zc(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+n);0<t.imgBytes&&am===0&&(am=62500*ij());var m=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Zc(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>am?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function Xc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Kc=null;function Zc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Kc=new Map,n.forEach(Tj,t),Kc=null,Xc.call(t))}function Tj(t,n){if(!(n.state.loading&4)){var s=Kc.get(t);if(s)var c=s.get(null);else{s=new Map,Kc.set(t,s);for(var m=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<m.length;x++){var k=m[x];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(s.set(k.dataset.precedence,k),c=k)}c&&s.set(null,c)}m=n.instance,k=m.getAttribute("data-precedence"),x=s.get(k)||c,x===c&&s.set(null,m),s.set(k,m),this.count++,c=Xc.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),x?x.parentNode.insertBefore(m,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(m,t.firstChild)),n.state.loading|=4}}var ao={$$typeof:H,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function Aj(t,n,s,c,m,x,k,S,U){this.tag=1,this.containerInfo=t,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=ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ze(0),this.hiddenUpdates=ze(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function Gg(t,n,s,c,m,x,k,S,U,ne,de,he){return t=new Aj(t,n,s,k,U,ne,de,he,S),n=1,x===!0&&(n|=24),x=In(3,null,null,n),t.current=x,x.stateNode=t,n=_d(),n.refCount++,t.pooledCache=n,n.refCount++,x.memoizedState={element:c,isDehydrated:s,cache:n},Ud(x),t}function $g(t){return t?(t=Ia,t):Ia}function Yg(t,n,s,c,m,x){m=$g(m),c.context===null?c.context=m:c.pendingContext=m,c=Ga(n),c.payload={element:s},x=x===void 0?null:x,x!==null&&(c.callback=x),s=$a(t,c,n),s!==null&&(Kn(s,t,n),_s(s,t,n))}function Qg(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function rm(t,n){Qg(t,n),(t=t.alternate)&&Qg(t,n)}function Xg(t){if(t.tag===13||t.tag===31){var n=la(t,67108864);n!==null&&Kn(n,t,67108864),rm(t,67108864)}}function Kg(t){if(t.tag===13||t.tag===31){var n=ol();n=gr(n);var s=la(t,n);s!==null&&Kn(s,t,n),rm(t,n)}}var Wc=!0;function Ej(t,n,s,c){var m=w.T;w.T=null;var x=Y.p;try{Y.p=2,im(t,n,s,c)}finally{Y.p=x,w.T=m}}function Rj(t,n,s,c){var m=w.T;w.T=null;var x=Y.p;try{Y.p=8,im(t,n,s,c)}finally{Y.p=x,w.T=m}}function im(t,n,s,c){if(Wc){var m=sm(c);if(m===null)$f(t,n,c,Jc,s),Wg(t,c);else if(zj(m,t,n,s,c))c.stopPropagation();else if(Wg(t,c),n&4&&-1<Mj.indexOf(t)){for(;m!==null;){var x=Dl(m);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=Ut(x.pendingLanes);if(k!==0){var S=x;for(S.pendingLanes|=2,S.entangledLanes|=2;k;){var U=1<<31-je(k);S.entanglements[1]|=U,k&=~U}Hl(x),(Et&6)===0&&(Dc=Ze()+500,Ws(0))}}break;case 31:case 13:S=la(x,2),S!==null&&Kn(S,x,2),Bc(),rm(x,2)}if(x=sm(c),x===null&&$f(t,n,c,Jc,s),x===m)break;m=x}m!==null&&c.stopPropagation()}else $f(t,n,c,null,s)}}function sm(t){return t=os(t),om(t)}var Jc=null;function om(t){if(Jc=null,t=ml(t),t!==null){var n=u(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=d(n),t!==null)return t;t=null}else if(s===31){if(t=f(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Jc=t,null}function Zg(t){switch(t){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(mt()){case re:return 2;case ge:return 8;case Ce:case _e:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var cm=!1,lr=null,ar=null,rr=null,ro=new Map,io=new Map,ir=[],Mj="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 Wg(t,n){switch(t){case"focusin":case"focusout":lr=null;break;case"dragenter":case"dragleave":ar=null;break;case"mouseover":case"mouseout":rr=null;break;case"pointerover":case"pointerout":ro.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":io.delete(n.pointerId)}}function so(t,n,s,c,m,x){return t===null||t.nativeEvent!==x?(t={blockedOn:n,domEventName:s,eventSystemFlags:c,nativeEvent:x,targetContainers:[m]},n!==null&&(n=Dl(n),n!==null&&Xg(n)),t):(t.eventSystemFlags|=c,n=t.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),t)}function zj(t,n,s,c,m){switch(n){case"focusin":return lr=so(lr,t,n,s,c,m),!0;case"dragenter":return ar=so(ar,t,n,s,c,m),!0;case"mouseover":return rr=so(rr,t,n,s,c,m),!0;case"pointerover":var x=m.pointerId;return ro.set(x,so(ro.get(x)||null,t,n,s,c,m)),!0;case"gotpointercapture":return x=m.pointerId,io.set(x,so(io.get(x)||null,t,n,s,c,m)),!0}return!1}function Jg(t){var n=ml(t.target);if(n!==null){var s=u(n);if(s!==null){if(n=s.tag,n===13){if(n=d(s),n!==null){t.blockedOn=n,br(t.priority,function(){Kg(s)});return}}else if(n===31){if(n=f(s),n!==null){t.blockedOn=n,br(t.priority,function(){Kg(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function eu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=sm(t.nativeEvent);if(s===null){s=t.nativeEvent;var c=new s.constructor(s.type,s);ss=c,s.target.dispatchEvent(c),ss=null}else return n=Dl(s),n!==null&&Xg(n),t.blockedOn=s,!1;n.shift()}return!0}function eb(t,n,s){eu(t)&&s.delete(n)}function Oj(){cm=!1,lr!==null&&eu(lr)&&(lr=null),ar!==null&&eu(ar)&&(ar=null),rr!==null&&eu(rr)&&(rr=null),ro.forEach(eb),io.forEach(eb)}function tu(t,n){t.blockedOn===n&&(t.blockedOn=null,cm||(cm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Oj)))}var nu=null;function tb(t){nu!==t&&(nu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){nu===t&&(nu=null);for(var n=0;n<t.length;n+=3){var s=t[n],c=t[n+1],m=t[n+2];if(typeof c!="function"){if(om(c||s)===null)continue;break}var x=Dl(s);x!==null&&(t.splice(n,3),n-=3,sf(x,{pending:!0,data:m,method:s.method,action:c},c,m))}}))}function Pi(t){function n(U){return tu(U,t)}lr!==null&&tu(lr,t),ar!==null&&tu(ar,t),rr!==null&&tu(rr,t),ro.forEach(n),io.forEach(n);for(var s=0;s<ir.length;s++){var c=ir[s];c.blockedOn===t&&(c.blockedOn=null)}for(;0<ir.length&&(s=ir[0],s.blockedOn===null);)Jg(s),s.blockedOn===null&&ir.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var m=s[c],x=s[c+1],k=m[fn]||null;if(typeof x=="function")k||tb(s);else if(k){var S=null;if(x&&x.hasAttribute("formAction")){if(m=x,k=x[fn]||null)S=k.formAction;else if(om(m)!==null)continue}else S=k.action;typeof S=="function"?s[c+1]=S:(s.splice(c,3),c-=3),tb(s)}}}function nb(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(k){return m=k})},focusReset:"manual",scroll:"manual"})}function n(){m!==null&&(m(),m=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),m!==null&&(m(),m=null)}}}function um(t){this._internalRoot=t}lu.prototype.render=um.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));var s=n.current,c=ol();Yg(s,c,t,n,null,null)},lu.prototype.unmount=um.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Yg(t.current,2,null,t,null,null),Bc(),n[Ft]=null}};function lu(t){this._internalRoot=t}lu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Jr();t={blockedOn:null,target:t,priority:n};for(var s=0;s<ir.length&&n!==0&&n<ir[s].priority;s++);ir.splice(s,0,t),s===0&&Jg(t)}};var lb=l.version;if(lb!=="19.2.3")throw Error(i(527,lb,"19.2.3"));Y.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=h(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var Lj={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:w,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!au.isDisabled&&au.supportsFiber)try{Ee=au.inject(Lj),V=au}catch{}}return co.createRoot=function(t,n){if(!o(t))throw Error(i(299));var s=!1,c="",m=ux,x=dx,k=fx;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(m=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(k=n.onRecoverableError)),n=Gg(t,1,!1,null,null,s,c,null,m,x,k,nb),t[Ft]=n.current,Gf(t),new um(n)},co.hydrateRoot=function(t,n,s){if(!o(t))throw Error(i(299));var c=!1,m="",x=ux,k=dx,S=fx,U=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(k=s.onCaughtError),s.onRecoverableError!==void 0&&(S=s.onRecoverableError),s.formState!==void 0&&(U=s.formState)),n=Gg(t,1,!0,n,s??null,c,m,U,x,k,S,nb),n.context=$g(null),s=n.current,c=ol(),c=gr(c),m=Ga(c),m.callback=null,$a(s,m,c),s=c,n.current.lanes=s,nt(n,s),Hl(n),t[Ft]=n.current,Gf(t),new lu(n)},co.version="19.2.3",co}var mb;function Vj(){if(mb)return mm.exports;mb=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(l){console.error(l)}}return e(),mm.exports=qj(),mm.exports}var pb=Vj(),d1=u1();const Gj=Pu(d1);function No(){return No=Object.assign?Object.assign.bind():function(e){for(var l=1;l<arguments.length;l++){var a=arguments[l];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},No.apply(this,arguments)}var $r;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})($r||($r={}));const hb="popstate";function $j(e){e===void 0&&(e={});function l(i,o){let{pathname:u,search:d,hash:f}=i.location;return Xm("",{pathname:u,search:d,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function a(i,o){return typeof o=="string"?o:f1(o)}return Xj(l,a,null,e)}function Vl(e,l){if(e===!1||e===null||typeof e>"u")throw new Error(l)}function Yj(e,l){{typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Qj(){return Math.random().toString(36).substr(2,8)}function xb(e,l){return{usr:e.state,key:e.key,idx:l}}function Xm(e,l,a,i){return a===void 0&&(a=null),No({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof l=="string"?Hu(l):l,{state:a,key:l&&l.key||i||Qj()})}function f1(e){let{pathname:l="/",search:a="",hash:i=""}=e;return a&&a!=="?"&&(l+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(l+=i.charAt(0)==="#"?i:"#"+i),l}function Hu(e){let l={};if(e){let a=e.indexOf("#");a>=0&&(l.hash=e.substr(a),e=e.substr(0,a));let i=e.indexOf("?");i>=0&&(l.search=e.substr(i),e=e.substr(0,i)),e&&(l.pathname=e)}return l}function Xj(e,l,a,i){i===void 0&&(i={});let{window:o=document.defaultView,v5Compat:u=!1}=i,d=o.history,f=$r.Pop,p=null,h=y();h==null&&(h=0,d.replaceState(No({},d.state,{idx:h}),""));function y(){return(d.state||{idx:null}).idx}function b(){f=$r.Pop;let N=y(),M=N==null?null:N-h;h=N,p&&p({action:f,location:E.location,delta:M})}function v(N,M){f=$r.Push;let L=Xm(E.location,N,M);h=y()+1;let H=xb(L,h),X=E.createHref(L);try{d.pushState(H,"",X)}catch(q){if(q instanceof DOMException&&q.name==="DataCloneError")throw q;o.location.assign(X)}u&&p&&p({action:f,location:E.location,delta:1})}function j(N,M){f=$r.Replace;let L=Xm(E.location,N,M);h=y();let H=xb(L,h),X=E.createHref(L);d.replaceState(H,"",X),u&&p&&p({action:f,location:E.location,delta:0})}function C(N){let M=o.location.origin!=="null"?o.location.origin:o.location.href,L=typeof N=="string"?N:f1(N);return L=L.replace(/ $/,"%20"),Vl(M,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,M)}let E={get action(){return f},get location(){return e(o,d)},listen(N){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(hb,b),p=N,()=>{o.removeEventListener(hb,b),p=null}},createHref(N){return l(o,N)},createURL:C,encodeLocation(N){let M=C(N);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:v,replace:j,go(N){return d.go(N)}};return E}var gb;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gb||(gb={}));function Kj(e,l){if(l==="/")return e;if(!e.toLowerCase().startsWith(l.toLowerCase()))return null;let a=l.endsWith("/")?l.length-1:l.length,i=e.charAt(a);return i&&i!=="/"?null:e.slice(a)||"/"}const Zj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wj=e=>Zj.test(e);function Jj(e,l){l===void 0&&(l="/");let{pathname:a,search:i="",hash:o=""}=typeof e=="string"?Hu(e):e,u;if(a)if(Wj(a))u=a;else{if(a.includes("//")){let d=a;a=a.replace(/\/\/+/g,"/"),Yj(!1,"Pathnames cannot have embedded double slashes - normalizing "+(d+" -> "+a))}a.startsWith("/")?u=bb(a.substring(1),"/"):u=bb(a,l)}else u=l;return{pathname:u,search:aN(i),hash:rN(o)}}function bb(e,l){let a=l.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function gm(e,l,a,i){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+l+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function eN(e){return e.filter((l,a)=>a===0||l.route.path&&l.route.path.length>0)}function tN(e,l){let a=eN(e);return l?a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase):a.map(i=>i.pathnameBase)}function nN(e,l,a,i){i===void 0&&(i=!1);let o;typeof e=="string"?o=Hu(e):(o=No({},e),Vl(!o.pathname||!o.pathname.includes("?"),gm("?","pathname","search",o)),Vl(!o.pathname||!o.pathname.includes("#"),gm("#","pathname","hash",o)),Vl(!o.search||!o.search.includes("#"),gm("#","search","hash",o)));let u=e===""||o.pathname==="",d=u?"/":o.pathname,f;if(d==null)f=a;else{let b=l.length-1;if(!i&&d.startsWith("..")){let v=d.split("/");for(;v[0]==="..";)v.shift(),b-=1;o.pathname=v.join("/")}f=b>=0?l[b]:"/"}let p=Jj(o,f),h=d&&d!=="/"&&d.endsWith("/"),y=(u||d===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(h||y)&&(p.pathname+="/"),p}const lN=e=>e.join("/").replace(/\/\/+/g,"/"),aN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,rN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,m1=["post","put","patch","delete"];new Set(m1);const iN=["get",...m1];new Set(iN);function Eu(){return Eu=Object.assign?Object.assign.bind():function(e){for(var l=1;l<arguments.length;l++){var a=arguments[l];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},Eu.apply(this,arguments)}const p1=A.createContext(null),kp=A.createContext(null),jp=A.createContext(null),Np=A.createContext({outlet:null,matches:[],isDataRoute:!1});function wp(){return A.useContext(jp)!=null}function h1(){return wp()||Vl(!1),A.useContext(jp).location}function x1(e){A.useContext(kp).static||A.useLayoutEffect(e)}function sN(){let{isDataRoute:e}=A.useContext(Np);return e?fN():oN()}function oN(){wp()||Vl(!1);let e=A.useContext(p1),{basename:l,future:a,navigator:i}=A.useContext(kp),{matches:o}=A.useContext(Np),{pathname:u}=h1(),d=JSON.stringify(tN(o,a.v7_relativeSplatPath)),f=A.useRef(!1);return x1(()=>{f.current=!0}),A.useCallback(function(h,y){if(y===void 0&&(y={}),!f.current)return;if(typeof h=="number"){i.go(h);return}let b=nN(h,JSON.parse(d),u,y.relative==="path");e==null&&l!=="/"&&(b.pathname=b.pathname==="/"?l:lN([l,b.pathname])),(y.replace?i.replace:i.push)(b,y.state,y)},[l,i,d,u,e])}var g1=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(g1||{}),b1=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(b1||{});function cN(e){let l=A.useContext(p1);return l||Vl(!1),l}function uN(e){let l=A.useContext(Np);return l||Vl(!1),l}function dN(e){let l=uN(),a=l.matches[l.matches.length-1];return a.route.id||Vl(!1),a.route.id}function fN(){let{router:e}=cN(g1.UseNavigateStable),l=dN(b1.UseNavigateStable),a=A.useRef(!1);return x1(()=>{a.current=!0}),A.useCallback(function(o,u){u===void 0&&(u={}),a.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Eu({fromRouteId:l},u)))},[e,l])}function mN(e,l){e?.v7_startTransition,e?.v7_relativeSplatPath}function pN(e){let{basename:l="/",children:a=null,location:i,navigationType:o=$r.Pop,navigator:u,static:d=!1,future:f}=e;wp()&&Vl(!1);let p=l.replace(/^\/*/,"/"),h=A.useMemo(()=>({basename:p,navigator:u,static:d,future:Eu({v7_relativeSplatPath:!1},f)}),[p,f,u,d]);typeof i=="string"&&(i=Hu(i));let{pathname:y="/",search:b="",hash:v="",state:j=null,key:C="default"}=i,E=A.useMemo(()=>{let N=Kj(y,p);return N==null?null:{location:{pathname:N,search:b,hash:v,state:j,key:C},navigationType:o}},[p,y,b,v,j,C,o]);return E==null?null:A.createElement(kp.Provider,{value:h},A.createElement(jp.Provider,{children:a,value:E}))}new Promise(()=>{});const hN="6";try{window.__reactRouterVersion=hN}catch{}const xN="startTransition",yb=Uu[xN];function gN(e){let{basename:l,children:a,future:i,window:o}=e,u=A.useRef();u.current==null&&(u.current=$j({window:o,v5Compat:!0}));let d=u.current,[f,p]=A.useState({action:d.action,location:d.location}),{v7_startTransition:h}=i||{},y=A.useCallback(b=>{h&&yb?yb(()=>p(b)):p(b)},[p,h]);return A.useLayoutEffect(()=>d.listen(y),[d,y]),A.useEffect(()=>mN(i),[i]),A.createElement(pN,{basename:l,children:a,location:f.location,navigationType:f.action,navigator:d,future:i})}var vb;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(vb||(vb={}));var kb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kb||(kb={}));const y1=(...e)=>e.filter((l,a,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===a).join(" ").trim();const bN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const yN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,a,i)=>i?i.toUpperCase():a.toLowerCase());const jb=e=>{const l=yN(e);return l.charAt(0).toUpperCase()+l.slice(1)};var vN={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"};const kN=e=>{for(const l in e)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1};const jN=A.forwardRef(({color:e="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:o="",children:u,iconNode:d,...f},p)=>A.createElement("svg",{ref:p,...vN,width:l,height:l,stroke:e,strokeWidth:i?Number(a)*24/Number(l):a,className:y1("lucide",o),...!u&&!kN(f)&&{"aria-hidden":"true"},...f},[...d.map(([h,y])=>A.createElement(h,y)),...Array.isArray(u)?u:[u]]));const Ie=(e,l)=>{const a=A.forwardRef(({className:i,...o},u)=>A.createElement(jN,{ref:u,iconNode:l,className:y1(`lucide-${bN(jb(e))}`,`lucide-${e}`,i),...o}));return a.displayName=jb(e),a};const NN=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Km=Ie("activity",NN);const wN=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],SN=Ie("arrow-up-down",wN);const CN=[["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"}]],Sp=Ie("at-sign",CN);const TN=[["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"}]],AN=Ie("bell",TN);const EN=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],v1=Ie("book-open",EN);const RN=[["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"}]],Yi=Ie("bot",RN);const MN=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],zN=Ie("calendar",MN);const ON=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Ru=Ie("check-check",ON);const LN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Qi=Ie("check",LN);const DN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],El=Ie("chevron-right",DN);const _N=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Cp=Ie("circle-alert",_N);const BN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],k1=Ie("circle-check",BN);const IN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],PN=Ie("circle",IN);const UN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Wi=Ie("clock",UN);const HN=[["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"}]],wa=Ie("copy",HN);const FN=[["path",{d:"M20 20v-7a4 4 0 0 0-4-4H4",key:"1nkjon"}],["path",{d:"M9 14 4 9l5-5",key:"102s5s"}]],qN=Ie("corner-up-left",FN);const VN=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],GN=Ie("database",VN);const $N=[["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"}]],YN=Ie("external-link",$N);const QN=[["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"}]],j1=Ie("eye",QN);const XN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],wo=Ie("file-braces",XN);const KN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Tp=Ie("file-text",KN);const ZN=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],fr=Ie("folder-open",ZN);const WN=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],JN=Ie("funnel",WN);const e2=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],N1=Ie("git-branch",e2);const t2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],w1=Ie("globe",t2);const n2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],l2=Ie("grid-3x3",n2);const a2=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],r2=Ie("hard-drive",a2);const i2=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],s2=Ie("hash",i2);const o2=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],S1=Ie("key",o2);const c2=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],u2=Ie("laptop",c2);const d2=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Ap=Ie("layout-grid",d2);const f2=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],m2=Ie("list-todo",f2);const p2=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],C1=Ie("list",p2);const h2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],T1=Ie("loader-circle",h2);const x2=[["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"}]],Rl=Ie("message-square",x2);const g2=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],b2=Ie("mic",g2);const y2=[["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"}]],A1=Ie("moon",y2);const v2=[["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"}]],E1=Ie("network",v2);const k2=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],j2=Ie("palette",k2);const N2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],w2=Ie("panel-left-close",N2);const S2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],C2=Ie("panel-left-open",S2);const T2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Nb=Ie("plus",T2);const A2=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],E2=Ie("radar",A2);const R2=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Zm=Ie("radio",R2);const M2=[["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"}]],gn=Ie("refresh-cw",M2);const z2=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],O2=Ie("reply",z2);const L2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],So=Ie("search",L2);const D2=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],R1=Ie("send-horizontal",D2);const _2=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ep=Ie("server",_2);const B2=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],M1=Ie("settings-2",B2);const I2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Yr=Ie("settings",I2);const P2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],z1=Ie("shield",P2);const U2=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],H2=Ie("smartphone",U2);const F2=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],wb=Ie("star",F2);const q2=[["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"}]],O1=Ie("sun",q2);const V2=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],G2=Ie("tag",V2);const $2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Y2=Ie("target",$2);const Q2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],bo=Ie("terminal",Q2);const X2=[["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"}]],K2=Ie("triangle-alert",X2);const Z2=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Sb=Ie("workflow",Z2);const W2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ul=Ie("x",W2);const J2=[["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"}]],L1=Ie("zap",J2);var Gr=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(Gr||{});const ew=[0,1],D1=[1,0],_1=[2,3],B1=[3,2],tw={L:ew,M:D1,Q:_1,H:B1},nw=/^\d*$/,lw=/^[A-Z0-9 $%*+./:-]*$/,bm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Rp=1,Mp=40,Cb=3,aw=3,ru=40,rw=10,I1=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],P1=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class iw{constructor(l,a,i,o){if(this.version=l,this.ecc=a,l<Rp||l>Mp)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=l*4+17;const u=Array.from({length:this.size}).fill(!1);for(let f=0;f<this.size;f++)this.modules.push(u.slice()),this.types.push(u.map(()=>0));this.drawFunctionPatterns();const d=this.addEccAndInterleave(i);if(this.drawCodewords(d),o===-1){let f=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);const h=this.getPenaltyScore();h<f&&(o=p,f=h),this.applyMask(p)}}this.mask=o,this.applyMask(o),this.drawFormatBits(o)}size;mask;modules=[];types=[];getModule(l,a){return l>=0&&l<this.size&&a>=0&&a<this.size&&this.modules[a][l]}drawFunctionPatterns(){for(let i=0;i<this.size;i++)this.setFunctionModule(6,i,i%2===0,Gr.Timing),this.setFunctionModule(i,6,i%2===0,Gr.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const l=this.getAlignmentPatternPositions(),a=l.length;for(let i=0;i<a;i++)for(let o=0;o<a;o++)i===0&&o===0||i===0&&o===a-1||i===a-1&&o===0||this.drawAlignmentPattern(l[i],l[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(l){const a=this.ecc[1]<<3|l;let i=a;for(let u=0;u<10;u++)i=i<<1^(i>>>9)*1335;const o=(a<<10|i)^21522;for(let u=0;u<=5;u++)this.setFunctionModule(8,u,ya(o,u));this.setFunctionModule(8,7,ya(o,6)),this.setFunctionModule(8,8,ya(o,7)),this.setFunctionModule(7,8,ya(o,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,ya(o,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,ya(o,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,ya(o,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let l=this.version;for(let i=0;i<12;i++)l=l<<1^(l>>>11)*7973;const a=this.version<<12|l;for(let i=0;i<18;i++){const o=ya(a,i),u=this.size-11+i%3,d=Math.floor(i/3);this.setFunctionModule(u,d,o),this.setFunctionModule(d,u,o)}}drawFinderPattern(l,a){for(let i=-4;i<=4;i++)for(let o=-4;o<=4;o++){const u=Math.max(Math.abs(o),Math.abs(i)),d=l+o,f=a+i;d>=0&&d<this.size&&f>=0&&f<this.size&&this.setFunctionModule(d,f,u!==2&&u!==4,Gr.Position)}}drawAlignmentPattern(l,a){for(let i=-2;i<=2;i++)for(let o=-2;o<=2;o++)this.setFunctionModule(l+o,a+i,Math.max(Math.abs(o),Math.abs(i))!==1,Gr.Alignment)}setFunctionModule(l,a,i,o=Gr.Function){this.modules[a][l]=i,this.types[a][l]=o}addEccAndInterleave(l){const a=this.version,i=this.ecc;if(l.length!==ku(a,i))throw new RangeError("Invalid argument");const o=P1[i[0]][a],u=I1[i[0]][a],d=Math.floor(Wm(a)/8),f=o-d%o,p=Math.floor(d/o),h=[],y=hw(u);for(let v=0,j=0;v<o;v++){const C=l.slice(j,j+p-u+(v<f?0:1));j+=C.length;const E=xw(C,y);v<f&&C.push(0),h.push(C.concat(E))}const b=[];for(let v=0;v<h[0].length;v++)h.forEach((j,C)=>{(v!==p-u||C>=f)&&b.push(j[v])});return b}drawCodewords(l){if(l.length!==Math.floor(Wm(this.version)/8))throw new RangeError("Invalid argument");let a=0;for(let i=this.size-1;i>=1;i-=2){i===6&&(i=5);for(let o=0;o<this.size;o++)for(let u=0;u<2;u++){const d=i-u,p=(i+1&2)===0?this.size-1-o:o;!this.types[p][d]&&a<l.length*8&&(this.modules[p][d]=ya(l[a>>>3],7-(a&7)),a++)}}}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let a=0;a<this.size;a++)for(let i=0;i<this.size;i++){let o;switch(l){case 0:o=(i+a)%2===0;break;case 1:o=a%2===0;break;case 2:o=i%3===0;break;case 3:o=(i+a)%3===0;break;case 4:o=(Math.floor(i/3)+Math.floor(a/2))%2===0;break;case 5:o=i*a%2+i*a%3===0;break;case 6:o=(i*a%2+i*a%3)%2===0;break;case 7:o=((i+a)%2+i*a%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[a][i]&&o&&(this.modules[a][i]=!this.modules[a][i])}}getPenaltyScore(){let l=0;for(let u=0;u<this.size;u++){let d=!1,f=0;const p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[u][h]===d?(f++,f===5?l+=Cb:f>5&&l++):(this.finderPenaltyAddHistory(f,p),d||(l+=this.finderPenaltyCountPatterns(p)*ru),d=this.modules[u][h],f=1);l+=this.finderPenaltyTerminateAndCount(d,f,p)*ru}for(let u=0;u<this.size;u++){let d=!1,f=0;const p=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][u]===d?(f++,f===5?l+=Cb:f>5&&l++):(this.finderPenaltyAddHistory(f,p),d||(l+=this.finderPenaltyCountPatterns(p)*ru),d=this.modules[h][u],f=1);l+=this.finderPenaltyTerminateAndCount(d,f,p)*ru}for(let u=0;u<this.size-1;u++)for(let d=0;d<this.size-1;d++){const f=this.modules[u][d];f===this.modules[u][d+1]&&f===this.modules[u+1][d]&&f===this.modules[u+1][d+1]&&(l+=aw)}let a=0;for(const u of this.modules)a=u.reduce((d,f)=>d+(f?1:0),a);const i=this.size*this.size,o=Math.ceil(Math.abs(a*20-i*10)/i)-1;return l+=o*rw,l}getAlignmentPatternPositions(){if(this.version===1)return[];{const l=Math.floor(this.version/7)+2,a=this.version===32?26:Math.ceil((this.version*4+4)/(l*2-2))*2,i=[6];for(let o=this.size-7;i.length<l;o-=a)i.splice(1,0,o);return i}}finderPenaltyCountPatterns(l){const a=l[1],i=a>0&&l[2]===a&&l[3]===a*3&&l[4]===a&&l[5]===a;return(i&&l[0]>=a*4&&l[6]>=a?1:0)+(i&&l[6]>=a*4&&l[0]>=a?1:0)}finderPenaltyTerminateAndCount(l,a,i){return l&&(this.finderPenaltyAddHistory(a,i),a=0),a+=this.size,this.finderPenaltyAddHistory(a,i),this.finderPenaltyCountPatterns(i)}finderPenaltyAddHistory(l,a){a[0]===0&&(l+=this.size),a.pop(),a.unshift(l)}}function ja(e,l,a){if(l<0||l>31||e>>>l)throw new RangeError("Value out of range");for(let i=l-1;i>=0;i--)a.push(e>>>i&1)}function ya(e,l){return(e>>>l&1)!==0}class zp{constructor(l,a,i){if(this.mode=l,this.numChars=a,this.bitData=i,a<0)throw new RangeError("Invalid argument");this.bitData=i.slice()}getData(){return this.bitData.slice()}}const sw=[1,10,12,14],ow=[2,9,11,13],cw=[4,8,16,16];function U1(e,l){return e[Math.floor((l+7)/17)+1]}function H1(e){const l=[];for(const a of e)ja(a,8,l);return new zp(cw,e.length,l)}function uw(e){if(!F1(e))throw new RangeError("String contains non-numeric characters");const l=[];for(let a=0;a<e.length;){const i=Math.min(e.length-a,3);ja(Number.parseInt(e.substring(a,a+i),10),i*3+1,l),a+=i}return new zp(sw,e.length,l)}function dw(e){if(!q1(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const l=[];let a;for(a=0;a+2<=e.length;a+=2){let i=bm.indexOf(e.charAt(a))*45;i+=bm.indexOf(e.charAt(a+1)),ja(i,11,l)}return a<e.length&&ja(bm.indexOf(e.charAt(a)),6,l),new zp(ow,e.length,l)}function fw(e){return e===""?[]:F1(e)?[uw(e)]:q1(e)?[dw(e)]:[H1(pw(e))]}function F1(e){return nw.test(e)}function q1(e){return lw.test(e)}function mw(e,l){let a=0;for(const i of e){const o=U1(i.mode,l);if(i.numChars>=1<<o)return Number.POSITIVE_INFINITY;a+=4+o+i.bitData.length}return a}function pw(e){e=encodeURI(e);const l=[];for(let a=0;a<e.length;a++)e.charAt(a)!=="%"?l.push(e.charCodeAt(a)):(l.push(Number.parseInt(e.substring(a+1,a+3),16)),a+=2);return l}function Wm(e){if(e<Rp||e>Mp)throw new RangeError("Version number out of range");let l=(16*e+128)*e+64;if(e>=2){const a=Math.floor(e/7)+2;l-=(25*a-10)*a-55,e>=7&&(l-=36)}return l}function ku(e,l){return Math.floor(Wm(e)/8)-I1[l[0]][e]*P1[l[0]][e]}function hw(e){if(e<1||e>255)throw new RangeError("Degree out of range");const l=[];for(let i=0;i<e-1;i++)l.push(0);l.push(1);let a=1;for(let i=0;i<e;i++){for(let o=0;o<l.length;o++)l[o]=Jm(l[o],a),o+1<l.length&&(l[o]^=l[o+1]);a=Jm(a,2)}return l}function xw(e,l){const a=l.map(i=>0);for(const i of e){const o=i^a.shift();a.push(0),l.forEach((u,d)=>a[d]^=Jm(u,o))}return a}function Jm(e,l){if(e>>>8||l>>>8)throw new RangeError("Byte out of range");let a=0;for(let i=7;i>=0;i--)a=a<<1^(a>>>7)*285,a^=(l>>>i&1)*e;return a}function gw(e,l,a=1,i=40,o=-1,u=!0){if(!(Rp<=a&&a<=i&&i<=Mp)||o<-1||o>7)throw new RangeError("Invalid value");let d,f;for(d=a;;d++){const b=ku(d,l)*8,v=mw(e,d);if(v<=b){f=v;break}if(d>=i)throw new RangeError("Data too long")}for(const b of[D1,_1,B1])u&&f<=ku(d,b)*8&&(l=b);const p=[];for(const b of e){ja(b.mode[0],4,p),ja(b.numChars,U1(b.mode,d),p);for(const v of b.getData())p.push(v)}const h=ku(d,l)*8;ja(0,Math.min(4,h-p.length),p),ja(0,(8-p.length%8)%8,p);for(let b=236;p.length<h;b^=253)ja(b,8,p);const y=Array.from({length:Math.ceil(p.length/8)},()=>0);return p.forEach((b,v)=>y[v>>>3]|=b<<7-(v&7)),new iw(d,l,y,o)}function bw(e,l){const{ecc:a="L",boostEcc:i=!1,minVersion:o=1,maxVersion:u=40,maskPattern:d=-1,border:f=1}=l||{},p=typeof e=="string"?fw(e):Array.isArray(e)?[H1(e)]:void 0;if(!p)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const h=gw(p,tw[a],o,u,d,i),y=yw({version:h.version,maskPattern:h.mask,size:h.size,data:h.modules,types:h.types},f);return l?.invert&&(y.data=y.data.map(b=>b.map(v=>!v))),l?.onEncoded?.(y),y}function yw(e,l=1){if(!l)return e;const{size:a}=e,i=a+l*2;e.size=i,e.data.forEach(u=>{for(let d=0;d<l;d++)u.unshift(!1),u.push(!1)});for(let u=0;u<l;u++)e.data.unshift(Array.from({length:i},d=>!1)),e.data.push(Array.from({length:i},d=>!1));const o=Gr.Border;e.types.forEach(u=>{for(let d=0;d<l;d++)u.unshift(o),u.push(o)});for(let u=0;u<l;u++)e.types.unshift(Array.from({length:i},d=>o)),e.types.push(Array.from({length:i},d=>o));return e}function Tb(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function vw(e,l={}){const a=bw(e,l),{pixelSize:i=10,whiteColor:o="white",blackColor:u="black"}=l,d=a.size*i,f=a.size*i;let p=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${f} ${d}">`;const h=[];for(let y=0;y<a.size;y++)for(let b=0;b<a.size;b++){const v=b*i,j=y*i;a.data[y][b]&&h.push(`M${v},${j}h${i}v${i}h-${i}z`)}return p+=`<rect fill="${Tb(o)}" width="${f}" height="${d}"/>`,p+=`<path fill="${Tb(u)}" d="${h.join("")}"/>`,p+="</svg>",p}const cn={border:"var(--os-border)",termBg:"var(--os-terminal-bg)",termFg:"var(--os-terminal-fg)",accent:"var(--os-accent)",accentBg:"var(--os-accent-bg)",ink:"var(--os-ink)",muted:"var(--os-muted)"};function V1({title:e,pathLabel:l,body:a,truncated:i=!1,lineCount:o,missing:u=!1,loading:d=!1,searchQuery:f="",updatedAtLabel:p,minHeight:h=240,maxHeight:y,onRevealPath:b}){const v=A.useMemo(()=>{if(!a)return"";const j=f.trim().toLowerCase();return j?a.split(`
10
+ `).filter(C=>C.toLowerCase().includes(j)).join(`
11
+ `):a},[a,f]);return r.jsxs("div",{className:"border rounded-xl overflow-hidden",style:{borderColor:cn.border},children:[r.jsxs("div",{className:"px-4 h-9 border-b flex items-center justify-between gap-4",style:{borderBottomColor:cn.border,backgroundColor:"var(--os-surface)"},children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-[11px] font-mono truncate",style:{color:cn.ink},children:[r.jsx("span",{className:"font-semibold uppercase tracking-widest text-[9px] shrink-0",style:{color:cn.muted},children:e}),l?r.jsxs(r.Fragment,{children:[r.jsx("span",{style:{color:cn.border},children:"·"}),b?r.jsx("button",{type:"button",className:"truncate underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:{color:cn.muted},onClick:()=>b(l),children:l}):r.jsx("span",{className:"truncate",style:{color:cn.muted},children:l})]}):null]}),r.jsxs("div",{className:"flex items-center gap-3 shrink-0 text-[10px] font-mono",style:{color:cn.muted},children:[p?r.jsx("span",{children:p}):null,o!=null?r.jsx("span",{children:i?`${o} lines`:`${o} lines`}):null]})]}),d?r.jsx("div",{className:"flex items-center justify-center",style:{minHeight:h,backgroundColor:cn.termBg},children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"flex gap-1",children:[r.jsx("span",{className:"os-thinking-dot",style:{color:cn.accent}}),r.jsx("span",{className:"os-thinking-dot",style:{color:cn.accent}}),r.jsx("span",{className:"os-thinking-dot",style:{color:cn.accent}})]}),r.jsx("span",{className:"text-[12px]",style:{color:cn.muted},children:"Loading…"})]})}):u?r.jsxs("div",{className:"flex flex-col items-center justify-center px-6 text-center",style:{minHeight:h,backgroundColor:cn.termBg},children:[r.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-3",style:{backgroundColor:cn.accentBg},children:r.jsx(wo,{size:20,style:{color:cn.accent}})}),r.jsx("div",{className:"text-[13px] font-medium mb-1",style:{color:cn.ink},children:"No log file yet"}),r.jsxs("div",{className:"text-[12px] max-w-xs",style:{color:cn.muted},children:[e," has not written a log yet. This will update as soon as output lands."]})]}):r.jsx("pre",{className:"overflow-auto p-4 text-[11px] leading-[1.55] whitespace-pre-wrap break-words",style:{backgroundColor:cn.termBg,color:cn.termFg,minHeight:h,maxHeight:y??void 0},children:v||(f.trim()?"No lines match the filter.":"(empty log)")})]})}function Ab(e,l){if(typeof e=="function")return e(l);e!=null&&(e.current=l)}function Op(...e){return l=>{let a=!1;const i=e.map(o=>{const u=Ab(o,l);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let o=0;o<i.length;o++){const u=i[o];typeof u=="function"?u():Ab(e[o],null)}}}}function mr(...e){return A.useCallback(Op(...e),e)}var kw=Symbol.for("react.lazy"),Mu=Uu[" use ".trim().toString()];function jw(e){return typeof e=="object"&&e!==null&&"then"in e}function G1(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===kw&&"_payload"in e&&jw(e._payload)}function Nw(e){const l=ww(e),a=A.forwardRef((i,o)=>{let{children:u,...d}=i;G1(u)&&typeof Mu=="function"&&(u=Mu(u._payload));const f=A.Children.toArray(u),p=f.find(Cw);if(p){const h=p.props.children,y=f.map(b=>b===p?A.Children.count(h)>1?A.Children.only(null):A.isValidElement(h)?h.props.children:null:b);return r.jsx(l,{...d,ref:o,children:A.isValidElement(h)?A.cloneElement(h,void 0,y):null})}return r.jsx(l,{...d,ref:o,children:u})});return a.displayName=`${e}.Slot`,a}var $1=Nw("Slot");function ww(e){const l=A.forwardRef((a,i)=>{let{children:o,...u}=a;if(G1(o)&&typeof Mu=="function"&&(o=Mu(o._payload)),A.isValidElement(o)){const d=Aw(o),f=Tw(u,o.props);return o.type!==A.Fragment&&(f.ref=i?Op(i,d):d),A.cloneElement(o,f)}return A.Children.count(o)>1?A.Children.only(null):null});return l.displayName=`${e}.SlotClone`,l}var Sw=Symbol("radix.slottable");function Cw(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sw}function Tw(e,l){const a={...l};for(const i in l){const o=e[i],u=l[i];/^on[A-Z]/.test(i)?o&&u?a[i]=(...f)=>{const p=u(...f);return o(...f),p}:o&&(a[i]=o):i==="style"?a[i]={...o,...u}:i==="className"&&(a[i]=[o,u].filter(Boolean).join(" "))}return{...e,...a}}function Aw(e){let l=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=l&&"isReactWarning"in l&&l.isReactWarning;return a?e.ref:(l=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=l&&"isReactWarning"in l&&l.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function Y1(e){var l,a,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(l=0;l<o;l++)e[l]&&(a=Y1(e[l]))&&(i&&(i+=" "),i+=a)}else for(a in e)e[a]&&(i&&(i+=" "),i+=a);return i}function Q1(){for(var e,l,a=0,i="",o=arguments.length;a<o;a++)(e=arguments[a])&&(l=Y1(e))&&(i&&(i+=" "),i+=l);return i}const Eb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Rb=Q1,X1=(e,l)=>a=>{var i;if(l?.variants==null)return Rb(e,a?.class,a?.className);const{variants:o,defaultVariants:u}=l,d=Object.keys(o).map(h=>{const y=a?.[h],b=u?.[h];if(y===null)return null;const v=Eb(y)||Eb(b);return o[h][v]}),f=a&&Object.entries(a).reduce((h,y)=>{let[b,v]=y;return v===void 0||(h[b]=v),h},{}),p=l==null||(i=l.compoundVariants)===null||i===void 0?void 0:i.reduce((h,y)=>{let{class:b,className:v,...j}=y;return Object.entries(j).every(C=>{let[E,N]=C;return Array.isArray(N)?N.includes({...u,...f}[E]):{...u,...f}[E]===N})?[...h,b,v]:h},[]);return Rb(e,d,p,a?.class,a?.className)},Ew=(e,l)=>{const a=new Array(e.length+l.length);for(let i=0;i<e.length;i++)a[i]=e[i];for(let i=0;i<l.length;i++)a[e.length+i]=l[i];return a},Rw=(e,l)=>({classGroupId:e,validator:l}),K1=(e=new Map,l=null,a)=>({nextPart:e,validators:l,classGroupId:a}),zu="-",Mb=[],Mw="arbitrary..",zw=e=>{const l=Lw(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return Ow(d);const f=d.split(zu),p=f[0]===""&&f.length>1?1:0;return Z1(f,p,l)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=i[d],h=a[d];return p?h?Ew(h,p):p:h||Mb}return a[d]||Mb}}},Z1=(e,l,a)=>{if(e.length-l===0)return a.classGroupId;const o=e[l],u=a.nextPart.get(o);if(u){const h=Z1(e,l+1,u);if(h)return h}const d=a.validators;if(d===null)return;const f=l===0?e.join(zu):e.slice(l).join(zu),p=d.length;for(let h=0;h<p;h++){const y=d[h];if(y.validator(f))return y.classGroupId}},Ow=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const l=e.slice(1,-1),a=l.indexOf(":"),i=l.slice(0,a);return i?Mw+i:void 0})(),Lw=e=>{const{theme:l,classGroups:a}=e;return Dw(a,l)},Dw=(e,l)=>{const a=K1();for(const i in e){const o=e[i];Lp(o,a,i,l)}return a},Lp=(e,l,a,i)=>{const o=e.length;for(let u=0;u<o;u++){const d=e[u];_w(d,l,a,i)}},_w=(e,l,a,i)=>{if(typeof e=="string"){Bw(e,l,a);return}if(typeof e=="function"){Iw(e,l,a,i);return}Pw(e,l,a,i)},Bw=(e,l,a)=>{const i=e===""?l:W1(l,e);i.classGroupId=a},Iw=(e,l,a,i)=>{if(Uw(e)){Lp(e(i),l,a,i);return}l.validators===null&&(l.validators=[]),l.validators.push(Rw(a,e))},Pw=(e,l,a,i)=>{const o=Object.entries(e),u=o.length;for(let d=0;d<u;d++){const[f,p]=o[d];Lp(p,W1(l,f),a,i)}},W1=(e,l)=>{let a=e;const i=l.split(zu),o=i.length;for(let u=0;u<o;u++){const d=i[u];let f=a.nextPart.get(d);f||(f=K1(),a.nextPart.set(d,f)),a=f}return a},Uw=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Hw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let l=0,a=Object.create(null),i=Object.create(null);const o=(u,d)=>{a[u]=d,l++,l>e&&(l=0,i=a,a=Object.create(null))};return{get(u){let d=a[u];if(d!==void 0)return d;if((d=i[u])!==void 0)return o(u,d),d},set(u,d){u in a?a[u]=d:o(u,d)}}},ep="!",zb=":",Fw=[],Ob=(e,l,a,i,o)=>({modifiers:e,hasImportantModifier:l,baseClassName:a,maybePostfixModifierPosition:i,isExternal:o}),qw=e=>{const{prefix:l,experimentalParseClassName:a}=e;let i=o=>{const u=[];let d=0,f=0,p=0,h;const y=o.length;for(let E=0;E<y;E++){const N=o[E];if(d===0&&f===0){if(N===zb){u.push(o.slice(p,E)),p=E+1;continue}if(N==="/"){h=E;continue}}N==="["?d++:N==="]"?d--:N==="("?f++:N===")"&&f--}const b=u.length===0?o:o.slice(p);let v=b,j=!1;b.endsWith(ep)?(v=b.slice(0,-1),j=!0):b.startsWith(ep)&&(v=b.slice(1),j=!0);const C=h&&h>p?h-p:void 0;return Ob(u,j,v,C)};if(l){const o=l+zb,u=i;i=d=>d.startsWith(o)?u(d.slice(o.length)):Ob(Fw,!1,d,void 0,!0)}if(a){const o=i;i=u=>a({className:u,parseClassName:o})}return i},Vw=e=>{const l=new Map;return e.orderSensitiveModifiers.forEach((a,i)=>{l.set(a,1e6+i)}),a=>{const i=[];let o=[];for(let u=0;u<a.length;u++){const d=a[u],f=d[0]==="[",p=l.has(d);f||p?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(d)):o.push(d)}return o.length>0&&(o.sort(),i.push(...o)),i}},Gw=e=>({cache:Hw(e.cacheSize),parseClassName:qw(e),sortModifiers:Vw(e),...zw(e)}),$w=/\s+/,Yw=(e,l)=>{const{parseClassName:a,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:u}=l,d=[],f=e.trim().split($w);let p="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:b,modifiers:v,hasImportantModifier:j,baseClassName:C,maybePostfixModifierPosition:E}=a(y);if(b){p=y+(p.length>0?" "+p:p);continue}let N=!!E,M=i(N?C.substring(0,E):C);if(!M){if(!N){p=y+(p.length>0?" "+p:p);continue}if(M=i(C),!M){p=y+(p.length>0?" "+p:p);continue}N=!1}const L=v.length===0?"":v.length===1?v[0]:u(v).join(":"),H=j?L+ep:L,X=H+M;if(d.indexOf(X)>-1)continue;d.push(X);const q=o(M,N);for(let D=0;D<q.length;++D){const B=q[D];d.push(H+B)}p=y+(p.length>0?" "+p:p)}return p},Qw=(...e)=>{let l=0,a,i,o="";for(;l<e.length;)(a=e[l++])&&(i=J1(a))&&(o&&(o+=" "),o+=i);return o},J1=e=>{if(typeof e=="string")return e;let l,a="";for(let i=0;i<e.length;i++)e[i]&&(l=J1(e[i]))&&(a&&(a+=" "),a+=l);return a},Xw=(e,...l)=>{let a,i,o,u;const d=p=>{const h=l.reduce((y,b)=>b(y),e());return a=Gw(h),i=a.cache.get,o=a.cache.set,u=f,f(p)},f=p=>{const h=i(p);if(h)return h;const y=Yw(p,a);return o(p,y),y};return u=d,(...p)=>u(Qw(...p))},Kw=[],pn=e=>{const l=a=>a[e]||Kw;return l.isThemeGetter=!0,l},ev=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Zw=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ww=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jw=/\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$/,eS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,or=e=>Zw.test(e),pt=e=>!!e&&!Number.isNaN(Number(e)),cr=e=>!!e&&Number.isInteger(Number(e)),ym=e=>e.endsWith("%")&&pt(e.slice(0,-1)),va=e=>Ww.test(e),nv=()=>!0,lS=e=>Jw.test(e)&&!eS.test(e),Dp=()=>!1,aS=e=>tS.test(e),rS=e=>nS.test(e),iS=e=>!De(e)&&!Be(e),sS=e=>pr(e,rv,Dp),De=e=>ev.test(e),qr=e=>pr(e,iv,lS),Lb=e=>pr(e,hS,pt),oS=e=>pr(e,ov,nv),cS=e=>pr(e,sv,Dp),Db=e=>pr(e,lv,Dp),uS=e=>pr(e,av,rS),iu=e=>pr(e,cv,aS),Be=e=>tv.test(e),uo=e=>Kr(e,iv),dS=e=>Kr(e,sv),_b=e=>Kr(e,lv),fS=e=>Kr(e,rv),mS=e=>Kr(e,av),su=e=>Kr(e,cv,!0),pS=e=>Kr(e,ov,!0),pr=(e,l,a)=>{const i=ev.exec(e);return i?i[1]?l(i[1]):a(i[2]):!1},Kr=(e,l,a=!1)=>{const i=tv.exec(e);return i?i[1]?l(i[1]):a:!1},lv=e=>e==="position"||e==="percentage",av=e=>e==="image"||e==="url",rv=e=>e==="length"||e==="size"||e==="bg-size",iv=e=>e==="length",hS=e=>e==="number",sv=e=>e==="family-name",ov=e=>e==="number"||e==="weight",cv=e=>e==="shadow",xS=()=>{const e=pn("color"),l=pn("font"),a=pn("text"),i=pn("font-weight"),o=pn("tracking"),u=pn("leading"),d=pn("breakpoint"),f=pn("container"),p=pn("spacing"),h=pn("radius"),y=pn("shadow"),b=pn("inset-shadow"),v=pn("text-shadow"),j=pn("drop-shadow"),C=pn("blur"),E=pn("perspective"),N=pn("aspect"),M=pn("ease"),L=pn("animate"),H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],q=()=>[...X(),Be,De],D=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],F=()=>[Be,De,p],Z=()=>[or,"full","auto",...F()],O=()=>[cr,"none","subgrid",Be,De],P=()=>["auto",{span:["full",cr,Be,De]},cr,Be,De],Q=()=>[cr,"auto",Be,De],oe=()=>["auto","min","max","fr",Be,De],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...F()],Y=()=>[or,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],$=()=>[or,"screen","full","dvw","lvw","svw","min","max","fit",...F()],ye=()=>[or,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],T=()=>[e,Be,De],_=()=>[...X(),_b,Db,{position:[Be,De]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],R=()=>["auto","cover","contain",fS,sS,{size:[Be,De]}],pe=()=>[ym,uo,qr],xe=()=>["","none","full",h,Be,De],ce=()=>["",pt,uo,qr],Re=()=>["solid","dashed","dotted","double"],Te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ne=()=>[pt,ym,_b,Db],He=()=>["","none",C,Be,De],Le=()=>["none",pt,Be,De],Ue=()=>["none",pt,Be,De],it=()=>[pt,Be,De],tt=()=>[or,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[va],breakpoint:[va],color:[nv],container:[va],"drop-shadow":[va],ease:["in","out","in-out"],font:[iS],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[va],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[va],shadow:[va],spacing:["px",pt],text:[va],"text-shadow":[va],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",or,De,Be,N]}],container:["container"],columns:[{columns:[pt,De,Be,f]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"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:q()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[cr,"auto",Be,De]}],basis:[{basis:[or,"full","auto",f,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pt,or,"auto","initial","none",De]}],grow:[{grow:["",pt,Be,De]}],shrink:[{shrink:["",pt,Be,De]}],order:[{order:[cr,"first","last","none",Be,De]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:P()}],"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":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mbs:[{mbs:w()}],mbe:[{mbe:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...ye()]}],"min-block-size":[{"min-block":["auto",...ye()]}],"max-block-size":[{"max-block":["none",...ye()]}],w:[{w:[f,"screen",...Y()]}],"min-w":[{"min-w":[f,"screen","none",...Y()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",a,uo,qr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,pS,oS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ym,De]}],"font-family":[{font:[dS,cS,l]}],"font-features":[{"font-features":[De]}],"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:[o,Be,De]}],"line-clamp":[{"line-clamp":[pt,"none",Be,Lb]}],leading:[{leading:[u,...F()]}],"list-image":[{"list-image":["none",Be,De]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,De]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Re(),"wavy"]}],"text-decoration-thickness":[{decoration:[pt,"from-font","auto",Be,qr]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[pt,"auto",Be,De]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,De]}],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",Be,De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cr,Be,De],radial:["",Be,De],conic:[cr,Be,De]},mS,uS]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:xe()}],"rounded-s":[{"rounded-s":xe()}],"rounded-e":[{"rounded-e":xe()}],"rounded-t":[{"rounded-t":xe()}],"rounded-r":[{"rounded-r":xe()}],"rounded-b":[{"rounded-b":xe()}],"rounded-l":[{"rounded-l":xe()}],"rounded-ss":[{"rounded-ss":xe()}],"rounded-se":[{"rounded-se":xe()}],"rounded-ee":[{"rounded-ee":xe()}],"rounded-es":[{"rounded-es":xe()}],"rounded-tl":[{"rounded-tl":xe()}],"rounded-tr":[{"rounded-tr":xe()}],"rounded-br":[{"rounded-br":xe()}],"rounded-bl":[{"rounded-bl":xe()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Re(),"hidden","none"]}],"divide-style":[{divide:[...Re(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...Re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pt,Be,De]}],"outline-w":[{outline:["",pt,uo,qr]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",y,su,iu]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",b,su,iu]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[pt,qr]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",v,su,iu]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[pt,Be,De]}],"mix-blend":[{"mix-blend":[...Te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Te()}],"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":[pt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ne()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":Ne()}],"mask-image-t-to-pos":[{"mask-t-to":Ne()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":Ne()}],"mask-image-r-to-pos":[{"mask-r-to":Ne()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":Ne()}],"mask-image-b-to-pos":[{"mask-b-to":Ne()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":Ne()}],"mask-image-l-to-pos":[{"mask-l-to":Ne()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":Ne()}],"mask-image-x-to-pos":[{"mask-x-to":Ne()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":Ne()}],"mask-image-y-to-pos":[{"mask-y-to":Ne()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[Be,De]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ne()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":X()}],"mask-image-conic-pos":[{"mask-conic":[pt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ne()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,De]}],filter:[{filter:["","none",Be,De]}],blur:[{blur:He()}],brightness:[{brightness:[pt,Be,De]}],contrast:[{contrast:[pt,Be,De]}],"drop-shadow":[{"drop-shadow":["","none",j,su,iu]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",pt,Be,De]}],"hue-rotate":[{"hue-rotate":[pt,Be,De]}],invert:[{invert:["",pt,Be,De]}],saturate:[{saturate:[pt,Be,De]}],sepia:[{sepia:["",pt,Be,De]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,De]}],"backdrop-blur":[{"backdrop-blur":He()}],"backdrop-brightness":[{"backdrop-brightness":[pt,Be,De]}],"backdrop-contrast":[{"backdrop-contrast":[pt,Be,De]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pt,Be,De]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pt,Be,De]}],"backdrop-invert":[{"backdrop-invert":["",pt,Be,De]}],"backdrop-opacity":[{"backdrop-opacity":[pt,Be,De]}],"backdrop-saturate":[{"backdrop-saturate":[pt,Be,De]}],"backdrop-sepia":[{"backdrop-sepia":["",pt,Be,De]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,De]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pt,"initial",Be,De]}],ease:[{ease:["linear","initial",M,Be,De]}],delay:[{delay:[pt,Be,De]}],animate:[{animate:["none",L,Be,De]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,Be,De]}],"perspective-origin":[{"perspective-origin":q()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:Ue()}],"scale-x":[{"scale-x":Ue()}],"scale-y":[{"scale-y":Ue()}],"scale-z":[{"scale-z":Ue()}],"scale-3d":["scale-3d"],skew:[{skew:it()}],"skew-x":[{"skew-x":it()}],"skew-y":[{"skew-y":it()}],transform:[{transform:[Be,De,"","none","gpu","cpu"]}],"transform-origin":[{origin:q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:tt()}],"translate-x":[{"translate-x":tt()}],"translate-y":[{"translate-y":tt()}],"translate-z":[{"translate-z":tt()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,De]}],"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":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Be,De]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[pt,uo,qr,Lb]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},gS=Xw(xS);function En(...e){return gS(Q1(e))}const bS=X1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Nt({className:e,variant:l,size:a,asChild:i=!1,...o}){const u=i?$1:"button";return r.jsx(u,{"data-slot":"button",className:En(bS({variant:l,size:a,className:e})),...o})}function Na(e,l,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return l?.(o)}}function yS(e,l){const a=A.createContext(l),i=u=>{const{children:d,...f}=u,p=A.useMemo(()=>f,Object.values(f));return r.jsx(a.Provider,{value:p,children:d})};i.displayName=e+"Provider";function o(u){const d=A.useContext(a);if(d)return d;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[i,o]}function uv(e,l=[]){let a=[];function i(u,d){const f=A.createContext(d),p=a.length;a=[...a,d];const h=b=>{const{scope:v,children:j,...C}=b,E=v?.[e]?.[p]||f,N=A.useMemo(()=>C,Object.values(C));return r.jsx(E.Provider,{value:N,children:j})};h.displayName=u+"Provider";function y(b,v){const j=v?.[e]?.[p]||f,C=A.useContext(j);if(C)return C;if(d!==void 0)return d;throw new Error(`\`${b}\` must be used within \`${u}\``)}return[h,y]}const o=()=>{const u=a.map(d=>A.createContext(d));return function(f){const p=f?.[e]||u;return A.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return o.scopeName=e,[i,vS(o,...l)]}function vS(...e){const l=e[0];if(e.length===1)return l;const a=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=i.reduce((f,{useScope:p,scopeName:h})=>{const b=p(u)[`__scope${h}`];return{...f,...b}},{});return A.useMemo(()=>({[`__scope${l.scopeName}`]:d}),[d])}};return a.scopeName=l.scopeName,a}var Ji=globalThis?.document?A.useLayoutEffect:()=>{},kS=Uu[" useInsertionEffect ".trim().toString()]||Ji;function dv({prop:e,defaultProp:l,onChange:a=()=>{},caller:i}){const[o,u,d]=jS({defaultProp:l,onChange:a}),f=e!==void 0,p=f?e:o;{const y=A.useRef(e!==void 0);A.useEffect(()=>{const b=y.current;b!==f&&console.warn(`${i} is changing from ${b?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,i])}const h=A.useCallback(y=>{if(f){const b=NS(y)?y(e):y;b!==e&&d.current?.(b)}else u(y)},[f,e,u,d]);return[p,h]}function jS({defaultProp:e,onChange:l}){const[a,i]=A.useState(e),o=A.useRef(a),u=A.useRef(l);return kS(()=>{u.current=l},[l]),A.useEffect(()=>{o.current!==a&&(u.current?.(a),o.current=a)},[a,o]),[a,i,u]}function NS(e){return typeof e=="function"}function fv(e){const l=wS(e),a=A.forwardRef((i,o)=>{const{children:u,...d}=i,f=A.Children.toArray(u),p=f.find(CS);if(p){const h=p.props.children,y=f.map(b=>b===p?A.Children.count(h)>1?A.Children.only(null):A.isValidElement(h)?h.props.children:null:b);return r.jsx(l,{...d,ref:o,children:A.isValidElement(h)?A.cloneElement(h,void 0,y):null})}return r.jsx(l,{...d,ref:o,children:u})});return a.displayName=`${e}.Slot`,a}function wS(e){const l=A.forwardRef((a,i)=>{const{children:o,...u}=a;if(A.isValidElement(o)){const d=AS(o),f=TS(u,o.props);return o.type!==A.Fragment&&(f.ref=i?Op(i,d):d),A.cloneElement(o,f)}return A.Children.count(o)>1?A.Children.only(null):null});return l.displayName=`${e}.SlotClone`,l}var SS=Symbol("radix.slottable");function CS(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SS}function TS(e,l){const a={...l};for(const i in l){const o=e[i],u=l[i];/^on[A-Z]/.test(i)?o&&u?a[i]=(...f)=>{const p=u(...f);return o(...f),p}:o&&(a[i]=o):i==="style"?a[i]={...o,...u}:i==="className"&&(a[i]=[o,u].filter(Boolean).join(" "))}return{...e,...a}}function AS(e){let l=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=l&&"isReactWarning"in l&&l.isReactWarning;return a?e.ref:(l=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=l&&"isReactWarning"in l&&l.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var ES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nl=ES.reduce((e,l)=>{const a=fv(`Primitive.${l}`),i=A.forwardRef((o,u)=>{const{asChild:d,...f}=o,p=d?a:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(p,{...f,ref:u})});return i.displayName=`Primitive.${l}`,{...e,[l]:i}},{});function RS(e,l){e&&d1.flushSync(()=>e.dispatchEvent(l))}function MS(e,l){return A.useReducer((a,i)=>l[a][i]??a,e)}var Ro=e=>{const{present:l,children:a}=e,i=zS(l),o=typeof a=="function"?a({present:i.isPresent}):A.Children.only(a),u=mr(i.ref,OS(o));return typeof a=="function"||i.isPresent?A.cloneElement(o,{ref:u}):null};Ro.displayName="Presence";function zS(e){const[l,a]=A.useState(),i=A.useRef(null),o=A.useRef(e),u=A.useRef("none"),d=e?"mounted":"unmounted",[f,p]=MS(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const h=ou(i.current);u.current=f==="mounted"?h:"none"},[f]),Ji(()=>{const h=i.current,y=o.current;if(y!==e){const v=u.current,j=ou(h);e?p("MOUNT"):j==="none"||h?.display==="none"?p("UNMOUNT"):p(y&&v!==j?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),Ji(()=>{if(l){let h;const y=l.ownerDocument.defaultView??window,b=j=>{const E=ou(i.current).includes(CSS.escape(j.animationName));if(j.target===l&&E&&(p("ANIMATION_END"),!o.current)){const N=l.style.animationFillMode;l.style.animationFillMode="forwards",h=y.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=N)})}},v=j=>{j.target===l&&(u.current=ou(i.current))};return l.addEventListener("animationstart",v),l.addEventListener("animationcancel",b),l.addEventListener("animationend",b),()=>{y.clearTimeout(h),l.removeEventListener("animationstart",v),l.removeEventListener("animationcancel",b),l.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[l,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:A.useCallback(h=>{i.current=h?getComputedStyle(h):null,a(h)},[])}}function ou(e){return e?.animationName||"none"}function OS(e){let l=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=l&&"isReactWarning"in l&&l.isReactWarning;return a?e.ref:(l=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=l&&"isReactWarning"in l&&l.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var LS=Uu[" useId ".trim().toString()]||(()=>{}),DS=0;function ju(e){const[l,a]=A.useState(LS());return Ji(()=>{a(i=>i??String(DS++))},[e]),e||(l?`radix-${l}`:"")}var Fu="Collapsible",[_S]=uv(Fu),[BS,_p]=_S(Fu),mv=A.forwardRef((e,l)=>{const{__scopeCollapsible:a,open:i,defaultOpen:o,disabled:u,onOpenChange:d,...f}=e,[p,h]=dv({prop:i,defaultProp:o??!1,onChange:d,caller:Fu});return r.jsx(BS,{scope:a,disabled:u,contentId:ju(),open:p,onOpenToggle:A.useCallback(()=>h(y=>!y),[h]),children:r.jsx(Nl.div,{"data-state":Ip(p),"data-disabled":u?"":void 0,...f,ref:l})})});mv.displayName=Fu;var pv="CollapsibleTrigger",hv=A.forwardRef((e,l)=>{const{__scopeCollapsible:a,...i}=e,o=_p(pv,a);return r.jsx(Nl.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Ip(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...i,ref:l,onClick:Na(e.onClick,o.onOpenToggle)})});hv.displayName=pv;var Bp="CollapsibleContent",xv=A.forwardRef((e,l)=>{const{forceMount:a,...i}=e,o=_p(Bp,e.__scopeCollapsible);return r.jsx(Ro,{present:a||o.open,children:({present:u})=>r.jsx(IS,{...i,ref:l,present:u})})});xv.displayName=Bp;var IS=A.forwardRef((e,l)=>{const{__scopeCollapsible:a,present:i,children:o,...u}=e,d=_p(Bp,a),[f,p]=A.useState(i),h=A.useRef(null),y=mr(l,h),b=A.useRef(0),v=b.current,j=A.useRef(0),C=j.current,E=d.open||f,N=A.useRef(E),M=A.useRef(void 0);return A.useEffect(()=>{const L=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(L)},[]),Ji(()=>{const L=h.current;if(L){M.current=M.current||{transitionDuration:L.style.transitionDuration,animationName:L.style.animationName},L.style.transitionDuration="0s",L.style.animationName="none";const H=L.getBoundingClientRect();b.current=H.height,j.current=H.width,N.current||(L.style.transitionDuration=M.current.transitionDuration,L.style.animationName=M.current.animationName),p(i)}},[d.open,i]),r.jsx(Nl.div,{"data-state":Ip(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!E,...u,ref:y,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...e.style},children:E&&o})});function Ip(e){return e?"open":"closed"}var PS=mv;function Nu({...e}){return r.jsx(PS,{"data-slot":"collapsible",...e})}function wu({...e}){return r.jsx(hv,{"data-slot":"collapsible-trigger",...e})}function Su({...e}){return r.jsx(xv,{"data-slot":"collapsible-content",...e})}const Bb=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function dn({className:e,fps:l=12,...a}){const[i,o]=A.useState(0);return A.useEffect(()=>{const u=setInterval(()=>{o(d=>(d+1)%Bb.length)},1e3/l);return()=>clearInterval(u)},[l]),r.jsx("span",{role:"status","aria-label":"Loading",className:En("inline-block font-mono",e),...a,children:Bb[i]})}const g={bg:"var(--os-bg)",surface:"var(--os-surface)",border:"var(--os-border)",ink:"var(--os-ink)",muted:"var(--os-muted)",accent:"var(--os-accent)",accentBg:"var(--os-accent-bg)",accentBorder:"var(--os-accent-border)",tagBg:"var(--os-tag-bg)",logoBg:"var(--os-logo-bg)",logoBorder:"var(--os-logo-border)",termBg:"var(--os-terminal-bg)",termFg:"var(--os-terminal-fg)",markBg:"var(--os-mark-bg)",markFg:"var(--os-mark-fg)",radiusXs:"var(--os-radius-xs)",radiusSm:"var(--os-radius-sm)",radiusMd:"var(--os-radius-md)",radiusLg:"var(--os-radius-lg)",radiusXl:"var(--os-radius-xl)",shadowXs:"var(--os-shadow-xs)",shadowSm:"var(--os-shadow-sm)",shadowMd:"var(--os-shadow-md)",shadowLg:"var(--os-shadow-lg)"};function US({pairingControlPending:e,pairingApprovalPendingId:l,pairingConfigFeedback:a,pairingConfigPending:i,pairingError:o,pairingLoading:u,pairingState:d,onControlPairing:f,onDecideApproval:p,onOpenFeedback:h,onOpenFullLogs:y,onUpdateConfig:b,onRefresh:v,onRevealPath:j}){const[C,E]=A.useState(null),[N,M]=A.useState(""),[L,H]=A.useState(""),[X,q]=A.useState(!1),[D,B]=A.useState(!1),[F,Z]=A.useState(()=>Date.now()),[O,P]=A.useState(!1),[Q,oe]=A.useState(!1),[J,ee]=A.useState(!1),w=A.useRef(null),Y=A.useRef(null),$=A.useMemo(()=>{const we=d?.pairing?.qrValue;return we?vw(we,{border:2,ecc:"M",pixelSize:O?12:6,blackColor:"#111111",whiteColor:"#ffffff"}):null},[d?.pairing?.qrValue,O]),ye=d?.pairing?Math.max(0,Math.floor((d.pairing.expiresAt-F)/1e3)):null,T=!!d?.isRunning,_=d?.trustedPeers??[],le=d?.pendingApprovals??[],R=_.find(we=>we.fingerprint===d?.connectedPeerFingerprint)??null,pe=d?.status==="paired"&&!!d?.connectedPeerFingerprint,xe=d?.pairing?.relay??d?.relay??null,ce=d?.status==="paired"||d?.status==="connected"||d?.status==="connecting"?{label:"Relay Active",backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:d?.status==="error"||d?.status==="closed"?{label:"Attention",backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:{label:"Ready",backgroundColor:"#eff6ff",borderColor:"#bfdbfe",color:"#1d4ed8"},Re=d?.status==="paired"?{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:d?.status==="error"||d?.status==="closed"?{backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:{backgroundColor:"#eff6ff",borderColor:"#bfdbfe",color:"#1d4ed8"},Te={backgroundColor:"#ffffff",borderColor:"rgba(15, 23, 42, 0.08)",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.04)"},Ne={backgroundColor:"#f7f8fb",borderColor:"rgba(15, 23, 42, 0.08)"},He={backgroundColor:"#fbfbfd",borderColor:"rgba(15, 23, 42, 0.06)"},Le=d?.commandLabel??"scout pair",Ue=pe?"Device Connected":d?.pairing?"Pairing Ready":d?.status==="error"||d?.status==="closed"?d.statusLabel:T?d?.statusLabel??"Running":"Ready to Start",it=o??(pe?`${vm(R)} is connected through the pairing relay.`:null)??d?.statusDetail??"Start Pairing to launch a local pairing relay, generate a fresh QR code, and wait for your phone to connect.",tt=[["Expires In",ye!==null?Ib(ye):"—"],["Secure Mode",d?.secure?"Yes":"No"],["Active Sessions",`${d?.sessionCount??0}`],["Trusted Peers",`${d?.trustedPeerCount??0}`],["Last Updated",d?.lastUpdatedLabel??"—"]],st=[["Relay",xe??"Not set"],["Client ID",d?.identityFingerprint??"Not created"],["Room",d?.pairing?.room??"Pending"],["Connected Device",pe?vm(R):"None"]],ot=r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[10px] font-medium",style:ce,children:[r.jsx("span",{className:`block h-1.5 w-1.5 rounded-full ${T?"bg-emerald-500":d?.status==="error"?"bg-rose-500":"bg-zinc-400"}`}),ce.label]}),r.jsx("button",{type:"button",onClick:h,className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:g.muted},children:"Feedback"}),r.jsx("button",{type:"button",onClick:()=>{ee(!0),window.setTimeout(()=>{w.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)},className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:g.muted},children:"Logs"}),r.jsx("button",{type:"button",onClick:()=>{oe(!0),window.setTimeout(()=>{Y.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)},className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:g.muted},children:"Advanced"})]}),bt=z.useCallback(async(we,et)=>{try{await navigator.clipboard.writeText(et),E(we),window.setTimeout(()=>{E(Se=>Se===we?null:Se)},1200)}catch{E(null)}},[]),Ye=z.useCallback(async()=>{try{await b({relay:N,workspaceRoot:L||null}),B(!1),q(!1)}catch{}},[b,N,L]);A.useEffect(()=>{D||(M(d?.configuredRelay??""),H(d?.workspaceRoot??""))},[D,d?.configuredRelay,d?.workspaceRoot]);const Ge=A.useRef(f);A.useEffect(()=>{Ge.current=f},[f]);const We=A.useRef(!1);return A.useEffect(()=>{if(!d?.pairing?.expiresAt)return;We.current=!1,Z(Date.now());const we=window.setInterval(()=>{const et=Date.now();Z(et),!We.current&&et>=d.pairing.expiresAt&&(We.current=!0,Ge.current("restart"))},1e3);return()=>{window.clearInterval(we)}},[d?.pairing?.expiresAt]),r.jsx("div",{className:"flex flex-1 overflow-hidden os-fade-in",style:{backgroundColor:g.bg},children:r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsx("div",{className:"px-8 py-10",style:{backgroundColor:"#FAFAFA"},children:r.jsxs("div",{className:"mx-auto flex max-w-[980px] flex-col gap-8",children:[r.jsxs("div",{className:"sticky top-0 z-10 -mx-8 flex items-center justify-between gap-6 border-b px-8 py-4 backdrop-blur",style:{borderBottomColor:g.border,backgroundColor:"rgba(250,250,250,0.92)"},children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg",style:{backgroundColor:"#4f46e5",color:"#ffffff"},children:r.jsx(Km,{size:15,strokeWidth:1.6})}),r.jsx("div",{className:"text-[18px] font-medium tracking-tight",style:{color:g.ink},children:"Pairing Relay"})]}),r.jsx("div",{className:"flex items-center gap-4",children:ot})]}),r.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1.45fr)_320px] items-start",children:[r.jsxs("div",{className:"flex flex-col gap-5",children:[r.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"inline-flex items-center gap-2 text-[17px] font-medium tracking-tight",style:{color:g.ink},children:[r.jsx(Ep,{size:15,style:{color:"#9ca3af"},strokeWidth:1.5}),"Pairing Status"]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-[11px] font-normal uppercase tracking-wide",style:Re,children:[!T&&(d?.status==="error"||d?.status==="closed")?r.jsx(Cp,{size:13,strokeWidth:1.5}):null,Ue]})]}),r.jsx("p",{className:"mt-3 text-[15px] leading-[1.75] font-light",style:{color:g.muted},children:it}),d?.statusDetail&&(d.status==="error"||d.status==="closed")?r.jsx("div",{className:"mt-4 rounded-2xl border px-4 py-3 text-[12px] leading-[1.7] font-mono whitespace-pre-wrap break-words",style:{backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#9f1239"},children:d.statusDetail}):null]}),r.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:v,disabled:e||u,children:[r.jsx(gn,{size:14}),"Refresh"]})]}),r.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-5",children:tt.map(([we,et])=>r.jsxs("div",{className:"rounded-2xl border px-3 py-3",style:Ne,children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-[0.16em]",style:{color:g.muted},children:we}),r.jsx("div",{className:"mt-2 text-[14px] font-medium tracking-tight",style:{color:g.ink},children:et})]},we))})]}),r.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:g.ink},children:"Bridge Details"}),r.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"Relay identity, room state, workspace binding, and control actions."})]}),r.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>{oe(!0),window.setTimeout(()=>{Y.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)},children:[r.jsx(Yr,{size:14}),"Advanced"]})]}),r.jsxs("div",{className:"mt-4 overflow-hidden rounded-xl border",style:He,children:[st.map(([we,et],Se)=>r.jsxs("div",{className:"grid gap-2 px-3 py-2.5 md:grid-cols-[112px_minmax(0,1fr)] md:items-start",style:Se===0?void 0:{borderTop:`1px solid ${g.border}`},children:[r.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-[0.16em]",style:{color:g.muted},children:[we,":"]}),r.jsx("div",{className:"text-[12px] leading-[1.5] break-words",style:{color:g.ink},children:et})]},we)),r.jsxs("div",{className:"grid gap-2 px-3 py-2.5 md:grid-cols-[112px_minmax(0,1fr)_auto] md:items-center",style:{borderTop:`1px solid ${g.border}`},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-[0.16em]",style:{color:g.muted},children:"Workspace:"}),X?r.jsx("input",{type:"text",value:L,onChange:we=>{H(we.target.value),B(!0)},placeholder:"/Users/arach/dev/openscout",className:"w-full rounded-lg border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):r.jsx("div",{className:"text-[12px] leading-[1.5] break-words",style:{color:g.ink},children:d?.workspaceRoot||"Not set"}),r.jsx("div",{className:"flex items-center gap-2 md:justify-end",children:X?r.jsxs(r.Fragment,{children:[r.jsx(Nt,{type:"button",size:"sm",onClick:()=>{Ye()},disabled:i,children:"Save"}),r.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>{H(d?.workspaceRoot??""),B(!1),q(!1)},disabled:i,children:"Cancel"})]}):r.jsx("button",{type:"button",onClick:()=>{H(d?.workspaceRoot??""),q(!0)},className:"text-[12px] font-medium transition-opacity hover:opacity-70",style:{color:g.muted},children:"[edit]"})})]}),a?r.jsx("div",{className:"px-4 py-3 text-[11px] leading-[1.6]",style:{borderTop:`1px solid ${g.border}`,color:g.ink},children:a}):null]}),r.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-2",children:[r.jsx(Nt,{type:"button",size:"sm",onClick:()=>f(T?"stop":"start"),disabled:e,children:T?"Stop Pairing":"Start Pairing"}),T?r.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>f("restart"),disabled:e,children:"Restart"}):null]})]}),r.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:g.ink},children:"Pending Approvals"}),r.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"One normalized approval queue for any pairing adapter that can pause and wait."})]}),r.jsxs("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:le.length>0?{backgroundColor:"#fff7ed",borderColor:"#fed7aa",color:"#c2410c"}:{backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"},children:[le.length," queued"]})]}),le.length>0?r.jsx("div",{className:"mt-4 flex flex-col gap-3",children:le.map(we=>{const et=`${we.sessionId}:${we.turnId}:${we.blockId}`,Se=l===`${et}:approve`,Ze=l===`${et}:deny`;return r.jsxs("div",{className:"rounded-2xl border px-4 py-4",style:Ne,children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("span",{className:"rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em]",style:we.risk==="high"?{backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:we.risk==="medium"?{backgroundColor:"#fff7ed",borderColor:"#fed7aa",color:"#c2410c"}:{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"},children:[we.risk," risk"]}),r.jsx("span",{className:"text-[11px] font-medium",style:{color:g.ink},children:we.title}),r.jsx("span",{className:"text-[11px]",style:{color:g.muted},children:we.sessionName})]}),r.jsx("div",{className:"mt-3 text-[13px] leading-[1.6]",style:{color:g.ink},children:we.description}),we.detail&&we.detail!==we.description?r.jsx("div",{className:"mt-3 rounded-xl border px-3 py-2 text-[11px] font-mono break-words",style:{backgroundColor:"#ffffff",borderColor:g.border,color:g.ink},children:we.detail}):null,r.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[r.jsxs(Nt,{type:"button",size:"sm",onClick:()=>p(we,"approve"),disabled:!!l,children:[Se?r.jsx(dn,{className:"text-[12px]"}):r.jsx(Qi,{size:14}),"Approve"]}),r.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>p(we,"deny"),disabled:!!l,children:[Ze?r.jsx(dn,{className:"text-[12px]"}):r.jsx(ul,{size:14}),"Deny"]})]})]},et)})}):r.jsx("div",{className:"mt-4 rounded-2xl border px-4 py-4 text-[12px] leading-[1.7]",style:Ne,children:"No approvals are waiting right now. When an adapter emits `awaiting_approval`, it will appear here."})]})]}),r.jsx("div",{children:$?r.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:g.ink},children:"Scan QR Code"}),r.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"Point Pairing on your phone at this code."})]}),r.jsx("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"},children:"Ready to Pair"})]}),r.jsx("div",{className:"mt-5 rounded-[22px] border p-4",style:{backgroundColor:"#ffffff",borderColor:"rgba(15, 23, 42, 0.08)"},children:r.jsx("div",{"aria-label":"Pairing pairing QR code",className:`mx-auto w-full ${O?"max-w-[480px]":"max-w-[248px]"}`,dangerouslySetInnerHTML:{__html:$}})}),r.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 text-[11px] leading-[1.65] font-light",style:{color:g.muted},children:[r.jsx("div",{className:"flex items-center gap-2",children:ye===0?r.jsxs(r.Fragment,{children:[r.jsx("span",{style:{color:"#be123c"},children:"Expired"}),r.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>f("restart"),disabled:e||u,className:"flex items-center gap-1",children:[r.jsx(gn,{size:11}),"Refresh"]})]}):r.jsxs(r.Fragment,{children:["Refreshes in ",r.jsx("span",{style:{color:g.ink},children:ye!==null?Ib(ye):"—"})]})}),r.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>P(we=>!we),children:O?"Compact QR":"Larger QR"})]})]}):r.jsxs("section",{className:"rounded-[20px] border bg-[rgba(250,250,250,0.65)] p-5",style:Te,children:[r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em] mb-3",style:{color:g.muted},children:"CLI Equivalent"}),r.jsxs("div",{className:"rounded-2xl border px-3 py-3 flex items-center gap-3",style:Ne,children:[r.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",style:{color:g.ink},children:Le}),r.jsx(Nt,{type:"button",variant:"outline",size:"icon-sm",onClick:()=>{bt("command",Le)},children:C==="command"?r.jsx(Qi,{size:14}):r.jsx(wa,{size:14})})]}),r.jsx("div",{className:"mt-4 text-[11px] leading-[1.6] font-light",style:{color:g.muted},children:r.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[r.jsx(S1,{size:13,strokeWidth:1.5}),"Same backend as the command line, with QR rotation and log access."]})})]})})]}),r.jsxs("section",{className:"rounded-[20px] border p-5",style:Te,children:[r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[15px] font-medium tracking-tight",style:{color:g.ink},children:"Trusted Devices"}),r.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"Saved phone identities that have paired with this bridge."})]}),r.jsxs("span",{className:"rounded-full border px-2.5 py-1 text-[10px] font-medium whitespace-nowrap",style:pe?{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:{backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"},children:[_.length," saved"]})]}),_.length>0?r.jsxs("div",{className:"mt-4 overflow-hidden rounded-xl border",style:He,children:[r.jsxs("div",{className:"hidden gap-3 px-4 py-2 text-[9px] font-mono uppercase tracking-[0.16em] md:grid md:grid-cols-[minmax(0,1.8fr)_140px_140px_140px]",style:{color:g.muted},children:[r.jsx("div",{children:"Device"}),r.jsx("div",{children:"Status"}),r.jsx("div",{children:"Last Seen"}),r.jsx("div",{children:"Paired"})]}),_.map((we,et)=>{const Se=we.fingerprint===d?.connectedPeerFingerprint;return r.jsxs("div",{className:"grid gap-3 px-4 py-3 md:grid-cols-[minmax(0,1.8fr)_140px_140px_140px] md:items-center",style:et===0?void 0:{borderTop:`1px solid ${g.border}`},children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[13px] font-medium tracking-tight",style:{color:g.ink},children:vm(we)}),r.jsx("div",{className:"mt-1 truncate text-[11px] font-mono",style:{color:g.muted},children:HS(we.publicKey)})]}),r.jsx("div",{children:r.jsx("span",{className:"inline-flex rounded-full border px-2 py-1 text-[10px] font-medium whitespace-nowrap",style:Se?{backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:{backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"},children:Se?"Connected now":"Trusted"})}),r.jsx("div",{className:"text-[12px]",style:{color:g.ink},children:we.lastSeenLabel??"Unknown"}),r.jsx("div",{className:"text-[12px]",style:{color:g.ink},children:we.pairedAtLabel??"Unknown"})]},we.publicKey)})]}):r.jsx("div",{className:"mt-4 rounded-2xl border px-4 py-4 text-[12px] leading-[1.7]",style:Ne,children:"No trusted devices yet. Start Pairing and scan the QR code from your phone to add one."})]}),r.jsxs("div",{className:`grid gap-5 items-start ${Q?"lg:grid-cols-[minmax(0,1.5fr)_320px]":"lg:grid-cols-1"}`,children:[r.jsx("section",{id:"pairing-live-logs",ref:w,children:r.jsx(Nu,{open:J,onOpenChange:ee,children:r.jsxs("div",{className:"rounded-[20px] border overflow-hidden",style:Te,children:[r.jsx(wu,{asChild:!0,children:r.jsxs("button",{type:"button",className:"w-full px-5 py-4 border-b flex items-center justify-between gap-3 text-left hover:opacity-95 transition-opacity",style:{borderBottomColor:J?g.border:"transparent",backgroundColor:"#ffffff"},children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"inline-flex items-center gap-2 text-[15px] font-medium tracking-tight",style:{color:g.ink},children:[r.jsx(bo,{size:15,style:{color:"#9ca3af"},strokeWidth:1.5}),"Pairing Logs"]}),r.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:J?"Live bridge output and runtime diagnostics.":"Hidden by default. Expand only when debugging pairing."})]}),r.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[d?.logUpdatedAtLabel?r.jsx("span",{className:"text-[10px] font-mono",style:{color:g.muted},children:d.logUpdatedAtLabel}):null,r.jsx(El,{size:14,className:"transition-transform duration-150",style:{color:g.muted,transform:J?"rotate(90deg)":void 0}})]})]})}),r.jsxs(Su,{children:[r.jsxs("div",{className:"px-5 pt-4 flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-[11px] font-light",style:{color:g.muted},children:"Open the full Logs view if you want the broader app and relay log catalog."}),r.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:y,children:"Open Full Logs"})]}),r.jsx("div",{className:"px-5 pb-5 pt-4",children:r.jsx(V1,{title:"Pairing",pathLabel:d?.logPath??null,body:d?.logTail??null,truncated:d?.logTruncated,missing:d?.logMissing,loading:!d,updatedAtLabel:d?.logUpdatedAtLabel,maxHeight:320,minHeight:160,onRevealPath:j})})]})]})})}),Q?r.jsxs("section",{id:"pairing-settings-card",ref:Y,className:"rounded-[20px] border overflow-hidden",style:Te,children:[r.jsxs("div",{className:"px-5 py-4 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border},children:[r.jsxs("div",{children:[r.jsxs("div",{className:"inline-flex items-center gap-2 text-[15px] font-medium tracking-tight",style:{color:g.ink},children:[r.jsx(Yr,{size:15,style:{color:"#9ca3af"},strokeWidth:1.5}),"Advanced Settings"]}),r.jsx("div",{className:"mt-1 text-[11px] font-light",style:{color:g.muted},children:"You usually do not need these. Pairing can auto-launch a local relay for pairing."})]}),r.jsxs(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>{bt("config",d?.configPath??"")},disabled:!d?.configPath,children:[C==="config"?r.jsx(Qi,{size:14}):r.jsx(wa,{size:14}),"Config Path"]})]}),r.jsxs("div",{className:"divide-y",style:{borderColor:g.border},children:[r.jsx("div",{className:"px-5 py-4 space-y-3",children:tt.map(([we,et])=>r.jsxs("div",{className:"flex items-center justify-between gap-3 text-[12px]",children:[r.jsx("span",{className:"font-light",style:{color:g.muted},children:we==="Secure Mode"?r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(z1,{size:13,strokeWidth:1.5}),we]}):we==="Last Updated"?r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(Wi,{size:13,strokeWidth:1.5}),we]}):we}),r.jsx("span",{className:"text-right break-words font-normal",style:{color:g.ink},children:et})]},we))}),r.jsxs("div",{className:"px-5 py-4 space-y-4",children:[r.jsxs("label",{className:"block",children:[r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em] mb-2",style:{color:g.muted},children:"Custom Pairing Relay URL"}),r.jsx("input",{type:"text",value:N,onChange:we=>{M(we.target.value),B(!0)},placeholder:"Leave blank to auto-select a local relay",className:"w-full rounded-xl border px-3 py-2 text-[13px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})]}),r.jsxs("label",{className:"block",children:[r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em] mb-2",style:{color:g.muted},children:"Workspace Root"}),r.jsx("input",{type:"text",value:L,onChange:we=>{H(we.target.value),B(!0)},placeholder:"/Users/arach/dev/openscout",className:"w-full rounded-xl border px-3 py-2 text-[13px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})]}),r.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r.jsx(Nt,{type:"button",size:"sm",onClick:()=>{Ye()},disabled:i,children:"Save"})}),a?r.jsx("div",{className:"text-[11px] leading-[1.6]",style:{color:g.ink},children:a}):null]})]})]}):null]})]})})})})}function vm(e){return e?e.name??`Device ${e.fingerprint}`:"Unknown device"}function HS(e){return e.length<=16?e:`${e.slice(0,8)}...${e.slice(-8)}`}function FS(e,l,a){return a?{label:"Error",backgroundColor:"#fff1f2",borderColor:"#fecdd3",color:"#be123c"}:l&&!e?{label:"Loading",backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"}:e?.status==="paired"&&e.connectedPeerFingerprint?{label:"Connected",backgroundColor:"#ecfdf3",borderColor:"#bbf7d0",color:"#15803d"}:e?.isRunning&&e?.pairing?{label:"Waiting",backgroundColor:"#eff6ff",borderColor:"#bfdbfe",color:"#1d4ed8"}:(e?.trustedPeerCount??0)>0?{label:`${e.trustedPeerCount} trusted`,backgroundColor:"#f8fafc",borderColor:"#e2e8f0",color:"#475569"}:null}function qS({active:e,surface:l}){return l==="relay"?r.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center text-[9px] font-mono font-bold",style:e?{backgroundColor:g.ink,color:"#fff"}:{backgroundColor:g.surface,color:g.ink,boxShadow:`inset 0 0 0 1px ${g.border}`},children:">_"}):r.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center",style:e?{backgroundColor:g.accentBg,boxShadow:`inset 0 0 0 1px ${g.accentBorder}`}:{backgroundColor:g.tagBg,boxShadow:`inset 0 0 0 1px ${g.border}`},children:r.jsx("span",{className:"block w-1.5 h-1.5 rounded-full",style:{backgroundColor:e?g.accent:g.muted}})})}function Ib(e){if(e<60)return`${e}s`;const l=Math.floor(e/60),a=e%60;if(l<60)return a>0?`${l}m ${a}s`:`${l}m`;const i=Math.floor(l/60),o=l%60;return o>0?`${i}h ${o}m`:`${i}h`}function VS(e,l){return e.find(a=>a.participants.some(i=>i.id===l))?.id??null}function Pp(e,l){const a=l?e.participants.filter(i=>i.id!==l):e.participants;return a.length>0?a:e.participants}function tp(e,l){return Pp(e,l).map(a=>a.title).join(", ")}function np(e,l){const a=e.sourceKind==="private"?"Private thread":"Targeted relay traffic",i=e.participants.map(u=>u.title).join(" ↔ ");if(!l)return`${a} · ${i}`;const o=Pp(e,l).map(u=>u.title).join(", ");return e.latestAuthorName?`${a} · ${o} · Last from ${e.latestAuthorName}`:`${a} · ${i}`}function gv(e){return e==="project"?"Relay Agent":e==="system"?"System":"Built-in Role"}function GS(e){return e==="active"?"active":"all"}function $S(e){return e==="code"?"code":e==="session"?"session":e==="alpha"?"a-z":"chat"}function Pb(e){return e.threadCount>0||e.reachable||!!(e.lastChatAt||e.lastCodeChangeAt||e.lastSessionAt)}function Ub(e,l){return l==="code"?e.lastCodeChangeAt??0:l==="session"?e.lastSessionAt??0:e.lastChatAt??0}function Hb(e,l,a){if(a==="alpha")return e.title.localeCompare(l.title);const i=Ub(l,a)-Ub(e,a);return i!==0?i:l.threadCount-e.threadCount||e.title.localeCompare(l.title)}function YS(e,l){return l==="chat"&&e.lastChatLabel?`${e.subtitle} · chat ${e.lastChatLabel}`:l==="code"&&e.lastCodeChangeLabel?`${e.subtitle} · code ${e.lastCodeChangeLabel}`:l==="session"&&e.lastSessionLabel?`${e.subtitle} · session ${e.lastSessionLabel}`:e.subtitle}function Ln(e){return e.replace(/\r\n/g,`
12
+ `).trim()}function Fb(e){return e?JSON.stringify({cwd:Ln(e.runtime.cwd),harness:e.runtime.harness,sessionId:Ln(e.runtime.sessionId),systemPrompt:Ln(e.systemPrompt),launchArgsText:Ln(e.toolUse.launchArgsText),capabilitiesText:Ln(e.capabilitiesText)}):""}function qb(e){return e?JSON.stringify({operatorName:Ln(e.operatorName),onboardingContextRoot:Ln(e.onboardingContextRoot),workspaceRoots:e.workspaceRoots.map(l=>Ln(l)),includeCurrentRepo:e.includeCurrentRepo,defaultHarness:e.defaultHarness,defaultCapabilities:e.defaultCapabilities.map(l=>Ln(l)),sessionPrefix:Ln(e.sessionPrefix),telegram:{enabled:e.telegram.enabled,mode:e.telegram.mode,botToken:Ln(e.telegram.botToken),secretToken:Ln(e.telegram.secretToken),apiBaseUrl:Ln(e.telegram.apiBaseUrl),userName:Ln(e.telegram.userName),defaultConversationId:Ln(e.telegram.defaultConversationId),ownerNodeId:Ln(e.telegram.ownerNodeId)}}):""}function QS(e){return Array.from(new Set(e.split(/[\n,]/g).map(l=>l.trim()).filter(Boolean)))}function Vb(e){return e||null}function Zr(e){return e?e.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~"):null}function XS(e){return e?e.trim().toLowerCase()!=="operator":!1}function bv(e){return e.state==="working"?e.activeTask??e.statusDetail??e.subtitle:e.statusDetail?`${e.subtitle} · ${e.statusDetail}`:e.subtitle}function Mo(e){return e==="working"?"bg-[var(--os-accent)] os-presence-pulse":e==="available"?"bg-emerald-500":"bg-zinc-400/50"}function KS(e){switch(e){case"replied":return{color:"#059669"};case"working":return{color:"var(--os-accent)"};case"seen":return{color:"var(--os-accent)"};case"delivered":return{color:"#64748b"};default:return{color:"var(--os-muted)"}}}function ZS(e){const l=e.trim();return!(!l||l.includes(`
13
+ `)||/```|`|\[[^\]]+\]\([^)]+\)|^>\s|^#{1,6}\s|^\s*[-*+]\s|^\s*\d+\.\s|\|/.test(l))}function yv(e){return!e.isDirectConversation&&!e.isSystem&&!e.isVoice&&e.messageClass!=="status"&&(!e.normalizedChannel||e.normalizedChannel==="shared")}function vv(e){return e.isSystem}function kv(e){return e.isVoice}function jv(e){return!e.isVoice}function Nv(e){return!e.isVoice&&!e.isSystem&&(e.isDirectConversation||e.recipients.length>0||e.messageClass==="status")}function wv(e){return!e.isDirectConversation&&!e.isSystem&&!e.isVoice&&e.messageClass!=="status"&&e.recipients.length>0}function Gi(e,l){return e.filter(l).length}function Gb(e){if(!e)return[];const l=new Map(e.views.map(i=>[i.id,i])),a=new Map(e.channels.map(i=>[i.id,i]));return[l.get("all-traffic")??{kind:"filter",id:"all-traffic",title:"All Traffic",subtitle:"Every non-voice message across the workspace.",count:Gi(e.messages,jv)},l.get("coordination")??{kind:"filter",id:"coordination",title:"Coordination",subtitle:"Targeted messages, direct threads, and task handoffs.",count:Gi(e.messages,Nv)},l.get("mentions")??{kind:"filter",id:"mentions",title:"Mentions",subtitle:"Focused view over shared-channel targeted messages.",count:Gi(e.messages,wv)},a.get("system")??{kind:"channel",id:"system",title:"# system",subtitle:"Infrastructure, lifecycle, and broker state events.",count:Gi(e.messages,vv)},a.get("voice")??{kind:"channel",id:"voice",title:"# voice",subtitle:"Voice-related chat, transcripts, and spoken updates.",count:Gi(e.messages,kv)}]}function WS(e){return e?[e.channels.find(a=>a.id==="shared")??{kind:"channel",id:"shared",title:"# shared-channel",subtitle:"Broadcast updates and shared context.",count:Gi(e.messages,yv)}]:[]}function JS(e,l,a,i){return a==="channel"?e.channels.find(o=>o.id===i)??null:a==="filter"?l.find(o=>o.id===i)??null:e.directs.find(o=>o.id===i)??null}function eC(e,l,a){return l==="direct"?e.filter(i=>i.isDirectConversation&&(i.authorId===a||i.recipients.includes(a))):l==="filter"&&a==="all-traffic"?e.filter(jv):l==="filter"&&a==="coordination"?e.filter(Nv):l==="filter"&&a==="mentions"?e.filter(wv):l==="channel"&&a==="voice"?e.filter(kv):l==="channel"&&a==="system"?e.filter(vv):e.filter(yv)}function Up(e){return e.replace(/^[@#]\s*/,"")}function Sv(e){return e>1e10?e:e*1e3}function tC(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(new Date(Sv(e)))}function nC(e){return new Intl.DateTimeFormat("en-US",{weekday:"short",month:"short",day:"numeric"}).format(new Date(Sv(e))).toUpperCase()}function lC(e){return new Intl.DateTimeFormat([],{hour:"numeric",minute:"2-digit"}).format(e)}function dl(e){const l=["#3b82f6","#14b8a6","#fb923c","#f43f5e","#8b5cf6","#10b981"];let a=0;for(const i of e)a+=i.charCodeAt(0);return l[a%l.length]}function aC(e,l){const a=l?.operatorName?.trim();if(a)return a;const i=e?.operatorId??"operator",o=e?.messages??[];for(let u=o.length-1;u>=0;u-=1){const d=o[u];if(d?.authorId===i&&d.authorName.trim())return d.authorName.trim()}return l?.operatorNameDefault??"Operator"}function $b(e){const l=e.match(/@[a-z0-9][\w.-]*(?:@[a-z0-9][\w.-]*)?(?:#[a-z0-9][\w.-]*)?/gi)??[];return Array.from(new Set(l.map(a=>a.slice(1))))}function Cv(e){return e.trim().toLowerCase()}function rC(e,l){const a=Math.max(0,Math.min(l,e.length));let i=a-1;for(;i>=0&&/[\w.@#-]/.test(e[i]??"");)i-=1;const o=i+1;return e[o]!=="@"||i>=0&&!/[\s([{,]/.test(e[i]??"")?null:{start:o,end:a,query:Cv(e.slice(o+1,a))}}function iC(e,l,a){const i=e.mentionToken.replace(/^@/,"").toLowerCase(),o=e.title.toLowerCase(),u=Cv(l);let d=0;return e.agentId===a&&(d+=100),u?(i===u?d+=120:i.startsWith(u)?d+=80:o.startsWith(u)?d+=72:e.searchText.includes(u)&&(d+=28),e.state==="working"?d+=8:e.state==="available"&&(d+=4),d):(e.state==="working"?d+=10:e.state==="available"&&(d+=6),d)}function sC(e,l){return e==="direct"?l==="scout"?"dm.scout.primary":`dm.operator.${l}`:e==="channel"&&l==="voice"?"channel.voice":e==="channel"&&l==="system"?"channel.system":"channel.shared"}function Co(e){const l=e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();return`m:${l.slice(-7)||l.slice(0,7)||"message"}`}function oC(e){const l=e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();return l.slice(-4)||l.slice(0,4)||"ref"}function Tv(e){return`message:${e}`}function km(e){return`message-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function lp(e,l=88){const a=e.replace(/\s+/g," ").trim();return a.length<=l?a:`${a.slice(0,Math.max(0,l-1)).trimEnd()}…`}function Yb(){return{color:g.ink,backgroundColor:g.accentBg,boxShadow:"inset 0 0 0 1px rgba(0,102,255,0.16)"}}function lt(e){return e instanceof Error?e.message:"Action failed."}function To(e){const l=A.useRef(e);return A.useEffect(()=>{l.current=e}),A.useMemo(()=>(...a)=>l.current?.(...a),[])}function cC(e,l=globalThis?.document){const a=To(e);A.useEffect(()=>{const i=o=>{o.key==="Escape"&&a(o)};return l.addEventListener("keydown",i,{capture:!0}),()=>l.removeEventListener("keydown",i,{capture:!0})},[a,l])}var uC="DismissableLayer",ap="dismissableLayer.update",dC="dismissableLayer.pointerDownOutside",fC="dismissableLayer.focusOutside",Qb,Av=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ev=A.forwardRef((e,l)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...p}=e,h=A.useContext(Av),[y,b]=A.useState(null),v=y?.ownerDocument??globalThis?.document,[,j]=A.useState({}),C=mr(l,B=>b(B)),E=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),M=E.indexOf(N),L=y?E.indexOf(y):-1,H=h.layersWithOutsidePointerEventsDisabled.size>0,X=L>=M,q=hC(B=>{const F=B.target,Z=[...h.branches].some(O=>O.contains(F));!X||Z||(o?.(B),d?.(B),B.defaultPrevented||f?.())},v),D=xC(B=>{const F=B.target;[...h.branches].some(O=>O.contains(F))||(u?.(B),d?.(B),B.defaultPrevented||f?.())},v);return cC(B=>{L===h.layers.size-1&&(i?.(B),!B.defaultPrevented&&f&&(B.preventDefault(),f()))},v),A.useEffect(()=>{if(y)return a&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Qb=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),Xb(),()=>{a&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Qb)}},[y,v,a,h]),A.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),Xb())},[y,h]),A.useEffect(()=>{const B=()=>j({});return document.addEventListener(ap,B),()=>document.removeEventListener(ap,B)},[]),r.jsx(Nl.div,{...p,ref:C,style:{pointerEvents:H?X?"auto":"none":void 0,...e.style},onFocusCapture:Na(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Na(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Na(e.onPointerDownCapture,q.onPointerDownCapture)})});Ev.displayName=uC;var mC="DismissableLayerBranch",pC=A.forwardRef((e,l)=>{const a=A.useContext(Av),i=A.useRef(null),o=mr(l,i);return A.useEffect(()=>{const u=i.current;if(u)return a.branches.add(u),()=>{a.branches.delete(u)}},[a.branches]),r.jsx(Nl.div,{...e,ref:o})});pC.displayName=mC;function hC(e,l=globalThis?.document){const a=To(e),i=A.useRef(!1),o=A.useRef(()=>{});return A.useEffect(()=>{const u=f=>{if(f.target&&!i.current){let p=function(){Rv(dC,a,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(l.removeEventListener("click",o.current),o.current=p,l.addEventListener("click",o.current,{once:!0})):p()}else l.removeEventListener("click",o.current);i.current=!1},d=window.setTimeout(()=>{l.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),l.removeEventListener("pointerdown",u),l.removeEventListener("click",o.current)}},[l,a]),{onPointerDownCapture:()=>i.current=!0}}function xC(e,l=globalThis?.document){const a=To(e),i=A.useRef(!1);return A.useEffect(()=>{const o=u=>{u.target&&!i.current&&Rv(fC,a,{originalEvent:u},{discrete:!1})};return l.addEventListener("focusin",o),()=>l.removeEventListener("focusin",o)},[l,a]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Xb(){const e=new CustomEvent(ap);document.dispatchEvent(e)}function Rv(e,l,a,{discrete:i}){const o=a.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});l&&o.addEventListener(e,l,{once:!0}),i?RS(o,u):o.dispatchEvent(u)}var jm="focusScope.autoFocusOnMount",Nm="focusScope.autoFocusOnUnmount",Kb={bubbles:!1,cancelable:!0},gC="FocusScope",Mv=A.forwardRef((e,l)=>{const{loop:a=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...d}=e,[f,p]=A.useState(null),h=To(o),y=To(u),b=A.useRef(null),v=mr(l,E=>p(E)),j=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(i){let E=function(H){if(j.paused||!f)return;const X=H.target;f.contains(X)?b.current=X:dr(b.current,{select:!0})},N=function(H){if(j.paused||!f)return;const X=H.relatedTarget;X!==null&&(f.contains(X)||dr(b.current,{select:!0}))},M=function(H){if(document.activeElement===document.body)for(const q of H)q.removedNodes.length>0&&dr(f)};document.addEventListener("focusin",E),document.addEventListener("focusout",N);const L=new MutationObserver(M);return f&&L.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",N),L.disconnect()}}},[i,f,j.paused]),A.useEffect(()=>{if(f){Wb.add(j);const E=document.activeElement;if(!f.contains(E)){const M=new CustomEvent(jm,Kb);f.addEventListener(jm,h),f.dispatchEvent(M),M.defaultPrevented||(bC(NC(zv(f)),{select:!0}),document.activeElement===E&&dr(f))}return()=>{f.removeEventListener(jm,h),setTimeout(()=>{const M=new CustomEvent(Nm,Kb);f.addEventListener(Nm,y),f.dispatchEvent(M),M.defaultPrevented||dr(E??document.body,{select:!0}),f.removeEventListener(Nm,y),Wb.remove(j)},0)}}},[f,h,y,j]);const C=A.useCallback(E=>{if(!a&&!i||j.paused)return;const N=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,M=document.activeElement;if(N&&M){const L=E.currentTarget,[H,X]=yC(L);H&&X?!E.shiftKey&&M===X?(E.preventDefault(),a&&dr(H,{select:!0})):E.shiftKey&&M===H&&(E.preventDefault(),a&&dr(X,{select:!0})):M===L&&E.preventDefault()}},[a,i,j.paused]);return r.jsx(Nl.div,{tabIndex:-1,...d,ref:v,onKeyDown:C})});Mv.displayName=gC;function bC(e,{select:l=!1}={}){const a=document.activeElement;for(const i of e)if(dr(i,{select:l}),document.activeElement!==a)return}function yC(e){const l=zv(e),a=Zb(l,e),i=Zb(l.reverse(),e);return[a,i]}function zv(e){const l=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)l.push(a.currentNode);return l}function Zb(e,l){for(const a of e)if(!vC(a,{upTo:l}))return a}function vC(e,{upTo:l}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(l!==void 0&&e===l)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function kC(e){return e instanceof HTMLInputElement&&"select"in e}function dr(e,{select:l=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&kC(e)&&l&&e.select()}}var Wb=jC();function jC(){let e=[];return{add(l){const a=e[0];l!==a&&a?.pause(),e=Jb(e,l),e.unshift(l)},remove(l){e=Jb(e,l),e[0]?.resume()}}}function Jb(e,l){const a=[...e],i=a.indexOf(l);return i!==-1&&a.splice(i,1),a}function NC(e){return e.filter(l=>l.tagName!=="A")}var wC="Portal",Ov=A.forwardRef((e,l)=>{const{container:a,...i}=e,[o,u]=A.useState(!1);Ji(()=>u(!0),[]);const d=a||o&&globalThis?.document?.body;return d?Gj.createPortal(r.jsx(Nl.div,{...i,ref:l}),d):null});Ov.displayName=wC;var wm=0;function SC(){A.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ey()),document.body.insertAdjacentElement("beforeend",e[1]??ey()),wm++,()=>{wm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(l=>l.remove()),wm--}},[])}function ey(){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 ql=function(){return ql=Object.assign||function(l){for(var a,i=1,o=arguments.length;i<o;i++){a=arguments[i];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(l[u]=a[u])}return l},ql.apply(this,arguments)};function Lv(e,l){var a={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&l.indexOf(i)<0&&(a[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)l.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(a[i[o]]=e[i[o]]);return a}function CC(e,l,a){if(a||arguments.length===2)for(var i=0,o=l.length,u;i<o;i++)(u||!(i in l))&&(u||(u=Array.prototype.slice.call(l,0,i)),u[i]=l[i]);return e.concat(u||Array.prototype.slice.call(l))}var Cu="right-scroll-bar-position",Tu="width-before-scroll-bar",TC="with-scroll-bars-hidden",AC="--removed-body-scroll-bar-size";function Sm(e,l){return typeof e=="function"?e(l):e&&(e.current=l),e}function EC(e,l){var a=A.useState(function(){return{value:e,callback:l,facade:{get current(){return a.value},set current(i){var o=a.value;o!==i&&(a.value=i,a.callback(i,o))}}}})[0];return a.callback=l,a.facade}var RC=typeof window<"u"?A.useLayoutEffect:A.useEffect,ty=new WeakMap;function MC(e,l){var a=EC(null,function(i){return e.forEach(function(o){return Sm(o,i)})});return RC(function(){var i=ty.get(a);if(i){var o=new Set(i),u=new Set(e),d=a.current;o.forEach(function(f){u.has(f)||Sm(f,null)}),u.forEach(function(f){o.has(f)||Sm(f,d)})}ty.set(a,e)},[e]),a}function zC(e){return e}function OC(e,l){l===void 0&&(l=zC);var a=[],i=!1,o={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(u){var d=l(u,i);return a.push(d),function(){a=a.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(i=!0;a.length;){var d=a;a=[],d.forEach(u)}a={push:function(f){return u(f)},filter:function(){return a}}},assignMedium:function(u){i=!0;var d=[];if(a.length){var f=a;a=[],f.forEach(u),d=a}var p=function(){var y=d;d=[],y.forEach(u)},h=function(){return Promise.resolve().then(p)};h(),a={push:function(y){d.push(y),h()},filter:function(y){return d=d.filter(y),a}}}};return o}function LC(e){e===void 0&&(e={});var l=OC(null);return l.options=ql({async:!0,ssr:!1},e),l}var Dv=function(e){var l=e.sideCar,a=Lv(e,["sideCar"]);if(!l)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=l.read();if(!i)throw new Error("Sidecar medium not found");return A.createElement(i,ql({},a))};Dv.isSideCarExport=!0;function DC(e,l){return e.useMedium(l),Dv}var _v=LC(),Cm=function(){},qu=A.forwardRef(function(e,l){var a=A.useRef(null),i=A.useState({onScrollCapture:Cm,onWheelCapture:Cm,onTouchMoveCapture:Cm}),o=i[0],u=i[1],d=e.forwardProps,f=e.children,p=e.className,h=e.removeScrollBar,y=e.enabled,b=e.shards,v=e.sideCar,j=e.noRelative,C=e.noIsolation,E=e.inert,N=e.allowPinchZoom,M=e.as,L=M===void 0?"div":M,H=e.gapMode,X=Lv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),q=v,D=MC([a,l]),B=ql(ql({},X),o);return A.createElement(A.Fragment,null,y&&A.createElement(q,{sideCar:_v,removeScrollBar:h,shards:b,noRelative:j,noIsolation:C,inert:E,setCallbacks:u,allowPinchZoom:!!N,lockRef:a,gapMode:H}),d?A.cloneElement(A.Children.only(f),ql(ql({},B),{ref:D})):A.createElement(L,ql({},B,{className:p,ref:D}),f))});qu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qu.classNames={fullWidth:Tu,zeroRight:Cu};var _C=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var l=_C();return l&&e.setAttribute("nonce",l),e}function IC(e,l){e.styleSheet?e.styleSheet.cssText=l:e.appendChild(document.createTextNode(l))}function PC(e){var l=document.head||document.getElementsByTagName("head")[0];l.appendChild(e)}var UC=function(){var e=0,l=null;return{add:function(a){e==0&&(l=BC())&&(IC(l,a),PC(l)),e++},remove:function(){e--,!e&&l&&(l.parentNode&&l.parentNode.removeChild(l),l=null)}}},HC=function(){var e=UC();return function(l,a){A.useEffect(function(){return e.add(l),function(){e.remove()}},[l&&a])}},Bv=function(){var e=HC(),l=function(a){var i=a.styles,o=a.dynamic;return e(i,o),null};return l},FC={left:0,top:0,right:0,gap:0},Tm=function(e){return parseInt(e||"",10)||0},qC=function(e){var l=window.getComputedStyle(document.body),a=l[e==="padding"?"paddingLeft":"marginLeft"],i=l[e==="padding"?"paddingTop":"marginTop"],o=l[e==="padding"?"paddingRight":"marginRight"];return[Tm(a),Tm(i),Tm(o)]},VC=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return FC;var l=qC(e),a=document.documentElement.clientWidth,i=window.innerWidth;return{left:l[0],top:l[1],right:l[2],gap:Math.max(0,i-a+l[2]-l[0])}},GC=Bv(),Xi="data-scroll-locked",$C=function(e,l,a,i){var o=e.left,u=e.top,d=e.right,f=e.gap;return a===void 0&&(a="margin"),`
14
+ .`.concat(TC,` {
15
+ overflow: hidden `).concat(i,`;
16
+ padding-right: `).concat(f,"px ").concat(i,`;
17
+ }
18
+ body[`).concat(Xi,`] {
19
+ overflow: hidden `).concat(i,`;
20
+ overscroll-behavior: contain;
21
+ `).concat([l&&"position: relative ".concat(i,";"),a==="margin"&&`
22
+ padding-left: `.concat(o,`px;
23
+ padding-top: `).concat(u,`px;
24
+ padding-right: `).concat(d,`px;
25
+ margin-left:0;
26
+ margin-top:0;
27
+ margin-right: `).concat(f,"px ").concat(i,`;
28
+ `),a==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
29
+ }
30
+
31
+ .`).concat(Cu,` {
32
+ right: `).concat(f,"px ").concat(i,`;
33
+ }
34
+
35
+ .`).concat(Tu,` {
36
+ margin-right: `).concat(f,"px ").concat(i,`;
37
+ }
38
+
39
+ .`).concat(Cu," .").concat(Cu,` {
40
+ right: 0 `).concat(i,`;
41
+ }
42
+
43
+ .`).concat(Tu," .").concat(Tu,` {
44
+ margin-right: 0 `).concat(i,`;
45
+ }
46
+
47
+ body[`).concat(Xi,`] {
48
+ `).concat(AC,": ").concat(f,`px;
49
+ }
50
+ `)},ny=function(){var e=parseInt(document.body.getAttribute(Xi)||"0",10);return isFinite(e)?e:0},YC=function(){A.useEffect(function(){return document.body.setAttribute(Xi,(ny()+1).toString()),function(){var e=ny()-1;e<=0?document.body.removeAttribute(Xi):document.body.setAttribute(Xi,e.toString())}},[])},QC=function(e){var l=e.noRelative,a=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;YC();var u=A.useMemo(function(){return VC(o)},[o]);return A.createElement(GC,{styles:$C(u,!l,o,a?"":"!important")})},rp=!1;if(typeof window<"u")try{var cu=Object.defineProperty({},"passive",{get:function(){return rp=!0,!0}});window.addEventListener("test",cu,cu),window.removeEventListener("test",cu,cu)}catch{rp=!1}var Ui=rp?{passive:!1}:!1,XC=function(e){return e.tagName==="TEXTAREA"},Iv=function(e,l){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[l]!=="hidden"&&!(a.overflowY===a.overflowX&&!XC(e)&&a[l]==="visible")},KC=function(e){return Iv(e,"overflowY")},ZC=function(e){return Iv(e,"overflowX")},ly=function(e,l){var a=l.ownerDocument,i=l;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=Pv(e,i);if(o){var u=Uv(e,i),d=u[1],f=u[2];if(d>f)return!0}i=i.parentNode}while(i&&i!==a.body);return!1},WC=function(e){var l=e.scrollTop,a=e.scrollHeight,i=e.clientHeight;return[l,a,i]},JC=function(e){var l=e.scrollLeft,a=e.scrollWidth,i=e.clientWidth;return[l,a,i]},Pv=function(e,l){return e==="v"?KC(l):ZC(l)},Uv=function(e,l){return e==="v"?WC(l):JC(l)},eT=function(e,l){return e==="h"&&l==="rtl"?-1:1},tT=function(e,l,a,i,o){var u=eT(e,window.getComputedStyle(l).direction),d=u*i,f=a.target,p=l.contains(f),h=!1,y=d>0,b=0,v=0;do{if(!f)break;var j=Uv(e,f),C=j[0],E=j[1],N=j[2],M=E-N-u*C;(C||M)&&Pv(e,f)&&(b+=M,v+=C);var L=f.parentNode;f=L&&L.nodeType===Node.DOCUMENT_FRAGMENT_NODE?L.host:L}while(!p&&f!==document.body||p&&(l.contains(f)||l===f));return(y&&Math.abs(b)<1||!y&&Math.abs(v)<1)&&(h=!0),h},uu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ay=function(e){return[e.deltaX,e.deltaY]},ry=function(e){return e&&"current"in e?e.current:e},nT=function(e,l){return e[0]===l[0]&&e[1]===l[1]},lT=function(e){return`
51
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
52
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
53
+ `)},aT=0,Hi=[];function rT(e){var l=A.useRef([]),a=A.useRef([0,0]),i=A.useRef(),o=A.useState(aT++)[0],u=A.useState(Bv)[0],d=A.useRef(e);A.useEffect(function(){d.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var E=CC([e.lockRef.current],(e.shards||[]).map(ry),!0).filter(Boolean);return E.forEach(function(N){return N.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),E.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var f=A.useCallback(function(E,N){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!d.current.allowPinchZoom;var M=uu(E),L=a.current,H="deltaX"in E?E.deltaX:L[0]-M[0],X="deltaY"in E?E.deltaY:L[1]-M[1],q,D=E.target,B=Math.abs(H)>Math.abs(X)?"h":"v";if("touches"in E&&B==="h"&&D.type==="range")return!1;var F=window.getSelection(),Z=F&&F.anchorNode,O=Z?Z===D||Z.contains(D):!1;if(O)return!1;var P=ly(B,D);if(!P)return!0;if(P?q=B:(q=B==="v"?"h":"v",P=ly(B,D)),!P)return!1;if(!i.current&&"changedTouches"in E&&(H||X)&&(i.current=q),!q)return!0;var Q=i.current||q;return tT(Q,N,E,Q==="h"?H:X)},[]),p=A.useCallback(function(E){var N=E;if(!(!Hi.length||Hi[Hi.length-1]!==u)){var M="deltaY"in N?ay(N):uu(N),L=l.current.filter(function(q){return q.name===N.type&&(q.target===N.target||N.target===q.shadowParent)&&nT(q.delta,M)})[0];if(L&&L.should){N.cancelable&&N.preventDefault();return}if(!L){var H=(d.current.shards||[]).map(ry).filter(Boolean).filter(function(q){return q.contains(N.target)}),X=H.length>0?f(N,H[0]):!d.current.noIsolation;X&&N.cancelable&&N.preventDefault()}}},[]),h=A.useCallback(function(E,N,M,L){var H={name:E,delta:N,target:M,should:L,shadowParent:iT(M)};l.current.push(H),setTimeout(function(){l.current=l.current.filter(function(X){return X!==H})},1)},[]),y=A.useCallback(function(E){a.current=uu(E),i.current=void 0},[]),b=A.useCallback(function(E){h(E.type,ay(E),E.target,f(E,e.lockRef.current))},[]),v=A.useCallback(function(E){h(E.type,uu(E),E.target,f(E,e.lockRef.current))},[]);A.useEffect(function(){return Hi.push(u),e.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:v}),document.addEventListener("wheel",p,Ui),document.addEventListener("touchmove",p,Ui),document.addEventListener("touchstart",y,Ui),function(){Hi=Hi.filter(function(E){return E!==u}),document.removeEventListener("wheel",p,Ui),document.removeEventListener("touchmove",p,Ui),document.removeEventListener("touchstart",y,Ui)}},[]);var j=e.removeScrollBar,C=e.inert;return A.createElement(A.Fragment,null,C?A.createElement(u,{styles:lT(o)}):null,j?A.createElement(QC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iT(e){for(var l=null;e!==null;)e instanceof ShadowRoot&&(l=e.host,e=e.host),e=e.parentNode;return l}const sT=DC(_v,rT);var Hv=A.forwardRef(function(e,l){return A.createElement(qu,ql({},e,{ref:l,sideCar:sT}))});Hv.classNames=qu.classNames;var oT=function(e){if(typeof document>"u")return null;var l=Array.isArray(e)?e[0]:e;return l.ownerDocument.body},Fi=new WeakMap,du=new WeakMap,fu={},Am=0,Fv=function(e){return e&&(e.host||Fv(e.parentNode))},cT=function(e,l){return l.map(function(a){if(e.contains(a))return a;var i=Fv(a);return i&&e.contains(i)?i:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},uT=function(e,l,a,i){var o=cT(l,Array.isArray(e)?e:[e]);fu[a]||(fu[a]=new WeakMap);var u=fu[a],d=[],f=new Set,p=new Set(o),h=function(b){!b||f.has(b)||(f.add(b),h(b.parentNode))};o.forEach(h);var y=function(b){!b||p.has(b)||Array.prototype.forEach.call(b.children,function(v){if(f.has(v))y(v);else try{var j=v.getAttribute(i),C=j!==null&&j!=="false",E=(Fi.get(v)||0)+1,N=(u.get(v)||0)+1;Fi.set(v,E),u.set(v,N),d.push(v),E===1&&C&&du.set(v,!0),N===1&&v.setAttribute(a,"true"),C||v.setAttribute(i,"true")}catch(M){console.error("aria-hidden: cannot operate on ",v,M)}})};return y(l),f.clear(),Am++,function(){d.forEach(function(b){var v=Fi.get(b)-1,j=u.get(b)-1;Fi.set(b,v),u.set(b,j),v||(du.has(b)||b.removeAttribute(i),du.delete(b)),j||b.removeAttribute(a)}),Am--,Am||(Fi=new WeakMap,Fi=new WeakMap,du=new WeakMap,fu={})}},dT=function(e,l,a){a===void 0&&(a="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=oT(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),uT(i,o,a,"aria-hidden")):function(){return null}},Vu="Dialog",[qv]=uv(Vu),[fT,zl]=qv(Vu),Vv=e=>{const{__scopeDialog:l,children:a,open:i,defaultOpen:o,onOpenChange:u,modal:d=!0}=e,f=A.useRef(null),p=A.useRef(null),[h,y]=dv({prop:i,defaultProp:o??!1,onChange:u,caller:Vu});return r.jsx(fT,{scope:l,triggerRef:f,contentRef:p,contentId:ju(),titleId:ju(),descriptionId:ju(),open:h,onOpenChange:y,onOpenToggle:A.useCallback(()=>y(b=>!b),[y]),modal:d,children:a})};Vv.displayName=Vu;var Gv="DialogTrigger",mT=A.forwardRef((e,l)=>{const{__scopeDialog:a,...i}=e,o=zl(Gv,a),u=mr(l,o.triggerRef);return r.jsx(Nl.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":qp(o.open),...i,ref:u,onClick:Na(e.onClick,o.onOpenToggle)})});mT.displayName=Gv;var Hp="DialogPortal",[pT,$v]=qv(Hp,{forceMount:void 0}),Yv=e=>{const{__scopeDialog:l,forceMount:a,children:i,container:o}=e,u=zl(Hp,l);return r.jsx(pT,{scope:l,forceMount:a,children:A.Children.map(i,d=>r.jsx(Ro,{present:a||u.open,children:r.jsx(Ov,{asChild:!0,container:o,children:d})}))})};Yv.displayName=Hp;var Ou="DialogOverlay",Qv=A.forwardRef((e,l)=>{const a=$v(Ou,e.__scopeDialog),{forceMount:i=a.forceMount,...o}=e,u=zl(Ou,e.__scopeDialog);return u.modal?r.jsx(Ro,{present:i||u.open,children:r.jsx(xT,{...o,ref:l})}):null});Qv.displayName=Ou;var hT=fv("DialogOverlay.RemoveScroll"),xT=A.forwardRef((e,l)=>{const{__scopeDialog:a,...i}=e,o=zl(Ou,a);return r.jsx(Hv,{as:hT,allowPinchZoom:!0,shards:[o.contentRef],children:r.jsx(Nl.div,{"data-state":qp(o.open),...i,ref:l,style:{pointerEvents:"auto",...i.style}})})}),Qr="DialogContent",Xv=A.forwardRef((e,l)=>{const a=$v(Qr,e.__scopeDialog),{forceMount:i=a.forceMount,...o}=e,u=zl(Qr,e.__scopeDialog);return r.jsx(Ro,{present:i||u.open,children:u.modal?r.jsx(gT,{...o,ref:l}):r.jsx(bT,{...o,ref:l})})});Xv.displayName=Qr;var gT=A.forwardRef((e,l)=>{const a=zl(Qr,e.__scopeDialog),i=A.useRef(null),o=mr(l,a.contentRef,i);return A.useEffect(()=>{const u=i.current;if(u)return dT(u)},[]),r.jsx(Kv,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Na(e.onCloseAutoFocus,u=>{u.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Na(e.onPointerDownOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&u.preventDefault()}),onFocusOutside:Na(e.onFocusOutside,u=>u.preventDefault())})}),bT=A.forwardRef((e,l)=>{const a=zl(Qr,e.__scopeDialog),i=A.useRef(!1),o=A.useRef(!1);return r.jsx(Kv,{...e,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(i.current||a.triggerRef.current?.focus(),u.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(i.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=u.target;a.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),Kv=A.forwardRef((e,l)=>{const{__scopeDialog:a,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:u,...d}=e,f=zl(Qr,a),p=A.useRef(null),h=mr(l,p);return SC(),r.jsxs(r.Fragment,{children:[r.jsx(Mv,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:u,children:r.jsx(Ev,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":qp(f.open),...d,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(yT,{titleId:f.titleId}),r.jsx(kT,{contentRef:p,descriptionId:f.descriptionId})]})]})}),Fp="DialogTitle",Zv=A.forwardRef((e,l)=>{const{__scopeDialog:a,...i}=e,o=zl(Fp,a);return r.jsx(Nl.h2,{id:o.titleId,...i,ref:l})});Zv.displayName=Fp;var Wv="DialogDescription",Jv=A.forwardRef((e,l)=>{const{__scopeDialog:a,...i}=e,o=zl(Wv,a);return r.jsx(Nl.p,{id:o.descriptionId,...i,ref:l})});Jv.displayName=Wv;var e0="DialogClose",t0=A.forwardRef((e,l)=>{const{__scopeDialog:a,...i}=e,o=zl(e0,a);return r.jsx(Nl.button,{type:"button",...i,ref:l,onClick:Na(e.onClick,()=>o.onOpenChange(!1))})});t0.displayName=e0;function qp(e){return e?"open":"closed"}var n0="DialogTitleWarning",[Vz,l0]=yS(n0,{contentName:Qr,titleName:Fp,docsSlug:"dialog"}),yT=({titleId:e})=>{const l=l0(n0),a=`\`${l.contentName}\` requires a \`${l.titleName}\` for the component to be accessible for screen reader users.
54
+
55
+ If you want to hide the \`${l.titleName}\`, you can wrap it with our VisuallyHidden component.
56
+
57
+ For more information, see https://radix-ui.com/primitives/docs/components/${l.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},vT="DialogDescriptionWarning",kT=({contentRef:e,descriptionId:l})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${l0(vT).contentName}}.`;return A.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");l&&o&&(document.getElementById(l)||console.warn(i))},[i,e,l]),null},jT=Vv,NT=Yv,wT=Qv,ST=Xv,CT=Zv,TT=Jv,AT=t0;function a0({...e}){return r.jsx(jT,{"data-slot":"dialog",...e})}function ET({...e}){return r.jsx(NT,{"data-slot":"dialog-portal",...e})}function RT({className:e,...l}){return r.jsx(wT,{"data-slot":"dialog-overlay",className:En("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...l})}function r0({className:e,children:l,showCloseButton:a=!0,...i}){return r.jsxs(ET,{"data-slot":"dialog-portal",children:[r.jsx(RT,{}),r.jsxs(ST,{"data-slot":"dialog-content",className:En("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...i,children:[l,a&&r.jsxs(AT,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[r.jsx(ul,{}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function i0({className:e,...l}){return r.jsx("div",{"data-slot":"dialog-header",className:En("flex flex-col gap-2 text-center sm:text-left",e),...l})}function MT({className:e,...l}){return r.jsx("div",{"data-slot":"dialog-footer",className:En("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...l})}function s0({className:e,...l}){return r.jsx(CT,{"data-slot":"dialog-title",className:En("text-lg leading-none font-semibold",e),...l})}function o0({className:e,...l}){return r.jsx(TT,{"data-slot":"dialog-description",className:En("text-muted-foreground text-sm",e),...l})}function ip({className:e,type:l,...a}){return r.jsx("input",{type:l,"data-slot":"input",className:En("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}function zT({className:e,...l}){return r.jsx("textarea",{"data-slot":"textarea",className:En("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...l})}function sp(e){return e==="codex"?"codex":"claude"}function Em(e,l){const a=e.find(i=>i.root===l?.onboardingContextRoot)??e[0]??null;return{projectPath:a?.root??l?.onboardingContextRoot??"",agentName:"",harness:sp(a?.defaultHarness??l?.defaultHarness)}}function OT(e,l){return e.length!==l.length?!1:e.every((a,i)=>{const o=l[i];return a.publicKey===o?.publicKey&&a.fingerprint===o?.fingerprint&&a.name===o?.name&&a.pairedAt===o?.pairedAt&&a.pairedAtLabel===o?.pairedAtLabel&&a.lastSeen===o?.lastSeen&&a.lastSeenLabel===o?.lastSeenLabel})}function LT(e,l){return e.length!==l.length?!1:e.every((a,i)=>{const o=l[i];return a.sessionId===o?.sessionId&&a.turnId===o?.turnId&&a.blockId===o?.blockId&&a.version===o?.version&&a.risk===o?.risk&&a.title===o?.title&&a.description===o?.description&&a.detail===o?.detail&&a.actionKind===o?.actionKind&&a.actionStatus===o?.actionStatus})}function DT(e,l){return e===l?!0:!e||!l?e===l:e.status===l.status&&e.statusLabel===l.statusLabel&&e.statusDetail===l.statusDetail&&e.connectedPeerFingerprint===l.connectedPeerFingerprint&&e.isRunning===l.isRunning&&e.commandLabel===l.commandLabel&&e.configPath===l.configPath&&e.identityPath===l.identityPath&&e.trustedPeersPath===l.trustedPeersPath&&e.logPath===l.logPath&&e.relay===l.relay&&e.configuredRelay===l.configuredRelay&&e.secure===l.secure&&e.workspaceRoot===l.workspaceRoot&&e.sessionCount===l.sessionCount&&e.identityFingerprint===l.identityFingerprint&&e.trustedPeerCount===l.trustedPeerCount&&OT(e.trustedPeers,l.trustedPeers)&&LT(e.pendingApprovals,l.pendingApprovals)&&e.logTail===l.logTail&&e.logUpdatedAtLabel===l.logUpdatedAtLabel&&e.logMissing===l.logMissing&&e.logTruncated===l.logTruncated&&e.pairing?.relay===l.pairing?.relay&&e.pairing?.room===l.pairing?.room&&e.pairing?.publicKey===l.pairing?.publicKey&&e.pairing?.expiresAt===l.pairing?.expiresAt&&e.pairing?.qrValue===l.pairing?.qrValue&&e.pairing?.qrArt===l.pairing?.qrArt}function _T({open:e,selectedInterAgent:l,visibleAgentSession:a,agentSessionPending:i,agentSessionLoading:o,agentSessionFeedback:u,agentSessionCopied:d,agentSessionPeekViewportRef:f,handlePeekAgentSessionScroll:p,handleCopyAgentSessionCommand:h,handleOpenAgentSession:y,closeAgentSessionPeek:b,renderLocalPathValue:v,s:j}){return!e||!l?null:r.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-6",style:{backgroundColor:"rgba(244, 240, 232, 0.72)",backdropFilter:"blur(6px)"},onClick:b,children:r.jsxs("div",{className:"w-full max-w-5xl h-[78vh] border rounded-2xl overflow-hidden flex flex-col",style:{backgroundColor:g.surface,borderColor:g.border,boxShadow:"0 24px 72px rgba(15, 23, 42, 0.16)"},onClick:C=>C.stopPropagation(),children:[r.jsxs("div",{className:"px-4 h-14 border-b flex items-center justify-between gap-3 shrink-0",style:{borderBottomColor:g.border},children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"text-[15px] font-semibold tracking-tight truncate",style:j.inkText,children:["Peek · ",l.title]}),r.jsx("div",{className:"text-[11px] truncate mt-0.5",style:j.mutedText,children:i?"Checking tmux pane and runtime logs for the selected agent.":a?.subtitle??"No live session output available yet."})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a?.commandLabel?r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:h,children:d?"Copied":"Copy Attach"}):null,a&&a.mode!=="none"?r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:y,children:a.mode==="tmux"?"Open TMUX":"Open Logs"}):null,r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:b,children:[r.jsx(ul,{size:12}),"Close"]})]})]}),r.jsxs("div",{className:"px-4 py-2 border-b flex items-center gap-2 flex-wrap text-[10px] shrink-0",style:{borderBottomColor:g.border,color:g.muted},children:[r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:a?.mode==="tmux"?j.activePill:j.tagBadge,children:i?"Loading":a?.mode==="tmux"?"TMUX":a?.mode==="logs"?"Logs":"Unavailable"}),a?.harness??l.harness?r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:j.tagBadge,children:a?.harness??l.harness}):null,a?.transport??l.transport?r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:j.tagBadge,children:a?.transport??l.transport}):null,a?.sessionId??l.sessionId?r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:j.tagBadge,children:a?.sessionId??l.sessionId}):null,a?.updatedAtLabel?r.jsxs("span",{children:["Updated ",a.updatedAtLabel]}):null,typeof a?.lineCount=="number"&&a.lineCount>0?r.jsxs("span",{children:[a.lineCount," lines"]}):null,a?.truncated?r.jsx("span",{children:"Tail only"}):null,r.jsx("span",{children:"Refreshing live while open"})]}),r.jsx("div",{className:"flex-1 overflow-hidden",style:{backgroundColor:g.bg},children:o&&!a?r.jsx("div",{className:"px-4 py-8 text-[12px]",style:j.mutedText,children:"Loading live session…"}):a?.body?r.jsx("pre",{ref:C=>{f.current=C},onScroll:p,className:"h-full px-4 py-4 text-[11px] leading-[1.58] overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words",style:{color:g.ink,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:a.body}):r.jsx("div",{className:"px-4 py-8 text-[12px] leading-[1.65]",style:j.mutedText,children:i?"Checking for a live tmux pane first, then falling back to canonical runtime logs.":a?.subtitle??"No session output available yet."})}),r.jsxs("div",{className:"px-4 h-10 border-t flex items-center justify-between gap-3 shrink-0 text-[10px]",style:{borderTopColor:g.border,color:g.muted},children:[r.jsx("div",{className:"truncate min-w-0",children:v(a?.pathLabel??Zr(l.cwd??l.projectRoot)??"No stable session path yet.",{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"})}),u?r.jsx("div",{style:j.inkText,children:u}):null]})]})})}function BT({open:e,setOpen:l,agentableProjects:a,createAgentDraft:i,setCreateAgentDraft:o,createAgentDefaults:u,createAgentSubmitting:d,createAgentFeedback:f,setCreateAgentFeedback:p,handleBrowseCreateAgentProject:h,handleCreateAgent:y,availableAgentHarnesses:b,s:v}){return r.jsx(a0,{open:e,onOpenChange:l,children:r.jsxs(r0,{className:"sm:max-w-xl",children:[r.jsxs(i0,{children:[r.jsx(s0,{children:"New Agent"}),r.jsx(o0,{children:"Pick a project, choose a harness, and start a local relay agent without leaving the homepage."})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Project"}),r.jsxs("select",{className:"w-full rounded-lg border px-3 py-2.5 text-[13px] outline-none",style:{borderColor:g.border,backgroundColor:g.surface,color:g.ink},value:a.find(j=>j.root===i.projectPath)?.id??"",onChange:j=>{const C=a.find(E=>E.id===j.target.value)??null;C&&(o(E=>({...E,projectPath:C.root,harness:sp(C.defaultHarness||E.harness)})),p(null))},children:[r.jsx("option",{value:"",children:"Select a discovered project"}),a.map(j=>r.jsxs("option",{value:j.id,children:[j.title," · ",Zr(j.root)??j.root]},j.id))]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Path"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ip,{value:i.projectPath,onChange:j=>{o(C=>({...C,projectPath:j.target.value})),p(null)},placeholder:u.projectPath||"/path/to/project",className:"h-10"}),r.jsxs(Nt,{type:"button",variant:"outline",className:"shrink-0",onClick:h,children:[r.jsx(fr,{size:14}),"Browse"]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-[1fr_160px]",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Agent Name"}),r.jsx(ip,{value:i.agentName,onChange:j=>{o(C=>({...C,agentName:j.target.value})),p(null)},placeholder:"Optional. Defaults to the project name.",className:"h-10"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-[11px] font-mono uppercase tracking-widest",style:v.mutedText,children:"Harness"}),r.jsx("select",{className:"w-full rounded-lg border px-3 py-2.5 text-[13px] outline-none",style:{borderColor:g.border,backgroundColor:g.surface,color:g.ink},value:i.harness,onChange:j=>{o(C=>({...C,harness:sp(j.target.value)})),p(null)},children:b.map(j=>r.jsx("option",{value:j,children:j},j))})]})]}),r.jsx("div",{className:"rounded-lg border px-3 py-3 text-[12px] leading-[1.6]",style:{borderColor:g.border,backgroundColor:g.surface,color:g.muted},children:"Scout will create the relay-agent config if needed, start the session, then refresh the desktop shell so the new agent appears immediately."}),f?r.jsx("div",{className:"text-[12px] leading-[1.6]",style:{color:"#b91c1c"},children:f}):null]}),r.jsxs(MT,{children:[r.jsx(Nt,{type:"button",variant:"outline",onClick:()=>l(!1),disabled:d,children:"Cancel"}),r.jsx(Nt,{type:"button",onClick:y,disabled:d||!i.projectPath.trim(),children:d?r.jsxs(r.Fragment,{children:[r.jsx(dn,{className:"mr-2"}),"Starting…"]}):r.jsxs(r.Fragment,{children:[r.jsx(Yi,{size:14}),"Create Agent"]})})]})]})})}function IT({open:e,handleFeedbackDialogOpenChange:l,feedbackDraft:a,setFeedbackDraft:i,feedbackSubmission:o,feedbackActionPending:u,feedbackBundleLoading:d,feedbackBundle:f,feedbackBundleError:p,feedbackActionMessage:h,handleSubmitFeedbackReport:y,handleRefreshFeedbackBundle:b,handleRepairSetup:v,handleCopyFeedbackBundle:j,s:C}){return r.jsx(a0,{open:e,onOpenChange:l,children:r.jsxs(r0,{className:"sm:max-w-3xl",children:[r.jsxs(i0,{children:[r.jsx(s0,{children:"Feedback"}),r.jsx(o0,{children:"Submit feedback directly, copy a support bundle, inspect the local Scout environment, or repair onboarding and background services without leaving the current screen."})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-[12px] font-medium",style:C.inkText,children:"What should we look at?"}),r.jsx(zT,{value:a,onChange:E=>i(E.target.value),placeholder:"Describe the issue, what you expected, and what Scout did instead.",className:"min-h-24 resize-y",disabled:u==="submit"}),o?r.jsxs("div",{className:"text-[11px] leading-[1.5]",style:C.mutedText,children:["Latest submission: ",r.jsx("a",{href:o.adminUrl,target:"_blank",rel:"noreferrer",className:"underline",children:o.key})]}):null]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs(Nt,{type:"button",onClick:y,disabled:d||u!==null,children:[u==="submit"?r.jsx(dn,{className:"mr-2"}):r.jsx(R1,{size:14}),"Submit Feedback"]}),r.jsxs(Nt,{type:"button",variant:"outline",onClick:b,disabled:d||u!==null,children:[u==="refresh"?r.jsx(dn,{className:"mr-2"}):r.jsx(gn,{size:14}),"Refresh"]}),r.jsxs(Nt,{type:"button",variant:"outline",onClick:v,disabled:d||u!==null,children:[u==="repair"?r.jsx(dn,{className:"mr-2"}):r.jsx(M1,{size:14}),"Repair Setup"]}),r.jsxs(Nt,{type:"button",onClick:j,disabled:d||u!==null||!f?.text,children:[u==="copy"?r.jsx(dn,{className:"mr-2"}):r.jsx(wa,{size:14}),"Copy Support Bundle"]})]}),h?r.jsx("div",{className:"text-[12px] leading-[1.6]",style:C.inkText,children:h}):null,p?r.jsx("div",{className:"text-[12px] leading-[1.6]",style:{color:"#b91c1c"},children:p}):null,r.jsxs("div",{className:"max-h-[60vh] space-y-3 overflow-y-auto pr-1",style:{scrollbarGutter:"stable both-edges"},children:[d&&!f?r.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:C.mutedText,children:[r.jsx(dn,{className:"text-[14px]"}),"Loading support details…"]}):null,f?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"rounded-lg border px-3 py-2.5 text-[11px] leading-[1.6]",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsx("span",{className:"font-mono uppercase tracking-widest",style:C.mutedText,children:"Generated"}),r.jsx("div",{className:"mt-1",style:C.inkText,children:f.generatedAtLabel})]}),f.sections.map(E=>r.jsxs("section",{className:"rounded-xl border",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsx("div",{className:"border-b px-4 py-3",style:{borderBottomColor:g.border},children:r.jsx("h3",{className:"text-[12px] font-semibold tracking-tight",style:C.inkText,children:E.title})}),r.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:E.entries.map(N=>r.jsxs("div",{className:"grid grid-cols-1 gap-1 px-4 py-3 text-[12px] leading-[1.6] sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3",children:[r.jsx("div",{className:"font-mono uppercase tracking-widest",style:C.mutedText,children:N.label}),r.jsx("div",{className:"break-words",style:C.inkText,children:N.value})]},`${E.id}-${N.label}`))})]},E.id))]}):null]})]})]})})}function PT({children:e,dark:l,setDark:a,C:i,s:o,productSurface:u,setProductSurface:d,activeView:f,setActiveView:p,desktopFeatures:h,pairingSurfaceBadge:y,openRelayDiagnostics:b,relayStatusTitle:v,relayRuntimeBooting:j,relayStatusDotClassName:C,relayStatusLabel:E,runtime:N,headerAgentCount:M,appReloadPending:L,handleReloadApp:H,handleQuitApp:X,navViews:q,collapsibleViews:D,isCollapsed:B,setIsCollapsed:F,pairingSurfaceProps:Z,isAgentSessionPeekOpen:O,selectedInterAgent:P,visibleAgentSession:Q,agentSessionPending:oe,agentSessionLoading:J,agentSessionFeedback:ee,agentSessionCopied:w,agentSessionPeekViewportRef:Y,handlePeekAgentSessionScroll:$,closeAgentSessionPeek:ye,handleCopyAgentSessionCommand:T,handleOpenAgentSession:_,renderLocalPathValue:le,isCreateAgentDialogOpen:R,setIsCreateAgentDialogOpen:pe,agentableProjects:xe,createAgentDraft:ce,setCreateAgentDraft:Re,createAgentDefaults:Te,createAgentSubmitting:Ne,createAgentFeedback:He,setCreateAgentFeedback:Le,handleBrowseCreateAgentProject:Ue,handleCreateAgent:it,availableAgentHarnesses:tt,isFeedbackDialogOpen:st,handleFeedbackDialogOpenChange:ot,feedbackDraft:bt,setFeedbackDraft:Ye,feedbackSubmission:Ge,feedbackActionPending:We,feedbackBundleLoading:we,feedbackBundle:et,feedbackBundleError:Se,feedbackActionMessage:Ze,handleSubmitFeedbackReport:mt,handleRefreshFeedbackBundle:re,handleRepairSetup:ge,handleCopyFeedbackBundle:Ce,openFeedbackDialog:_e,openKnowledgeBase:Xe,logsAttentionLevel:Ae,logsButtonTitle:ue,footerTimeLabel:Ee}){return r.jsxs("div",{className:`flex flex-col h-screen w-full font-sans overflow-hidden${l?" dark":""}`,style:o.root,children:[r.jsxs("div",{className:"scout-window-bar h-12 border-b flex items-center px-3 shrink-0 z-10 gap-3",style:o.topBar,children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("button",{type:"button",className:"w-5 h-5 rounded-md flex items-center justify-center transition-colors hover:bg-[var(--os-hover)]",style:{WebkitAppRegion:"no-drag",color:i.muted},onClick:X,"aria-label":"Quit",title:"Quit",children:r.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:r.jsx("path",{d:"M1 1l6 6M7 1l-6 6"})})}),r.jsx("div",{className:"flex items-center gap-1.5 ml-2",children:[["relay","Relay",h.relay],["pairing","Pairing",h.pairing]].filter(([,,V])=>V).map(([V,me])=>{const je=u===V,Fe=V==="pairing"?y:null;return r.jsxs("button",{type:"button",onClick:()=>d(V),className:"flex items-center gap-2 rounded-lg border px-2.5 py-1 text-[12px] font-semibold tracking-tight transition-colors",style:je?{backgroundColor:i.surface,borderColor:i.border,color:i.ink,boxShadow:"0 1px 0 rgba(0,0,0,0.04)"}:{backgroundColor:i.bg,borderColor:i.border,color:i.muted},children:[r.jsx(qS,{surface:V,active:je}),r.jsx("span",{children:me}),Fe?r.jsx("span",{className:"rounded-full border px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.08em]",style:{backgroundColor:Fe.backgroundColor,borderColor:Fe.borderColor,color:Fe.color},children:Fe.label}):null]},V)})})]}),r.jsx("div",{className:"flex-1 self-stretch min-w-[120px] rounded-md cursor-grab active:cursor-grabbing","aria-hidden":"true"}),r.jsxs("div",{className:"flex items-center gap-5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-3 font-mono text-[9px] uppercase tracking-wider",style:o.mutedText,children:[r.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 rounded-full border px-2 py-1 transition-opacity hover:opacity-80",style:{borderColor:i.border},title:v,children:["Relay",j?r.jsx(dn,{className:"text-[11px]",style:{color:i.muted},"aria-label":"Syncing relay status"}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${C}`}),r.jsx("span",{className:"font-medium",style:o.inkText,children:E})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:["Agents ",r.jsx("span",{className:"font-medium",style:o.inkText,children:M})]})]}),r.jsxs("div",{className:"flex items-center gap-2",style:o.mutedText,children:[r.jsx("button",{onClick:()=>a(V=>!V),className:"p-1 rounded transition-colors hover:opacity-70",title:l?"Switch to light mode":"Switch to dark mode",children:l?r.jsx(O1,{size:14}):r.jsx(A1,{size:14})}),r.jsx("button",{className:"hover:opacity-70 transition-opacity",onClick:H,title:L?"Reloading…":"Reload app",disabled:L,children:L?r.jsx(dn,{className:"text-[14px]"}):r.jsx(gn,{size:14})})]})]})]}),u==="relay"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex flex-1 overflow-hidden os-fade-in",children:[r.jsxs("div",{className:"w-12 border-r flex flex-col items-center py-2 gap-3 shrink-0 z-10",style:o.navBar,children:[r.jsx("div",{className:"flex flex-col gap-1 w-full px-2 mt-2",style:o.mutedText,children:q.map(({id:V,icon:me,title:je,badgeCount:Fe})=>r.jsxs("button",{onClick:()=>p(V),title:je,className:"relative p-1.5 rounded flex items-center justify-center transition-colors",style:f===V?o.activePill:void 0,children:[me,Fe?r.jsx("span",{className:"absolute -top-1 -right-1 min-w-[16px] h-4 px-1 rounded-full text-[9px] font-mono flex items-center justify-center",style:{backgroundColor:"#f97316",color:"#fff7ed"},children:Fe>9?"9+":Fe}):null]},V))}),r.jsxs("div",{className:"mt-auto flex flex-col gap-1 items-center w-full px-2",children:[D.has(f)?r.jsx("button",{onClick:()=>F(V=>!V),className:"p-1.5 rounded flex items-center justify-center transition-opacity hover:opacity-70",style:o.mutedText,title:B?"Expand Sidebar":"Collapse Sidebar",children:B?r.jsx(C2,{size:16,strokeWidth:1.5}):r.jsx(w2,{size:16,strokeWidth:1.5})}):null,h.settings?r.jsx("button",{className:"p-1.5 rounded flex items-center justify-center transition-colors",style:f==="settings"?o.activePill:o.mutedText,title:"Settings",onClick:()=>p("settings"),children:r.jsx(Yr,{size:16,strokeWidth:1.5})}):null]})]}),e]}),r.jsx(_T,{open:O,selectedInterAgent:P,visibleAgentSession:Q,agentSessionPending:oe,agentSessionLoading:J,agentSessionFeedback:ee,agentSessionCopied:w,agentSessionPeekViewportRef:Y,handlePeekAgentSessionScroll:$,handleCopyAgentSessionCommand:T,handleOpenAgentSession:_,closeAgentSessionPeek:ye,renderLocalPathValue:le,s:o})]}):r.jsx(US,{...Z}),r.jsx(BT,{open:R,setOpen:pe,agentableProjects:xe,createAgentDraft:ce,setCreateAgentDraft:Re,createAgentDefaults:Te,createAgentSubmitting:Ne,createAgentFeedback:He,setCreateAgentFeedback:Le,handleBrowseCreateAgentProject:Ue,handleCreateAgent:it,availableAgentHarnesses:tt,s:o}),r.jsx(IT,{open:st,handleFeedbackDialogOpenChange:ot,feedbackDraft:bt,setFeedbackDraft:Ye,feedbackSubmission:Ge,feedbackActionPending:We,feedbackBundleLoading:we,feedbackBundle:et,feedbackBundleError:Se,feedbackActionMessage:Ze,handleSubmitFeedbackReport:mt,handleRefreshFeedbackBundle:re,handleRepairSetup:ge,handleCopyFeedbackBundle:Ce,s:o}),r.jsxs("div",{className:"h-6 border-t flex items-center justify-between px-3 shrink-0 text-[9px] font-mono uppercase tracking-widest",style:{backgroundColor:i.bg,borderTopColor:i.border,color:i.muted},children:[r.jsx("div",{className:"flex items-center gap-4",children:r.jsxs("button",{type:"button",onClick:()=>{d("relay"),p("overview")},className:"flex items-center gap-1 hover:opacity-70 cursor-pointer transition-opacity",children:[r.jsx(Ap,{size:9})," Home"]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("button",{type:"button",onClick:_e,className:"flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:opacity-80",style:st?o.activePill:o.mutedText,title:"Feedback",children:[r.jsx(Rl,{size:9}),r.jsx("span",{children:"Feedback"})]}),r.jsxs("button",{type:"button",onClick:Xe,className:"flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:opacity-80",style:f==="help"?o.activePill:o.mutedText,title:"Help",children:[r.jsx(v1,{size:9}),r.jsx("span",{children:"Help"})]}),r.jsxs("button",{onClick:()=>{d("relay"),p("logs")},className:"flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:opacity-80",style:f==="logs"?o.activePill:o.mutedText,title:ue,children:[r.jsx(wo,{size:9}),r.jsx("span",{children:"Logs"}),Ae?r.jsx("span",{className:`block w-1.5 h-1.5 rounded-full ${Ae==="error"?"bg-rose-500":"bg-amber-500"}`}):null]}),r.jsx("span",{className:"w-px h-3",style:{backgroundColor:i.border}}),r.jsx("span",{style:o.inkText,children:Ee})]})]})]})}function UT(e,l){return e==="working"?l.activePill:e==="available"?{backgroundColor:"rgba(34, 197, 94, 0.12)",color:"#166534"}:l.tagBadge}function HT({C:e,s:l,bootLoader:a,homeAgents:i,activity:o,shellError:u,onRefresh:d,onOpenAgent:f,colorForIdentity:p}){const h=z.useMemo(()=>i.slice(0,8),[i]),y=z.useMemo(()=>o.slice(0,18),[o]),b=z.useCallback(async(v,j)=>{if(v.stopPropagation(),!(typeof navigator>"u"||!navigator.clipboard?.writeText))try{await navigator.clipboard.writeText(j)}catch{}},[]);return r.jsx("div",{className:"flex-1 flex overflow-hidden",children:r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsxs("div",{className:"w-full px-8 py-8",children:[r.jsxs("div",{className:"flex items-center justify-between mb-8",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-semibold tracking-tight",style:l.inkText,children:"Home"}),r.jsx("p",{className:"text-[12px] mt-1 leading-[1.6]",style:l.mutedText,children:"Recent agents and the latest relay activity."})]}),r.jsx("button",{onClick:d,className:"os-btn flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-[12px] transition-colors",style:{color:e.muted},title:"Refresh",children:r.jsx(gn,{size:13})})]}),r.jsxs("section",{className:"mb-8",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h2",{className:"text-[16px] font-semibold",style:l.inkText,children:"Recent Agents"}),i.length>h.length?r.jsxs("div",{className:"text-[11px]",style:l.mutedText,children:["Top ",h.length," by recent activity"]}):null]}),h.length>0?r.jsx("div",{className:"-mx-2 overflow-x-auto px-2 pb-2",children:r.jsx("div",{className:"flex gap-3 min-w-max",children:h.map(v=>r.jsx("button",{type:"button",onClick:()=>f(v.id),className:"w-[220px] shrink-0 text-left rounded-xl border px-4 py-3 transition-colors hover:opacity-90",style:{borderColor:e.border,backgroundColor:e.surface},children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-full text-white flex items-center justify-center text-[12px] font-bold shrink-0",style:{backgroundColor:p(v.id)},title:v.title,children:v.title.charAt(0).toUpperCase()}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("div",{className:"text-[13px] font-semibold truncate",style:l.inkText,children:v.title}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded-full",style:UT(v.state,l),children:v.statusLabel})]}),v.role?r.jsx("div",{className:"text-[11px] mt-1 truncate",style:l.mutedText,children:v.role}):null,v.statusDetail?r.jsx("div",{className:"text-[11px] mt-2 line-clamp-2",style:l.mutedText,children:v.statusDetail}):v.summary?r.jsx("div",{className:"text-[11px] mt-2 line-clamp-2",style:l.mutedText,children:v.summary}):null,v.timestampLabel?r.jsxs("div",{className:"text-[10px] mt-2 uppercase tracking-[0.12em]",style:l.mutedText,children:["Active ",v.timestampLabel]}):null]})]})},v.id))})}):r.jsx("div",{className:"rounded-xl border px-4 py-6 text-[13px]",style:{borderColor:e.border,color:e.muted},children:"No agents are visible yet."})]}),r.jsxs("section",{children:[r.jsx("div",{className:"flex items-center justify-between mb-4",children:r.jsx("h2",{className:"text-[16px] font-semibold",style:l.inkText,children:"Activity Stream"})}),a?r.jsx("div",{className:"min-h-[20rem] flex items-center justify-center rounded-xl border px-6 py-8",style:{borderColor:e.border,backgroundColor:e.surface},children:a}):y.length>0?r.jsx("div",{className:"divide-y rounded-xl border overflow-hidden",style:{borderColor:e.border},children:y.map(v=>r.jsxs("div",{className:"group relative flex items-start gap-4 px-4 py-4",style:{backgroundColor:e.surface},children:[r.jsx("button",{type:"button",className:"relative shrink-0 mt-0.5",onClick:()=>f(v.actorId),title:v.actorName,children:r.jsx("div",{className:"w-9 h-9 rounded-full text-white flex items-center justify-center text-[12px] font-bold",style:{backgroundColor:p(v.actorId)},children:v.actorName.slice(0,1).toUpperCase()})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[r.jsx("button",{type:"button",className:"text-[13px] font-semibold transition-opacity hover:opacity-75",style:l.inkText,onClick:()=>f(v.actorId),title:`Open ${v.actorName}`,children:v.actorName}),v.kind==="system"?r.jsx("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full",style:l.tagBadge,children:"system"}):v.channel?r.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full",style:l.tagBadge,children:["#",v.channel]}):null,r.jsx("span",{className:"flex-1"}),r.jsxs("span",{className:"text-[11px] flex items-center gap-1",style:l.mutedText,children:[r.jsx(Wi,{size:10}),v.timestampLabel]})]}),r.jsx("div",{className:"text-[13px] leading-[1.65]",style:l.mutedText,children:v.detail??v.title})]}),v.detail?r.jsx("div",{className:"absolute right-3 top-3 flex items-center gap-0.5 rounded-lg border p-1 opacity-0 group-hover:opacity-100 transition-opacity",style:{backgroundColor:e.bg,borderColor:e.border},children:r.jsx("button",{onClick:j=>{b(j,v.detail??"")},className:"p-1 rounded hover:opacity-70",style:{color:e.muted},title:"Copy",children:r.jsx(wa,{size:12})})}):null]},v.id))}):r.jsx("div",{className:"py-16 text-center border rounded-xl",style:{borderColor:e.border},children:r.jsx("div",{className:"text-[13px]",style:l.mutedText,children:"Waiting for recent activity..."})})]}),u?r.jsx("div",{className:"mt-6 rounded-xl border px-4 py-3",style:{borderColor:e.border,backgroundColor:e.surface},children:r.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:l.mutedText,children:[r.jsx(ul,{size:12}),r.jsx("span",{children:u})]})}):null]})})})}function FT({activeView:e,overviewViewProps:l,inbox:a,activity:i}){return e==="overview"?r.jsx(HT,{...l}):e==="inbox"?r.jsx(r.Fragment,{children:r.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:a.styles.surface,children:[r.jsxs("div",{className:"border-b shrink-0 px-6 py-5",style:{borderBottomColor:g.border},children:[r.jsx("div",{className:"flex items-start justify-between gap-6",children:r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:a.styles.mutedText,children:"Inbox"}),r.jsx("h1",{className:"text-[28px] font-semibold tracking-tight",style:a.styles.inkText,children:"Things You Asked Scout To Tell You About"}),r.jsx("p",{className:"text-[13px] mt-2 max-w-3xl leading-[1.65]",style:a.styles.mutedText,children:"Notifications are opt-in. This surface is reserved for approvals, failed asks, and other subscribed updates that are actually worth surfacing."})]})}),r.jsx("div",{className:"grid grid-cols-4 gap-3 mt-5",children:[{label:"Needs You",value:`${a.inboxAlertCount}`,detail:`${a.pendingApprovalsCount} approvals · ${a.inboxFailedTaskCount} failed asks`},{label:"Approvals",value:`${a.pendingApprovalsCount}`,detail:"Inline pairing actions"},{label:"Failures",value:`${a.inboxFailedTaskCount}`,detail:"Failed asks from plans"},{label:"Policy",value:"Opt-in",detail:"Progress and watchlists stay elsewhere"}].map(o=>r.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:a.styles.mutedText,children:o.label}),r.jsx("div",{className:"text-[24px] font-semibold mt-2",style:a.styles.inkText,children:o.value}),r.jsx("div",{className:"text-[11px] mt-1",style:a.styles.mutedText,children:o.detail})]},o.label))})]}),r.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:r.jsxs("div",{className:"grid grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)] gap-4",children:[r.jsxs("section",{className:"border rounded-xl overflow-hidden min-w-0",style:{...a.styles.surface,borderColor:g.border},children:[r.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border},children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:a.styles.mutedText,children:"Needs You"}),r.jsx("div",{className:"text-[11px] mt-1",style:a.styles.mutedText,children:"Approvals and failed asks that are worth interrupting for."})]}),r.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:a.inboxAlertCount>0?a.styles.activePill:a.styles.tagBadge,children:[a.inboxAlertCount," items"]})]}),r.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:a.inboxAwaitingYouItems.length>0?a.inboxAwaitingYouItems.map(o=>r.jsx("div",{className:"px-4 py-4",style:{backgroundColor:g.surface},children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:o.tone==="critical"?{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"}:o.tone==="warning"?{backgroundColor:"rgba(251, 191, 36, 0.16)",color:"#92400e"}:a.styles.activePill,children:o.kind}),r.jsx("span",{className:"text-[9px] font-mono",style:a.styles.mutedText,children:o.meta})]}),r.jsx("div",{className:"text-[13px] font-medium mt-2 leading-[1.5]",style:a.styles.inkText,children:o.title}),r.jsx("div",{className:"text-[11px] mt-1 leading-[1.6]",style:a.styles.mutedText,children:o.summary}),o.detail&&o.detail!==o.summary?r.jsx("div",{className:"mt-2 rounded-lg border px-3 py-2 text-[11px] leading-[1.6]",style:{borderColor:g.border,backgroundColor:g.bg,color:g.muted},children:o.detail}):null]}),r.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[r.jsx("button",{type:"button",onClick:o.onAction,className:"text-[10px] font-medium hover:opacity-80",style:{color:g.accent},children:o.actionLabel}),o.onSecondaryAction&&o.secondaryActionLabel?r.jsx("button",{type:"button",onClick:o.onSecondaryAction,className:"text-[10px] font-medium hover:opacity-80",style:a.styles.mutedText,children:o.secondaryActionLabel}):null]})]})},o.id)):r.jsx("div",{className:"px-4 py-10 text-[12px] text-center",style:a.styles.mutedText,children:"Nothing urgent right now."})})]}),r.jsx("div",{className:"space-y-4 min-w-0",children:r.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...a.styles.surface,borderColor:g.border},children:[r.jsxs("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:a.styles.mutedText,children:"Notes"}),r.jsx("div",{className:"text-[11px] mt-1",style:a.styles.mutedText,children:"This is UI-only for now, backed by existing desktop state instead of durable broker attention events."})]}),r.jsx("div",{className:"px-4 py-4 text-[11px] leading-[1.7]",style:a.styles.mutedText,children:"Inbox is currently limited to approvals and failed asks. Agent progress, stale/problem states, and cleanup flows stay in other parts of Scout."})]})})]})})]})}):e!=="activity"?null:r.jsx(GT,{activity:i})}const iy=280,sy=["#6366f1","#f59e0b","#10b981","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#06b6d4","#84cc16"];function Rm(e){let l=0;for(let a=0;a<e.length;a++)l=(l<<5)-l+e.charCodeAt(a)|0;return sy[Math.abs(l)%sy.length]}function qT(e){const l=[];for(const a of e.activityTasks)l.push({id:`task-${a.id}`,kind:"task",sortKey:a.createdAt,actor:a.targetAgentName,avatarLabel:a.targetAgentName.charAt(0).toUpperCase(),avatarColor:Rm(a.targetAgentId),eventLabel:a.statusLabel,timestamp:a.ageLabel??a.updatedAtLabel??a.createdAtLabel,body:a.title+(a.statusDetail?`
58
+ ${a.statusDetail}`:"")+(a.replyPreview?`
59
+ ${a.replyPreview}`:""),channel:a.project,data:a});for(const a of e.activityRecentMessages)l.push({id:`msg-${a.id}`,kind:"message",sortKey:a.createdAt,actor:a.authorName,avatarLabel:a.avatarLabel,avatarColor:a.avatarColor,eventLabel:a.messageClass??"message",timestamp:a.timestampLabel,body:a.body,channel:a.normalizedChannel,data:a});for(const a of e.activityFindings)l.push({id:`finding-${a.id}`,kind:"finding",sortKey:Date.now(),actor:a.targetAgentName??"System",avatarLabel:(a.targetAgentName??"S").charAt(0).toUpperCase(),avatarColor:a.severity==="error"?"#ef4444":"#f59e0b",eventLabel:a.severity,timestamp:a.ageLabel??a.updatedAtLabel??"",body:`${a.title}
60
+ ${a.summary}`,channel:null,data:a});for(const a of e.activityEndpoints)l.push({id:`ep-${a.endpoint.id}`,kind:"endpoint",sortKey:Date.now()-1,actor:a.endpoint.agentName,avatarLabel:a.endpoint.agentName.charAt(0).toUpperCase(),avatarColor:Rm(a.endpoint.agentId),eventLabel:a.endpoint.stateLabel,timestamp:a.endpoint.lastActiveLabel??"",body:a.endpoint.activeTask??`${a.endpoint.stateLabel} on ${a.machineTitle}`,channel:a.endpoint.project,data:a});for(const a of e.overviewSessions)l.push({id:`session-${a.id}`,kind:"session",sortKey:new Date(a.lastModified).getTime()||0,actor:a.agent,avatarLabel:a.agent.charAt(0).toUpperCase(),avatarColor:Rm(a.agent),eventLabel:"session",timestamp:a.lastModified,body:a.title+(a.preview?`
61
+ ${a.preview}`:""),channel:a.project,data:a});return l.sort((a,i)=>i.sortKey-a.sortKey),l}const VT={task:"Task",message:"Message",finding:"Finding",endpoint:"Endpoint",session:"Session"};function GT({activity:e}){const[l,a]=A.useState(null),[i,o]=A.useState(()=>new Set),u=A.useMemo(()=>qT(e),[e.activityTasks,e.activityRecentMessages,e.activityFindings,e.activityEndpoints,e.overviewSessions]),d=A.useMemo(()=>{const b=new Set;for(const v of u)v.channel&&b.add(v.channel);return Array.from(b).sort()},[u]),[f,p]=A.useState(null),h=f?u.filter(b=>b.channel===f):u,y=l?u.find(b=>b.id===l)??null:null;return r.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:e.styles.surface,children:[r.jsxs("div",{className:"border-b shrink-0 px-6 py-3",style:{borderBottomColor:g.border},children:[r.jsxs("div",{className:"flex items-center justify-between gap-6",children:[r.jsxs("div",{className:"flex items-center gap-4 min-w-0",children:[r.jsx("h1",{className:"text-[18px] font-semibold tracking-tight",style:e.styles.inkText,children:"Activity"}),r.jsx("div",{className:"flex items-center gap-3",children:[{label:"Running",value:e.plansState?.runningTaskCount??0},{label:"Watchlist",value:e.plansState?.findingCount??0},{label:"Agents",value:e.runtime?.agentCount??0}].map(b=>r.jsxs("span",{className:"text-[11px] font-mono",style:e.styles.mutedText,children:[b.label," ",r.jsx("span",{style:e.styles.inkText,children:b.value})]},b.label))})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsxs("button",{type:"button",onClick:e.onRefresh,className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},children:[r.jsx(gn,{size:14}),"Refresh"]}),r.jsxs("button",{type:"button",onClick:e.onOpenPlans,className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},children:[r.jsx(Tp,{size:14}),"Plans"]}),r.jsxs("button",{type:"button",onClick:e.onOpenMessages,className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},children:[r.jsx(Rl,{size:14}),"Messages"]})]})]}),d.length>0&&r.jsxs("div",{className:"flex items-center gap-1.5 mt-3 overflow-x-auto",children:[r.jsx("button",{type:"button",onClick:()=>p(null),className:"text-[10px] font-medium px-2.5 py-1 rounded-full shrink-0 transition-colors",style:f===null?{backgroundColor:g.accent,color:"#fff"}:{backgroundColor:g.bg,color:g.muted,border:`1px solid ${g.border}`},children:"All"}),d.map(b=>r.jsx("button",{type:"button",onClick:()=>p(f===b?null:b),className:"text-[10px] font-medium px-2.5 py-1 rounded-full shrink-0 transition-colors",style:f===b?{backgroundColor:g.accent,color:"#fff"}:{backgroundColor:g.bg,color:g.muted,border:`1px solid ${g.border}`},children:b},b))]})]}),r.jsxs("div",{className:"flex-1 flex min-h-0",children:[r.jsx("div",{className:"flex-1 overflow-y-auto min-w-0",children:h.length>0?r.jsx("div",{className:"px-5 py-4 space-y-1",children:h.map(b=>{const v=b.id===l,j=i.has(b.id),C=b.body.length>iy,E=C&&!j?b.body.slice(0,iy)+"...":b.body;return r.jsxs("div",{className:"flex items-start gap-3 rounded-xl px-3 py-3 transition-colors cursor-pointer",style:{backgroundColor:v?g.accentBg:"transparent"},onClick:()=>a(v?null:b.id),role:"button",tabIndex:0,onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),a(v?null:b.id))},children:[r.jsx("div",{className:"w-8 h-8 rounded-full text-white flex items-center justify-center text-[11px] font-bold shrink-0 mt-0.5",style:{backgroundColor:b.avatarColor},children:b.avatarLabel}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-[13px] font-semibold",style:e.styles.inkText,children:b.actor}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:b.kind==="task"?c0(e,b.data.status):b.kind==="finding"?u0(b.data.severity):b.kind==="endpoint"?d0(e,b.data.endpoint.state):e.styles.tagBadge,children:b.eventLabel}),r.jsx("span",{className:"text-[10px] font-mono",style:e.styles.mutedText,children:b.timestamp})]}),r.jsx("div",{className:"text-[12px] leading-[1.7] mt-1.5 whitespace-pre-wrap",style:e.styles.inkText,children:E}),C&&r.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),o(M=>{const L=new Set(M);return L.has(b.id)?L.delete(b.id):L.add(b.id),L})},className:"text-[11px] font-medium mt-1 hover:opacity-80",style:{color:g.accent},children:j?"Show less":"Show more"}),b.channel&&r.jsx("div",{className:"mt-1.5",children:r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.styles.tagBadge,children:b.channel})})]}),r.jsx("div",{className:"shrink-0 mt-1",children:r.jsx(El,{size:14,style:{color:g.muted,opacity:v?1:.3}})})]},b.id)})}):r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsx("div",{className:"text-[12px] text-center",style:e.styles.mutedText,children:"No activity yet."})})}),y&&r.jsxs("div",{className:"border-l overflow-y-auto shrink-0",style:{width:360,borderLeftColor:g.border,backgroundColor:g.bg},children:[r.jsxs("div",{className:"px-5 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border},children:[r.jsxs("span",{className:"text-[10px] font-mono uppercase tracking-widest",style:e.styles.mutedText,children:[VT[y.kind]," Details"]}),r.jsx("button",{type:"button",onClick:()=>a(null),className:"shrink-0 hover:opacity-80",style:{color:g.muted},children:r.jsx(ul,{size:14})})]}),r.jsxs("div",{className:"px-5 py-4",children:[y.kind==="task"&&r.jsx($T,{task:y.data,activity:e}),y.kind==="message"&&r.jsx(YT,{message:y.data,activity:e}),y.kind==="finding"&&r.jsx(QT,{finding:y.data,activity:e}),y.kind==="endpoint"&&r.jsx(XT,{entry:y.data,activity:e}),y.kind==="session"&&r.jsx(KT,{session:y.data,activity:e})]})]})]})]})}function c0(e,l){switch(l){case"running":return e.styles.activePill;case"failed":return{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"};case"completed":return{backgroundColor:"rgba(34, 197, 94, 0.12)",color:"#166534"};default:return e.styles.tagBadge}}function u0(e){return e==="error"?{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"}:{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#b45309"}}function d0(e,l){switch(l){case"running":return e.styles.activePill;case"waiting":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#b45309"};default:return e.styles.tagBadge}}function Rt({label:e,children:l,styles:a}){return r.jsxs("div",{className:"mb-3",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:e}),r.jsx("div",{className:"text-[12px] leading-[1.6]",style:a.inkText,children:l})]})}function $T({task:e,activity:l}){const{styles:a}=l;return r.jsxs("div",{children:[r.jsx(Rt,{label:"Status",styles:a,children:r.jsx("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded",style:c0(l,e.status),children:e.statusLabel})}),r.jsx(Rt,{label:"Agent",styles:a,children:e.targetAgentName}),e.project&&r.jsx(Rt,{label:"Project",styles:a,children:e.project}),r.jsx(Rt,{label:"Created",styles:a,children:e.createdAtLabel}),e.updatedAtLabel&&r.jsx(Rt,{label:"Updated",styles:a,children:e.updatedAtLabel}),e.ageLabel&&r.jsx(Rt,{label:"Age",styles:a,children:e.ageLabel}),e.body&&e.body!==e.title&&r.jsxs("div",{className:"mt-4",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Full Body"}),r.jsx("div",{className:"text-[11px] leading-[1.65] rounded-lg border px-3 py-2 whitespace-pre-wrap",style:{borderColor:g.border,backgroundColor:g.surface,...a.mutedText},children:e.body})]}),r.jsxs("button",{type:"button",onClick:()=>l.onOpenAgentProfile(e.targetAgentId),className:"mt-5 text-[11px] font-medium hover:opacity-80",style:{color:g.accent},children:["Open ",e.targetAgentName]})]})}function YT({message:e,activity:l}){const{styles:a}=l,i=l.interAgentAgentLookup.get(e.authorId)??null,o=e.recipients.filter(u=>u!==e.authorId);return r.jsxs("div",{children:[e.messageClass&&r.jsx(Rt,{label:"Event",styles:a,children:r.jsx("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded",style:e.messageClass==="status"?l.styles.activePill:l.styles.tagBadge,children:e.messageClass})}),r.jsx(Rt,{label:"Time",styles:a,children:e.timestampLabel}),r.jsx(Rt,{label:"Author",styles:a,children:e.authorName}),o.length>0&&r.jsx(Rt,{label:"Recipients",styles:a,children:o.join(", ")}),e.normalizedChannel&&r.jsx(Rt,{label:"Channel",styles:a,children:e.normalizedChannel}),r.jsx(Rt,{label:"Thread",styles:a,children:r.jsx("span",{className:"font-mono text-[10px]",children:e.conversationId})}),i&&r.jsxs("button",{type:"button",onClick:()=>l.onOpenAgentProfile(i.id),className:"mt-4 text-[11px] font-medium hover:opacity-80",style:{color:g.accent},children:["Open ",i.title??e.authorName]})]})}function QT({finding:e,activity:l}){const{styles:a}=l;return r.jsxs("div",{children:[r.jsx(Rt,{label:"Severity",styles:a,children:r.jsx("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded",style:u0(e.severity),children:e.severity})}),r.jsx(Rt,{label:"Kind",styles:a,children:e.kind}),e.targetAgentName&&r.jsx(Rt,{label:"Agent",styles:a,children:e.targetAgentName}),e.requesterName&&r.jsx(Rt,{label:"Requester",styles:a,children:e.requesterName}),e.ageLabel&&r.jsx(Rt,{label:"Age",styles:a,children:e.ageLabel}),e.detail&&r.jsxs("div",{className:"mt-4",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Detail"}),r.jsx("div",{className:"text-[11px] leading-[1.65] rounded-lg border px-3 py-2 whitespace-pre-wrap",style:{borderColor:g.border,backgroundColor:g.surface,...a.mutedText},children:e.detail})]}),e.targetAgentId&&r.jsxs("button",{type:"button",onClick:()=>l.onOpenAgentProfile(e.targetAgentId),className:"mt-5 text-[11px] font-medium hover:opacity-80",style:{color:g.accent},children:["Open ",e.targetAgentName]})]})}function XT({entry:e,activity:l}){const{styles:a}=l,i=e.endpoint;return r.jsxs("div",{children:[r.jsx(Rt,{label:"State",styles:a,children:r.jsx("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded",style:d0(l,i.state),children:i.stateLabel})}),r.jsx(Rt,{label:"Machine",styles:a,children:e.machineTitle}),r.jsx(Rt,{label:"Transport",styles:a,children:i.transport??"runtime"}),i.project&&r.jsx(Rt,{label:"Project",styles:a,children:i.project}),i.harness&&r.jsx(Rt,{label:"Harness",styles:a,children:i.harness}),i.lastActiveLabel&&r.jsx(Rt,{label:"Last Active",styles:a,children:i.lastActiveLabel}),r.jsxs("button",{type:"button",onClick:()=>l.onOpenAgentProfile(i.agentId),className:"mt-5 text-[11px] font-medium hover:opacity-80",style:{color:g.accent},children:["Open ",i.agentName]})]})}function KT({session:e,activity:l}){const{styles:a}=l;return r.jsxs("div",{children:[r.jsx(Rt,{label:"Project",styles:a,children:e.project}),r.jsx(Rt,{label:"Agent",styles:a,children:e.agent}),r.jsx(Rt,{label:"Messages",styles:a,children:e.messageCount}),r.jsx(Rt,{label:"Created",styles:a,children:l.formatDate(e.createdAt)}),r.jsx(Rt,{label:"Last Modified",styles:a,children:l.formatDate(e.lastModified)}),e.model&&r.jsx(Rt,{label:"Model",styles:a,children:e.model}),e.tokens!=null&&r.jsx(Rt,{label:"Tokens",styles:a,children:e.tokens.toLocaleString()}),e.tags&&e.tags.length>0&&r.jsx(Rt,{label:"Tags",styles:a,children:r.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(i=>r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:i},i))})}),r.jsx("button",{type:"button",onClick:()=>l.onOpenSessionDetail(e),className:"mt-5 text-[11px] font-medium hover:opacity-80",style:{color:g.accent},children:"Open Session"})]})}function ZT(e){return e.isLocal?u2:e.capabilities.includes("broker")?Ep:w1}function oy(e,l){switch(e){case"online":return{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"};case"degraded":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"};case"offline":return{backgroundColor:l.tagBg,color:l.muted}}}function WT(e,l){switch(e){case"running":return{backgroundColor:"rgba(59, 130, 246, 0.12)",color:"#2563eb"};case"idle":return{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"};case"waiting":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"};case"offline":return{backgroundColor:l.tagBg,color:l.muted}}}function JT({machinesState:e,C:l,s:a,isCollapsed:i,sidebarWidth:o,onResizeStart:u,onOpenRelayAgent:d,onRefresh:f,identityColor:p}){const[h,y]=A.useState(e.machines[0]?.id??null);A.useEffect(()=>{if(!e.machines.length){y(null);return}(!h||!e.machines.some(v=>v.id===h))&&y(e.machines[0]?.id??null)},[e.machines,h]);const b=A.useMemo(()=>e.machines.find(v=>v.id===h)??e.machines[0]??null,[e.machines,h]);return r.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[i?null:r.jsxs("div",{style:{width:o,...a.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[r.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:u}),r.jsxs("div",{className:"px-4 h-14 flex items-center justify-between border-b",style:{borderBottomColor:l.border},children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:a.inkText,children:"Machines"}),r.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:a.mutedText,children:[e.onlineCount,"/",e.totalMachines," online"]})]}),r.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:a.mutedText,onClick:f,children:r.jsx(gn,{size:14})})]}),r.jsx("div",{className:"p-3 border-b grid grid-cols-3 gap-2",style:{borderColor:l.border},children:[{label:"Nodes",value:e.totalMachines,icon:Ep},{label:"Live",value:e.onlineCount,icon:Km},{label:"Warn",value:e.degradedCount,icon:Sb}].map(v=>r.jsxs("div",{className:"text-center p-2 rounded",style:{backgroundColor:l.surface},children:[r.jsx(v.icon,{size:14,className:"mx-auto mb-1",style:a.mutedText}),r.jsx("div",{className:"text-sm font-bold",style:a.inkText,children:v.value}),r.jsx("div",{className:"text-[8px] font-mono uppercase",style:a.mutedText,children:v.label})]},v.label))}),r.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:r.jsx("div",{className:"space-y-1",children:e.machines.map(v=>{const j=ZT(v),C=v.id===b?.id;return r.jsx("button",{onClick:()=>y(v.id),className:"os-row w-full text-left p-3 rounded-lg transition-all",style:C?{backgroundColor:l.surface,borderColor:l.border,border:`1px solid ${l.border}`}:void 0,children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center",style:{backgroundColor:l.tagBg},children:r.jsx(j,{size:18,style:v.status==="offline"?a.mutedText:a.inkText})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("div",{className:"text-[12px] font-medium truncate",style:a.inkText,children:v.title}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:oy(v.status,l),children:v.statusLabel})]}),r.jsxs("div",{className:"text-[10px] leading-[1.5]",style:a.mutedText,children:[v.endpointCount," endpoints",v.lastSeenLabel?` · seen ${v.lastSeenLabel}`:""]})]})]})},v.id)})})})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i&&e.machines.length>0?r.jsx("div",{className:"px-6 py-4 border-b flex items-center gap-2 overflow-x-auto",style:{borderColor:l.border},children:e.machines.map(v=>r.jsx("button",{onClick:()=>y(v.id),className:"os-btn border rounded-lg px-3 py-2 text-[11px] font-medium whitespace-nowrap",style:v.id===b?.id?a.activeItem:{...a.surface,borderColor:l.border,color:l.ink},children:v.title},v.id))}):null,b?r.jsxs("div",{className:"px-8 py-8 space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-6",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:a.mutedText,children:"Node Detail"}),r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx("h1",{className:"text-[26px] font-semibold tracking-tight",style:a.inkText,children:b.title}),r.jsx("span",{className:"text-[10px] font-mono uppercase px-2 py-1 rounded",style:oy(b.status,l),children:b.statusLabel})]}),r.jsxs("div",{className:"text-[13px] leading-[1.7] max-w-2xl",style:a.mutedText,children:[b.statusDetail,b.hostName?` Host: ${b.hostName}.`:"",b.brokerUrl?` Broker: ${b.brokerUrl}.`:""]})]}),r.jsxs("button",{onClick:f,className:"os-btn border px-3 py-2 rounded-lg text-[12px] font-medium shadow-sm flex items-center gap-2",style:{...a.surface,borderColor:l.border,color:l.ink},children:[r.jsx(gn,{size:14}),"Refresh"]})]}),r.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Reachable",value:b.reachableEndpointCount,icon:Km},{label:"Running",value:b.workingEndpointCount,icon:Sb},{label:"Projects",value:b.projectCount,icon:w1},{label:"Endpoints",value:b.endpointCount,icon:bo}].map(v=>r.jsxs("div",{className:"border rounded-xl p-4",style:{...a.surface,borderColor:l.border},children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",style:a.mutedText,children:[r.jsx(v.icon,{size:14}),r.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest",children:v.label})]}),r.jsx("div",{className:"text-[22px] font-semibold",style:a.inkText,children:v.value})]},v.label))}),r.jsxs("div",{className:"grid grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)] gap-6",children:[r.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{borderColor:l.border},children:[r.jsx("div",{className:"px-4 py-3 border-b flex items-center justify-between",style:{...a.surface,borderBottomColor:l.border},children:r.jsxs("div",{children:[r.jsx("div",{className:"text-[13px] font-semibold",style:a.inkText,children:"Runtime Endpoints"}),r.jsx("div",{className:"text-[10px] font-mono mt-1",style:a.mutedText,children:"Relay agents and sessions attached to this node"})]})}),r.jsx("div",{className:"divide-y",style:{borderColor:l.border},children:b.endpoints.length>0?b.endpoints.map(v=>r.jsxs("div",{className:"px-4 py-4",style:a.surface,children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[r.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r.jsx("div",{className:"w-8 h-8 rounded-lg text-white flex items-center justify-center text-[11px] font-bold shrink-0",style:{backgroundColor:p(v.agentId)},children:v.agentName.charAt(0).toUpperCase()}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("div",{className:"text-[13px] font-medium truncate",style:a.inkText,children:v.agentName}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:WT(v.state,l),children:v.stateLabel})]}),r.jsxs("div",{className:"text-[11px] leading-[1.6]",style:a.mutedText,children:[v.project??"No project root",v.projectRoot?` · ${v.projectRoot}`:""]})]})]}),r.jsxs("button",{onClick:()=>d(v.agentId),className:"text-[11px] font-medium flex items-center gap-1 shrink-0",style:{color:l.accent},children:["Open Relay ",r.jsx(El,{size:12})]})]}),r.jsxs("div",{className:"grid grid-cols-4 gap-3 text-[11px]",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Harness"}),r.jsx("div",{style:a.inkText,children:v.harness??"Unknown"})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Transport"}),r.jsx("div",{style:a.inkText,children:v.transport??"Unknown"})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Session"}),r.jsx("div",{style:a.inkText,children:v.sessionId??"Not reported"})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Activity"}),r.jsx("div",{style:a.inkText,children:v.lastActiveLabel??"Not reported"})]})]}),v.activeTask?r.jsx("div",{className:"mt-3 text-[11px] leading-[1.6] border rounded-lg px-3 py-2",style:{borderColor:l.border,color:l.muted,backgroundColor:l.bg},children:v.activeTask}):null]},v.id)):r.jsx("div",{className:"px-4 py-8 text-[12px] text-center",style:{...a.surface,color:l.muted},children:"No registered endpoints on this node yet."})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("section",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:l.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:a.mutedText,children:"Machine Profile"}),r.jsx("div",{className:"space-y-3 text-[12px]",children:[["Scope",b.advertiseScope??"Not reported"],["Registered",b.registeredAtLabel??"Not reported"],["Seen",b.lastSeenLabel??"Not reported"],["Labels",b.labels.length?b.labels.join(", "):"None"]].map(([v,j])=>r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:v}),r.jsx("div",{style:a.inkText,children:j})]},v))})]}),r.jsxs("section",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:l.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:a.mutedText,children:"Projects"}),b.projectRoots.length>0?r.jsx("div",{className:"space-y-2",children:b.projectRoots.map(v=>r.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:a.inkText,children:[r.jsx(r2,{size:12,style:a.mutedText}),r.jsx("span",{className:"truncate",children:v})]},v))}):r.jsx("div",{className:"text-[12px]",style:a.mutedText,children:"No project roots reported for this node yet."})]})]})]})]}):r.jsx("div",{className:"h-full flex items-center justify-center px-8 text-center",children:r.jsxs("div",{children:[r.jsx("div",{className:"text-[15px] font-medium mb-2",style:a.inkText,children:"No machines visible"}),r.jsx("div",{className:"text-[12px]",style:a.mutedText,children:"Start the broker and register a node to inspect servers and workstations here."})]})})]})]})}function eA(e,l){switch(e.status){case"running":return{icon:T1,pill:{backgroundColor:"rgba(59, 130, 246, 0.12)",color:"#2563eb"}};case"completed":return{icon:k1,pill:{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"}};case"failed":return{icon:Cp,pill:{backgroundColor:"rgba(239, 68, 68, 0.12)",color:"#dc2626"}};case"queued":return{icon:PN,pill:{backgroundColor:l.tagBg,color:l.muted}}}}function tA(e,l){switch(e.status){case"completed":return{backgroundColor:"rgba(16, 185, 129, 0.12)",color:"#059669"};case"in-progress":return{backgroundColor:"rgba(59, 130, 246, 0.12)",color:"#2563eb"};case"awaiting-review":return{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"};case"paused":return{backgroundColor:"rgba(148, 163, 184, 0.18)",color:"#475569"};case"draft":return{backgroundColor:l.tagBg,color:l.muted}}}function nA(e,l){return e.severity==="error"?{backgroundColor:"rgba(239, 68, 68, 0.12)",color:"#dc2626"}:{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"}}function lA({plansState:e,C:l,s:a,isCollapsed:i,sidebarWidth:o,onResizeStart:u,onOpenRelayAgent:d,onRefresh:f,identityColor:p}){const[h,y]=A.useState("tasks"),[b,v]=A.useState("all"),j=A.useMemo(()=>Array.from(new Set(e.tasks.map(N=>N.targetAgentName))).sort(),[e.tasks]),C=A.useMemo(()=>b==="all"?e.tasks:e.tasks.filter(N=>N.targetAgentName===b),[e.tasks,b]),E=A.useMemo(()=>b==="all"?e.plans:e.plans.filter(N=>N.agent===b||N.agentId===b.toLowerCase()),[e.plans,b]);return r.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[i?null:r.jsxs("div",{style:{width:o,...a.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[r.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:u}),r.jsxs("div",{className:"px-4 h-14 flex items-center justify-between border-b",style:{borderBottomColor:l.border},children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:a.inkText,children:"Plans & Tasks"}),r.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:a.mutedText,children:[e.taskCount," asks · ",e.planCount," plans"]})]}),r.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:a.mutedText,onClick:f,children:r.jsx(gn,{size:14})})]}),r.jsx("div",{className:"p-3 border-b grid grid-cols-2 gap-2",style:{borderColor:l.border},children:[{label:"Running",value:e.runningTaskCount},{label:"Plans",value:e.planCount},{label:"Findings",value:e.findingCount},{label:"Workspaces",value:e.workspaceCount}].map(N=>r.jsxs("div",{className:"p-2 rounded",style:{backgroundColor:l.surface},children:[r.jsx("div",{className:"text-[8px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:N.label}),r.jsx("div",{className:"text-[16px] font-semibold",style:a.inkText,children:N.value})]},N.label))}),r.jsx("div",{className:"px-3 pt-3",children:r.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{mode:"tasks",label:"Tasks",icon:m2},{mode:"plans",label:"Plans",icon:fr}].map(N=>{const M=N.icon;return r.jsxs("button",{onClick:()=>y(N.mode),className:"border rounded-lg px-3 py-2 text-[11px] font-medium flex items-center gap-2 justify-center",style:h===N.mode?a.activeItem:{...a.surface,borderColor:l.border,color:l.ink},children:[r.jsx(M,{size:12}),N.label]},N.mode)})})}),r.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-2 px-2",style:a.mutedText,children:"Agents"}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("button",{onClick:()=>v("all"),className:"w-full text-left px-3 py-2 rounded-lg text-[12px] font-medium",style:b==="all"?a.activeItem:a.mutedText,children:"All Agents"}),j.map(N=>r.jsxs("button",{onClick:()=>v(N),className:"w-full text-left px-3 py-2 rounded-lg text-[12px] font-medium flex items-center gap-2",style:b===N?a.activeItem:a.mutedText,children:[r.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:p(N)},children:N.charAt(0).toUpperCase()}),r.jsx("span",{className:"truncate",children:N})]},N))]})]})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i?r.jsx("div",{className:"px-6 py-4 border-b flex items-center gap-2 overflow-x-auto",style:{borderColor:l.border},children:[["tasks","Tasks"],["plans","Plans"]].map(([N,M])=>r.jsx("button",{onClick:()=>y(N),className:"os-btn border rounded-lg px-3 py-2 text-[11px] font-medium whitespace-nowrap",style:h===N?a.activeItem:{...a.surface,borderColor:l.border,color:l.ink},children:M},N))}):null,r.jsxs("div",{className:"px-8 py-8 space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-6",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:a.mutedText,children:"Control Plane Queue"}),r.jsx("h1",{className:"text-[26px] font-semibold tracking-tight mb-2",style:a.inkText,children:h==="tasks"?"Recent Agent Asks":"Workspace Plans"}),r.jsx("div",{className:"text-[13px] leading-[1.7] max-w-2xl",style:a.mutedText,children:h==="tasks"?"These are the operator asks currently flowing through Relay, resolved against live reply and status signals.":"Plan files are loaded from registered agent workspaces under plans/ or .openscout/plans/ so each project can keep its own roadmap."})]}),r.jsxs("button",{onClick:f,className:"os-btn border px-3 py-2 rounded-lg text-[12px] font-medium shadow-sm flex items-center gap-2",style:{...a.surface,borderColor:l.border,color:l.ink},children:[r.jsx(gn,{size:14}),"Refresh"]})]}),r.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Running",value:e.runningTaskCount,icon:T1},{label:"Completed",value:e.completedTaskCount,icon:k1},{label:"Findings",value:e.findingCount,icon:K2},{label:"Plans",value:e.planCount,icon:Y2}].map(N=>r.jsxs("div",{className:"border rounded-xl p-4",style:{...a.surface,borderColor:l.border},children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",style:a.mutedText,children:[r.jsx(N.icon,{size:14,className:N.label==="Running"?"animate-spin":""}),r.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest",children:N.label})]}),r.jsx("div",{className:"text-[22px] font-semibold",style:a.inkText,children:N.value})]},N.label))}),h==="tasks"?r.jsxs("div",{className:"space-y-4",children:[e.findings.length>0?r.jsxs("div",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:l.border},children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:a.mutedText,children:"Reconciliation"}),r.jsx("div",{className:"text-[13px] leading-[1.7]",style:a.mutedText,children:"Open expectations that look stale, blocked, or otherwise at risk of being dropped."})]}),r.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono shrink-0",children:[r.jsxs("span",{className:"px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(239, 68, 68, 0.12)",color:"#dc2626"},children:[e.errorCount," errors"]}),r.jsxs("span",{className:"px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(245, 158, 11, 0.14)",color:"#d97706"},children:[e.warningCount," warnings"]})]})]}),r.jsx("div",{className:"space-y-3",children:e.findings.map(N=>r.jsx("div",{className:"border rounded-lg p-4",style:{borderColor:l.border,backgroundColor:l.bg},children:r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[r.jsx("div",{className:"text-[14px] font-semibold",style:a.inkText,children:N.title}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:nA(N),children:N.severity})]}),r.jsx("div",{className:"text-[12px] leading-[1.7]",style:a.mutedText,children:N.summary}),N.detail?r.jsx("div",{className:"mt-2 text-[11px] leading-[1.6]",style:a.mutedText,children:N.detail}):null,r.jsxs("div",{className:"mt-3 flex items-center gap-3 text-[10px] flex-wrap",style:a.mutedText,children:[N.requesterName?r.jsx("span",{children:N.requesterName}):null,N.targetAgentName?r.jsx("span",{children:N.targetAgentName}):null,N.ageLabel?r.jsx("span",{children:N.ageLabel}):null,N.updatedAtLabel?r.jsxs("span",{children:["Updated ",N.updatedAtLabel]}):null]})]}),N.targetAgentId?r.jsxs("button",{onClick:()=>d(N.targetAgentId),className:"text-[11px] font-medium flex items-center gap-1 shrink-0",style:{color:l.accent},children:["Open Relay ",r.jsx(El,{size:12})]}):null]})},N.id))})]}):null,C.length>0?C.map(N=>{const M=eA(N,l),L=M.icon;return r.jsx("div",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:l.border},children:r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r.jsx("div",{className:"mt-0.5",style:{color:M.pill.color},children:r.jsx(L,{size:18,className:N.status==="running"?"animate-spin":""})}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[r.jsx("div",{className:"text-[15px] font-semibold",style:a.inkText,children:N.title}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:M.pill,children:N.statusLabel})]}),r.jsxs("div",{className:"flex items-center gap-3 text-[11px] flex-wrap mb-3",style:a.mutedText,children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:p(N.targetAgentId)},children:N.targetAgentName.charAt(0).toUpperCase()}),r.jsx("span",{children:N.targetAgentName})]}),N.project?r.jsx("span",{className:"font-mono",children:N.project}):null,r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Wi,{size:10}),N.ageLabel]})]}),r.jsx("div",{className:"text-[12px] leading-[1.7]",style:a.mutedText,children:N.statusDetail}),N.replyPreview?r.jsx("div",{className:"mt-3 border rounded-lg px-3 py-2 text-[12px] leading-[1.7]",style:{borderColor:l.border,backgroundColor:l.bg,color:l.muted},children:N.replyPreview}):null,N.projectRoot?r.jsx("div",{className:"mt-3 text-[10px] font-mono",style:a.mutedText,children:N.projectRoot}):null]})]}),r.jsxs("button",{onClick:()=>d(N.targetAgentId),className:"text-[11px] font-medium flex items-center gap-1 shrink-0",style:{color:l.accent},children:["Open Relay ",r.jsx(El,{size:12})]})]})},N.id)}):r.jsx("div",{className:"border rounded-xl p-8 text-center",style:{...a.surface,borderColor:l.border,color:l.muted},children:"No task-like asks are visible yet."})]}):r.jsx("div",{className:"grid grid-cols-2 gap-5",children:E.length>0?E.map(N=>r.jsxs("div",{className:"border rounded-xl p-5",style:{...a.surface,borderColor:l.border},children:[r.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[15px] font-semibold mb-1",style:a.inkText,children:N.title}),r.jsxs("div",{className:"text-[11px] flex items-center gap-2 flex-wrap",style:a.mutedText,children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(N1,{size:10}),N.agentId]}),r.jsx("span",{children:N.workspaceName})]})]}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:tA(N,l),children:N.status})]}),r.jsx("div",{className:"text-[12px] leading-[1.7] mb-4",style:a.mutedText,children:N.summary}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center justify-between text-[10px] font-mono uppercase tracking-widest mb-2",style:a.mutedText,children:[r.jsx("span",{children:"Progress"}),r.jsxs("span",{children:[N.stepsCompleted,"/",N.stepsTotal||0]})]}),r.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{backgroundColor:l.border},children:r.jsx("div",{className:"h-full rounded-full",style:{width:`${N.progressPercent}%`,backgroundColor:l.accent}})})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 text-[11px]",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"Updated"}),r.jsx("div",{style:a.inkText,children:N.updatedAtLabel})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.mutedText,children:"File"}),r.jsx("div",{style:a.inkText,children:N.path})]})]}),N.tags.length>0?r.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:N.tags.map(M=>r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:a.tagBadge,children:M},M))}):null]},`${N.workspacePath}:${N.path}`)):r.jsxs("div",{className:"col-span-2 border rounded-xl p-8 text-center",style:{...a.surface,borderColor:l.border,color:l.muted},children:[r.jsx("div",{className:"text-[14px] font-medium mb-2",style:a.inkText,children:"No plan files found"}),r.jsxs("div",{className:"text-[12px] leading-[1.7]",children:["Add Markdown plans under ",r.jsx("span",{className:"font-mono",children:"plans/"})," or ",r.jsx("span",{className:"font-mono",children:".openscout/plans/"})," in a registered agent workspace and they will appear here."]})]})})]})]})]})}function aA({activeView:e,machinesViewProps:l,plansViewProps:a,search:i}){return e==="machines"?r.jsx(JT,{...l}):e==="plans"?r.jsx(lA,{...a}):e!=="search"?null:r.jsxs(r.Fragment,{children:[!i.isCollapsed&&r.jsxs("div",{style:{width:i.sidebarWidth,...i.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[r.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:i.onResizeStart}),r.jsx("div",{className:"px-3 py-2.5 flex items-center justify-between border-b",style:{borderBottomColor:g.border},children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:i.styles.inkText,children:"Search"}),r.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:i.styles.mutedText,children:"Full-text search"})]})}),r.jsxs("div",{className:"flex-1 overflow-y-auto py-2",children:[r.jsxs("div",{className:"mb-3 px-1.5",children:[r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Scope"}),r.jsxs("div",{className:"flex flex-col gap-px",children:[r.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 shadow-sm border rounded text-[12px]",style:i.styles.activeItem,children:[r.jsx(Ap,{size:12,style:{color:g.accent}}),r.jsx("span",{className:"font-medium flex-1 truncate text-left",children:"All Sessions"})]}),[["Content Only",r.jsx(Tp,{size:12})],["Tags Only",r.jsx(G2,{size:12})]].map(([o,u])=>r.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 rounded text-[12px] hover:opacity-80 transition-opacity",style:i.styles.mutedText,children:[u,r.jsx("span",{className:"font-medium flex-1 truncate text-left",children:o})]},o))]})]}),r.jsxs("div",{className:"mb-3 px-1.5",children:[r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Time Range"}),r.jsxs("div",{className:"flex flex-col gap-px",children:[r.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 shadow-sm border rounded text-[12px]",style:i.styles.activeItem,children:[r.jsx(zN,{size:12,style:{color:g.accent}}),r.jsx("span",{className:"font-medium flex-1 truncate text-left",children:"All Time"})]}),["Last 7 Days","Last 30 Days"].map(o=>r.jsxs("button",{className:"flex items-center gap-2 px-1.5 py-1 rounded text-[12px] hover:opacity-80 transition-opacity",style:i.styles.mutedText,children:[r.jsx(Wi,{size:12}),r.jsx("span",{className:"font-medium flex-1 truncate text-left",children:o})]},o))]})]}),r.jsxs("div",{className:"mb-3 px-1.5",children:[r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Agents"}),r.jsx("div",{className:"flex flex-col gap-px",children:i.availableAgentNames.map(o=>r.jsxs("label",{className:"flex items-center gap-2 px-1.5 py-1 rounded text-[12px] hover:opacity-80 transition-opacity cursor-pointer",style:i.styles.mutedText,children:[r.jsx("input",{type:"checkbox",defaultChecked:!0,className:"w-3 h-3 rounded"}),r.jsx("div",{className:"w-3 h-3 rounded text-white flex items-center justify-center text-[7px] font-bold",style:{backgroundColor:dl(o)},children:o.charAt(0)}),r.jsx("span",{className:"font-medium flex-1 truncate text-left",children:o})]},o))})]}),r.jsxs("div",{className:"px-1.5",children:[r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:i.styles.mutedText,children:"Quick Filters"}),r.jsx("div",{className:"flex flex-wrap gap-1 px-1.5",children:["code-review","debugging","docs","architecture","performance","testing"].map(o=>r.jsx("button",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded hover:opacity-70 transition-opacity",style:i.styles.tagBadge,children:o},o))})]})]})]}),r.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:i.styles.surface,children:[r.jsxs("div",{className:"border-b shrink-0 p-4",style:{...i.styles.surface,borderBottomColor:g.border},children:[r.jsxs("div",{className:"flex items-center gap-3 border rounded-lg px-3 py-2 transition-all focus-within:ring-1",style:{backgroundColor:g.bg,borderColor:g.border},children:[r.jsx(So,{size:16,className:"shrink-0",style:i.styles.mutedText}),r.jsx("input",{type:"text",placeholder:"Search across all sessions, messages, and metadata...",value:i.searchQuery,onChange:o=>i.setSearchQuery(o.target.value),className:"flex-1 bg-transparent border-none outline-none text-[13px]",style:{color:g.ink}}),i.searchQuery&&r.jsx("button",{onClick:()=>i.setSearchQuery(""),className:"p-1 hover:opacity-70",style:i.styles.mutedText,children:r.jsx(ul,{size:14})})]}),r.jsxs("div",{className:"flex items-center justify-between mt-2",children:[r.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono",style:i.styles.mutedText,children:[r.jsx("span",{children:"Press"}),r.jsx("kbd",{className:"px-1.5 py-0.5 rounded border text-[10px] font-medium",style:i.styles.kbd,children:"Enter"}),r.jsx("span",{children:"to search"})]}),r.jsx("div",{className:"text-[10px] font-mono",style:i.styles.mutedText,children:i.searchQuery?`${i.filteredSessions.length} results`:`${i.stats.totalSessions} sessions indexed`})]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:i.searchQuery?i.filteredSessions.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:r.jsx(So,{size:24,style:{color:g.accent}})}),r.jsx("h3",{className:"text-[15px] font-medium mb-1",style:i.styles.inkText,children:"No results found"}),r.jsx("p",{className:"text-[13px] max-w-sm",style:i.styles.mutedText,children:"Try different keywords or adjust your filters"})]}):r.jsx("div",{style:{borderColor:g.border},className:"divide-y",children:i.filteredSessions.map(o=>r.jsxs("div",{className:"px-4 py-4 cursor-pointer transition-opacity hover:opacity-90",style:{borderBottomColor:g.border},onClick:()=>i.onOpenSession(o),children:[r.jsxs("div",{className:"flex items-start justify-between mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:dl(o.agent)},children:o.agent.charAt(0)}),r.jsx("span",{className:"text-[13px] font-medium",style:i.styles.inkText,children:o.title})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[r.jsx("span",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded",style:i.styles.tagBadge,children:o.project}),r.jsx("span",{className:"text-[10px] font-mono",style:i.styles.mutedText,children:i.formatDate(o.lastModified)})]})]}),r.jsx("div",{className:"text-[12px] mb-2 pl-7 leading-relaxed",style:i.styles.mutedText,children:o.preview.split(new RegExp(`(${i.searchQuery})`,"gi")).map((u,d)=>u.toLowerCase()===i.searchQuery.toLowerCase()?r.jsx("mark",{className:"px-0.5 rounded",style:{backgroundColor:g.markBg,color:g.markFg},children:u},d):r.jsx("span",{children:u},d))}),r.jsxs("div",{className:"flex items-center gap-3 pl-7",children:[r.jsxs("span",{className:"text-[10px]",style:i.styles.mutedText,children:[o.messageCount," messages"]}),o.tokens?r.jsxs("span",{className:"text-[10px]",style:i.styles.mutedText,children:[(o.tokens/1e3).toFixed(1),"k tokens"]}):null,o.model?r.jsx("span",{className:"text-[9px] font-mono text-indigo-400 bg-indigo-950/30 px-1.5 py-0.5 rounded",children:o.model}):null]}),o.tags&&o.tags.length>0?r.jsx("div",{className:"flex items-center gap-1.5 mt-2 pl-7",children:o.tags.map(u=>r.jsx("span",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded",style:u.toLowerCase().includes(i.searchQuery.toLowerCase())?{backgroundColor:g.markBg,borderColor:g.border,color:g.markFg}:i.styles.tagBadge,children:u},u))}):null]},o.id))}):r.jsxs("div",{className:"p-6",children:[r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-3",style:i.styles.mutedText,children:"Recent Searches"}),r.jsx("div",{className:"flex flex-col gap-2",children:["authentication refactor","database migration","API performance"].map((o,u)=>r.jsxs("button",{onClick:()=>i.setSearchQuery(o),className:"flex items-center gap-2 text-left text-[12px] hover:opacity-70 transition-opacity",style:i.styles.mutedText,children:[r.jsx(Wi,{size:12}),r.jsx("span",{children:o})]},u))}),r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-3 mt-8",style:i.styles.mutedText,children:"Popular Tags"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:["code-review","auth","security","database","migration","api","performance","testing","docs"].map(o=>r.jsxs("button",{onClick:()=>i.setSearchQuery(o),className:"text-[11px] font-mono border px-2 py-1 rounded hover:opacity-70 transition-opacity",style:i.styles.tagBadge,children:["#",o]},o))}),r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-3 mt-8",style:i.styles.mutedText,children:"Search Tips"}),r.jsx("div",{className:"text-[12px] space-y-2",style:i.styles.mutedText,children:[["project:openscout-core","Search within a project"],["agent:claude","Filter by agent"],["tag:security","Search by tag"],['"exact phrase"',"Match exact phrase"]].map(([o,u])=>r.jsxs("p",{children:[r.jsx("code",{className:"border rounded px-1 font-mono text-[10px]",style:i.styles.tagBadge,children:o})," -- ",u]},o))})]})}),r.jsxs("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:[r.jsxs("span",{className:"text-[9px] font-mono",style:i.styles.mutedText,children:["Indexed: ",i.stats.totalSessions," sessions / ",i.stats.totalMessages," messages"]}),r.jsx("span",{className:"text-[9px] font-mono uppercase tracking-widest",style:i.styles.mutedText,children:"Index Ready"})]})]})]})}function rA({styles:e,selectedInterAgent:l,availableAgents:a,isAgentConfigEditing:i,hasEditableAgentConfig:o,agentConfigLoading:u,agentConfigSaving:d,agentConfigRestarting:f,visibleAgentConfig:p,agentConfigFeedback:h,agentCapabilitiesPreview:y,agentRuntimePathRef:b,onOpenAgents:v,onOpenAgentProfile:j,onOpenAgentThread:C,onUpdateAgentConfigDraft:E,renderLocalPathValue:N,interAgentProfileKindLabel:M,onSelectAgent:L}){const H=l?.id??null,X=r.jsxs("section",{className:"border rounded-xl p-3",style:{...e.surface,borderColor:g.border},children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 px-2 pt-2 mb-2",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Agent List"}),r.jsx("div",{className:"text-[11px] mt-1",style:e.mutedText,children:a.length>0?"Pick the agent you want to configure.":"No agents available yet."})]}),a.length>0?r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:e.tagBadge,children:a.length}):null]}),r.jsx("div",{className:"flex flex-col gap-1",children:a.length>0?a.map(q=>{const D=q.id===H;return r.jsx("button",{type:"button",className:"rounded-lg border px-3 py-2 text-left transition-opacity hover:opacity-90",style:{borderColor:D?g.accent:g.border,backgroundColor:D?g.surface:g.bg},onClick:()=>L(q.id),children:r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium truncate",style:e.inkText,children:q.title}),r.jsxs("div",{className:"text-[10px] mt-0.5 truncate",style:e.mutedText,children:[M(q.profileKind)," · ",q.statusDetail??q.summary??"No status reported."]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[D?r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:e.activePill,children:"Selected"}):null,r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:q.state==="working"?e.activePill:e.tagBadge,children:q.statusLabel})]})]})},q.id)}):r.jsx("div",{className:"px-3 py-6 text-[11px] text-center",style:e.mutedText,children:"No agents available yet."})}),r.jsx("div",{className:"mt-3 px-2 pb-2",children:r.jsx("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:v,children:"Open Agents"})})]});return l?r.jsxs("div",{className:"space-y-4 min-w-0",children:[r.jsx("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Selected Agent"}),r.jsx("div",{className:"text-[18px] font-semibold tracking-tight mt-1.5",style:e.inkText,children:l.title}),r.jsxs("div",{className:"text-[12px] mt-2 leading-[1.6]",style:e.mutedText,children:[M(l.profileKind)," · ",l.statusDetail??l.summary??"No status reported."]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>C(l.id),children:"Message"}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>j(l.id),children:"Show in Agents"})]})]})}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)] gap-4",children:[r.jsxs("div",{className:"space-y-4 min-w-0",children:[r.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Runtime"}),u?r.jsx("div",{className:"text-[11px]",style:e.mutedText,children:"Loading runtime…"}):i?r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Path"}),r.jsx("input",{ref:b,value:p?.runtime.cwd??"",onChange:q=>{E(D=>({...D,runtime:{...D.runtime,cwd:q.target.value}}))},readOnly:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Harness"}),r.jsx("select",{value:p?.runtime.harness??"",onChange:q=>{E(D=>({...D,runtime:{...D.runtime,harness:q.target.value}}))},disabled:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink},children:p?.availableHarnesses.map(q=>r.jsx("option",{value:q,children:q},q))})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Session"}),r.jsx("input",{value:p?.runtime.sessionId??"",onChange:q=>{E(D=>({...D,runtime:{...D.runtime,sessionId:q.target.value}}))},readOnly:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Mode"}),r.jsxs("select",{value:p?.runtime.transport==="tmux"?"interactive":"async",onChange:q=>{E(D=>({...D,runtime:{...D.runtime,transport:q.target.value==="interactive"?"tmux":"claude_stream_json"}}))},disabled:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink},children:[r.jsx("option",{value:"async",children:"Async"}),r.jsx("option",{value:"interactive",children:"Interactive (PTY)"})]})]})]})]}):r.jsx("dl",{children:[["Path",p?.runtime.cwd??l.projectRoot??l.cwd??"Not reported"],["Harness",p?.runtime.harness??l.harness??"Not reported"],["Session",p?.runtime.sessionId??l.sessionId??"Not reported"],["Mode",(p?.runtime.transport??l.transport)==="tmux"?"Interactive (PTY)":"Async"],["Wake policy",p?.runtime.wakePolicy||l.wakePolicy||"Not reported"],["Live runtime",l.projectRoot??l.cwd??"Not reported"]].map(([q,D])=>r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-baseline sm:justify-between gap-1 py-2.5 border-b last:border-b-0",style:{borderColor:g.border},children:[r.jsx("dt",{className:"text-[9px] font-mono uppercase tracking-widest shrink-0 sm:w-[7.5rem]",style:e.mutedText,children:q}),r.jsx("dd",{className:"text-[11px] leading-[1.45] break-words min-w-0 text-left sm:text-right sm:max-w-[70%]",children:r.jsx("span",{style:e.inkText,children:q==="Path"||q==="Live runtime"?N(String(D),{className:"text-left sm:text-right underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"}):D})})]},q))})]}),r.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Tool Use"}),i?r.jsx("textarea",{value:p?.toolUse.launchArgsText??"",onChange:q=>{E(D=>({...D,toolUse:{...D.toolUse,launchArgsText:q.target.value}}))},readOnly:!o||d||f,className:"w-full min-h-[132px] rounded-lg border px-3 py-3 text-[11px] font-mono leading-[1.5] resize-y bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):r.jsx("div",{className:"rounded-lg border px-3 py-3 text-[11px] font-mono leading-[1.55] whitespace-pre-wrap break-words min-h-[88px]",style:{borderColor:g.border,color:g.ink},children:p?iA(p.toolUse.launchArgsText)||"No launch args configured.":"Launch args load on demand when editing this agent."})]}),r.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Capabilities"}),i?r.jsx("input",{value:p?.capabilitiesText??"",onChange:q=>{E(D=>({...D,capabilitiesText:q.target.value}))},readOnly:!o||d||f,className:"w-full rounded-lg border px-3 py-2.5 text-[11px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):null,y.length>0?r.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:y.map(q=>r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:e.tagBadge,children:q},q))}):r.jsx("div",{className:"text-[11px]",style:e.mutedText,children:"No capabilities configured."}),h?r.jsx("div",{className:"text-[11px] mt-2 leading-[1.5]",style:e.inkText,children:h}):null]})]}),r.jsx("div",{className:"space-y-4 min-w-0",children:X})]})]}):r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,0.95fr)_minmax(320px,1.05fr)] gap-4 min-w-0",children:[r.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:g.accent},children:"Agent Settings"}),r.jsx("div",{className:"text-[18px] font-semibold tracking-tight",style:e.inkText,children:"Select an agent"}),r.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:e.mutedText,children:"Agent configuration lives here now. Pick an agent from the list to edit its runtime, tools, and capabilities."})]}),r.jsx("div",{className:"space-y-4 min-w-0",children:X})]})}function iA(e){return e.replace(/\r\n/g,`
62
+ `).trim()}function sA({styles:e,showTelegram:l,showVoice:a,visibleAppSettings:i,isAppSettingsEditing:o,appSettingsSaving:u,appSettingsFeedback:d,onUpdateAppSettingsDraft:f,brokerInspector:p,brokerControlPending:h,brokerControlFeedback:y,onBrokerControl:b,relayServiceInspectorRef:v,relayRuntimeBooting:j,relayRuntimeHealthLabel:C,runtime:E,reachableRelayAgentCount:N,voiceCaptureTitle:M,voiceRepliesEnabled:L,onSetVoiceRepliesEnabled:H,renderLocalPathValue:X}){return r.jsx("div",{className:"max-w-3xl space-y-5",children:r.jsxs("div",{className:"space-y-5 min-w-0",children:[l?r.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:g.border},children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Telegram Bridge"}),r.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:i?.telegram.running?e.activePill:e.tagBadge,children:i?.telegram.running?"Running":i?.telegram.enabled?"Stopped":"Disabled"})]}),r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[r.jsx("span",{className:"text-[11px]",style:e.mutedText,children:"Enabled"}),r.jsx("input",{type:"checkbox",checked:i?.telegram.enabled??!1,disabled:!o||u,onChange:q=>{f(D=>({...D,telegram:{...D.telegram,enabled:q.target.checked}}))}})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Mode"}),o?r.jsxs("select",{value:i?.telegram.mode??"polling",onChange:q=>{f(D=>({...D,telegram:{...D.telegram,mode:q.target.value}}))},disabled:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink},children:[r.jsx("option",{value:"polling",children:"polling"}),r.jsx("option",{value:"auto",children:"auto"}),r.jsx("option",{value:"webhook",children:"webhook"})]}):r.jsx("div",{className:"text-[12px] font-medium",style:e.inkText,children:i?.telegram.mode??"polling"})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Telegram Target"}),o?r.jsx("input",{value:i?.telegram.defaultConversationId??"dm.scout.primary",onChange:q=>{f(D=>({...D,telegram:{...D.telegram,defaultConversationId:q.target.value}}))},readOnly:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):r.jsx("div",{className:"text-[13px] font-medium",style:e.inkText,children:i?.telegram.defaultConversationId??"dm.scout.primary"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Bot Username"}),o?r.jsx("input",{value:i?.telegram.userName??"",onChange:q=>{f(D=>({...D,telegram:{...D.telegram,userName:q.target.value}}))},readOnly:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):r.jsx("div",{className:"text-[12px] font-medium break-words",style:e.inkText,children:i?.telegram.userName||"Not set"})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Owner Node"}),o?r.jsx("input",{value:i?.telegram.ownerNodeId??"",onChange:q=>{f(D=>({...D,telegram:{...D.telegram,ownerNodeId:q.target.value}}))},readOnly:u,placeholder:"Automatic",className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):r.jsx("div",{className:"text-[12px] font-medium break-words",style:e.inkText,children:i?.telegram.ownerNodeId||"Automatic"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Bot Token"}),o?r.jsx("input",{type:"password",value:i?.telegram.botToken??"",onChange:q=>{f(D=>({...D,telegram:{...D.telegram,botToken:q.target.value}}))},readOnly:u,placeholder:"Telegram bot token",className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):r.jsx("div",{className:"text-[11px]",style:e.inkText,children:i?.telegram.botToken?"Configured":"Not set"})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"Webhook Secret"}),o?r.jsx("input",{type:"password",value:i?.telegram.secretToken??"",onChange:q=>{f(D=>({...D,telegram:{...D.telegram,secretToken:q.target.value}}))},readOnly:u,placeholder:"Optional",className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):r.jsx("div",{className:"text-[11px]",style:e.inkText,children:i?.telegram.secretToken?"Configured":"Not set"})]})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:"API Base URL"}),o?r.jsx("input",{value:i?.telegram.apiBaseUrl??"",onChange:q=>{f(D=>({...D,telegram:{...D.telegram,apiBaseUrl:q.target.value}}))},readOnly:u,className:"w-full rounded-md border px-2.5 py-1.5 text-[12px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}):r.jsx("div",{className:"text-[12px] font-medium break-words",style:e.inkText,children:i?.telegram.apiBaseUrl||"Default Telegram API"})]}),d?r.jsx("div",{className:"text-[11px] leading-[1.5]",style:e.inkText,children:d}):null]})]}):null,r.jsxs("section",{ref:v,className:"border rounded-lg overflow-hidden",style:{...e.surface,borderColor:g.border},children:[p?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"p-4",children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Relay Service"}),r.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:p.reachable?e.activePill:e.tagBadge,children:p.statusLabel})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Nt,{type:"button",variant:p.reachable?"outline":"default",size:"sm",onClick:()=>b(p.reachable?"restart":"start"),disabled:h,children:p.reachable?"Restart":"Start"}),r.jsx(Nt,{type:"button",variant:"outline",size:"sm",onClick:()=>b("stop"),disabled:h||!p.loaded,children:"Stop"})]})]}),r.jsx("div",{className:"text-[11px] mb-4 leading-[1.5]",style:e.mutedText,children:p.statusDetail??"Service status not reported yet."}),r.jsx("div",{className:"grid grid-cols-3 gap-x-4 gap-y-3",children:[["Relay URL",p.url],["Version",p.version??"Not reported"],["Mode",p.mode],["Service Label",p.label],["PID",p.pid??"Not reported"],["Last Restart",p.lastRestartLabel??"Not reported"],["Launch State",p.launchdState??"Not reported"],["Mesh",p.meshId??"Not reported"],["Last Exit",p.lastExitStatus??"Not reported"]].map(([q,D])=>r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:q}),r.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:e.inkText,children:D})]},q))}),p.processCommand?r.jsxs("div",{className:"mt-3 pt-3 border-t",style:{borderTopColor:g.border},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Process"}),r.jsx("div",{className:"text-[10px] font-mono leading-[1.45] break-all",style:e.mutedText,children:p.processCommand})]}):null,y?r.jsx("div",{className:"mt-3 pt-3 border-t text-[11px] leading-[1.45]",style:{borderTopColor:g.border,color:g.ink},children:y}):null]}),r.jsx("div",{className:"border-t",style:{borderTopColor:g.border}})]}):null,r.jsxs("div",{className:"px-4 py-3",style:{backgroundColor:g.bg},children:[r.jsxs("div",{className:"flex items-center gap-2.5 mb-2.5",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Runtime"}),r.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:j||E?.brokerHealthy?e.activePill:e.tagBadge,children:C})]}),r.jsx("div",{className:"grid grid-cols-4 gap-x-4 gap-y-2.5",children:[["Node ID",j?"Syncing…":E?.nodeId??"Not reported"],["Agents",`${E?.agentCount??0}`],["Conversations",`${E?.conversationCount??0}`],["Flights",`${E?.flightCount??0}`],["Latest Relay",j?"Syncing…":E?.latestRelayLabel??"Not reported"],["Updated",j?"Syncing…":E?.updatedAtLabel??"Not reported"]].map(([q,D])=>r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:q}),r.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:e.inkText,children:D})]},q))})]})]}),p?r.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:e.mutedText,children:"Relay Paths"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[["Support",p.supportDirectory],["Control Home",p.controlHome],["LaunchAgent",p.launchAgentPath],["Stdout Log",p.stdoutLogPath],["Stderr Log",p.stderrLogPath]].map(([q,D])=>r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:q}),r.jsx("div",{className:"text-[10px] font-mono leading-[1.45] truncate",style:e.mutedText,children:X(String(D),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"})})]},q))}),p.lastLogLine?r.jsxs("div",{className:"mt-3 pt-3 border-t",style:{borderTopColor:g.border},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Last Service Log"}),r.jsx("div",{className:"text-[10px] font-mono leading-[1.45] break-words",style:e.mutedText,children:p.lastLogLine})]}):null]}):null,p&&(p.troubleshooting.length>0||p.feedbackSummary)?r.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:e.mutedText,children:"Diagnostics"}),p.troubleshooting.length>0?r.jsx("div",{className:"space-y-2 mb-4",children:p.troubleshooting.map(q=>r.jsx("div",{className:"text-[11px] leading-[1.5]",style:e.inkText,children:q},q))}):null,p.feedbackSummary?r.jsx("div",{className:"rounded-md border px-3 py-3 text-[10px] font-mono leading-[1.55] whitespace-pre-wrap break-words",style:{borderColor:g.border,color:g.ink},children:p.feedbackSummary}):null]}):null,a?r.jsxs("section",{className:"border rounded-lg p-4",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:e.mutedText,children:"Voice & Delivery"}),r.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Capture"}),r.jsx("div",{className:"text-[11px]",style:e.inkText,children:M})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Reachable Directs"}),r.jsx("div",{className:"text-[11px]",style:e.inkText,children:N})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-0.5",style:e.mutedText,children:"Replies"}),r.jsx("button",{className:"os-toolbar-button text-[10px] font-medium px-2 py-0.5 rounded-md",style:{color:g.ink},onClick:()=>{H(!L)},children:L?"Disable":"Enable"})]})]})]}):null]})})}const oA=X1("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Lu({className:e,variant:l,asChild:a=!1,...i}){const o=a?$1:"span";return r.jsx(o,{"data-slot":"badge",className:En(oA({variant:l}),e),...i})}function cA({styles:e,selectedWorkspaceProject:l,selectedWorkspaceAgent:a,workspaceExplorerQuery:i,setWorkspaceExplorerQuery:o,workspaceExplorerFilter:u,setWorkspaceExplorerFilter:d,workspaceExplorerViewMode:f,setWorkspaceExplorerViewMode:p,workspaceExplorerItems:h,workspaceExplorerBoundCount:y,workspaceExplorerDiscoveredCount:b,filteredWorkspaceExplorerItems:v,workspaceInventoryLoaded:j,workspaceInventoryLoading:C,canRefreshWorkspaceInventory:E,onboardingCommandPending:N,appSettingsLoading:M,appSettingsSaving:L,appSettingsDirty:H,appSettingsFeedback:X,showDoctorOutput:q,doctorOutput:D,projectRetirementPendingRoot:B,onRefreshWorkspaceDiscovery:F,onLoadWorkspaceInventory:Z,onAddWorkspace:O,onInspectWorkspace:P,onOpenWorkspace:Q,onRetireWorkspace:oe,onOpenAgentProfile:J,onOpenAgentSettings:ee,renderLocalPathValue:w}){return r.jsxs("div",{className:"max-w-6xl px-8 py-6 space-y-4",children:[r.jsx("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:g.accent},children:"Workspace Discovery"}),r.jsx("div",{className:"text-[18px] font-semibold tracking-tight",style:e.inkText,children:"Workspace Explorer"}),r.jsx("div",{className:"text-[12px] mt-1 leading-[1.6]",style:e.mutedText,children:"Discover local projects, inspect harness readiness, and jump into the bound agent when one already exists."})]}),r.jsxs("div",{className:"hidden xl:flex items-center gap-2 shrink-0",children:[r.jsxs(Nt,{variant:"outline",size:"sm",className:"gap-2",onClick:F,disabled:!!N||M||L||H,children:[N==="doctor"?r.jsx(dn,{className:"text-[14px]"}):r.jsx(gn,{className:"h-4 w-4"}),N==="doctor"?"Scanning…":"Refresh"]}),r.jsxs(Nt,{size:"sm",className:"gap-2",onClick:O,children:[r.jsx(Nb,{className:"h-4 w-4"}),"Add Workspace"]})]})]})}),r.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:g.border,backgroundColor:"color-mix(in srgb, var(--os-bg) 82%, transparent)"},children:r.jsxs("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",children:[r.jsxs("div",{className:"flex flex-1 flex-col gap-3 xl:flex-row xl:items-center",children:[r.jsxs("div",{className:"relative w-full xl:w-80",children:[r.jsx(So,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:g.muted}}),r.jsx(ip,{placeholder:"Search workspaces...",value:i,onChange:Y=>o(Y.target.value),className:"pl-9"})]}),r.jsx("div",{className:"flex items-center gap-1 rounded-lg border p-1",style:{borderColor:g.border,backgroundColor:g.bg},children:[["all","All",h.length],["bound","Bound",y],["discovered","Discovered",b]].map(([Y,$,ye])=>{const T=u===Y;return r.jsx("button",{type:"button",className:"rounded-md px-3 py-1.5 text-[12px] font-medium transition-colors",style:{backgroundColor:T?g.surface:"transparent",color:T?g.ink:g.muted,boxShadow:T?g.shadowXs:"none"},onClick:()=>d(Y),children:r.jsxs("span",{className:"flex items-center gap-1.5",children:[Y==="bound"?r.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}):null,$,r.jsx("span",{style:{color:g.muted},children:ye})]})},Y)})})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("button",{type:"button",className:"rounded-md p-1.5 transition-colors",style:{backgroundColor:f==="grid"?g.surface:"transparent",color:f==="grid"?g.ink:g.muted},onClick:()=>p("grid"),title:"Grid view",children:r.jsx(l2,{className:"h-4 w-4"})}),r.jsx("button",{type:"button",className:"rounded-md p-1.5 transition-colors",style:{backgroundColor:f==="list"?g.surface:"transparent",color:f==="list"?g.ink:g.muted},onClick:()=>p("list"),title:"List view",children:r.jsx(C1,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"xl:hidden flex items-center gap-2",children:[r.jsxs(Nt,{variant:"outline",size:"sm",className:"gap-2",onClick:F,disabled:!!N||M||L||H,children:[N==="doctor"?r.jsx(dn,{className:"text-[14px]"}):r.jsx(gn,{className:"h-4 w-4"}),"Refresh"]}),r.jsxs(Nt,{size:"sm",className:"gap-2",onClick:O,children:[r.jsx(Nb,{className:"h-4 w-4"}),"Add"]})]})]})]})}),r.jsx("div",{className:"p-6",children:j?v.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed px-6 py-12 text-center",style:{borderColor:g.border},children:[r.jsx(fr,{className:"h-8 w-8 mb-3",style:{color:g.muted,opacity:.5}}),r.jsx("div",{className:"text-[13px] font-medium mb-1",style:e.inkText,children:"No workspaces found"}),r.jsx("div",{className:"text-[11px] mb-4 max-w-md leading-[1.6]",style:e.mutedText,children:i?"Try a different search term or filter.":"Add scan directories in General settings, then refresh to discover workspaces."}),r.jsxs(Nt,{variant:"outline",className:"gap-2",onClick:F,disabled:!!N||M||L||H,children:[N==="doctor"?r.jsx(dn,{className:"text-[14px]"}):r.jsx(gn,{className:"h-4 w-4"}),"Scan Workspaces"]})]}):f==="grid"?r.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3",children:v.map(Y=>r.jsx(uA,{item:Y,isSelected:l?.id===Y.project.id,onSelect:()=>P(Y.project),onPrimaryAction:()=>Q(Y.project),onSecondaryAction:()=>oe(Y.project),secondaryActionPending:B===Y.project.root},Y.project.id))}):r.jsx(dA,{items:v,selectedWorkspaceId:l?.id??null,onSelectWorkspace:P,onPrimaryAction:Q,onSecondaryAction:oe,projectRetirementPendingRoot:B}):r.jsxs("div",{className:"flex flex-col items-stretch rounded-xl border border-dashed px-6 py-10 text-center",style:{borderColor:g.border},"aria-busy":C,children:[r.jsxs("div",{className:"flex flex-col items-center max-w-lg mx-auto",children:[C?r.jsx(dn,{className:"text-[28px] mb-3",style:{color:g.muted,opacity:.7}}):r.jsx(fr,{className:"h-8 w-8 mb-3",style:{color:g.muted,opacity:.5}}),r.jsx("div",{className:"text-[13px] font-medium mb-1",style:e.inkText,children:C?"Loading workspaces…":"Workspace inventory is not loaded yet"}),r.jsx("div",{className:"text-[11px] mb-5 max-w-md leading-[1.6]",style:e.mutedText,children:"Scan folders and project manifests are read when you load this list. Use General to edit scan roots first if discovery looks empty."}),r.jsxs(Nt,{variant:"default",size:"sm",className:"gap-2",onClick:Z,disabled:C||!E,children:[C?r.jsx(dn,{className:"text-[14px]"}):r.jsx(gn,{className:"h-4 w-4"}),"Load Workspaces"]})]}),C?r.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 2xl:grid-cols-3 mt-8 w-full",children:[0,1,2].map(Y=>r.jsx("div",{className:"h-[88px] rounded-xl border animate-pulse",style:{borderColor:g.border,backgroundColor:"color-mix(in srgb, var(--os-bg) 70%, transparent)"}},`ws-skel-${Y}`))}):null]})})]}),X?r.jsx("div",{className:"text-[11px] leading-[1.5]",style:e.inkText,children:X}):null,q?r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Scan Results"}),D]}):null,l?r.jsxs(r.Fragment,{children:[r.jsx("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Workspace Details"}),r.jsx("div",{className:"text-[18px] font-semibold tracking-tight mt-1.5",style:e.inkText,children:l.title}),r.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:e.mutedText,children:a?"Bound workspace with an existing agent.":"Discovered workspace. No bound agent is attached yet."})]}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50 shrink-0",style:{color:g.ink},onClick:()=>oe(l),disabled:!!B,children:B===l.root?"Retiring…":"Retire Workspace"})]})}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)] gap-4",children:[r.jsxs("section",{className:"border rounded-xl p-5 min-w-0",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Workspace Summary"}),r.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[["Workspace",l.projectName],["Agent ID",l.definitionId],["Root",l.root],["Source Root",l.sourceRoot],["Relative Path",l.relativePath],["Default Harness",l.defaultHarness],["Registration",l.registrationKind],["Manifest",l.projectConfigPath??"Not created"]].map(([Y,$])=>r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:e.mutedText,children:Y}),r.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:e.inkText,children:Y==="Root"||Y==="Source Root"||Y==="Manifest"?w(String($),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"}):$})]},Y))})]}),r.jsxs("div",{className:"space-y-4 min-w-0",children:[a?r.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Bound Agent"}),r.jsx("div",{className:"text-[14px] font-medium",style:e.inkText,children:a.title}),r.jsxs("div",{className:"text-[11px] mt-1 leading-[1.6]",style:e.mutedText,children:[a.profileKind," · ",a.statusDetail??a.summary??"No status reported."]}),r.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[r.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:()=>J(a.id),children:"Open Agent"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:()=>ee(a.id),children:"Edit Agent"})]})]}):null,r.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Harness Evidence"}),r.jsx("div",{className:"space-y-2",children:l.harnesses.map(Y=>r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-[12px] font-medium",style:e.inkText,children:Y.harness}),r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:Y.readinessState==="ready"?e.activePill:e.tagBadge,children:Y.source})]}),r.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:e.mutedText,children:Y.detail}),Y.readinessDetail?r.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:e.mutedText,children:Y.readinessDetail}):null]},`${Y.harness}-${Y.source}`))})]})]})]})]}):r.jsxs("section",{className:"border rounded-xl p-5",style:{...e.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[13px] font-medium mb-1",style:e.inkText,children:"Select a workspace"}),r.jsx("div",{className:"text-[12px] leading-[1.6]",style:e.mutedText,children:"Choose a workspace above to inspect its project details, harness evidence, and any bound agent."})]})]})}const ka={ink:{color:g.ink},muted:{color:g.muted}};function uA({item:e,isSelected:l,onSelect:a,onPrimaryAction:i,onSecondaryAction:o,secondaryActionPending:u}){const{project:d,isBound:f,primaryHarness:p,pathLabel:h,branchLabel:y,activityLabel:b,statusLabel:v}=e,j=d.title.trim().charAt(0).toUpperCase()||"W",C=f?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":d.registrationKind==="configured"?"border-amber-500/20 bg-amber-500/10 text-amber-700":"border-border bg-secondary text-secondary-foreground";return r.jsxs("div",{className:En("os-card rounded-xl border p-4 cursor-pointer",l?"ring-1 ring-[color:var(--os-accent)]":""),style:{borderColor:l?g.accent:g.border,backgroundColor:g.surface,boxShadow:l?g.shadowSm:void 0},onClick:a,children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:En("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-[12px] font-semibold",f?"bg-emerald-500/10 text-emerald-700":"bg-secondary text-secondary-foreground"),children:j}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-[13px] font-semibold leading-tight tracking-tight",style:ka.ink,children:d.title}),r.jsx("div",{className:"mt-0.5 truncate text-[10px] font-mono",style:ka.muted,children:h})]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[r.jsx(Lu,{variant:"outline",className:"font-mono text-[10px] capitalize",children:p}),r.jsxs(Lu,{className:En("text-[10px]",C),children:[f?r.jsx(L1,{className:"h-3 w-3"}):null,v]})]}),r.jsxs("div",{className:"mt-3 flex items-center gap-3 text-[10px]",style:ka.muted,children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(N1,{className:"h-3 w-3"}),y]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(Wi,{className:"h-3 w-3"}),b]})]}),r.jsx("div",{className:"mt-3 border-t pt-3",style:{borderColor:g.border},children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Nt,{variant:f?"outline":"default",size:"sm",className:"flex-1 text-[11px]",onClick:E=>{E.stopPropagation(),i()},children:f?"Open Agent":"Inspect"}),r.jsx(Nt,{variant:"ghost",size:"sm",className:"text-[11px]",onClick:E=>{E.stopPropagation(),o()},disabled:u,children:u?"Retiring…":"Retire"})]})})]})}function dA({items:e,selectedWorkspaceId:l,onSelectWorkspace:a,onPrimaryAction:i,onSecondaryAction:o,projectRetirementPendingRoot:u}){return r.jsx("div",{className:"overflow-hidden rounded-2xl border",style:{borderColor:g.border,backgroundColor:g.surface},children:r.jsxs("table",{className:"w-full",children:[r.jsx("thead",{children:r.jsxs("tr",{style:{backgroundColor:"color-mix(in srgb, var(--os-bg) 82%, transparent)"},children:[r.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-mono uppercase tracking-widest",style:ka.muted,children:"Workspace"}),r.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-mono uppercase tracking-widest",style:ka.muted,children:"Harness"}),r.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-mono uppercase tracking-widest",style:ka.muted,children:"Status"}),r.jsx("th",{className:"px-4 py-3 text-right text-[10px] font-mono uppercase tracking-widest",style:ka.muted,children:"Actions"})]})}),r.jsx("tbody",{children:e.map(d=>{const f=l===d.project.id;return r.jsxs("tr",{className:"border-t",style:{borderColor:g.border,backgroundColor:f?"color-mix(in srgb, var(--os-surface) 80%, white)":"transparent"},children:[r.jsx("td",{className:"px-4 py-3",children:r.jsxs("button",{type:"button",onClick:()=>a(d.project),className:"flex min-w-0 items-center gap-3 text-left",children:[r.jsx("div",{className:En("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-xs font-semibold",d.isBound?"bg-emerald-500/10 text-emerald-700":"bg-secondary text-secondary-foreground"),children:d.project.title.trim().charAt(0).toUpperCase()||"W"}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"truncate text-[13px] font-medium",style:ka.ink,children:d.project.title}),r.jsx("div",{className:"truncate text-[11px]",style:ka.muted,children:d.pathLabel})]})]})}),r.jsx("td",{className:"px-4 py-3",children:r.jsx(Lu,{variant:"outline",className:"font-mono text-[11px] capitalize",children:d.primaryHarness})}),r.jsx("td",{className:"px-4 py-3",children:r.jsxs(Lu,{className:En("text-[11px]",d.isBound?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":d.project.registrationKind==="configured"?"border-amber-500/20 bg-amber-500/10 text-amber-700":"border-border bg-secondary text-secondary-foreground"),children:[d.isBound?r.jsx(L1,{className:"h-3 w-3"}):null,d.statusLabel]})}),r.jsx("td",{className:"px-4 py-3",children:r.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[r.jsx(Nt,{variant:d.isBound?"outline":"default",size:"sm",onClick:()=>i(d.project),children:d.isBound?"Open":"Inspect"}),r.jsx(Nt,{variant:"ghost",size:"icon-sm",onClick:()=>o(d.project),disabled:u===d.project.root,children:r.jsx(M1,{className:"h-4 w-4"})})]})})]},d.project.id)})})]})})}function fA({activeView:e,help:l,settings:a}){if(e==="help")return r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsxs("div",{className:"max-w-5xl px-8 py-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-6 mb-5",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1.5",style:{color:g.accent},children:"Help"}),r.jsx("h1",{className:"text-[22px] font-semibold tracking-tight",style:l.styles.inkText,children:"Knowledge Base"}),r.jsx("p",{className:"text-[12px] mt-1.5 max-w-2xl leading-[1.6]",style:l.styles.mutedText,children:"Core Scout terms and the main CLI commands you can use here or in Terminal."})]}),r.jsx("div",{className:"flex items-center gap-2 shrink-0",children:r.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:g.ink},onClick:l.onOpenGeneralSettings,children:[r.jsx(Yr,{size:12}),"General"]})})]}),r.jsxs("div",{className:"space-y-5",children:[r.jsxs("section",{className:"border rounded-xl p-5",style:{...l.styles.surface,borderColor:g.border},children:[r.jsx("div",{className:"flex items-start justify-between gap-4 mb-5",children:r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Vocabulary"}),r.jsx("div",{className:"text-[14px] font-medium mt-1",style:l.styles.inkText,children:"What Scout means by each term"})]})}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[["Project Path","A folder Scout scans recursively to discover repos, project roots, and harness evidence."],["Context Root","The directory where Scout saves `.openscout/project.json` for the current local context."],["Harness","The assistant family a project prefers by default, such as `claude` or `codex`."],["Runtime","The installed local program or persistent session Scout uses to launch a chosen harness."]].map(([u,d])=>r.jsxs("article",{className:"rounded-xl border px-4 py-3.5",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:u}),r.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:l.styles.inkText,children:d})]},u))})]}),r.jsxs("section",{className:"border rounded-xl p-5",style:{...l.styles.surface,borderColor:g.border},children:[r.jsx("div",{className:"flex items-start justify-between gap-4 mb-5",children:r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"CLI Basics"}),r.jsx("div",{className:"text-[14px] font-medium mt-1",style:l.styles.inkText,children:"The same commands the app runs for you"}),r.jsx("div",{className:"text-[12px] mt-1 leading-[1.6] max-w-2xl",style:l.styles.mutedText,children:"Run them from here for guidance, or copy them into your shell when you want the direct Scout workflow."})]})}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[{command:"setup",title:"Setup",detail:"Writes a local `.openscout/project.json` for the chosen context."},{command:"doctor",title:"Doctor",detail:"Checks broker health and whether Scout can discover workspaces from your scan roots."},{command:"runtimes",title:"Runtimes",detail:"Shows whether Claude and Codex are installed, authenticated, and ready."}].map(u=>r.jsxs("article",{className:"rounded-xl border px-4 py-3.5",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:u.title}),r.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:l.styles.inkText,children:u.detail}),r.jsx("div",{className:"text-[10px] font-mono mt-3 break-all",style:l.styles.mutedText,children:l.buildOnboardingCommandLine(u.command)}),r.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[r.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:g.ink},onClick:()=>{l.onCopyOnboardingCommand(u.command)},children:[l.onboardingCopiedCommand===u.command?r.jsx(Qi,{size:12}):r.jsx(wa,{size:12}),"Copy"]}),r.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{l.onRunOnboardingCommand(u.command)},disabled:!!l.onboardingCommandPending,children:[r.jsx(bo,{size:12}),"Run"]})]})]},u.command))})]})]})]})});if(e!=="settings")return null;const i=a.profile,o=i.visibleAppSettings;return r.jsxs("div",{className:"flex-1 flex overflow-hidden",style:a.styles.surface,children:[r.jsxs("div",{className:"w-56 border-r flex flex-col shrink-0",style:{backgroundColor:g.bg,borderColor:g.border},children:[r.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:g.border},children:r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Settings"})}),r.jsx("div",{className:"px-2 py-2 flex flex-col gap-0.5 flex-1",children:a.settingsSections.map(u=>{const d=a.settingsSection===u.id;return r.jsxs("button",{onClick:()=>a.onSetSettingsSection(u.id),className:"flex items-center gap-2.5 px-3 py-2 rounded-lg text-left transition-colors",style:d?{backgroundColor:g.surface,borderColor:g.border,color:g.ink,boxShadow:g.shadowXs}:a.styles.mutedText,children:[r.jsx("span",{style:{color:d?g.accent:g.muted},children:u.icon}),r.jsx("span",{className:"text-[12px] font-medium",style:d?a.styles.inkText:void 0,children:u.label}),d?r.jsx(El,{size:12,className:"ml-auto",style:a.styles.mutedText}):null]},u.id)})}),r.jsx("div",{className:"px-3 py-3 border-t",style:{borderColor:g.border},children:r.jsxs("button",{type:"button",onClick:a.onOpenFeedbackDialog,className:"flex items-center gap-2 px-3 py-2 w-full rounded-lg transition-colors hover:opacity-70",style:a.styles.mutedText,children:[r.jsx(Rl,{size:13,style:{color:g.muted}}),r.jsx("span",{className:"text-[12px] font-medium",children:"Feedback"})]})})]}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsxs("div",{className:"max-w-6xl px-8 py-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-6 mb-5",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:g.accent},children:"Settings"}),r.jsx("h1",{className:"text-[18px] font-semibold tracking-tight",style:a.styles.inkText,children:a.activeSettingsMeta.label}),r.jsx("p",{className:"text-[11px] mt-1 max-w-2xl leading-[1.6]",style:a.styles.mutedText,children:a.activeSettingsMeta.description})]}),r.jsx("div",{className:"flex items-center gap-2 shrink-0",children:a.headerActions})]}),a.settingsSection==="profile"?r.jsx("div",{className:"max-w-3xl",children:r.jsxs("div",{className:"space-y-5 min-w-0",children:[o?.onboarding?.needed?r.jsxs("section",{className:"border rounded-xl p-5",style:{...a.styles.surface,borderColor:g.border},children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:a.styles.mutedText,children:"Onboarding"}),r.jsx("div",{className:"text-[13px] font-medium mt-1",style:a.styles.inkText,children:o.onboarding.title}),r.jsx("div",{className:"text-[11px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:o.onboarding.detail})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:i.handleRestartOnboarding,children:[r.jsx(gn,{size:12}),"Restart onboarding"]}),r.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded",style:a.styles.tagBadge,children:`${i.activeOnboardingStepIndex+1}/${i.onboardingWizardSteps.length}`})]})]}),r.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,220px)_minmax(0,1fr)]",children:[r.jsx("div",{className:"space-y-2",children:i.onboardingWizardSteps.map((u,d)=>{const f=i.onboardingWizardStep===u.id,p=d<i.activeOnboardingStepIndex;return r.jsx("button",{type:"button",className:"w-full rounded-lg border px-3 py-2 text-left transition-opacity hover:opacity-90",style:{borderColor:f?g.accent:g.border,backgroundColor:f?g.accentBg:g.surface,color:f?g.accent:g.ink},onClick:()=>i.setOnboardingWizardStep(u.id),children:r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest",children:u.title}),r.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:f?{color:g.accent}:a.styles.mutedText,children:u.detail})]}),r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:p?a.styles.activePill:a.styles.tagBadge,children:p?"done":d+1})]})},u.id)})}),r.jsxs("div",{className:"rounded-xl border p-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest",style:{color:g.accent},children:i.activeOnboardingStep.title}),r.jsx("div",{className:"text-[13px] font-medium mt-1",style:a.styles.inkText,children:i.activeOnboardingStep.detail}),r.jsx("div",{className:"text-[11px] mt-2 leading-[1.6]",style:a.styles.mutedText,children:i.activeOnboardingStep.helper}),i.activeOnboardingStep.id==="welcome"?r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Before you start"}),r.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:"Scout discovers workspaces from scan folders, stores local config under a context root, and needs a default harness before it can broker local runs."})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[["Source roots",(o.workspaceRoots??[]).join(", ")||"None yet"],["Context root",o.onboardingContextRoot||"Not set"],["Default harness",o.defaultHarness??"Not set"],["Operator",o.operatorName||o.operatorNameDefault]].map(([u,d])=>r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:u}),r.jsx("div",{className:"text-[11px] leading-[1.45]",style:a.styles.inkText,children:d})]},u))})]}):i.activeOnboardingStep.id==="source-roots"?r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Project scan folders"}),r.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:"Scout recursively scans these folders to find repos, manifests, and harness evidence."})]}),r.jsx("div",{className:"space-y-2",children:(o.workspaceRoots??[]).map((u,d)=>r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("input",{value:u,onChange:f=>i.handleSetSourceRootAt(d,f.target.value),readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:g.border,color:g.ink},placeholder:d===0?"~/dev":"Add another scan folder"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:g.ink},onClick:()=>i.handleBrowseForSourceRoot(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving,children:"Finder"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium w-7 h-7 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>i.handleRemoveSourceRootRow(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving||(o.workspaceRoots??[]).length<=1&&!u,"aria-label":`Remove source root ${d+1}`,children:"-"})]},`onboarding-source-root-${d}`))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[r.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootRow()},disabled:i.appSettingsSaving,children:[r.jsx("span",{className:"text-[12px] leading-none",children:"+"}),"Add path"]}),r.jsx("span",{className:"text-[10px]",style:a.styles.mutedText,children:"or"}),i.sourceRootPathSuggestions.map(u=>r.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-mono px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootSuggestion(u)},disabled:i.appSettingsSaving,children:u},u))]}),r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:"Context root"}),i.isAppSettingsEditing?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 max-w-md",children:[r.jsx("input",{value:o.onboardingContextRoot??"",onChange:u=>i.handleSetOnboardingContextRoot(u.target.value),readOnly:i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:g.border,color:g.ink},placeholder:"Choose where .openscout should live"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:g.ink},onClick:i.handleBrowseForOnboardingContextRoot,disabled:i.appSettingsSaving,children:"Finder"})]}),r.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"Project manifest will be saved here."})]}):r.jsx("div",{className:"text-[11px] leading-[1.45]",style:a.styles.inkText,children:o.onboardingContextRoot||"Not set"})]})]}):i.activeOnboardingStep.id==="harness"?r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(S1,{size:14,style:{color:g.accent}}),r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Harness vs runtime"})]}),r.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"The harness is the assistant family (e.g. Claude, Codex). The runtime is the local program that launches it."})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:["claude","codex"].map(u=>{const d=(o.runtimeCatalog??[]).find(p=>p.name===u)??null,f=o.defaultHarness===u;return r.jsx("button",{className:"text-left rounded-lg border px-3 py-3 transition-opacity hover:opacity-90 disabled:opacity-60",style:{borderColor:g.border,backgroundColor:f?g.bg:g.surface},disabled:!i.isAppSettingsEditing||i.appSettingsSaving,onClick:()=>{i.setAppSettingsDraft(p=>p&&{...p,defaultHarness:u}),i.setAppSettingsFeedback(null)},children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium capitalize",style:a.styles.inkText,children:u}),r.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:u==="claude"?"Use Claude as the default responder for new project agents.":"Use Codex as the default responder for new project agents."}),r.jsxs("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:["Runtime: ",d?.label??u," · ",d?.readinessDetail??"Not reported yet."]})]}),r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:f?a.styles.activePill:a.styles.tagBadge,children:f?"selected":"available"})]})},u)})})]}):i.activeOnboardingStep.id==="confirm"?r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Confirm this context"}),r.jsx("div",{className:"text-[10px] mt-1 leading-[1.5]",style:a.styles.mutedText,children:"Review your scan folders and context root before continuing."}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-3",children:[["Source roots",(o.workspaceRoots??[]).join(", ")||"None yet"],["Default harness",o.defaultHarness??"Not set"],["Relay context root",o.onboardingContextRoot||"Not set"],["Operator",o.operatorName||o.operatorNameDefault]].map(([u,d])=>r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:u}),r.jsx("div",{className:"text-[11px] leading-[1.45]",style:a.styles.inkText,children:d})]},u))})]}),r.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[i.isAppSettingsEditing?null:r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:i.handleStartAppSettingsEdit,disabled:i.appSettingsLoading||i.appSettingsSaving,children:"Edit Inputs"}),r.jsx("div",{className:"text-[10px] leading-[1.5]",style:a.styles.mutedText,children:i.appSettingsDirty?"Next confirms and saves these choices locally.":"Everything here is already saved locally."})]})]}):i.activeOnboardingStep.id==="setup"?r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wo,{size:14,style:{color:g.accent}}),r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Create the local project manifest"})]}),r.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"Initialize the project manifest at your context root."}),r.jsx("div",{className:"text-[11px] font-mono mt-3 break-all",style:a.styles.inkText,children:i.buildOnboardingCommandLine("setup")}),r.jsxs("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:["Project config path:"," ",i.renderLocalPathValue(o.currentProjectConfigPath??(o.onboardingContextRoot?`${o.onboardingContextRoot}/.openscout/project.json`:"Not created yet."),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:a.styles.mutedText})]})]}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleRunOnboardingCommand("setup")},disabled:!!i.onboardingCommandPending||i.appSettingsLoading||i.appSettingsDirty,children:i.onboardingCommandPending==="setup"?"Running Setup…":"Run Setup"})]}):i.activeOnboardingStep.id==="doctor"?r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(z1,{size:14,style:{color:g.accent}}),r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Review the current inventory"})]}),r.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"Check broker connectivity, source roots, and discovered projects."}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:"Projects"}),r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:o.projectInventory.length})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:"Broker"}),r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:o.broker.reachable?"Reachable":"Unavailable"})]})]}),r.jsx("div",{className:"text-[11px] font-mono mt-3 break-all",style:a.styles.inkText,children:"scout doctor"})]}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleRunOnboardingCommand("doctor")},disabled:!!i.onboardingCommandPending||i.appSettingsLoading||!i.onboardingHasProjectConfig,children:i.onboardingCommandPending==="doctor"?"Running Doctor…":"Run Doctor"})]}):r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(bo,{size:14,style:{color:g.accent}}),r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Check runtime readiness"})]}),r.jsx("div",{className:"text-[10px] mt-2 leading-[1.5]",style:a.styles.mutedText,children:"Verify each harness runtime is installed and ready."}),r.jsx("div",{className:"grid grid-cols-1 gap-2 mt-3",children:(o.runtimeCatalog??[]).map(u=>r.jsx("div",{className:"rounded-lg border px-3 py-2.5",style:{borderColor:g.border,backgroundColor:g.bg},children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[11px] font-medium",style:a.styles.inkText,children:u.label}),r.jsx("div",{className:"text-[10px] mt-1 leading-[1.4]",style:a.styles.mutedText,children:u.readinessDetail})]}),r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:u.readinessState==="ready"?a.styles.activePill:a.styles.tagBadge,children:u.readinessState})]})},u.name))}),r.jsxs("div",{className:"text-[10px] mt-3 leading-[1.5]",style:a.styles.mutedText,children:["Default harness: ",o.defaultHarness,". ",i.onboardingRuntimeMatch?`${i.onboardingRuntimeMatch.label} currently reports ${i.onboardingRuntimeMatch.readinessState}.`:"No matching runtime is reported yet."]}),r.jsx("div",{className:"text-[11px] font-mono mt-3 break-all",style:a.styles.inkText,children:"scout runtimes"})]}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleRunOnboardingCommand("runtimes")},disabled:!!i.onboardingCommandPending||i.appSettingsLoading,children:i.onboardingCommandPending==="runtimes"?"Running Runtimes…":"Run Runtimes"})]}),r.jsxs("div",{className:"flex items-center justify-between gap-3 mt-5 pt-4 border-t",style:{borderColor:g.border},children:[r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>i.moveOnboardingWizard(-1),disabled:!i.canGoToPreviousOnboardingStep,children:"Back"}),r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded disabled:opacity-50",style:{color:g.ink},onClick:i.handleOnboardingContinue,disabled:!i.canGoToNextOnboardingStep||i.appSettingsSaving||i.appSettingsLoading,children:[i.activeOnboardingStep.id==="confirm"?i.appSettingsSaving?"Confirming…":"Confirm":"Next",i.activeOnboardingStep.id==="confirm"?null:r.jsx(El,{size:12})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border px-3 py-3 mt-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-2",style:a.styles.mutedText,children:"CLI Equivalent"}),r.jsx("div",{className:"space-y-1",children:o.onboarding.commands.map(u=>r.jsx("div",{className:"text-[11px] font-mono break-all",style:a.styles.inkText,children:u},u))}),r.jsx("div",{className:"text-[10px] mt-3 leading-[1.5]",style:a.styles.mutedText,children:"Each wizard step runs the corresponding CLI command above."})]}),i.appSettingsFeedback?r.jsx("div",{className:"text-[11px] mt-3 leading-[1.5]",style:a.styles.inkText,children:i.appSettingsFeedback}):null,i.onboardingCommandResult?r.jsxs("div",{className:"rounded-lg border px-3 py-3 mt-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.styles.mutedText,children:"Last Command"}),r.jsx("div",{className:"text-[11px] font-mono break-all",style:a.styles.inkText,children:i.onboardingCommandResult.commandLine}),r.jsxs("div",{className:"text-[10px] mt-1",style:a.styles.mutedText,children:["cwd:"," ",i.renderLocalPathValue(i.onboardingCommandResult.cwd,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:a.styles.mutedText})]})]}),r.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:i.onboardingCommandResult.exitCode===0?a.styles.activePill:a.styles.tagBadge,children:["exit ",i.onboardingCommandResult.exitCode]})]}),r.jsx("pre",{className:"mt-3 text-[10px] leading-[1.45] whitespace-pre-wrap break-words overflow-x-auto",style:{color:g.ink},children:i.onboardingCommandResult.output})]}):null]}):null,i.appSettingsLoading&&!o?r.jsx("div",{className:"text-[11px]",style:a.styles.mutedText,children:"Loading settings…"}):r.jsxs("div",{className:"space-y-5",children:[r.jsxs("section",{className:"border rounded-lg overflow-hidden",style:{...a.styles.surface,borderColor:g.border},children:[r.jsx("div",{className:"p-4 border-b",style:{borderColor:g.border},children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Scout CLI"}),r.jsx("div",{className:"text-[14px] font-medium mt-1",style:a.styles.inkText,children:"Use the same commands here and in Terminal"}),r.jsx("div",{className:"text-[11px] mt-1 leading-[1.6] max-w-2xl",style:a.styles.mutedText,children:"General is for local Scout setup. Workspace discovery lives in Workspace Explorer so this screen can stay fast."})]}),r.jsx("div",{className:"flex items-center gap-2 shrink-0",children:r.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:g.ink},onClick:i.openKnowledgeBase,children:[r.jsx(v1,{size:12}),"Knowledge Base"]})})]})}),r.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3 p-4",children:[{command:"setup",title:"scout setup",detail:"Create or refresh the local project manifest for this context."},{command:"doctor",title:"scout doctor",detail:"Check broker health, scan roots, and discovery readiness."},{command:"runtimes",title:"scout runtimes",detail:"Verify Claude and Codex runtimes are installed and ready."}].map(u=>r.jsxs("article",{className:"rounded-xl border px-4 py-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[11px] font-mono font-medium",style:{color:g.accent},children:u.title}),r.jsx("div",{className:"text-[11px] mt-2 leading-[1.6]",style:a.styles.mutedText,children:u.detail}),r.jsx("div",{className:"text-[10px] font-mono mt-3 break-all",style:a.styles.inkText,children:i.buildOnboardingCommandLine(u.command)}),r.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[r.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleRunOnboardingCommand(u.command)},disabled:!!i.onboardingCommandPending||i.appSettingsLoading||i.appSettingsSaving||u.command==="doctor"&&i.appSettingsDirty,children:[r.jsx(bo,{size:12}),"Run"]}),r.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md",style:{color:g.ink},onClick:()=>{i.handleCopyOnboardingCommand(u.command)},children:[i.onboardingCopiedCommand===u.command?r.jsx(Qi,{size:12}):r.jsx(wa,{size:12}),"Copy"]})]})]},u.command))})]}),r.jsx("section",{className:"border rounded-lg overflow-hidden",style:{...a.styles.surface,borderColor:g.border},children:r.jsxs("div",{className:"divide-y",style:{borderColor:g.border},children:[r.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-center gap-3",children:[r.jsxs("div",{className:"sm:w-1/3",children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Display Name"}),r.jsx("div",{className:"text-[10px] mt-0.5",style:a.styles.mutedText,children:"Used across Scout and Relay."})]}),r.jsx("div",{className:"sm:w-2/3",children:r.jsx("input",{ref:i.settingsOperatorNameRef,value:i.isAppSettingsEditing?o?.operatorName??"":o?.operatorName??o?.operatorNameDefault??"",onChange:u=>{i.setAppSettingsDraft(d=>d&&{...d,operatorName:u.target.value}),i.setAppSettingsFeedback(null)},readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,placeholder:i.appSettings?.operatorNameDefault??"Operator",className:"w-full max-w-md rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})})]}),r.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[r.jsxs("div",{className:"sm:w-1/3",children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Default Harness"}),r.jsx("div",{className:"text-[10px] mt-0.5",style:a.styles.mutedText,children:"Fallback assistant family."})]}),r.jsx("div",{className:"sm:w-2/3",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[["claude","codex"].map(u=>{const d=o?.defaultHarness===u,f=(o?.runtimeCatalog??[]).find(p=>p.name===u);return r.jsxs("button",{type:"button",className:"rounded-md border px-3 py-1.5 text-[12px] font-medium capitalize transition-colors disabled:opacity-60 flex items-center gap-1.5",style:{borderColor:d?g.accentBorder:g.border,backgroundColor:d?g.accentBg:g.bg,color:d?g.accent:g.ink},disabled:!i.isAppSettingsEditing||i.appSettingsSaving,onClick:()=>{i.setAppSettingsDraft(p=>p&&{...p,defaultHarness:u}),i.setAppSettingsFeedback(null)},children:[u,f?r.jsx("span",{className:"text-[8px] font-mono uppercase tracking-wider px-1 py-px rounded-sm",style:f.readinessState==="ready"?a.styles.activePill:a.styles.tagBadge,children:f.readinessState}):null]},u)}),r.jsx("button",{type:"button",className:"rounded-md border border-dashed w-8 h-8 flex items-center justify-center text-[14px] transition-colors disabled:opacity-40",style:{borderColor:g.border,color:g.muted},disabled:!i.isAppSettingsEditing||i.appSettingsSaving,title:"Add runtime",children:"+"})]})})]}),r.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[r.jsxs("div",{className:"sm:w-1/3",children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Context Root"}),r.jsx("div",{className:"text-[10px] mt-0.5",style:a.styles.mutedText,children:"Where Scout stores workspace config."})]}),r.jsxs("div",{className:"sm:w-2/3",children:[r.jsxs("div",{className:"flex items-center gap-1.5 max-w-md mb-2",children:[r.jsx("input",{value:o?.onboardingContextRoot??"",onChange:u=>i.handleSetOnboardingContextRoot(u.target.value),readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:g.border,color:g.ink},placeholder:"Choose where .openscout should live"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:g.ink},onClick:i.handleBrowseForOnboardingContextRoot,disabled:!i.isAppSettingsEditing||i.appSettingsSaving,children:"Finder"})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:o?.includeCurrentRepo??!0,disabled:!i.isAppSettingsEditing||i.appSettingsSaving,onChange:u=>{i.setAppSettingsDraft(d=>d&&{...d,includeCurrentRepo:u.target.checked}),i.setAppSettingsFeedback(null)}}),r.jsx("span",{className:"text-[10px]",style:a.styles.inkText,children:"Include root in discovery"})]}),o?.currentProjectConfigPath?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"hidden sm:block w-px h-3",style:{backgroundColor:g.border}}),r.jsx("span",{className:"text-[9px] font-mono truncate",style:a.styles.mutedText,title:o.currentProjectConfigPath,children:i.renderLocalPathValue(o.currentProjectConfigPath,{compact:!0,className:"text-left hover:opacity-80 transition-opacity",style:a.styles.mutedText})})]}):null]})]})]}),r.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[r.jsxs("div",{className:"sm:w-1/3",children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.styles.inkText,children:"Scan Folders"}),r.jsx("div",{className:"text-[10px] mt-0.5",style:a.styles.mutedText,children:"Parent directories for repos."})]}),r.jsxs("div",{className:"sm:w-2/3",children:[r.jsxs("div",{className:"space-y-1.5",children:[(o?.workspaceRoots??[]).map((u,d)=>r.jsxs("div",{className:"flex items-center gap-1.5 max-w-md",children:[r.jsx("input",{value:u,onChange:f=>i.handleSetSourceRootAt(d,f.target.value),readOnly:!i.isAppSettingsEditing||i.appSettingsSaving,className:"flex-1 rounded-md border px-2.5 py-1.5 text-[12px] leading-[1.5] bg-transparent outline-none font-mono",style:{borderColor:g.border,color:g.ink},placeholder:d===0?"~/dev":"Add another path"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-medium px-2 py-1.5 rounded-md",style:{color:g.ink},onClick:()=>i.handleBrowseForSourceRoot(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving,children:"Finder"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium w-7 h-7 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>i.handleRemoveSourceRootRow(d),disabled:!i.isAppSettingsEditing||i.appSettingsSaving||(o?.workspaceRoots??[]).length<=1&&!u,"aria-label":`Remove project path ${d+1}`,children:"-"})]},`general-source-root-${d}`)),(o?.workspaceRoots?.length??0)===0?r.jsx("div",{className:"rounded-md border border-dashed px-2.5 py-2.5 text-[11px] leading-[1.5] max-w-md",style:{borderColor:g.border,color:g.muted},children:"No scan folders configured. Add one to discover projects."}):null]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-2",children:[r.jsxs("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootRow()},disabled:i.appSettingsSaving,children:[r.jsx("span",{className:"text-[12px] leading-none",children:"+"}),"Add path"]}),r.jsx("span",{className:"text-[10px]",style:a.styles.mutedText,children:"or"}),i.sourceRootPathSuggestions.map(u=>r.jsx("button",{type:"button",className:"os-toolbar-button text-[10px] font-mono px-2 py-1 rounded-md disabled:opacity-50",style:{color:g.ink},onClick:()=>{i.handleBeginGeneralEdit(),i.handleAddSourceRootSuggestion(u)},disabled:i.appSettingsSaving,children:u},u))]})]})]})]})}),i.appSettingsFeedback?r.jsx("div",{className:"text-[11px] leading-[1.5]",style:a.styles.inkText,children:i.appSettingsFeedback}):null,i.onboardingCommandResult?.command==="doctor"?r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:a.styles.mutedText,children:"Doctor Output"}),i.renderOnboardingCommandShell("doctor",i.buildOnboardingCommandLine("doctor"),i.onboardingCommandPending==="doctor")]}):null]})]})}):a.settingsSection==="agents"?r.jsx(rA,{...a.agentSettingsViewProps}):a.settingsSection==="workspaces"?r.jsx(cA,{...a.workspaceExplorerViewProps}):a.settingsSection==="communication"?r.jsx(sA,{...a.communicationSettingsViewProps}):a.settingsSection==="database"?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("section",{className:"border rounded-xl p-5",style:{...a.database.styles.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Session Index"}),r.jsx("div",{className:"grid grid-cols-3 gap-3",children:[["Sessions",`${a.database.stats.totalSessions}`],["Messages",`${a.database.stats.totalMessages}`],["Projects",`${a.database.stats.projects}`],["Tokens",`${Math.round(a.database.stats.totalTokens/1e3)}k`],["Runtime Messages",`${a.database.runtime?.messageCount??0}`],["tmux Sessions",`${a.database.runtime?.tmuxSessionCount??0}`]].map(([u,d])=>r.jsxs("div",{className:"rounded-lg border px-3 py-2.5",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.database.styles.mutedText,children:u}),r.jsx("div",{className:"text-[16px] font-semibold",style:a.database.styles.inkText,children:d})]},u))})]}),r.jsxs("section",{className:"border rounded-xl p-5",style:{...a.database.styles.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Storage"}),r.jsxs("div",{className:"space-y-3",children:[a.database.visibleAppSettings?.controlPlaneSqlitePath?r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.database.styles.inkText,children:"Control plane database"}),r.jsx("div",{className:"text-[11px] font-mono mt-1 truncate",style:a.database.styles.mutedText,children:a.database.renderLocalPathValue(a.database.visibleAppSettings.controlPlaneSqlitePath,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity truncate",style:a.database.styles.mutedText})})]}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[11px] font-medium px-3 py-1.5 rounded-lg border shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>a.database.onRevealPath(a.database.visibleAppSettings.controlPlaneSqlitePath),children:"Reveal in Finder"})]}):null,a.database.visibleAppSettings?.settingsPath?r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.database.styles.inkText,children:"Settings"}),r.jsx("div",{className:"text-[11px] font-mono mt-1 truncate",style:a.database.styles.mutedText,children:a.database.renderLocalPathValue(a.database.visibleAppSettings.settingsPath,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity truncate",style:a.database.styles.mutedText})})]}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[11px] font-medium px-3 py-1.5 rounded-lg border shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>a.database.onRevealPath(a.database.visibleAppSettings.settingsPath),children:"Reveal in Finder"})]}):null,a.database.visibleAppSettings?.supportDirectory?r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium",style:a.database.styles.inkText,children:"Support directory"}),r.jsx("div",{className:"text-[11px] font-mono mt-1 truncate",style:a.database.styles.mutedText,children:a.database.renderLocalPathValue(a.database.visibleAppSettings.supportDirectory,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity truncate",style:a.database.styles.mutedText})})]}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[11px] font-medium px-3 py-1.5 rounded-lg border shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>a.database.onRevealPath(a.database.visibleAppSettings.supportDirectory),children:"Reveal in Finder"})]}):null]})]})]}):r.jsxs("div",{className:"grid grid-cols-[minmax(0,1.05fr)_minmax(320px,0.85fr)] gap-4",children:[r.jsxs("section",{className:"border rounded-xl p-5",style:{...a.appearance.styles.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Color Mode"}),r.jsx("div",{className:"flex gap-3 mb-5",children:[{id:"light",label:"Light"},{id:"dark",label:"Dark"}].map(u=>{const d=u.id===(a.appearance.dark?"dark":"light");return r.jsxs("button",{onClick:()=>a.appearance.setDark(u.id==="dark"),className:"flex-1 border rounded-xl px-4 py-4 text-left",style:{borderColor:d?g.accent:g.border,backgroundColor:d?g.bg:g.surface},children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",style:{color:d?g.accent:g.muted},children:[u.id==="dark"?r.jsx(A1,{size:15}):r.jsx(O1,{size:15}),r.jsx("span",{className:"text-[12px] font-medium",style:d?{color:g.accent}:a.appearance.styles.inkText,children:u.label})]}),r.jsx("div",{className:"text-[11px] leading-[1.5]",style:a.appearance.styles.mutedText,children:u.id==="dark"?"Deep shell contrast for low-light work.":"Warm neutral shell with higher paper-like contrast."})]},u.id)})}),r.jsx("div",{className:"border rounded-xl px-4 py-4",style:{borderColor:g.border,backgroundColor:g.bg},children:r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:{color:g.accent},children:"Annotations"}),r.jsx("div",{className:"text-[12px] leading-[1.6]",style:a.appearance.styles.mutedText,children:"Show routing and provenance tags in timelines."})]}),r.jsx("button",{onClick:()=>a.appearance.setShowAnnotations(u=>!u),className:"os-toolbar-button text-[11px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:a.appearance.showAnnotations?"Hide annotations":"Show annotations"})]})})]}),r.jsxs("div",{className:"space-y-4 min-w-0",children:[r.jsxs("section",{className:"border rounded-xl p-5",style:{...a.appearance.styles.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Current Surface"}),r.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[["Mode",a.appearance.dark?"Dark":"Light"],["Annotations",a.appearance.showAnnotations?"Visible":"Hidden"],["Sidebar",a.appearance.isCollapsed?"Collapsed":"Expanded"],["Section",a.appearance.activeSettingsLabel]].map(([u,d])=>r.jsxs("div",{children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:a.appearance.styles.mutedText,children:u}),r.jsx("div",{className:"text-[12px]",style:a.appearance.styles.inkText,children:d})]},u))})]}),r.jsxs("section",{className:"border rounded-xl p-5",style:{...a.appearance.styles.surface,borderColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-3",style:{color:g.accent},children:"Coming Soon"}),r.jsx("div",{className:"text-[12px] leading-[1.6]",style:a.appearance.styles.mutedText,children:"Theme, density, and typography controls."})]})]})]})]})})]})}function mA({command:e,commandLine:l,running:a,commandResult:i,visibleAppSettings:o,onboardingCopiedCommand:u,onboardingCommandPending:d,onboardingContextRoot:f,onCopyOnboardingCommand:p,onRunOnboardingCommand:h}){const y=i&&i.exitCode===0,b=i&&i.exitCode!==0;return r.jsxs("div",{className:"space-y-2",children:[y&&(()=>{const v=o?.projectInventory?.length??0,j=o?.broker?.reachable,C=(o?.runtimeCatalog??[]).filter(M=>M.readinessState==="ready").length,E=(o?.runtimeCatalog??[]).length,N=[];return(e==="setup"||e==="doctor")&&(N.push(j?"Broker running":"Broker installed"),v>0&&N.push(`${v} project${v===1?"":"s"} discovered`)),e==="runtimes"&&E>0&&N.push(`${C} of ${E} runtime${E===1?"":"s"} ready`),r.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{backgroundColor:"rgba(34,197,94,0.08)",borderColor:"rgba(34,197,94,0.25)"},children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[r.jsx(Ru,{size:14,style:{color:"#16a34a"}}),r.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#16a34a"},children:"Done"})]}),N.length>0?r.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:N.map(M=>r.jsx("span",{className:"text-[11px]",style:{color:"#16a34a",opacity:.85},children:M},M))}):null]})})(),b?r.jsx("div",{className:"rounded-xl border overflow-hidden",style:{backgroundColor:"rgba(239,68,68,0.06)",borderColor:"rgba(239,68,68,0.25)"},children:r.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[r.jsx(Cp,{size:15,className:"shrink-0 mt-0.5",style:{color:"#dc2626"}}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"text-[12px] font-semibold",style:{color:"#dc2626"},children:["Command failed (exit ",i.exitCode,")"]}),r.jsx("div",{className:"text-[11px] mt-1 leading-[1.5]",style:{color:"#dc2626",opacity:.8},children:"Check the output below for details, then try again or run the command in Terminal for more context."})]}),r.jsx("button",{type:"button",className:"shrink-0 text-[11px] font-medium px-3 py-1.5 rounded-lg border transition-opacity hover:opacity-80",style:{borderColor:"rgba(239,68,68,0.35)",color:"#dc2626",backgroundColor:"rgba(239,68,68,0.08)"},onClick:()=>{h(e)},disabled:!!d,children:"Try again"})]})}):null,r.jsxs("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"rgba(15, 23, 42, 0.12)",backgroundColor:g.termBg},children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 px-3.5 py-2 border-b",style:{borderBottomColor:"rgba(255,255,255,0.06)",backgroundColor:"rgba(255,255,255,0.03)"},children:[r.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-[5px]",children:[r.jsx("span",{className:"w-[7px] h-[7px] rounded-full bg-[#ff5f57]"}),r.jsx("span",{className:"w-[7px] h-[7px] rounded-full bg-[#febc2e]"}),r.jsx("span",{className:"w-[7px] h-[7px] rounded-full bg-[#28c840]"})]}),r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em]",style:{color:"rgba(255,255,255,0.38)"},children:"Terminal"})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a?r.jsx("span",{className:"text-[10px] font-mono px-2 py-1 rounded animate-pulse",style:{backgroundColor:"rgba(45,212,191,0.18)",color:"#99f6e4"},children:"Running…"}):null,r.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-md border px-2.5 py-1.5 text-[11px] font-medium transition-opacity hover:opacity-85",style:{borderColor:"rgba(255,255,255,0.12)",color:"rgba(255,255,255,0.82)",backgroundColor:"rgba(255,255,255,0.04)"},onClick:()=>{p(e)},children:[u===e?r.jsx(Ru,{size:12}):r.jsx(wa,{size:12}),u===e?"Copied":"Copy"]})]})]}),r.jsx("div",{className:"px-4 py-3",children:r.jsxs("div",{className:"text-[13px] leading-[1.7] font-mono break-all",style:{color:g.termFg},children:[r.jsx("span",{style:{color:"rgba(153,246,228,0.80)"},children:"$"})," ",l]})}),a||i?r.jsxs("div",{className:"border-t px-4 py-3",style:{borderTopColor:"rgba(255,255,255,0.06)",backgroundColor:"rgba(0,0,0,0.08)"},children:[r.jsxs("div",{className:"text-[10px] font-mono mb-2",style:{color:"rgba(255,255,255,0.35)"},children:["cwd: ",i?.cwd??(f||"…")]}),r.jsx("pre",{className:"text-[11px] leading-[1.6] whitespace-pre-wrap break-words overflow-x-auto font-mono",style:{color:b?"rgba(252,165,165,0.85)":g.termFg,maxHeight:"16rem",overflowY:"auto"},children:a?"… waiting for output":i?.output})]}):r.jsx("div",{className:"px-4 py-4 border-t",style:{borderTopColor:"rgba(255,255,255,0.06)"},children:r.jsx("div",{className:"text-[11px] font-mono",style:{color:"rgba(255,255,255,0.35)"},children:"Output will appear here after you run the command."})})]})]})}function pA({activeOnboardingStep:e,visibleAppSettings:l,appSettingsSaving:a,appSettingsLoading:i,appSettingsDirty:o,onboardingCommandPending:u,onboardingHasProjectConfig:d,sourceRootPathSuggestions:f,settingsOperatorNameRef:p,setAppSettingsDraft:h,setAppSettingsFeedback:y,setIsAppSettingsEditing:b,handleAddSourceRootRow:v,handleSetSourceRootAt:j,handleBrowseForSourceRoot:C,handleRemoveSourceRootRow:E,handleSetOnboardingContextRoot:N,handleBrowseForOnboardingContextRoot:M,handleAddSourceRootSuggestion:L,handleRunOnboardingCommand:H,buildOnboardingCommandLine:X,renderOnboardingCommandShell:q,renderLocalPathValue:D,styles:B,availableHarnesses:F}){if(e.id==="welcome")return r.jsxs("div",{className:"space-y-8",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"text-[32px] font-bold tracking-tight leading-[1.15]",style:B.inkText,children:"Welcome to Scout"}),r.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"What should we call you?"})]}),r.jsxs("div",{className:"rounded-xl border px-6 py-6",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest mb-4",style:{color:g.accent},children:"Your name"}),r.jsx("input",{ref:p,value:l.operatorName??"",onChange:O=>{h(P=>P&&{...P,operatorName:O.target.value}),y(null),b(!0)},readOnly:a,placeholder:l.operatorNameDefault||"Operator",className:"w-full border-b-2 border-t-0 border-l-0 border-r-0 px-0 py-3 text-[24px] font-semibold leading-[1.3] bg-transparent outline-none transition-colors focus:border-[var(--os-accent)]",style:{borderBottomColor:g.border,color:g.ink}}),r.jsx("div",{className:"text-[12px] mt-4 leading-[1.6]",style:B.mutedText,children:"Prefilled from your machine."})]})]});if(e.id==="source-roots")return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Scan folders and context root"}),r.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"Choose the parent folders Scout should scan for repos, then choose the one directory where this Scout context should live."})]}),r.jsxs("div",{className:"rounded-xl border px-5 py-5",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[r.jsx("div",{className:"text-[11px] font-mono uppercase tracking-widest",style:B.mutedText,children:"Source Roots"}),r.jsxs("button",{type:"button",className:"os-toolbar-button inline-flex items-center gap-1 text-[12px] font-medium px-3 py-1.5 rounded-lg border disabled:opacity-50",style:{color:g.ink,borderColor:g.border},onClick:v,disabled:a,children:[r.jsx("span",{className:"text-[14px] leading-none",children:"+"}),"Add path"]})]}),r.jsx("div",{className:"text-[12px] mb-3 leading-[1.6]",style:B.mutedText,children:"These are scan inputs. Scout looks through the repos underneath them, but listing a folder here does not make it the place where Scout saves this context."}),r.jsxs("div",{className:"space-y-3",children:[(l.workspaceRoots??[]).map((O,P)=>r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{value:O,onChange:Q=>j(P,Q.target.value),readOnly:a,className:"flex-1 rounded-lg border px-4 py-3 text-[15px] font-mono leading-[1.5] bg-transparent outline-none transition-colors focus:border-[var(--os-accent)]",style:{borderColor:g.border,color:g.ink},placeholder:P===0?"~/dev":"Add another source root"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium px-3 py-3 rounded-lg border disabled:opacity-50 shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>C(P),disabled:a,children:"Finder"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[14px] font-medium w-10 h-10 rounded-lg border disabled:opacity-50 shrink-0",style:{color:g.ink,borderColor:g.border},onClick:()=>E(P),disabled:a||(l.workspaceRoots??[]).length<=1&&!O,"aria-label":`Remove source root ${P+1}`,children:"-"})]},`immersive-source-root-${P}`)),(l.workspaceRoots??[]).length===0?r.jsx("div",{className:"rounded-lg border border-dashed px-4 py-4 text-[12px] leading-[1.6]",style:{borderColor:g.border,color:g.muted},children:"No scan folders yet. Add a path above to tell Scout where to look for repos and projects."}):null]}),r.jsxs("div",{className:"mt-5 pt-5 border-t",style:{borderTopColor:g.border},children:[r.jsx("div",{className:"text-[11px] font-mono uppercase tracking-widest mb-3",style:B.mutedText,children:"Relay Context Root"}),r.jsxs("div",{className:"text-[12px] leading-[1.6] mb-3",style:B.mutedText,children:["This is different from the scan folders above. Scout will save this context here by writing ",r.jsx("code",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded",style:{backgroundColor:g.bg},children:".openscout/project.json"})," inside this directory."]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{value:l.onboardingContextRoot??"",onChange:O=>N(O.target.value),readOnly:a,className:"flex-1 rounded-lg border px-4 py-3 text-[15px] font-mono leading-[1.5] bg-transparent outline-none transition-colors focus:border-[var(--os-accent)]",style:{borderColor:g.border,color:g.ink},placeholder:"Choose where .openscout should live"}),r.jsx("button",{type:"button",className:"os-toolbar-button text-[12px] font-medium px-3 py-3 rounded-lg border disabled:opacity-50 shrink-0",style:{color:g.ink,borderColor:g.border},onClick:M,disabled:a,children:"Finder"})]})]}),r.jsxs("div",{className:"text-[12px] mt-3 leading-[1.6]",style:B.mutedText,children:["Usually something like ",r.jsx("code",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded",style:{backgroundColor:g.bg},children:"~/dev"})," or ",r.jsx("code",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded",style:{backgroundColor:g.bg},children:"~/src"}),"."]}),r.jsx("div",{className:"flex flex-wrap gap-2 mt-4",children:f.map(O=>r.jsx("button",{className:"os-toolbar-button text-[12px] font-mono font-medium px-3 py-1.5 rounded-lg border disabled:opacity-50",style:{color:g.ink,borderColor:g.border},onClick:()=>L(O),disabled:a,children:O},O))})]})]});if(e.id==="harness")return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Default harness"}),r.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"Which assistant should answer new project turns by default?"})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:F.map(O=>{const P=(l.runtimeCatalog??[]).find(oe=>oe.name===O)??null,Q=l.defaultHarness===O;return r.jsx("button",{className:"os-card text-left rounded-xl border px-5 py-5 disabled:opacity-60",style:{borderColor:Q?g.accent:g.border,backgroundColor:Q?g.accentBg:g.surface,boxShadow:Q?`0 0 0 1px ${g.accent}`:"none"},disabled:a,onClick:()=>{h(oe=>oe&&{...oe,defaultHarness:O}),y(null)},children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[18px] font-semibold capitalize tracking-tight",style:B.inkText,children:O}),r.jsx("div",{className:"text-[13px] mt-2 leading-[1.6]",style:B.mutedText,children:O==="claude"?"Anthropic Claude Code — agentic coding via local CLI session.":"OpenAI Codex — agentic coding via cloud sandbox."}),r.jsxs("div",{className:"text-[12px] mt-4 leading-[1.6]",style:B.mutedText,children:["Runtime: ",P?.label??O," · ",P?.readinessDetail??"Not reported yet."]})]}),r.jsx("span",{className:"text-[10px] font-mono px-2.5 py-1 rounded-full shrink-0",style:Q?B.activePill:B.tagBadge,children:Q?"selected":"available"})]})},O)})})]});if(e.id==="confirm")return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Confirm this context"}),r.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"Review which folders Scout will scan and where it will save this context before continuing."})]}),r.jsx("div",{className:"rounded-xl border px-5 py-5",style:{borderColor:g.border,backgroundColor:g.surface},children:r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[["Operator",l.operatorName||l.operatorNameDefault],["Source roots",(l.workspaceRoots??[]).join(", ")||"None yet"],["Default harness",l.defaultHarness??"Not set"],["Relay context root",l.onboardingContextRoot||"Not set"]].map(([O,P])=>r.jsxs("div",{className:"rounded-lg px-4 py-3",style:{backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest mb-2",style:{color:g.accent},children:O}),r.jsx("div",{className:"text-[15px] font-medium leading-[1.5]",style:B.inkText,children:O==="Relay context root"?D(String(P),{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"}):P})]},O))})}),o?r.jsx("div",{className:"text-[12px] leading-[1.6]",style:B.mutedText,children:"Unsaved changes."}):null]});if(e.id==="setup"){const O=X("setup"),P=u==="setup",Q=l.currentProjectConfigPath??(l.onboardingContextRoot?`${l.onboardingContextRoot}/.openscout/project.json`:"Not created yet.");return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Setup"}),r.jsx("div",{className:"text-[15px] leading-[1.7] max-w-2xl",style:B.mutedText,children:"Create the local project manifest."})]}),q("setup",O,P),r.jsxs("div",{className:"rounded-xl border px-5 py-5",style:{borderColor:g.border,backgroundColor:g.surface},children:[r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[["1. Context root",l.onboardingContextRoot||"Not set"],["2. Manifest","Writes `.openscout/project.json` at that root to anchor this context."],["3. Discovery","Uses that context plus scanned folders to build inventory and routing."]].map(([oe,J])=>r.jsxs("div",{className:"rounded-lg border px-4 py-4",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[11px] font-mono font-medium tracking-wide",style:{color:g.accent},children:oe}),r.jsx("div",{className:"text-[12px] mt-2 leading-[1.6]",style:B.mutedText,children:J})]},oe))}),r.jsx("div",{className:"text-[12px] font-mono mt-5 leading-[1.6] break-all",style:B.mutedText,children:typeof Q=="string"?D(Q,{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:B.mutedText}):Q})]}),r.jsx("button",{className:"os-btn-primary flex items-center gap-2 text-[13px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:g.accent,color:"#fff"},onClick:()=>{H("setup")},disabled:!!u||i||o,children:P?"Running Setup…":"Run Setup"})]})}if(e.id==="doctor"){const O=X("doctor"),P=u==="doctor",Q=l.broker.reachable,oe=l.projectInventory.length,J=[{label:"Broker",value:Q?"Reachable":"Unavailable",ok:Q,fix:Q?null:"Re-run setup to install and start the broker service."},{label:"Projects",value:`${oe} found`,ok:oe>0,fix:oe===0?"Add workspace roots in Settings → General, then refresh Workspaces.":null},{label:"Context root",value:l.currentProjectConfigPath?"Configured":"Missing",ok:!!l.currentProjectConfigPath,fix:l.currentProjectConfigPath?null:"Run setup again from the previous step."}],ee=J.some(w=>!w.ok);return r.jsxs("div",{className:"space-y-5",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Doctor"}),r.jsx("div",{className:"text-[14px] leading-[1.6]",style:B.mutedText,children:"Verify broker health, project discovery, and relay context."})]}),r.jsx("div",{className:"grid grid-cols-3 gap-3",children:J.map(w=>r.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{borderColor:w.ok?"rgba(34,197,94,0.25)":"rgba(239,68,68,0.25)",backgroundColor:w.ok?"rgba(34,197,94,0.05)":"rgba(239,68,68,0.05)"},children:[r.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[r.jsx("span",{style:{color:w.ok?"#16a34a":"#dc2626",fontSize:13},children:w.ok?"✓":"✗"}),r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-widest",style:{color:w.ok?"#16a34a":"#dc2626"},children:w.label})]}),r.jsx("div",{className:"text-[13px] font-medium",style:B.inkText,children:w.value}),w.fix?r.jsx("div",{className:"text-[11px] mt-1.5 leading-[1.5]",style:{color:"#dc2626",opacity:.8},children:w.fix}):null]},w.label))}),q("doctor",O,P),r.jsx("button",{className:"os-btn-primary flex items-center gap-2 text-[13px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:ee?"#dc2626":g.accent,color:"#fff"},onClick:()=>{H("doctor")},disabled:!!u||i||!d,children:P?"Running Doctor…":ee?"Run Doctor to diagnose":"Run Doctor"})]})}const Z=X("runtimes");return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[28px] font-semibold tracking-tight",style:B.inkText,children:"Runtimes"}),r.jsx("div",{className:"text-[14px] leading-[1.6]",style:B.mutedText,children:"Verify each harness has a working local runtime."})]}),(l.runtimeCatalog??[]).length>0?r.jsx("div",{className:"grid grid-cols-1 gap-2",children:(l.runtimeCatalog??[]).map(O=>{const P=O.readinessState==="ready";return r.jsxs("div",{className:"rounded-xl border px-4 py-3 flex items-start justify-between gap-3",style:{borderColor:P?"rgba(34,197,94,0.25)":"rgba(239,68,68,0.25)",backgroundColor:P?"rgba(34,197,94,0.05)":"rgba(239,68,68,0.05)"},children:[r.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r.jsx("span",{className:"mt-0.5 text-[14px]",style:{color:P?"#16a34a":"#dc2626"},children:P?"✓":"✗"}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[13px] font-semibold",style:B.inkText,children:O.label}),r.jsx("div",{className:"text-[11px] mt-0.5 leading-[1.5]",style:P?B.mutedText:{color:"#dc2626",opacity:.85},children:O.readinessDetail}),!P&&O.readinessState==="missing"?r.jsx("div",{className:"text-[10px] font-mono mt-1.5 px-2 py-1 rounded inline-block",style:{backgroundColor:"rgba(239,68,68,0.08)",color:"#dc2626"},children:O.name==="claude"?"brew install claude":O.name==="codex"?"npm install -g @openai/codex":`install ${O.name}`}):null,!P&&O.readinessState==="configured"?r.jsx("div",{className:"text-[10px] font-mono mt-1.5 px-2 py-1 rounded inline-block",style:{backgroundColor:"rgba(239,68,68,0.08)",color:"#dc2626"},children:O.name==="claude"?"claude login":O.name==="codex"?"codex login":`${O.name} login`}):null]})]}),r.jsx("span",{className:"text-[10px] font-mono px-2.5 py-1 rounded-full shrink-0",style:P?B.activePill:{backgroundColor:"rgba(239,68,68,0.12)",color:"#dc2626"},children:O.readinessState})]},O.name)})}):null,q("runtimes",Z,u==="runtimes"),r.jsx("button",{className:"os-btn-primary flex items-center gap-2 text-[13px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:g.accent,color:"#fff"},onClick:()=>{H("runtimes")},disabled:!!u||i,children:u==="runtimes"?"Running Runtimes…":"Run Runtimes"})]})}function hA(e,l){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const xA=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gA=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bA={};function cy(e,l){return(bA.jsx?gA:xA).test(e)}const yA=/[ \t\n\f\r]/g;function vA(e){return typeof e=="object"?e.type==="text"?uy(e.value):!1:uy(e)}function uy(e){return e.replace(yA,"")===""}class zo{constructor(l,a,i){this.normal=a,this.property=l,i&&(this.space=i)}}zo.prototype.normal={};zo.prototype.property={};zo.prototype.space=void 0;function f0(e,l){const a={},i={};for(const o of e)Object.assign(a,o.property),Object.assign(i,o.normal);return new zo(a,i,l)}function op(e){return e.toLowerCase()}class Wn{constructor(l,a){this.attribute=a,this.property=l}}Wn.prototype.attribute="";Wn.prototype.booleanish=!1;Wn.prototype.boolean=!1;Wn.prototype.commaOrSpaceSeparated=!1;Wn.prototype.commaSeparated=!1;Wn.prototype.defined=!1;Wn.prototype.mustUseProperty=!1;Wn.prototype.number=!1;Wn.prototype.overloadedBoolean=!1;Wn.prototype.property="";Wn.prototype.spaceSeparated=!1;Wn.prototype.space=void 0;let kA=0;const dt=Wr(),un=Wr(),cp=Wr(),ke=Wr(),Ht=Wr(),Ki=Wr(),cl=Wr();function Wr(){return 2**++kA}const up=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:un,commaOrSpaceSeparated:cl,commaSeparated:Ki,number:ke,overloadedBoolean:cp,spaceSeparated:Ht},Symbol.toStringTag,{value:"Module"})),Mm=Object.keys(up);class Vp extends Wn{constructor(l,a,i,o){let u=-1;if(super(l,a),dy(this,"space",o),typeof i=="number")for(;++u<Mm.length;){const d=Mm[u];dy(this,Mm[u],(i&up[d])===up[d])}}}Vp.prototype.defined=!0;function dy(e,l,a){a&&(e[l]=a)}function ts(e){const l={},a={};for(const[i,o]of Object.entries(e.properties)){const u=new Vp(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(u.mustUseProperty=!0),l[i]=u,a[op(i)]=i,a[op(u.attribute)]=i}return new zo(l,a,e.space)}const m0=ts({properties:{ariaActiveDescendant:null,ariaAtomic:un,ariaAutoComplete:null,ariaBusy:un,ariaChecked:un,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Ht,ariaCurrent:null,ariaDescribedBy:Ht,ariaDetails:null,ariaDisabled:un,ariaDropEffect:Ht,ariaErrorMessage:null,ariaExpanded:un,ariaFlowTo:Ht,ariaGrabbed:un,ariaHasPopup:null,ariaHidden:un,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ht,ariaLevel:ke,ariaLive:null,ariaModal:un,ariaMultiLine:un,ariaMultiSelectable:un,ariaOrientation:null,ariaOwns:Ht,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:un,ariaReadOnly:un,ariaRelevant:null,ariaRequired:un,ariaRoleDescription:Ht,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:un,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function p0(e,l){return l in e?e[l]:l}function h0(e,l){return p0(e,l.toLowerCase())}const jA=ts({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ki,acceptCharset:Ht,accessKey:Ht,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Ht,autoFocus:dt,autoPlay:dt,blocking:Ht,capture:null,charSet:null,checked:dt,cite:null,className:Ht,cols:ke,colSpan:null,content:null,contentEditable:un,controls:dt,controlsList:Ht,coords:ke|Ki,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:cp,draggable:un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Ht,height:ke,hidden:cp,high:ke,href:null,hrefLang:null,htmlFor:Ht,httpEquiv:Ht,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Ht,itemRef:Ht,itemScope:dt,itemType:Ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,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:dt,optimum:ke,pattern:null,ping:Ht,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Ht,required:dt,reversed:dt,rows:ke,rowSpan:ke,sandbox:Ht,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:un,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ht,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:un,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:h0}),NA=ts({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:cl,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Ht,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:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,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:Ki,g2:Ki,glyphName:Ki,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:cl,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,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:ke,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:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cl,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cl,rev:cl,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cl,requiredFeatures:cl,requiredFonts:cl,requiredFormats:cl,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:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:cl,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cl,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cl,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:p0}),x0=ts({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,l){return"xlink:"+l.slice(5).toLowerCase()}}),g0=ts({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:h0}),b0=ts({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,l){return"xml:"+l.slice(3).toLowerCase()}}),wA={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"},SA=/[A-Z]/g,fy=/-[a-z]/g,CA=/^data[-\w.:]+$/i;function TA(e,l){const a=op(l);let i=l,o=Wn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&CA.test(l)){if(l.charAt(4)==="-"){const u=l.slice(5).replace(fy,EA);i="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=l.slice(4);if(!fy.test(u)){let d=u.replace(SA,AA);d.charAt(0)!=="-"&&(d="-"+d),l="data"+d}}o=Vp}return new o(i,l)}function AA(e){return"-"+e.toLowerCase()}function EA(e){return e.charAt(1).toUpperCase()}const RA=f0([m0,jA,x0,g0,b0],"html"),Gp=f0([m0,NA,x0,g0,b0],"svg");function MA(e){return e.join(" ").trim()}var qi={},zm,my;function zA(){if(my)return zm;my=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,a=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,p=`
63
+ `,h="/",y="*",b="",v="comment",j="declaration";function C(N,M){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];M=M||{};var L=1,H=1;function X(J){var ee=J.match(l);ee&&(L+=ee.length);var w=J.lastIndexOf(p);H=~w?J.length-w:H+J.length}function q(){var J={line:L,column:H};return function(ee){return ee.position=new D(J),Z(),ee}}function D(J){this.start=J,this.end={line:L,column:H},this.source=M.source}D.prototype.content=N;function B(J){var ee=new Error(M.source+":"+L+":"+H+": "+J);if(ee.reason=J,ee.filename=M.source,ee.line=L,ee.column=H,ee.source=N,!M.silent)throw ee}function F(J){var ee=J.exec(N);if(ee){var w=ee[0];return X(w),N=N.slice(w.length),ee}}function Z(){F(a)}function O(J){var ee;for(J=J||[];ee=P();)ee!==!1&&J.push(ee);return J}function P(){var J=q();if(!(h!=N.charAt(0)||y!=N.charAt(1))){for(var ee=2;b!=N.charAt(ee)&&(y!=N.charAt(ee)||h!=N.charAt(ee+1));)++ee;if(ee+=2,b===N.charAt(ee-1))return B("End of comment missing");var w=N.slice(2,ee-2);return H+=2,X(w),N=N.slice(ee),H+=2,J({type:v,comment:w})}}function Q(){var J=q(),ee=F(i);if(ee){if(P(),!F(o))return B("property missing ':'");var w=F(u),Y=J({type:j,property:E(ee[0].replace(e,b)),value:w?E(w[0].replace(e,b)):b});return F(d),Y}}function oe(){var J=[];O(J);for(var ee;ee=Q();)ee!==!1&&(J.push(ee),O(J));return J}return Z(),oe()}function E(N){return N?N.replace(f,b):b}return zm=C,zm}var py;function OA(){if(py)return qi;py=1;var e=qi&&qi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=a;const l=e(zA());function a(i,o){let u=null;if(!i||typeof i!="string")return u;const d=(0,l.default)(i),f=typeof o=="function";return d.forEach(p=>{if(p.type!=="declaration")return;const{property:h,value:y}=p;f?o(h,y,p):y&&(u=u||{},u[h]=y)}),u}return qi}var fo={},hy;function LA(){if(hy)return fo;hy=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(h){return!h||a.test(h)||e.test(h)},d=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},p=function(h,y){return y===void 0&&(y={}),u(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(o,f):h=h.replace(i,f),h.replace(l,d))};return fo.camelCase=p,fo}var mo,xy;function DA(){if(xy)return mo;xy=1;var e=mo&&mo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},l=e(OA()),a=LA();function i(o,u){var d={};return!o||typeof o!="string"||(0,l.default)(o,function(f,p){f&&p&&(d[(0,a.camelCase)(f,u)]=p)}),d}return i.default=i,mo=i,mo}var _A=DA();const BA=Pu(_A),y0=v0("end"),$p=v0("start");function v0(e){return l;function l(a){const i=a&&a.position&&a.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function IA(e){const l=$p(e),a=y0(e);if(l&&a)return{start:l,end:a}}function yo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?gy(e.position):"start"in e||"end"in e?gy(e):"line"in e||"column"in e?dp(e):""}function dp(e){return by(e&&e.line)+":"+by(e&&e.column)}function gy(e){return dp(e&&e.start)+"-"+dp(e&&e.end)}function by(e){return e&&typeof e=="number"?e:1}class _n extends Error{constructor(l,a,i){super(),typeof a=="string"&&(i=a,a=void 0);let o="",u={},d=!1;if(a&&("line"in a&&"column"in a?u={place:a}:"start"in a&&"end"in a?u={place:a}:"type"in a?u={ancestors:[a],place:a.position}:u={...a}),typeof l=="string"?o=l:!u.cause&&l&&(d=!0,o=l.message,u.cause=l),!u.ruleId&&!u.source&&typeof i=="string"){const p=i.indexOf(":");p===-1?u.ruleId=i:(u.source=i.slice(0,p),u.ruleId=i.slice(p+1))}if(!u.place&&u.ancestors&&u.ancestors){const p=u.ancestors[u.ancestors.length-1];p&&(u.place=p.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=yo(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}_n.prototype.file="";_n.prototype.name="";_n.prototype.reason="";_n.prototype.message="";_n.prototype.stack="";_n.prototype.column=void 0;_n.prototype.line=void 0;_n.prototype.ancestors=void 0;_n.prototype.cause=void 0;_n.prototype.fatal=void 0;_n.prototype.place=void 0;_n.prototype.ruleId=void 0;_n.prototype.source=void 0;const Yp={}.hasOwnProperty,PA=new Map,UA=/[A-Z]/g,HA=new Set(["table","tbody","thead","tfoot","tr"]),FA=new Set(["td","th"]),k0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qA(e,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=l.filePath||void 0;let i;if(l.development){if(typeof l.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=ZA(a,l.jsxDEV)}else{if(typeof l.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof l.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=KA(a,l.jsx,l.jsxs)}const o={Fragment:l.Fragment,ancestors:[],components:l.components||{},create:i,elementAttributeNameCase:l.elementAttributeNameCase||"react",evaluater:l.createEvaluater?l.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?Gp:RA,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},u=j0(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function j0(e,l,a){if(l.type==="element")return VA(e,l,a);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return GA(e,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return YA(e,l,a);if(l.type==="mdxjsEsm")return $A(e,l);if(l.type==="root")return QA(e,l,a);if(l.type==="text")return XA(e,l)}function VA(e,l,a){const i=e.schema;let o=i;l.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Gp,e.schema=o),e.ancestors.push(l);const u=w0(e,l.tagName,!1),d=WA(e,l);let f=Xp(e,l);return HA.has(l.tagName)&&(f=f.filter(function(p){return typeof p=="string"?!vA(p):!0})),N0(e,d,u,l),Qp(d,f),e.ancestors.pop(),e.schema=i,e.create(l,u,d,a)}function GA(e,l){if(l.data&&l.data.estree&&e.evaluater){const i=l.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Ao(e,l.position)}function $A(e,l){if(l.data&&l.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(l.data.estree);Ao(e,l.position)}function YA(e,l,a){const i=e.schema;let o=i;l.name==="svg"&&i.space==="html"&&(o=Gp,e.schema=o),e.ancestors.push(l);const u=l.name===null?e.Fragment:w0(e,l.name,!0),d=JA(e,l),f=Xp(e,l);return N0(e,d,u,l),Qp(d,f),e.ancestors.pop(),e.schema=i,e.create(l,u,d,a)}function QA(e,l,a){const i={};return Qp(i,Xp(e,l)),e.create(l,e.Fragment,i,a)}function XA(e,l){return l.value}function N0(e,l,a,i){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(l.node=i)}function Qp(e,l){if(l.length>0){const a=l.length>1?l:l[0];a&&(e.children=a)}}function KA(e,l,a){return i;function i(o,u,d,f){const h=Array.isArray(d.children)?a:l;return f?h(u,d,f):h(u,d)}}function ZA(e,l){return a;function a(i,o,u,d){const f=Array.isArray(u.children),p=$p(i);return l(o,u,d,f,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function WA(e,l){const a={};let i,o;for(o in l.properties)if(o!=="children"&&Yp.call(l.properties,o)){const u=e3(e,o,l.properties[o]);if(u){const[d,f]=u;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&FA.has(l.tagName)?i=f:a[d]=f}}if(i){const u=a.style||(a.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return a}function JA(e,l){const a={};for(const i of l.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const u=i.data.estree.body[0];u.type;const d=u.expression;d.type;const f=d.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else Ao(e,l.position);else{const o=i.name;let u;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else Ao(e,l.position);else u=i.value===null?!0:i.value;a[o]=u}return a}function Xp(e,l){const a=[];let i=-1;const o=e.passKeys?new Map:PA;for(;++i<l.children.length;){const u=l.children[i];let d;if(e.passKeys){const p=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(p){const h=o.get(p)||0;d=p+"-"+h,o.set(p,h+1)}}const f=j0(e,u,d);f!==void 0&&a.push(f)}return a}function e3(e,l,a){const i=TA(e.schema,l);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=i.commaSeparated?hA(a):MA(a)),i.property==="style"){let o=typeof a=="object"?a:t3(e,String(a));return e.stylePropertyNameCase==="css"&&(o=n3(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?wA[i.property]||i.property:i.attribute,a]}}function t3(e,l){try{return BA(l,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const i=a,o=new _n("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=k0+"#cannot-parse-style-attribute",o}}function w0(e,l,a){let i;if(!a)i={type:"Literal",value:l};else if(l.includes(".")){const o=l.split(".");let u=-1,d;for(;++u<o.length;){const f=cy(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}i=d}else i=cy(l)&&!/^[a-z]/.test(l)?{type:"Identifier",name:l}:{type:"Literal",value:l};if(i.type==="Literal"){const o=i.value;return Yp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ao(e)}function Ao(e,l){const a=new _n("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:l,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=k0+"#cannot-handle-mdx-estrees-without-createevaluater",a}function n3(e){const l={};let a;for(a in e)Yp.call(e,a)&&(l[l3(a)]=e[a]);return l}function l3(e){let l=e.replace(UA,a3);return l.slice(0,3)==="ms-"&&(l="-"+l),l}function a3(e){return"-"+e.toLowerCase()}const Om={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"]},r3={};function Kp(e,l){const a=r3,i=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return S0(e,i,o)}function S0(e,l,a){if(i3(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(l&&"alt"in e&&e.alt)return e.alt;if("children"in e)return yy(e.children,l,a)}return Array.isArray(e)?yy(e,l,a):""}function yy(e,l,a){const i=[];let o=-1;for(;++o<e.length;)i[o]=S0(e[o],l,a);return i.join("")}function i3(e){return!!(e&&typeof e=="object")}const vy=document.createElement("i");function Zp(e){const l="&"+e+";";vy.innerHTML=l;const a=vy.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===l?!1:a}function fl(e,l,a,i){const o=e.length;let u=0,d;if(l<0?l=-l>o?0:o+l:l=l>o?o:l,a=a>0?a:0,i.length<1e4)d=Array.from(i),d.unshift(l,a),e.splice(...d);else for(a&&e.splice(l,a);u<i.length;)d=i.slice(u,u+1e4),d.unshift(l,0),e.splice(...d),u+=1e4,l+=1e4}function jl(e,l){return e.length>0?(fl(e,e.length,0,l),e):l}const ky={}.hasOwnProperty;function C0(e){const l={};let a=-1;for(;++a<e.length;)s3(l,e[a]);return l}function s3(e,l){let a;for(a in l){const o=(ky.call(e,a)?e[a]:void 0)||(e[a]={}),u=l[a];let d;if(u)for(d in u){ky.call(o,d)||(o[d]=[]);const f=u[d];o3(o[d],Array.isArray(f)?f:f?[f]:[])}}}function o3(e,l){let a=-1;const i=[];for(;++a<l.length;)(l[a].add==="after"?e:i).push(l[a]);fl(e,0,0,i)}function T0(e,l){const a=Number.parseInt(e,l);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ml(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Un=hr(/[A-Za-z]/),Dn=hr(/[\dA-Za-z]/),c3=hr(/[#-'*+\--9=?A-Z^-~]/);function Du(e){return e!==null&&(e<32||e===127)}const fp=hr(/\d/),u3=hr(/[\dA-Fa-f]/),d3=hr(/[!-/:-@[-`{-~]/);function $e(e){return e!==null&&e<-2}function Pt(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const Gu=hr(new RegExp("\\p{P}|\\p{S}","u")),Xr=hr(/\s/);function hr(e){return l;function l(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function ns(e){const l=[];let a=-1,i=0,o=0;for(;++a<e.length;){const u=e.charCodeAt(a);let d="";if(u===37&&Dn(e.charCodeAt(a+1))&&Dn(e.charCodeAt(a+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(a+1);u<56320&&f>56319&&f<57344?(d=String.fromCharCode(u,f),o=1):d="�"}else d=String.fromCharCode(u);d&&(l.push(e.slice(i,a),encodeURIComponent(d)),i=a+o+1,d=""),o&&(a+=o,o=0)}return l.join("")+e.slice(i)}function wt(e,l,a,i){const o=i?i-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(p){return gt(p)?(e.enter(a),f(p)):l(p)}function f(p){return gt(p)&&u++<o?(e.consume(p),f):(e.exit(a),l(p))}}const f3={tokenize:m3};function m3(e){const l=e.attempt(this.parser.constructs.contentInitial,i,o);let a;return l;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),wt(e,l,"linePrefix")}function o(f){return e.enter("paragraph"),u(f)}function u(f){const p=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return $e(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),d)}}const p3={tokenize:h3},jy={tokenize:x3};function h3(e){const l=this,a=[];let i=0,o,u,d;return f;function f(H){if(i<a.length){const X=a[i];return l.containerState=X[1],e.attempt(X[0].continuation,p,h)(H)}return h(H)}function p(H){if(i++,l.containerState._closeFlow){l.containerState._closeFlow=void 0,o&&L();const X=l.events.length;let q=X,D;for(;q--;)if(l.events[q][0]==="exit"&&l.events[q][1].type==="chunkFlow"){D=l.events[q][1].end;break}M(i);let B=X;for(;B<l.events.length;)l.events[B][1].end={...D},B++;return fl(l.events,q+1,0,l.events.slice(X)),l.events.length=B,h(H)}return f(H)}function h(H){if(i===a.length){if(!o)return v(H);if(o.currentConstruct&&o.currentConstruct.concrete)return C(H);l.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return l.containerState={},e.check(jy,y,b)(H)}function y(H){return o&&L(),M(i),v(H)}function b(H){return l.parser.lazy[l.now().line]=i!==a.length,d=l.now().offset,C(H)}function v(H){return l.containerState={},e.attempt(jy,j,C)(H)}function j(H){return i++,a.push([l.currentConstruct,l.containerState]),v(H)}function C(H){if(H===null){o&&L(),M(0),e.consume(H);return}return o=o||l.parser.flow(l.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),E(H)}function E(H){if(H===null){N(e.exit("chunkFlow"),!0),M(0),e.consume(H);return}return $e(H)?(e.consume(H),N(e.exit("chunkFlow")),i=0,l.interrupt=void 0,f):(e.consume(H),E)}function N(H,X){const q=l.sliceStream(H);if(X&&q.push(null),H.previous=u,u&&(u.next=H),u=H,o.defineSkip(H.start),o.write(q),l.parser.lazy[H.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<d&&(!o.events[D][1].end||o.events[D][1].end.offset>d))return;const B=l.events.length;let F=B,Z,O;for(;F--;)if(l.events[F][0]==="exit"&&l.events[F][1].type==="chunkFlow"){if(Z){O=l.events[F][1].end;break}Z=!0}for(M(i),D=B;D<l.events.length;)l.events[D][1].end={...O},D++;fl(l.events,F+1,0,l.events.slice(B)),l.events.length=D}}function M(H){let X=a.length;for(;X-- >H;){const q=a[X];l.containerState=q[1],q[0].exit.call(l,e)}a.length=H}function L(){o.write([null]),u=void 0,o=void 0,l.containerState._closeFlow=void 0}}function x3(e,l,a){return wt(e,e.attempt(this.parser.constructs.document,l,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function es(e){if(e===null||Pt(e)||Xr(e))return 1;if(Gu(e))return 2}function $u(e,l,a){const i=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!i.includes(u)&&(l=u(l,a),i.push(u))}return l}const mp={name:"attention",resolveAll:g3,tokenize:b3};function g3(e,l){let a=-1,i,o,u,d,f,p,h,y;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(i=a;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&l.sliceSerialize(e[i][1]).charCodeAt(0)===l.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[i][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;p=e[i][1].end.offset-e[i][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const b={...e[i][1].end},v={...e[a][1].start};Ny(b,-p),Ny(v,p),d={type:p>1?"strongSequence":"emphasisSequence",start:b,end:{...e[i][1].end}},f={type:p>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:v},u={type:p>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[a][1].start}},o={type:p>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[i][1].end={...d.start},e[a][1].start={...f.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=jl(h,[["enter",e[i][1],l],["exit",e[i][1],l]])),h=jl(h,[["enter",o,l],["enter",d,l],["exit",d,l],["enter",u,l]]),h=jl(h,$u(l.parser.constructs.insideSpan.null,e.slice(i+1,a),l)),h=jl(h,[["exit",u,l],["enter",f,l],["exit",f,l],["exit",o,l]]),e[a][1].end.offset-e[a][1].start.offset?(y=2,h=jl(h,[["enter",e[a][1],l],["exit",e[a][1],l]])):y=0,fl(e,i-1,a-i+3,h),a=i+h.length-y-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function b3(e,l){const a=this.parser.constructs.attentionMarkers.null,i=this.previous,o=es(i);let u;return d;function d(p){return u=p,e.enter("attentionSequence"),f(p)}function f(p){if(p===u)return e.consume(p),f;const h=e.exit("attentionSequence"),y=es(p),b=!y||y===2&&o||a.includes(p),v=!o||o===2&&y||a.includes(i);return h._open=!!(u===42?b:b&&(o||!v)),h._close=!!(u===42?v:v&&(y||!b)),l(p)}}function Ny(e,l){e.column+=l,e.offset+=l,e._bufferIndex+=l}const y3={name:"autolink",tokenize:v3};function v3(e,l,a){let i=0;return o;function o(j){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(j),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(j){return Un(j)?(e.consume(j),d):j===64?a(j):h(j)}function d(j){return j===43||j===45||j===46||Dn(j)?(i=1,f(j)):h(j)}function f(j){return j===58?(e.consume(j),i=0,p):(j===43||j===45||j===46||Dn(j))&&i++<32?(e.consume(j),f):(i=0,h(j))}function p(j){return j===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(j),e.exit("autolinkMarker"),e.exit("autolink"),l):j===null||j===32||j===60||Du(j)?a(j):(e.consume(j),p)}function h(j){return j===64?(e.consume(j),y):c3(j)?(e.consume(j),h):a(j)}function y(j){return Dn(j)?b(j):a(j)}function b(j){return j===46?(e.consume(j),i=0,y):j===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(j),e.exit("autolinkMarker"),e.exit("autolink"),l):v(j)}function v(j){if((j===45||Dn(j))&&i++<63){const C=j===45?v:b;return e.consume(j),C}return a(j)}}const Oo={partial:!0,tokenize:k3};function k3(e,l,a){return i;function i(u){return gt(u)?wt(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||$e(u)?l(u):a(u)}}const A0={continuation:{tokenize:N3},exit:w3,name:"blockQuote",tokenize:j3};function j3(e,l,a){const i=this;return o;function o(d){if(d===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return a(d)}function u(d){return gt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),l):(e.exit("blockQuotePrefix"),l(d))}}function N3(e,l,a){const i=this;return o;function o(d){return gt(d)?wt(e,u,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(A0,l,a)(d)}}function w3(e){e.exit("blockQuote")}const E0={name:"characterEscape",tokenize:S3};function S3(e,l,a){return i;function i(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return d3(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),l):a(u)}}const R0={name:"characterReference",tokenize:C3};function C3(e,l,a){const i=this;let o=0,u,d;return f;function f(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),p}function p(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),u=31,d=Dn,y(b))}function h(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=u3,y):(e.enter("characterReferenceValue"),u=7,d=fp,y(b))}function y(b){if(b===59&&o){const v=e.exit("characterReferenceValue");return d===Dn&&!Zp(i.sliceSerialize(v))?a(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),l)}return d(b)&&o++<u?(e.consume(b),y):a(b)}}const wy={partial:!0,tokenize:A3},Sy={concrete:!0,name:"codeFenced",tokenize:T3};function T3(e,l,a){const i=this,o={partial:!0,tokenize:q};let u=0,d=0,f;return p;function p(D){return h(D)}function h(D){const B=i.events[i.events.length-1];return u=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,f=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(D)}function y(D){return D===f?(d++,e.consume(D),y):d<3?a(D):(e.exit("codeFencedFenceSequence"),gt(D)?wt(e,b,"whitespace")(D):b(D))}function b(D){return D===null||$e(D)?(e.exit("codeFencedFence"),i.interrupt?l(D):e.check(wy,E,X)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||$e(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(D)):gt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),wt(e,j,"whitespace")(D)):D===96&&D===f?a(D):(e.consume(D),v)}function j(D){return D===null||$e(D)?b(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(D))}function C(D){return D===null||$e(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(D)):D===96&&D===f?a(D):(e.consume(D),C)}function E(D){return e.attempt(o,X,N)(D)}function N(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),M}function M(D){return u>0&&gt(D)?wt(e,L,"linePrefix",u+1)(D):L(D)}function L(D){return D===null||$e(D)?e.check(wy,E,X)(D):(e.enter("codeFlowValue"),H(D))}function H(D){return D===null||$e(D)?(e.exit("codeFlowValue"),L(D)):(e.consume(D),H)}function X(D){return e.exit("codeFenced"),l(D)}function q(D,B,F){let Z=0;return O;function O(ee){return D.enter("lineEnding"),D.consume(ee),D.exit("lineEnding"),P}function P(ee){return D.enter("codeFencedFence"),gt(ee)?wt(D,Q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):Q(ee)}function Q(ee){return ee===f?(D.enter("codeFencedFenceSequence"),oe(ee)):F(ee)}function oe(ee){return ee===f?(Z++,D.consume(ee),oe):Z>=d?(D.exit("codeFencedFenceSequence"),gt(ee)?wt(D,J,"whitespace")(ee):J(ee)):F(ee)}function J(ee){return ee===null||$e(ee)?(D.exit("codeFencedFence"),B(ee)):F(ee)}}}function A3(e,l,a){const i=this;return o;function o(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return i.parser.lazy[i.now().line]?a(d):l(d)}}const Lm={name:"codeIndented",tokenize:R3},E3={partial:!0,tokenize:M3};function R3(e,l,a){const i=this;return o;function o(h){return e.enter("codeIndented"),wt(e,u,"linePrefix",5)(h)}function u(h){const y=i.events[i.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?d(h):a(h)}function d(h){return h===null?p(h):$e(h)?e.attempt(E3,d,p)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||$e(h)?(e.exit("codeFlowValue"),d(h)):(e.consume(h),f)}function p(h){return e.exit("codeIndented"),l(h)}}function M3(e,l,a){const i=this;return o;function o(d){return i.parser.lazy[i.now().line]?a(d):$e(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):wt(e,u,"linePrefix",5)(d)}function u(d){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(d):$e(d)?o(d):a(d)}}const z3={name:"codeText",previous:L3,resolve:O3,tokenize:D3};function O3(e){let l=e.length-4,a=3,i,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[l][1].type==="lineEnding"||e[l][1].type==="space")){for(i=a;++i<l;)if(e[i][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[l][1].type="codeTextPadding",a+=2,l-=2;break}}for(i=a-1,l++;++i<=l;)o===void 0?i!==l&&e[i][1].type!=="lineEnding"&&(o=i):(i===l||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),l-=i-o-2,i=o+2),o=void 0);return e}function L3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function D3(e,l,a){let i=0,o,u;return d;function d(b){return e.enter("codeText"),e.enter("codeTextSequence"),f(b)}function f(b){return b===96?(e.consume(b),i++,f):(e.exit("codeTextSequence"),p(b))}function p(b){return b===null?a(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),p):b===96?(u=e.enter("codeTextSequence"),o=0,y(b)):$e(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("codeTextData"),h(b))}function h(b){return b===null||b===32||b===96||$e(b)?(e.exit("codeTextData"),p(b)):(e.consume(b),h)}function y(b){return b===96?(e.consume(b),o++,y):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),l(b)):(u.type="codeTextData",h(b))}}class _3{constructor(l){this.left=l?[...l]:[],this.right=[]}get(l){if(l<0||l>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+l+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return l<this.left.length?this.left[l]:this.right[this.right.length-l+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(l,a){const i=a??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(l,i):l>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-l+this.left.length).reverse():this.left.slice(l).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(l,a,i){const o=a||0;this.setCursor(Math.trunc(l));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&po(this.left,i),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(l){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(l)}pushMany(l){this.setCursor(Number.POSITIVE_INFINITY),po(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),po(this.right,l.reverse())}setCursor(l){if(!(l===this.left.length||l>this.left.length&&this.right.length===0||l<0&&this.left.length===0))if(l<this.left.length){const a=this.left.splice(l,Number.POSITIVE_INFINITY);po(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-l,Number.POSITIVE_INFINITY);po(this.left,a.reverse())}}}function po(e,l){let a=0;if(l.length<1e4)e.push(...l);else for(;a<l.length;)e.push(...l.slice(a,a+1e4)),a+=1e4}function M0(e){const l={};let a=-1,i,o,u,d,f,p,h;const y=new _3(e);for(;++a<y.length;){for(;a in l;)a=l[a];if(i=y.get(a),a&&i[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(p=i[1]._tokenizer.events,u=0,u<p.length&&p[u][1].type==="lineEndingBlank"&&(u+=2),u<p.length&&p[u][1].type==="content"))for(;++u<p.length&&p[u][1].type!=="content";)p[u][1].type==="chunkText"&&(p[u][1]._isInFirstContentOfListItem=!0,u++);if(i[0]==="enter")i[1].contentType&&(Object.assign(l,B3(y,a)),a=l[a],h=!0);else if(i[1]._container){for(u=a,o=void 0;u--;)if(d=y.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(i[1].end={...y.get(o)[1].start},f=y.slice(o,a),f.unshift(i),y.splice(o,a-o+1,f))}}return fl(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function B3(e,l){const a=e.get(l)[1],i=e.get(l)[2];let o=l-1;const u=[];let d=a._tokenizer;d||(d=i.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,p=[],h={};let y,b,v=-1,j=a,C=0,E=0;const N=[E];for(;j;){for(;e.get(++o)[1]!==j;);u.push(o),j._tokenizer||(y=i.sliceStream(j),j.next||y.push(null),b&&d.defineSkip(j.start),j._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(y),j._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),b=j,j=j.next}for(j=a;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(E=v+1,N.push(E),j._tokenizer=void 0,j.previous=void 0,j=j.next);for(d.events=[],j?(j._tokenizer=void 0,j.previous=void 0):N.pop(),v=N.length;v--;){const M=f.slice(N[v],N[v+1]),L=u.pop();p.push([L,L+M.length-1]),e.splice(L,2,M)}for(p.reverse(),v=-1;++v<p.length;)h[C+p[v][0]]=C+p[v][1],C+=p[v][1]-p[v][0]-1;return h}const I3={resolve:U3,tokenize:H3},P3={partial:!0,tokenize:F3};function U3(e){return M0(e),e}function H3(e,l){let a;return i;function i(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):$e(f)?e.check(P3,d,u)(f):(e.consume(f),o)}function u(f){return e.exit("chunkContent"),e.exit("content"),l(f)}function d(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function F3(e,l,a){const i=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),wt(e,u,"linePrefix")}function u(d){if(d===null||$e(d))return a(d);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(d):e.interrupt(i.parser.constructs.flow,a,l)(d)}}function z0(e,l,a,i,o,u,d,f,p){const h=p||Number.POSITIVE_INFINITY;let y=0;return b;function b(M){return M===60?(e.enter(i),e.enter(o),e.enter(u),e.consume(M),e.exit(u),v):M===null||M===32||M===41||Du(M)?a(M):(e.enter(i),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(M))}function v(M){return M===62?(e.enter(u),e.consume(M),e.exit(u),e.exit(o),e.exit(i),l):(e.enter(f),e.enter("chunkString",{contentType:"string"}),j(M))}function j(M){return M===62?(e.exit("chunkString"),e.exit(f),v(M)):M===null||M===60||$e(M)?a(M):(e.consume(M),M===92?C:j)}function C(M){return M===60||M===62||M===92?(e.consume(M),j):j(M)}function E(M){return!y&&(M===null||M===41||Pt(M))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(i),l(M)):y<h&&M===40?(e.consume(M),y++,E):M===41?(e.consume(M),y--,E):M===null||M===32||M===40||Du(M)?a(M):(e.consume(M),M===92?N:E)}function N(M){return M===40||M===41||M===92?(e.consume(M),E):E(M)}}function O0(e,l,a,i,o,u){const d=this;let f=0,p;return h;function h(j){return e.enter(i),e.enter(o),e.consume(j),e.exit(o),e.enter(u),y}function y(j){return f>999||j===null||j===91||j===93&&!p||j===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?a(j):j===93?(e.exit(u),e.enter(o),e.consume(j),e.exit(o),e.exit(i),l):$e(j)?(e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===null||j===91||j===93||$e(j)||f++>999?(e.exit("chunkString"),y(j)):(e.consume(j),p||(p=!gt(j)),j===92?v:b)}function v(j){return j===91||j===92||j===93?(e.consume(j),f++,b):b(j)}}function L0(e,l,a,i,o,u){let d;return f;function f(v){return v===34||v===39||v===40?(e.enter(i),e.enter(o),e.consume(v),e.exit(o),d=v===40?41:v,p):a(v)}function p(v){return v===d?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),l):(e.enter(u),h(v))}function h(v){return v===d?(e.exit(u),p(d)):v===null?a(v):$e(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),wt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===d||v===null||$e(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?b:y)}function b(v){return v===d||v===92?(e.consume(v),y):y(v)}}function vo(e,l){let a;return i;function i(o){return $e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,i):gt(o)?wt(e,i,a?"linePrefix":"lineSuffix")(o):l(o)}}const q3={name:"definition",tokenize:G3},V3={partial:!0,tokenize:$3};function G3(e,l,a){const i=this;let o;return u;function u(j){return e.enter("definition"),d(j)}function d(j){return O0.call(i,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(j)}function f(j){return o=Ml(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),j===58?(e.enter("definitionMarker"),e.consume(j),e.exit("definitionMarker"),p):a(j)}function p(j){return Pt(j)?vo(e,h)(j):h(j)}function h(j){return z0(e,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(j)}function y(j){return e.attempt(V3,b,b)(j)}function b(j){return gt(j)?wt(e,v,"whitespace")(j):v(j)}function v(j){return j===null||$e(j)?(e.exit("definition"),i.parser.defined.push(o),l(j)):a(j)}}function $3(e,l,a){return i;function i(f){return Pt(f)?vo(e,o)(f):a(f)}function o(f){return L0(e,u,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return gt(f)?wt(e,d,"whitespace")(f):d(f)}function d(f){return f===null||$e(f)?l(f):a(f)}}const Y3={name:"hardBreakEscape",tokenize:Q3};function Q3(e,l,a){return i;function i(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return $e(u)?(e.exit("hardBreakEscape"),l(u)):a(u)}}const X3={name:"headingAtx",resolve:K3,tokenize:Z3};function K3(e,l){let a=e.length-2,i=3,o,u;return e[i][1].type==="whitespace"&&(i+=2),a-2>i&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(i===a-1||a-4>i&&e[a-2][1].type==="whitespace")&&(a-=i+1===a?2:4),a>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[a][1].end},u={type:"chunkText",start:e[i][1].start,end:e[a][1].end,contentType:"text"},fl(e,i,a-i+1,[["enter",o,l],["enter",u,l],["exit",u,l],["exit",o,l]])),e}function Z3(e,l,a){let i=0;return o;function o(y){return e.enter("atxHeading"),u(y)}function u(y){return e.enter("atxHeadingSequence"),d(y)}function d(y){return y===35&&i++<6?(e.consume(y),d):y===null||Pt(y)?(e.exit("atxHeadingSequence"),f(y)):a(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),p(y)):y===null||$e(y)?(e.exit("atxHeading"),l(y)):gt(y)?wt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function p(y){return y===35?(e.consume(y),p):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||Pt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const W3=["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"],Cy=["pre","script","style","textarea"],J3={concrete:!0,name:"htmlFlow",resolveTo:n5,tokenize:l5},e5={partial:!0,tokenize:r5},t5={partial:!0,tokenize:a5};function n5(e){let l=e.length;for(;l--&&!(e[l][0]==="enter"&&e[l][1].type==="htmlFlow"););return l>1&&e[l-2][1].type==="linePrefix"&&(e[l][1].start=e[l-2][1].start,e[l+1][1].start=e[l-2][1].start,e.splice(l-2,2)),e}function l5(e,l,a){const i=this;let o,u,d,f,p;return h;function h(R){return y(R)}function y(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),b}function b(R){return R===33?(e.consume(R),v):R===47?(e.consume(R),u=!0,E):R===63?(e.consume(R),o=3,i.interrupt?l:T):Un(R)?(e.consume(R),d=String.fromCharCode(R),N):a(R)}function v(R){return R===45?(e.consume(R),o=2,j):R===91?(e.consume(R),o=5,f=0,C):Un(R)?(e.consume(R),o=4,i.interrupt?l:T):a(R)}function j(R){return R===45?(e.consume(R),i.interrupt?l:T):a(R)}function C(R){const pe="CDATA[";return R===pe.charCodeAt(f++)?(e.consume(R),f===pe.length?i.interrupt?l:Q:C):a(R)}function E(R){return Un(R)?(e.consume(R),d=String.fromCharCode(R),N):a(R)}function N(R){if(R===null||R===47||R===62||Pt(R)){const pe=R===47,xe=d.toLowerCase();return!pe&&!u&&Cy.includes(xe)?(o=1,i.interrupt?l(R):Q(R)):W3.includes(d.toLowerCase())?(o=6,pe?(e.consume(R),M):i.interrupt?l(R):Q(R)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?a(R):u?L(R):H(R))}return R===45||Dn(R)?(e.consume(R),d+=String.fromCharCode(R),N):a(R)}function M(R){return R===62?(e.consume(R),i.interrupt?l:Q):a(R)}function L(R){return gt(R)?(e.consume(R),L):O(R)}function H(R){return R===47?(e.consume(R),O):R===58||R===95||Un(R)?(e.consume(R),X):gt(R)?(e.consume(R),H):O(R)}function X(R){return R===45||R===46||R===58||R===95||Dn(R)?(e.consume(R),X):q(R)}function q(R){return R===61?(e.consume(R),D):gt(R)?(e.consume(R),q):H(R)}function D(R){return R===null||R===60||R===61||R===62||R===96?a(R):R===34||R===39?(e.consume(R),p=R,B):gt(R)?(e.consume(R),D):F(R)}function B(R){return R===p?(e.consume(R),p=null,Z):R===null||$e(R)?a(R):(e.consume(R),B)}function F(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||Pt(R)?q(R):(e.consume(R),F)}function Z(R){return R===47||R===62||gt(R)?H(R):a(R)}function O(R){return R===62?(e.consume(R),P):a(R)}function P(R){return R===null||$e(R)?Q(R):gt(R)?(e.consume(R),P):a(R)}function Q(R){return R===45&&o===2?(e.consume(R),w):R===60&&o===1?(e.consume(R),Y):R===62&&o===4?(e.consume(R),_):R===63&&o===3?(e.consume(R),T):R===93&&o===5?(e.consume(R),ye):$e(R)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(e5,le,oe)(R)):R===null||$e(R)?(e.exit("htmlFlowData"),oe(R)):(e.consume(R),Q)}function oe(R){return e.check(t5,J,le)(R)}function J(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),ee}function ee(R){return R===null||$e(R)?oe(R):(e.enter("htmlFlowData"),Q(R))}function w(R){return R===45?(e.consume(R),T):Q(R)}function Y(R){return R===47?(e.consume(R),d="",$):Q(R)}function $(R){if(R===62){const pe=d.toLowerCase();return Cy.includes(pe)?(e.consume(R),_):Q(R)}return Un(R)&&d.length<8?(e.consume(R),d+=String.fromCharCode(R),$):Q(R)}function ye(R){return R===93?(e.consume(R),T):Q(R)}function T(R){return R===62?(e.consume(R),_):R===45&&o===2?(e.consume(R),T):Q(R)}function _(R){return R===null||$e(R)?(e.exit("htmlFlowData"),le(R)):(e.consume(R),_)}function le(R){return e.exit("htmlFlow"),l(R)}}function a5(e,l,a){const i=this;return o;function o(d){return $e(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):a(d)}function u(d){return i.parser.lazy[i.now().line]?a(d):l(d)}}function r5(e,l,a){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Oo,l,a)}}const i5={name:"htmlText",tokenize:s5};function s5(e,l,a){const i=this;let o,u,d;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),p}function p(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),q):T===63?(e.consume(T),H):Un(T)?(e.consume(T),F):a(T)}function h(T){return T===45?(e.consume(T),y):T===91?(e.consume(T),u=0,C):Un(T)?(e.consume(T),L):a(T)}function y(T){return T===45?(e.consume(T),j):a(T)}function b(T){return T===null?a(T):T===45?(e.consume(T),v):$e(T)?(d=b,Y(T)):(e.consume(T),b)}function v(T){return T===45?(e.consume(T),j):b(T)}function j(T){return T===62?w(T):T===45?v(T):b(T)}function C(T){const _="CDATA[";return T===_.charCodeAt(u++)?(e.consume(T),u===_.length?E:C):a(T)}function E(T){return T===null?a(T):T===93?(e.consume(T),N):$e(T)?(d=E,Y(T)):(e.consume(T),E)}function N(T){return T===93?(e.consume(T),M):E(T)}function M(T){return T===62?w(T):T===93?(e.consume(T),M):E(T)}function L(T){return T===null||T===62?w(T):$e(T)?(d=L,Y(T)):(e.consume(T),L)}function H(T){return T===null?a(T):T===63?(e.consume(T),X):$e(T)?(d=H,Y(T)):(e.consume(T),H)}function X(T){return T===62?w(T):H(T)}function q(T){return Un(T)?(e.consume(T),D):a(T)}function D(T){return T===45||Dn(T)?(e.consume(T),D):B(T)}function B(T){return $e(T)?(d=B,Y(T)):gt(T)?(e.consume(T),B):w(T)}function F(T){return T===45||Dn(T)?(e.consume(T),F):T===47||T===62||Pt(T)?Z(T):a(T)}function Z(T){return T===47?(e.consume(T),w):T===58||T===95||Un(T)?(e.consume(T),O):$e(T)?(d=Z,Y(T)):gt(T)?(e.consume(T),Z):w(T)}function O(T){return T===45||T===46||T===58||T===95||Dn(T)?(e.consume(T),O):P(T)}function P(T){return T===61?(e.consume(T),Q):$e(T)?(d=P,Y(T)):gt(T)?(e.consume(T),P):Z(T)}function Q(T){return T===null||T===60||T===61||T===62||T===96?a(T):T===34||T===39?(e.consume(T),o=T,oe):$e(T)?(d=Q,Y(T)):gt(T)?(e.consume(T),Q):(e.consume(T),J)}function oe(T){return T===o?(e.consume(T),o=void 0,ee):T===null?a(T):$e(T)?(d=oe,Y(T)):(e.consume(T),oe)}function J(T){return T===null||T===34||T===39||T===60||T===61||T===96?a(T):T===47||T===62||Pt(T)?Z(T):(e.consume(T),J)}function ee(T){return T===47||T===62||Pt(T)?Z(T):a(T)}function w(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),l):a(T)}function Y(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),$}function $(T){return gt(T)?wt(e,ye,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ye(T)}function ye(T){return e.enter("htmlTextData"),d(T)}}const Wp={name:"labelEnd",resolveAll:d5,resolveTo:f5,tokenize:m5},o5={tokenize:p5},c5={tokenize:h5},u5={tokenize:x5};function d5(e){let l=-1;const a=[];for(;++l<e.length;){const i=e[l][1];if(a.push(e[l]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",l+=o}}return e.length!==a.length&&fl(e,0,e.length,a),e}function f5(e,l){let a=e.length,i=0,o,u,d,f;for(;a--;)if(o=e[a][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=a,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(d=a);const p={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},y={type:"labelText",start:{...e[u+i+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",p,l],["enter",h,l]],f=jl(f,e.slice(u+1,u+i+3)),f=jl(f,[["enter",y,l]]),f=jl(f,$u(l.parser.constructs.insideSpan.null,e.slice(u+i+4,d-3),l)),f=jl(f,[["exit",y,l],e[d-2],e[d-1],["exit",h,l]]),f=jl(f,e.slice(d+1)),f=jl(f,[["exit",p,l]]),fl(e,u,e.length,f),e}function m5(e,l,a){const i=this;let o=i.events.length,u,d;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){u=i.events[o][1];break}return f;function f(v){return u?u._inactive?b(v):(d=i.parser.defined.includes(Ml(i.sliceSerialize({start:u.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),p):a(v)}function p(v){return v===40?e.attempt(o5,y,d?y:b)(v):v===91?e.attempt(c5,y,d?h:b)(v):d?y(v):b(v)}function h(v){return e.attempt(u5,y,b)(v)}function y(v){return l(v)}function b(v){return u._balanced=!0,a(v)}}function p5(e,l,a){return i;function i(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),o}function o(b){return Pt(b)?vo(e,u)(b):u(b)}function u(b){return b===41?y(b):z0(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function d(b){return Pt(b)?vo(e,p)(b):y(b)}function f(b){return a(b)}function p(b){return b===34||b===39||b===40?L0(e,h,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):y(b)}function h(b){return Pt(b)?vo(e,y)(b):y(b)}function y(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),l):a(b)}}function h5(e,l,a){const i=this;return o;function o(f){return O0.call(i,e,u,d,"reference","referenceMarker","referenceString")(f)}function u(f){return i.parser.defined.includes(Ml(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?l(f):a(f)}function d(f){return a(f)}}function x5(e,l,a){return i;function i(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),l):a(u)}}const g5={name:"labelStartImage",resolveAll:Wp.resolveAll,tokenize:b5};function b5(e,l,a){const i=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):a(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(f):l(f)}}const y5={name:"labelStartLink",resolveAll:Wp.resolveAll,tokenize:v5};function v5(e,l,a){const i=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(d):l(d)}}const Dm={name:"lineEnding",tokenize:k5};function k5(e,l){return a;function a(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),wt(e,l,"linePrefix")}}const Au={name:"thematicBreak",tokenize:j5};function j5(e,l,a){let i=0,o;return u;function u(h){return e.enter("thematicBreak"),d(h)}function d(h){return o=h,f(h)}function f(h){return h===o?(e.enter("thematicBreakSequence"),p(h)):i>=3&&(h===null||$e(h))?(e.exit("thematicBreak"),l(h)):a(h)}function p(h){return h===o?(e.consume(h),i++,p):(e.exit("thematicBreakSequence"),gt(h)?wt(e,f,"whitespace")(h):f(h))}}const Zn={continuation:{tokenize:C5},exit:A5,name:"list",tokenize:S5},N5={partial:!0,tokenize:E5},w5={partial:!0,tokenize:T5};function S5(e,l,a){const i=this,o=i.events[i.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return f;function f(j){const C=i.containerState.type||(j===42||j===43||j===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!i.containerState.marker||j===i.containerState.marker:fp(j)){if(i.containerState.type||(i.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),j===42||j===45?e.check(Au,a,h)(j):h(j);if(!i.interrupt||j===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(j)}return a(j)}function p(j){return fp(j)&&++d<10?(e.consume(j),p):(!i.interrupt||d<2)&&(i.containerState.marker?j===i.containerState.marker:j===41||j===46)?(e.exit("listItemValue"),h(j)):a(j)}function h(j){return e.enter("listItemMarker"),e.consume(j),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||j,e.check(Oo,i.interrupt?a:y,e.attempt(N5,v,b))}function y(j){return i.containerState.initialBlankLine=!0,u++,v(j)}function b(j){return gt(j)?(e.enter("listItemPrefixWhitespace"),e.consume(j),e.exit("listItemPrefixWhitespace"),v):a(j)}function v(j){return i.containerState.size=u+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,l(j)}}function C5(e,l,a){const i=this;return i.containerState._closeFlow=void 0,e.check(Oo,o,u);function o(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,wt(e,l,"listItemIndent",i.containerState.size+1)(f)}function u(f){return i.containerState.furtherBlankLines||!gt(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,d(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(w5,l,d)(f))}function d(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,wt(e,e.attempt(Zn,l,a),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function T5(e,l,a){const i=this;return wt(e,o,"listItemIndent",i.containerState.size+1);function o(u){const d=i.events[i.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===i.containerState.size?l(u):a(u)}}function A5(e){e.exit(this.containerState.type)}function E5(e,l,a){const i=this;return wt(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=i.events[i.events.length-1];return!gt(u)&&d&&d[1].type==="listItemPrefixWhitespace"?l(u):a(u)}}const Ty={name:"setextUnderline",resolveTo:R5,tokenize:M5};function R5(e,l){let a=e.length,i,o,u;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){i=a;break}e[a][1].type==="paragraph"&&(o=a)}else e[a][1].type==="content"&&e.splice(a,1),!u&&e[a][1].type==="definition"&&(u=a);const d={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",d,l]),e.splice(u+1,0,["exit",e[i][1],l]),e[i][1].end={...e[u][1].end}):e[i][1]=d,e.push(["exit",d,l]),e}function M5(e,l,a){const i=this;let o;return u;function u(h){let y=i.events.length,b;for(;y--;)if(i.events[y][1].type!=="lineEnding"&&i.events[y][1].type!=="linePrefix"&&i.events[y][1].type!=="content"){b=i.events[y][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||b)?(e.enter("setextHeadingLine"),o=h,d(h)):a(h)}function d(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===o?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),gt(h)?wt(e,p,"lineSuffix")(h):p(h))}function p(h){return h===null||$e(h)?(e.exit("setextHeadingLine"),l(h)):a(h)}}const z5={tokenize:O5};function O5(e){const l=this,a=e.attempt(Oo,i,e.attempt(this.parser.constructs.flowInitial,o,wt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(I3,o)),"linePrefix")));return a;function i(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),l.currentConstruct=void 0,a}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l.currentConstruct=void 0,a}}const L5={resolveAll:_0()},D5=D0("string"),_5=D0("text");function D0(e){return{resolveAll:_0(e==="text"?B5:void 0),tokenize:l};function l(a){const i=this,o=this.parser.constructs[e],u=a.attempt(o,d,f);return d;function d(y){return h(y)?u(y):f(y)}function f(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return h(y)?(a.exit("data"),u(y)):(a.consume(y),p)}function h(y){if(y===null)return!0;const b=o[y];let v=-1;if(b)for(;++v<b.length;){const j=b[v];if(!j.previous||j.previous.call(i,i.previous))return!0}return!1}}}function _0(e){return l;function l(a,i){let o=-1,u;for(;++o<=a.length;)u===void 0?a[o]&&a[o][1].type==="data"&&(u=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==u+2&&(a[u][1].end=a[o-1][1].end,a.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(a,i):a}}function B5(e,l){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const i=e[a-1][1],o=l.sliceStream(i);let u=o.length,d=-1,f=0,p;for(;u--;){const h=o[u];if(typeof h=="string"){for(d=h.length;h.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(h===-2)p=!0,f++;else if(h!==-1){u++;break}}if(l._contentTypeTextTrailing&&a===e.length&&(f=0),f){const h={type:a===e.length||p||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:i.start._bufferIndex+d,_index:i.start._index+u,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(a,0,["enter",h,l],["exit",h,l]),a+=2)}a++}return e}const I5={42:Zn,43:Zn,45:Zn,48:Zn,49:Zn,50:Zn,51:Zn,52:Zn,53:Zn,54:Zn,55:Zn,56:Zn,57:Zn,62:A0},P5={91:q3},U5={[-2]:Lm,[-1]:Lm,32:Lm},H5={35:X3,42:Au,45:[Ty,Au],60:J3,61:Ty,95:Au,96:Sy,126:Sy},F5={38:R0,92:E0},q5={[-5]:Dm,[-4]:Dm,[-3]:Dm,33:g5,38:R0,42:mp,60:[y3,i5],91:y5,92:[Y3,E0],93:Wp,95:mp,96:z3},V5={null:[mp,L5]},G5={null:[42,95]},$5={null:[]},Y5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:G5,contentInitial:P5,disable:$5,document:I5,flow:H5,flowInitial:U5,insideSpan:V5,string:F5,text:q5},Symbol.toStringTag,{value:"Module"}));function Q5(e,l,a){let i={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},u=[];let d=[],f=[];const p={attempt:B(q),check:B(D),consume:L,enter:H,exit:X,interrupt:B(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:C,parser:e,previous:null,sliceSerialize:v,sliceStream:j,write:b};let y=l.tokenize.call(h,p);return l.resolveAll&&u.push(l),h;function b(P){return d=jl(d,P),N(),d[d.length-1]!==null?[]:(F(l,0),h.events=$u(u,h.events,h),h.events)}function v(P,Q){return K5(j(P),Q)}function j(P){return X5(d,P)}function C(){const{_bufferIndex:P,_index:Q,line:oe,column:J,offset:ee}=i;return{_bufferIndex:P,_index:Q,line:oe,column:J,offset:ee}}function E(P){o[P.line]=P.column,O()}function N(){let P;for(;i._index<d.length;){const Q=d[i._index];if(typeof Q=="string")for(P=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===P&&i._bufferIndex<Q.length;)M(Q.charCodeAt(i._bufferIndex));else M(Q)}}function M(P){y=y(P)}function L(P){$e(P)?(i.line++,i.column=1,i.offset+=P===-3?2:1,O()):P!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===d[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=P}function H(P,Q){const oe=Q||{};return oe.type=P,oe.start=C(),h.events.push(["enter",oe,h]),f.push(oe),oe}function X(P){const Q=f.pop();return Q.end=C(),h.events.push(["exit",Q,h]),Q}function q(P,Q){F(P,Q.from)}function D(P,Q){Q.restore()}function B(P,Q){return oe;function oe(J,ee,w){let Y,$,ye,T;return Array.isArray(J)?le(J):"tokenize"in J?le([J]):_(J);function _(ce){return Re;function Re(Te){const Ne=Te!==null&&ce[Te],He=Te!==null&&ce.null,Le=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(He)?He:He?[He]:[]];return le(Le)(Te)}}function le(ce){return Y=ce,$=0,ce.length===0?w:R(ce[$])}function R(ce){return Re;function Re(Te){return T=Z(),ye=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?xe():ce.tokenize.call(Q?Object.assign(Object.create(h),Q):h,p,pe,xe)(Te)}}function pe(ce){return P(ye,T),ee}function xe(ce){return T.restore(),++$<Y.length?R(Y[$]):w}}}function F(P,Q){P.resolveAll&&!u.includes(P)&&u.push(P),P.resolve&&fl(h.events,Q,h.events.length-Q,P.resolve(h.events.slice(Q),h)),P.resolveTo&&(h.events=P.resolveTo(h.events,h))}function Z(){const P=C(),Q=h.previous,oe=h.currentConstruct,J=h.events.length,ee=Array.from(f);return{from:J,restore:w};function w(){i=P,h.previous=Q,h.currentConstruct=oe,h.events.length=J,f=ee,O()}}function O(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function X5(e,l){const a=l.start._index,i=l.start._bufferIndex,o=l.end._index,u=l.end._bufferIndex;let d;if(a===o)d=[e[a].slice(i,u)];else{if(d=e.slice(a,o),i>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(i):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function K5(e,l){let a=-1;const i=[];let o;for(;++a<e.length;){const u=e[a];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
64
+ `;break}case-3:{d=`\r
65
+ `;break}case-2:{d=l?" ":" ";break}case-1:{if(!l&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,i.push(d)}return i.join("")}function Z5(e){const i={constructs:C0([Y5,...(e||{}).extensions||[]]),content:o(f3),defined:[],document:o(p3),flow:o(z5),lazy:{},string:o(D5),text:o(_5)};return i;function o(u){return d;function d(f){return Q5(i,u,f)}}}function W5(e){for(;!M0(e););return e}const Ay=/[\0\t\n\r]/g;function J5(){let e=1,l="",a=!0,i;return o;function o(u,d,f){const p=[];let h,y,b,v,j;for(u=l+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),b=0,l="",a&&(u.charCodeAt(0)===65279&&b++,a=void 0);b<u.length;){if(Ay.lastIndex=b,h=Ay.exec(u),v=h&&h.index!==void 0?h.index:u.length,j=u.charCodeAt(v),!h){l=u.slice(b);break}if(j===10&&b===v&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),b<v&&(p.push(u.slice(b,v)),e+=v-b),j){case 0:{p.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,p.push(-2);e++<y;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:i=!0,e=1}b=v+1}return f&&(i&&p.push(-5),l&&p.push(l),p.push(null)),p}}const e4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function t4(e){return e.replace(e4,n4)}function n4(e,l,a){if(l)return l;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),u=o===120||o===88;return T0(a.slice(u?2:1),u?16:10)}return Zp(a)||e}const B0={}.hasOwnProperty;function l4(e,l,a){return l&&typeof l=="object"&&(a=l,l=void 0),a4(a)(W5(Z5(a).document().write(J5()(e,l,!0))))}function a4(e){const l={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Ge),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:u(st),blockQuote:u(He),characterEscape:Z,characterReference:Z,codeFenced:u(Le),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(Le,d),codeText:u(Ue,d),codeTextData:Z,data:Z,codeFlowValue:Z,definition:u(it),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(tt),hardBreakEscape:u(ot),hardBreakTrailing:u(ot),htmlFlow:u(bt,d),htmlFlowData:Z,htmlText:u(bt,d),htmlTextData:Z,image:u(Ye),label:d,link:u(Ge),listItem:u(we),listItemValue:v,listOrdered:u(We,b),listUnordered:u(We),paragraph:u(et),reference:R,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(st),strong:u(Se),thematicBreak:u(mt)},exit:{atxHeading:p(),atxHeadingSequence:q,autolink:p(),autolinkEmail:Ne,autolinkProtocol:Te,blockQuote:p(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:xe,characterReferenceMarkerNumeric:xe,characterReferenceValue:ce,characterReference:Re,codeFenced:p(N),codeFencedFence:E,codeFencedFenceInfo:j,codeFencedFenceMeta:C,codeFlowValue:O,codeIndented:p(M),codeText:p(ee),codeTextData:O,data:O,definition:p(),definitionDestinationString:X,definitionLabelString:L,definitionTitleString:H,emphasis:p(),hardBreakEscape:p(Q),hardBreakTrailing:p(Q),htmlFlow:p(oe),htmlFlowData:O,htmlText:p(J),htmlTextData:O,image:p(Y),label:ye,labelText:$,lineEnding:P,link:p(w),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:pe,resourceDestinationString:T,resourceTitleString:_,resource:le,setextHeading:p(F),setextHeadingLineSequence:B,setextHeadingText:D,strong:p(),thematicBreak:p()}};I0(l,(e||{}).mdastExtensions||[]);const a={};return i;function i(re){let ge={type:"root",children:[]};const Ce={stack:[ge],tokenStack:[],config:l,enter:f,exit:h,buffer:d,resume:y,data:a},_e=[];let Xe=-1;for(;++Xe<re.length;)if(re[Xe][1].type==="listOrdered"||re[Xe][1].type==="listUnordered")if(re[Xe][0]==="enter")_e.push(Xe);else{const Ae=_e.pop();Xe=o(re,Ae,Xe)}for(Xe=-1;++Xe<re.length;){const Ae=l[re[Xe][0]];B0.call(Ae,re[Xe][1].type)&&Ae[re[Xe][1].type].call(Object.assign({sliceSerialize:re[Xe][2].sliceSerialize},Ce),re[Xe][1])}if(Ce.tokenStack.length>0){const Ae=Ce.tokenStack[Ce.tokenStack.length-1];(Ae[1]||Ey).call(Ce,void 0,Ae[0])}for(ge.position={start:ur(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:ur(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<l.transforms.length;)ge=l.transforms[Xe](ge)||ge;return ge}function o(re,ge,Ce){let _e=ge-1,Xe=-1,Ae=!1,ue,Ee,V,me;for(;++_e<=Ce;){const je=re[_e];switch(je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{je[0]==="enter"?Xe++:Xe--,me=void 0;break}case"lineEndingBlank":{je[0]==="enter"&&(ue&&!me&&!Xe&&!V&&(V=_e),me=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:me=void 0}if(!Xe&&je[0]==="enter"&&je[1].type==="listItemPrefix"||Xe===-1&&je[0]==="exit"&&(je[1].type==="listUnordered"||je[1].type==="listOrdered")){if(ue){let Fe=_e;for(Ee=void 0;Fe--;){const Je=re[Fe];if(Je[1].type==="lineEnding"||Je[1].type==="lineEndingBlank"){if(Je[0]==="exit")continue;Ee&&(re[Ee][1].type="lineEndingBlank",Ae=!0),Je[1].type="lineEnding",Ee=Fe}else if(!(Je[1].type==="linePrefix"||Je[1].type==="blockQuotePrefix"||Je[1].type==="blockQuotePrefixWhitespace"||Je[1].type==="blockQuoteMarker"||Je[1].type==="listItemIndent"))break}V&&(!Ee||V<Ee)&&(ue._spread=!0),ue.end=Object.assign({},Ee?re[Ee][1].start:je[1].end),re.splice(Ee||_e,0,["exit",ue,je[2]]),_e++,Ce++}if(je[1].type==="listItemPrefix"){const Fe={type:"listItem",_spread:!1,start:Object.assign({},je[1].start),end:void 0};ue=Fe,re.splice(_e,0,["enter",Fe,je[2]]),_e++,Ce++,V=void 0,me=!0}}}return re[ge][1]._spread=Ae,Ce}function u(re,ge){return Ce;function Ce(_e){f.call(this,re(_e),_e),ge&&ge.call(this,_e)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(re,ge,Ce){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([ge,Ce||void 0]),re.position={start:ur(ge.start),end:void 0}}function p(re){return ge;function ge(Ce){re&&re.call(this,Ce),h.call(this,Ce)}}function h(re,ge){const Ce=this.stack.pop(),_e=this.tokenStack.pop();if(_e)_e[0].type!==re.type&&(ge?ge.call(this,re,_e[0]):(_e[1]||Ey).call(this,re,_e[0]));else throw new Error("Cannot close `"+re.type+"` ("+yo({start:re.start,end:re.end})+"): it’s not open");Ce.position.end=ur(re.end)}function y(){return Kp(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function v(re){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function j(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=re}function C(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=re}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re.replace(/(\r?\n|\r)$/g,"")}function L(re){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ge,Ce.identifier=Ml(this.sliceSerialize(re)).toLowerCase()}function H(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.title=re}function X(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.url=re}function q(re){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Ce=this.sliceSerialize(re).length;ge.depth=Ce}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function B(re){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(re){const Ce=this.stack[this.stack.length-1].children;let _e=Ce[Ce.length-1];(!_e||_e.type!=="text")&&(_e=Ze(),_e.position={start:ur(re.start),end:void 0},Ce.push(_e)),this.stack.push(_e)}function O(re){const ge=this.stack.pop();ge.value+=this.sliceSerialize(re),ge.position.end=ur(re.end)}function P(re){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=ge.children[ge.children.length-1];Ce.position.end=ur(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&l.canContainEols.includes(ge.type)&&(Z.call(this,re),O.call(this,re))}function Q(){this.data.atHardBreak=!0}function oe(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re}function J(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re}function ee(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.value=re}function w(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=ge,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function Y(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=ge,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function $(re){const ge=this.sliceSerialize(re),Ce=this.stack[this.stack.length-2];Ce.label=t4(ge),Ce.identifier=Ml(ge).toLowerCase()}function ye(){const re=this.stack[this.stack.length-1],ge=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const _e=re.children;Ce.children=_e}else Ce.alt=ge}function T(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.url=re}function _(){const re=this.resume(),ge=this.stack[this.stack.length-1];ge.title=re}function le(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function pe(re){const ge=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ge,Ce.identifier=Ml(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function xe(re){this.data.characterReferenceType=re.type}function ce(re){const ge=this.sliceSerialize(re),Ce=this.data.characterReferenceType;let _e;Ce?(_e=T0(ge,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):_e=Zp(ge);const Xe=this.stack[this.stack.length-1];Xe.value+=_e}function Re(re){const ge=this.stack.pop();ge.position.end=ur(re.end)}function Te(re){O.call(this,re);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(re)}function Ne(re){O.call(this,re);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(re)}function He(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function Ue(){return{type:"inlineCode",value:""}}function it(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function tt(){return{type:"emphasis",children:[]}}function st(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function bt(){return{type:"html",value:""}}function Ye(){return{type:"image",title:null,url:"",alt:null}}function Ge(){return{type:"link",title:null,url:"",children:[]}}function We(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[]}}function we(re){return{type:"listItem",spread:re._spread,checked:null,children:[]}}function et(){return{type:"paragraph",children:[]}}function Se(){return{type:"strong",children:[]}}function Ze(){return{type:"text",value:""}}function mt(){return{type:"thematicBreak"}}}function ur(e){return{line:e.line,column:e.column,offset:e.offset}}function I0(e,l){let a=-1;for(;++a<l.length;){const i=l[a];Array.isArray(i)?I0(e,i):r4(e,i)}}function r4(e,l){let a;for(a in l)if(B0.call(l,a))switch(a){case"canContainEols":{const i=l[a];i&&e[a].push(...i);break}case"transforms":{const i=l[a];i&&e[a].push(...i);break}case"enter":case"exit":{const i=l[a];i&&Object.assign(e[a],i);break}}}function Ey(e,l){throw e?new Error("Cannot close `"+e.type+"` ("+yo({start:e.start,end:e.end})+"): a different token (`"+l.type+"`, "+yo({start:l.start,end:l.end})+") is open"):new Error("Cannot close document, a token (`"+l.type+"`, "+yo({start:l.start,end:l.end})+") is still open")}function i4(e){const l=this;l.parser=a;function a(i){return l4(i,{...l.data("settings"),...e,extensions:l.data("micromarkExtensions")||[],mdastExtensions:l.data("fromMarkdownExtensions")||[]})}}function s4(e,l){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(l),!0)};return e.patch(l,a),e.applyData(l,a)}function o4(e,l){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(l,a),[e.applyData(l,a),{type:"text",value:`
66
+ `}]}function c4(e,l){const a=l.value?l.value+`
67
+ `:"",i={},o=l.lang?l.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:i,children:[{type:"text",value:a}]};return l.meta&&(u.data={meta:l.meta}),e.patch(l,u),u=e.applyData(l,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(l,u),u}function u4(e,l){const a={type:"element",tagName:"del",properties:{},children:e.all(l)};return e.patch(l,a),e.applyData(l,a)}function d4(e,l){const a={type:"element",tagName:"em",properties:{},children:e.all(l)};return e.patch(l,a),e.applyData(l,a)}function f4(e,l){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(l.identifier).toUpperCase(),o=ns(i.toLowerCase()),u=e.footnoteOrder.indexOf(i);let d,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),d=e.footnoteOrder.length):d=u+1,f+=1,e.footnoteCounts.set(i,f);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(l,p);const h={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(l,h),e.applyData(l,h)}function m4(e,l){const a={type:"element",tagName:"h"+l.depth,properties:{},children:e.all(l)};return e.patch(l,a),e.applyData(l,a)}function p4(e,l){if(e.options.allowDangerousHtml){const a={type:"raw",value:l.value};return e.patch(l,a),e.applyData(l,a)}}function P0(e,l){const a=l.referenceType;let i="]";if(a==="collapsed"?i+="[]":a==="full"&&(i+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+i}];const o=e.all(l),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=i:o.push({type:"text",value:i}),o}function h4(e,l){const a=String(l.identifier).toUpperCase(),i=e.definitionById.get(a);if(!i)return P0(e,l);const o={src:ns(i.url||""),alt:l.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(l,u),e.applyData(l,u)}function x4(e,l){const a={src:ns(l.url)};l.alt!==null&&l.alt!==void 0&&(a.alt=l.alt),l.title!==null&&l.title!==void 0&&(a.title=l.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(l,i),e.applyData(l,i)}function g4(e,l){const a={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};e.patch(l,a);const i={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(l,i),e.applyData(l,i)}function b4(e,l){const a=String(l.identifier).toUpperCase(),i=e.definitionById.get(a);if(!i)return P0(e,l);const o={href:ns(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const u={type:"element",tagName:"a",properties:o,children:e.all(l)};return e.patch(l,u),e.applyData(l,u)}function y4(e,l){const a={href:ns(l.url)};l.title!==null&&l.title!==void 0&&(a.title=l.title);const i={type:"element",tagName:"a",properties:a,children:e.all(l)};return e.patch(l,i),e.applyData(l,i)}function v4(e,l,a){const i=e.all(l),o=a?k4(a):U0(l),u={},d=[];if(typeof l.checked=="boolean"){const y=i[0];let b;y&&y.type==="element"&&y.tagName==="p"?b=y:(b={type:"element",tagName:"p",properties:{},children:[]},i.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const y=i[f];(o||f!==0||y.type!=="element"||y.tagName!=="p")&&d.push({type:"text",value:`
68
+ `}),y.type==="element"&&y.tagName==="p"&&!o?d.push(...y.children):d.push(y)}const p=i[i.length-1];p&&(o||p.type!=="element"||p.tagName!=="p")&&d.push({type:"text",value:`
69
+ `});const h={type:"element",tagName:"li",properties:u,children:d};return e.patch(l,h),e.applyData(l,h)}function k4(e){let l=!1;if(e.type==="list"){l=e.spread||!1;const a=e.children;let i=-1;for(;!l&&++i<a.length;)l=U0(a[i])}return l}function U0(e){const l=e.spread;return l??e.children.length>1}function j4(e,l){const a={},i=e.all(l);let o=-1;for(typeof l.start=="number"&&l.start!==1&&(a.start=l.start);++o<i.length;){const d=i[o];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const u={type:"element",tagName:l.ordered?"ol":"ul",properties:a,children:e.wrap(i,!0)};return e.patch(l,u),e.applyData(l,u)}function N4(e,l){const a={type:"element",tagName:"p",properties:{},children:e.all(l)};return e.patch(l,a),e.applyData(l,a)}function w4(e,l){const a={type:"root",children:e.wrap(e.all(l))};return e.patch(l,a),e.applyData(l,a)}function S4(e,l){const a={type:"element",tagName:"strong",properties:{},children:e.all(l)};return e.patch(l,a),e.applyData(l,a)}function C4(e,l){const a=e.all(l),i=a.shift(),o=[];if(i){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(l.children[0],d),o.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=$p(l.children[1]),p=y0(l.children[l.children.length-1]);f&&p&&(d.position={start:f,end:p}),o.push(d)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(l,u),e.applyData(l,u)}function T4(e,l,a){const i=a?a.children:void 0,u=(i?i.indexOf(l):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,f=d?d.length:l.children.length;let p=-1;const h=[];for(;++p<f;){const b=l.children[p],v={},j=d?d[p]:void 0;j&&(v.align=j);let C={type:"element",tagName:u,properties:v,children:[]};b&&(C.children=e.all(b),e.patch(b,C),C=e.applyData(b,C)),h.push(C)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(l,y),e.applyData(l,y)}function A4(e,l){const a={type:"element",tagName:"td",properties:{},children:e.all(l)};return e.patch(l,a),e.applyData(l,a)}const Ry=9,My=32;function E4(e){const l=String(e),a=/\r?\n|\r/g;let i=a.exec(l),o=0;const u=[];for(;i;)u.push(zy(l.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=a.exec(l);return u.push(zy(l.slice(o),o>0,!1)),u.join("")}function zy(e,l,a){let i=0,o=e.length;if(l){let u=e.codePointAt(i);for(;u===Ry||u===My;)i++,u=e.codePointAt(i)}if(a){let u=e.codePointAt(o-1);for(;u===Ry||u===My;)o--,u=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function R4(e,l){const a={type:"text",value:E4(String(l.value))};return e.patch(l,a),e.applyData(l,a)}function M4(e,l){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(l,a),e.applyData(l,a)}const z4={blockquote:s4,break:o4,code:c4,delete:u4,emphasis:d4,footnoteReference:f4,heading:m4,html:p4,imageReference:h4,image:x4,inlineCode:g4,linkReference:b4,link:y4,listItem:v4,list:j4,paragraph:N4,root:w4,strong:S4,table:C4,tableCell:A4,tableRow:T4,text:R4,thematicBreak:M4,toml:mu,yaml:mu,definition:mu,footnoteDefinition:mu};function mu(){}const H0=-1,Yu=0,ko=1,_u=2,Jp=3,eh=4,th=5,nh=6,F0=7,q0=8,Oy=typeof self=="object"?self:globalThis,O4=(e,l)=>{const a=(o,u)=>(e.set(u,o),o),i=o=>{if(e.has(o))return e.get(o);const[u,d]=l[o];switch(u){case Yu:case H0:return a(d,o);case ko:{const f=a([],o);for(const p of d)f.push(i(p));return f}case _u:{const f=a({},o);for(const[p,h]of d)f[i(p)]=i(h);return f}case Jp:return a(new Date(d),o);case eh:{const{source:f,flags:p}=d;return a(new RegExp(f,p),o)}case th:{const f=a(new Map,o);for(const[p,h]of d)f.set(i(p),i(h));return f}case nh:{const f=a(new Set,o);for(const p of d)f.add(i(p));return f}case F0:{const{name:f,message:p}=d;return a(new Oy[f](p),o)}case q0:return a(BigInt(d),o);case"BigInt":return a(Object(BigInt(d)),o);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return a(new DataView(f),d)}}return a(new Oy[u](d),o)};return i},Ly=e=>O4(new Map,e)(0),Vi="",{toString:L4}={},{keys:D4}=Object,ho=e=>{const l=typeof e;if(l!=="object"||!e)return[Yu,l];const a=L4.call(e).slice(8,-1);switch(a){case"Array":return[ko,Vi];case"Object":return[_u,Vi];case"Date":return[Jp,Vi];case"RegExp":return[eh,Vi];case"Map":return[th,Vi];case"Set":return[nh,Vi];case"DataView":return[ko,a]}return a.includes("Array")?[ko,a]:a.includes("Error")?[F0,a]:[_u,a]},pu=([e,l])=>e===Yu&&(l==="function"||l==="symbol"),_4=(e,l,a,i)=>{const o=(d,f)=>{const p=i.push(d)-1;return a.set(f,p),p},u=d=>{if(a.has(d))return a.get(d);let[f,p]=ho(d);switch(f){case Yu:{let y=d;switch(p){case"bigint":f=q0,y=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return o([H0],d)}return o([f,y],d)}case ko:{if(p){let v=d;return p==="DataView"?v=new Uint8Array(d.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(d)),o([p,[...v]],d)}const y=[],b=o([f,y],d);for(const v of d)y.push(u(v));return b}case _u:{if(p)switch(p){case"BigInt":return o([p,d.toString()],d);case"Boolean":case"Number":case"String":return o([p,d.valueOf()],d)}if(l&&"toJSON"in d)return u(d.toJSON());const y=[],b=o([f,y],d);for(const v of D4(d))(e||!pu(ho(d[v])))&&y.push([u(v),u(d[v])]);return b}case Jp:return o([f,d.toISOString()],d);case eh:{const{source:y,flags:b}=d;return o([f,{source:y,flags:b}],d)}case th:{const y=[],b=o([f,y],d);for(const[v,j]of d)(e||!(pu(ho(v))||pu(ho(j))))&&y.push([u(v),u(j)]);return b}case nh:{const y=[],b=o([f,y],d);for(const v of d)(e||!pu(ho(v)))&&y.push(u(v));return b}}const{message:h}=d;return o([f,{name:p,message:h}],d)};return u},Dy=(e,{json:l,lossy:a}={})=>{const i=[];return _4(!(l||a),!!l,new Map,i)(e),i},Bu=typeof structuredClone=="function"?(e,l)=>l&&("json"in l||"lossy"in l)?Ly(Dy(e,l)):structuredClone(e):(e,l)=>Ly(Dy(e,l));function B4(e,l){const a=[{type:"text",value:"↩"}];return l>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),a}function I4(e,l){return"Back to reference "+(e+1)+(l>1?"-"+l:"")}function P4(e){const l=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||B4,i=e.options.footnoteBackLabel||I4,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let p=-1;for(;++p<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[p]);if(!h)continue;const y=e.all(h),b=String(h.identifier).toUpperCase(),v=ns(b.toLowerCase());let j=0;const C=[],E=e.footnoteCounts.get(b);for(;E!==void 0&&++j<=E;){C.length>0&&C.push({type:"text",value:" "});let L=typeof a=="string"?a:a(p,j);typeof L=="string"&&(L={type:"text",value:L}),C.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+v+(j>1?"-"+j:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(p,j),className:["data-footnote-backref"]},children:Array.isArray(L)?L:[L]})}const N=y[y.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const L=N.children[N.children.length-1];L&&L.type==="text"?L.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...C)}else y.push(...C);const M={type:"element",tagName:"li",properties:{id:l+"fn-"+v},children:e.wrap(y,!0)};e.patch(h,M),f.push(M)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Bu(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
70
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
71
+ `}]}}const Qu=(function(e){if(e==null)return q4;if(typeof e=="function")return Xu(e);if(typeof e=="object")return Array.isArray(e)?U4(e):H4(e);if(typeof e=="string")return F4(e);throw new Error("Expected function, string, or object as test")});function U4(e){const l=[];let a=-1;for(;++a<e.length;)l[a]=Qu(e[a]);return Xu(i);function i(...o){let u=-1;for(;++u<l.length;)if(l[u].apply(this,o))return!0;return!1}}function H4(e){const l=e;return Xu(a);function a(i){const o=i;let u;for(u in e)if(o[u]!==l[u])return!1;return!0}}function F4(e){return Xu(l);function l(a){return a&&a.type===e}}function Xu(e){return l;function l(a,i,o){return!!(V4(a)&&e.call(this,a,typeof i=="number"?i:void 0,o||void 0))}}function q4(){return!0}function V4(e){return e!==null&&typeof e=="object"&&"type"in e}const V0=[],G4=!0,pp=!1,$4="skip";function G0(e,l,a,i){let o;typeof l=="function"&&typeof a!="function"?(i=a,a=l):o=l;const u=Qu(o),d=i?-1:1;f(e,void 0,[])();function f(p,h,y){const b=p&&typeof p=="object"?p:{};if(typeof b.type=="string"){const j=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(j?"<"+j+">":""))+")"})}return v;function v(){let j=V0,C,E,N;if((!l||u(p,h,y[y.length-1]||void 0))&&(j=Y4(a(p,y)),j[0]===pp))return j;if("children"in p&&p.children){const M=p;if(M.children&&j[0]!==$4)for(E=(i?M.children.length:-1)+d,N=y.concat(M);E>-1&&E<M.children.length;){const L=M.children[E];if(C=f(L,E,N)(),C[0]===pp)return C;E=typeof C[1]=="number"?C[1]:E+d}}return j}}}function Y4(e){return Array.isArray(e)?e:typeof e=="number"?[G4,e]:e==null?V0:[e]}function lh(e,l,a,i){let o,u,d;typeof l=="function"&&typeof a!="function"?(u=void 0,d=l,o=a):(u=l,d=a,o=i),G0(e,u,f,o);function f(p,h){const y=h[h.length-1],b=y?y.children.indexOf(p):void 0;return d(p,b,y)}}const hp={}.hasOwnProperty,Q4={};function X4(e,l){const a=l||Q4,i=new Map,o=new Map,u=new Map,d={...z4,...a.handlers},f={all:h,applyData:Z4,definitionById:i,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:d,one:p,options:a,patch:K4,wrap:J4};return lh(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const b=y.type==="definition"?i:o,v=String(y.identifier).toUpperCase();b.has(v)||b.set(v,y)}}),f;function p(y,b){const v=y.type,j=f.handlers[v];if(hp.call(f.handlers,v)&&j)return j(f,y,b);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in y){const{children:E,...N}=y,M=Bu(N);return M.children=f.all(y),M}return Bu(y)}return(f.options.unknownHandler||W4)(f,y,b)}function h(y){const b=[];if("children"in y){const v=y.children;let j=-1;for(;++j<v.length;){const C=f.one(v[j],y);if(C){if(j&&v[j-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=_y(C.value)),!Array.isArray(C)&&C.type==="element")){const E=C.children[0];E&&E.type==="text"&&(E.value=_y(E.value))}Array.isArray(C)?b.push(...C):b.push(C)}}}return b}}function K4(e,l){e.position&&(l.position=IA(e))}function Z4(e,l){let a=l;if(e&&e.data){const i=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof i=="string")if(a.type==="element")a.tagName=i;else{const d="children"in a?a.children:[a];a={type:"element",tagName:i,properties:{},children:d}}a.type==="element"&&u&&Object.assign(a.properties,Bu(u)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function W4(e,l){const a=l.data||{},i="value"in l&&!(hp.call(a,"hProperties")||hp.call(a,"hChildren"))?{type:"text",value:l.value}:{type:"element",tagName:"div",properties:{},children:e.all(l)};return e.patch(l,i),e.applyData(l,i)}function J4(e,l){const a=[];let i=-1;for(l&&a.push({type:"text",value:`
72
+ `});++i<e.length;)i&&a.push({type:"text",value:`
73
+ `}),a.push(e[i]);return l&&e.length>0&&a.push({type:"text",value:`
74
+ `}),a}function _y(e){let l=0,a=e.charCodeAt(l);for(;a===9||a===32;)l++,a=e.charCodeAt(l);return e.slice(l)}function By(e,l){const a=X4(e,l),i=a.one(e,void 0),o=P4(a),u=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
75
+ `},o),u}function eE(e,l){return e&&"run"in e?async function(a,i){const o=By(a,{file:i,...l});await e.run(o,i)}:function(a,i){return By(a,{file:i,...e||l})}}function Iy(e){if(e)throw e}var _m,Py;function tE(){if(Py)return _m;Py=1;var e=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):l.call(h)==="[object Array]"},u=function(h){if(!h||l.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),b=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!b)return!1;var v;for(v in h);return typeof v>"u"||e.call(h,v)},d=function(h,y){a&&y.name==="__proto__"?a(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(i)return i(h,y).value}else return;return h[y]};return _m=function p(){var h,y,b,v,j,C,E=arguments[0],N=1,M=arguments.length,L=!1;for(typeof E=="boolean"&&(L=E,E=arguments[1]||{},N=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});N<M;++N)if(h=arguments[N],h!=null)for(y in h)b=f(E,y),v=f(h,y),E!==v&&(L&&v&&(u(v)||(j=o(v)))?(j?(j=!1,C=b&&o(b)?b:[]):C=b&&u(b)?b:{},d(E,{name:y,newValue:p(L,C,v)})):typeof v<"u"&&d(E,{name:y,newValue:v}));return E},_m}var nE=tE();const Bm=Pu(nE);function xp(e){if(typeof e!="object"||e===null)return!1;const l=Object.getPrototypeOf(e);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function lE(){const e=[],l={run:a,use:i};return l;function a(...o){let u=-1;const d=o.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...o);function f(p,...h){const y=e[++u];let b=-1;if(p){d(p);return}for(;++b<o.length;)(h[b]===null||h[b]===void 0)&&(h[b]=o[b]);o=h,y?aE(y,f)(...h):d(null,...h)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),l}}function aE(e,l){let a;return i;function i(...d){const f=e.length>d.length;let p;f&&d.push(o);try{p=e.apply(this,d)}catch(h){const y=h;if(f&&a)throw y;return o(y)}f||(p&&p.then&&typeof p.then=="function"?p.then(u,o):p instanceof Error?o(p):u(p))}function o(d,...f){a||(a=!0,l(d,...f))}function u(d){o(null,d)}}const Fl={basename:rE,dirname:iE,extname:sE,join:oE,sep:"/"};function rE(e,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');Lo(e);let a=0,i=-1,o=e.length,u;if(l===void 0||l.length===0||l.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else i<0&&(u=!0,i=o+1);return i<0?"":e.slice(a,i)}if(l===e)return"";let d=-1,f=l.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){a=o+1;break}}else d<0&&(u=!0,d=o+1),f>-1&&(e.codePointAt(o)===l.codePointAt(f--)?f<0&&(i=o):(f=-1,i=d));return a===i?i=d:i<0&&(i=e.length),e.slice(a,i)}function iE(e){if(Lo(e),e.length===0)return".";let l=-1,a=e.length,i;for(;--a;)if(e.codePointAt(a)===47){if(i){l=a;break}}else i||(i=!0);return l<0?e.codePointAt(0)===47?"/":".":l===1&&e.codePointAt(0)===47?"//":e.slice(0,l)}function sE(e){Lo(e);let l=e.length,a=-1,i=0,o=-1,u=0,d;for(;l--;){const f=e.codePointAt(l);if(f===47){if(d){i=l+1;break}continue}a<0&&(d=!0,a=l+1),f===46?o<0?o=l:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||a<0||u===0||u===1&&o===a-1&&o===i+1?"":e.slice(o,a)}function oE(...e){let l=-1,a;for(;++l<e.length;)Lo(e[l]),e[l]&&(a=a===void 0?e[l]:a+"/"+e[l]);return a===void 0?".":cE(a)}function cE(e){Lo(e);const l=e.codePointAt(0)===47;let a=uE(e,!l);return a.length===0&&!l&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),l?"/"+a:a}function uE(e,l){let a="",i=0,o=-1,u=0,d=-1,f,p;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(o===d-1||u===1))if(o!==d-1&&u===2){if(a.length<2||i!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",i=0):(a=a.slice(0,p),i=a.length-1-a.lastIndexOf("/")),o=d,u=0;continue}}else if(a.length>0){a="",i=0,o=d,u=0;continue}}l&&(a=a.length>0?a+"/..":"..",i=2)}else a.length>0?a+="/"+e.slice(o+1,d):a=e.slice(o+1,d),i=d-o-1;o=d,u=0}else f===46&&u>-1?u++:u=-1}return a}function Lo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dE={cwd:fE};function fE(){return"/"}function gp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function mE(e){if(typeof e=="string")e=new URL(e);else if(!gp(e)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(e.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return pE(e)}function pE(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const l=e.pathname;let a=-1;for(;++a<l.length;)if(l.codePointAt(a)===37&&l.codePointAt(a+1)===50){const i=l.codePointAt(a+2);if(i===70||i===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(l)}const Im=["history","path","basename","stem","extname","dirname"];class $0{constructor(l){let a;l?gp(l)?a={path:l}:typeof l=="string"||hE(l)?a={value:l}:a=l:a={},this.cwd="cwd"in a?"":dE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Im.length;){const u=Im[i];u in a&&a[u]!==void 0&&a[u]!==null&&(this[u]=u==="history"?[...a[u]]:a[u])}let o;for(o in a)Im.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?Fl.basename(this.path):void 0}set basename(l){Um(l,"basename"),Pm(l,"basename"),this.path=Fl.join(this.dirname||"",l)}get dirname(){return typeof this.path=="string"?Fl.dirname(this.path):void 0}set dirname(l){Uy(this.basename,"dirname"),this.path=Fl.join(l||"",this.basename)}get extname(){return typeof this.path=="string"?Fl.extname(this.path):void 0}set extname(l){if(Pm(l,"extname"),Uy(this.dirname,"extname"),l){if(l.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(l.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Fl.join(this.dirname,this.stem+(l||""))}get path(){return this.history[this.history.length-1]}set path(l){gp(l)&&(l=mE(l)),Um(l,"path"),this.path!==l&&this.history.push(l)}get stem(){return typeof this.path=="string"?Fl.basename(this.path,this.extname):void 0}set stem(l){Um(l,"stem"),Pm(l,"stem"),this.path=Fl.join(this.dirname||"",l+(this.extname||""))}fail(l,a,i){const o=this.message(l,a,i);throw o.fatal=!0,o}info(l,a,i){const o=this.message(l,a,i);return o.fatal=void 0,o}message(l,a,i){const o=new _n(l,a,i);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(l){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(l||void 0).decode(this.value)}}function Pm(e,l){if(e&&e.includes(Fl.sep))throw new Error("`"+l+"` cannot be a path: did not expect `"+Fl.sep+"`")}function Um(e,l){if(!e)throw new Error("`"+l+"` cannot be empty")}function Uy(e,l){if(!e)throw new Error("Setting `"+l+"` requires `path` to be set too")}function hE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const xE=(function(e){const i=this.constructor.prototype,o=i[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,i),u}),gE={}.hasOwnProperty;class ah extends xE{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=lE()}copy(){const l=new ah;let a=-1;for(;++a<this.attachers.length;){const i=this.attachers[a];l.use(...i)}return l.data(Bm(!0,{},this.namespace)),l}data(l,a){return typeof l=="string"?arguments.length===2?(qm("data",this.frozen),this.namespace[l]=a,this):gE.call(this.namespace,l)&&this.namespace[l]||void 0:l?(qm("data",this.frozen),this.namespace=l,this):this.namespace}freeze(){if(this.frozen)return this;const l=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=a.call(l,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(l){this.freeze();const a=hu(l),i=this.parser||this.Parser;return Hm("parse",i),i(String(a),a)}process(l,a){const i=this;return this.freeze(),Hm("process",this.parser||this.Parser),Fm("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(u,d){const f=hu(l),p=i.parse(f);i.run(p,f,function(y,b,v){if(y||!b||!v)return h(y);const j=b,C=i.stringify(j,v);vE(C)?v.value=C:v.result=C,h(y,v)});function h(y,b){y||!b?d(y):u?u(b):a(void 0,b)}}}processSync(l){let a=!1,i;return this.freeze(),Hm("processSync",this.parser||this.Parser),Fm("processSync",this.compiler||this.Compiler),this.process(l,o),Fy("processSync","process",a),i;function o(u,d){a=!0,Iy(u),i=d}}run(l,a,i){Hy(l),this.freeze();const o=this.transformers;return!i&&typeof a=="function"&&(i=a,a=void 0),i?u(void 0,i):new Promise(u);function u(d,f){const p=hu(a);o.run(l,p,h);function h(y,b,v){const j=b||l;y?f(y):d?d(j):i(void 0,j,v)}}}runSync(l,a){let i=!1,o;return this.run(l,a,u),Fy("runSync","run",i),o;function u(d,f){Iy(d),o=f,i=!0}}stringify(l,a){this.freeze();const i=hu(a),o=this.compiler||this.Compiler;return Fm("stringify",o),Hy(l),o(l,i)}use(l,...a){const i=this.attachers,o=this.namespace;if(qm("use",this.frozen),l!=null)if(typeof l=="function")p(l,a);else if(typeof l=="object")Array.isArray(l)?f(l):d(l);else throw new TypeError("Expected usable value, not `"+l+"`");return this;function u(h){if(typeof h=="function")p(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...b]=h;p(y,b)}else d(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function d(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&&(o.settings=Bm(!0,o.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const b=h[y];u(b)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function p(h,y){let b=-1,v=-1;for(;++b<i.length;)if(i[b][0]===h){v=b;break}if(v===-1)i.push([h,...y]);else if(y.length>0){let[j,...C]=y;const E=i[v][1];xp(E)&&xp(j)&&(j=Bm(!0,E,j)),i[v]=[h,j,...C]}}}}const bE=new ah().freeze();function Hm(e,l){if(typeof l!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Fm(e,l){if(typeof l!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qm(e,l){if(l)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Hy(e){if(!xp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Fy(e,l,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+l+"` instead")}function hu(e){return yE(e)?e:new $0(e)}function yE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vE(e){return typeof e=="string"||kE(e)}function kE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",qy=[],Vy={allowDangerousHtml:!0},NE=/^(https?|ircs?|mailto|xmpp)$/i,wE=[{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 SE(e){const l=CE(e),a=TE(e);return AE(l.runSync(l.parse(a),a),e)}function CE(e){const l=e.rehypePlugins||qy,a=e.remarkPlugins||qy,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vy}:Vy;return bE().use(i4).use(a).use(eE,i).use(l)}function TE(e){const l=e.children||"",a=new $0;return typeof l=="string"&&(a.value=l),a}function AE(e,l){const a=l.allowedElements,i=l.allowElement,o=l.components,u=l.disallowedElements,d=l.skipHtml,f=l.unwrapDisallowed,p=l.urlTransform||EE;for(const y of wE)Object.hasOwn(l,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+jE+y.id,void 0);return lh(e,h),qA(e,{Fragment:r.Fragment,components:o,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function h(y,b,v){if(y.type==="raw"&&v&&typeof b=="number")return d?v.children.splice(b,1):v.children[b]={type:"text",value:y.value},b;if(y.type==="element"){let j;for(j in Om)if(Object.hasOwn(Om,j)&&Object.hasOwn(y.properties,j)){const C=y.properties[j],E=Om[j];(E===null||E.includes(y.tagName))&&(y.properties[j]=p(String(C||""),j,y))}}if(y.type==="element"){let j=a?!a.includes(y.tagName):u?u.includes(y.tagName):!1;if(!j&&i&&typeof b=="number"&&(j=!i(y,b,v)),j&&v&&typeof b=="number")return f&&y.children?v.children.splice(b,1,...y.children):v.children.splice(b,1),b}}}function EE(e){const l=e.indexOf(":"),a=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return l===-1||o!==-1&&l>o||a!==-1&&l>a||i!==-1&&l>i||NE.test(e.slice(0,l))?e:""}function Gy(e,l){const a=String(e);if(typeof l!="string")throw new TypeError("Expected character");let i=0,o=a.indexOf(l);for(;o!==-1;)i++,o=a.indexOf(l,o+l.length);return i}function RE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ME(e,l,a){const o=Qu((a||{}).ignore||[]),u=zE(l);let d=-1;for(;++d<u.length;)G0(e,"text",f);function f(h,y){let b=-1,v;for(;++b<y.length;){const j=y[b],C=v?v.children:void 0;if(o(j,C?C.indexOf(j):void 0,v))return;v=j}if(v)return p(h,y)}function p(h,y){const b=y[y.length-1],v=u[d][0],j=u[d][1];let C=0;const N=b.children.indexOf(h);let M=!1,L=[];v.lastIndex=0;let H=v.exec(h.value);for(;H;){const X=H.index,q={index:H.index,input:H.input,stack:[...y,h]};let D=j(...H,q);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=X+1:(C!==X&&L.push({type:"text",value:h.value.slice(C,X)}),Array.isArray(D)?L.push(...D):D&&L.push(D),C=X+H[0].length,M=!0),!v.global)break;H=v.exec(h.value)}return M?(C<h.value.length&&L.push({type:"text",value:h.value.slice(C)}),b.children.splice(N,1,...L)):L=[h],N+L.length}}function zE(e){const l=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<a.length;){const o=a[i];l.push([OE(o[0]),LE(o[1])])}return l}function OE(e){return typeof e=="string"?new RegExp(RE(e),"g"):e}function LE(e){return typeof e=="function"?e:function(){return e}}const Vm="phrasing",Gm=["autolink","link","image","label"];function DE(){return{transforms:[FE],enter:{literalAutolink:BE,literalAutolinkEmail:$m,literalAutolinkHttp:$m,literalAutolinkWww:$m},exit:{literalAutolink:HE,literalAutolinkEmail:UE,literalAutolinkHttp:IE,literalAutolinkWww:PE}}}function _E(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Vm,notInConstruct:Gm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Vm,notInConstruct:Gm},{character:":",before:"[ps]",after:"\\/",inConstruct:Vm,notInConstruct:Gm}]}}function BE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function $m(e){this.config.enter.autolinkProtocol.call(this,e)}function IE(e){this.config.exit.autolinkProtocol.call(this,e)}function PE(e){this.config.exit.data.call(this,e);const l=this.stack[this.stack.length-1];l.type,l.url="http://"+this.sliceSerialize(e)}function UE(e){this.config.exit.autolinkEmail.call(this,e)}function HE(e){this.exit(e)}function FE(e){ME(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,qE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),VE]],{ignore:["link","linkReference"]})}function qE(e,l,a,i,o){let u="";if(!Y0(o)||(/^w/i.test(l)&&(a=l+a,l="",u="http://"),!GE(a)))return!1;const d=$E(a+i);if(!d[0])return!1;const f={type:"link",title:null,url:u+l+d[0],children:[{type:"text",value:l+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function VE(e,l,a,i){return!Y0(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+l+"@"+a,children:[{type:"text",value:l+"@"+a}]}}function GE(e){const l=e.split(".");return!(l.length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[a-zA-Z\d]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[a-zA-Z\d]/.test(l[l.length-2])))}function $E(e){const l=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!l)return[e,void 0];e=e.slice(0,l.index);let a=l[0],i=a.indexOf(")");const o=Gy(e,"(");let u=Gy(e,")");for(;i!==-1&&o>u;)e+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),u++;return[e,a]}function Y0(e,l){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Xr(a)||Gu(a))&&(!l||a!==47)}Q0.peek=tR;function YE(){this.buffer()}function QE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function XE(){this.buffer()}function KE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZE(e){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ml(this.sliceSerialize(e)).toLowerCase(),a.label=l}function WE(e){this.exit(e)}function JE(e){const l=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ml(this.sliceSerialize(e)).toLowerCase(),a.label=l}function eR(e){this.exit(e)}function tR(){return"["}function Q0(e,l,a,i){const o=a.createTracker(i);let u=o.move("[^");const d=a.enter("footnoteReference"),f=a.enter("reference");return u+=o.move(a.safe(a.associationId(e),{after:"]",before:u})),f(),d(),u+=o.move("]"),u}function nR(){return{enter:{gfmFootnoteCallString:YE,gfmFootnoteCall:QE,gfmFootnoteDefinitionLabelString:XE,gfmFootnoteDefinition:KE},exit:{gfmFootnoteCallString:ZE,gfmFootnoteCall:WE,gfmFootnoteDefinitionLabelString:JE,gfmFootnoteDefinition:eR}}}function lR(e){let l=!1;return e&&e.firstLineBlank&&(l=!0),{handlers:{footnoteDefinition:a,footnoteReference:Q0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(i,o,u,d){const f=u.createTracker(d);let p=f.move("[^");const h=u.enter("footnoteDefinition"),y=u.enter("label");return p+=f.move(u.safe(u.associationId(i),{before:p,after:"]"})),y(),p+=f.move("]:"),i.children&&i.children.length>0&&(f.shift(4),p+=f.move((l?`
76
+ `:" ")+u.indentLines(u.containerFlow(i,f.current()),l?X0:aR))),h(),p}}function aR(e,l,a){return l===0?e:X0(e,l,a)}function X0(e,l,a){return(a?"":" ")+e}const rR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];K0.peek=uR;function iR(){return{canContainEols:["delete"],enter:{strikethrough:oR},exit:{strikethrough:cR}}}function sR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rR}],handlers:{delete:K0}}}function oR(e){this.enter({type:"delete",children:[]},e)}function cR(e){this.exit(e)}function K0(e,l,a,i){const o=a.createTracker(i),u=a.enter("strikethrough");let d=o.move("~~");return d+=a.containerPhrasing(e,{...o.current(),before:d,after:"~"}),d+=o.move("~~"),u(),d}function uR(){return"~"}function dR(e){return e.length}function fR(e,l){const a=l||{},i=(a.align||[]).concat(),o=a.stringLength||dR,u=[],d=[],f=[],p=[];let h=0,y=-1;for(;++y<e.length;){const E=[],N=[];let M=-1;for(e[y].length>h&&(h=e[y].length);++M<e[y].length;){const L=mR(e[y][M]);if(a.alignDelimiters!==!1){const H=o(L);N[M]=H,(p[M]===void 0||H>p[M])&&(p[M]=H)}E.push(L)}d[y]=E,f[y]=N}let b=-1;if(typeof i=="object"&&"length"in i)for(;++b<h;)u[b]=$y(i[b]);else{const E=$y(i);for(;++b<h;)u[b]=E}b=-1;const v=[],j=[];for(;++b<h;){const E=u[b];let N="",M="";E===99?(N=":",M=":"):E===108?N=":":E===114&&(M=":");let L=a.alignDelimiters===!1?1:Math.max(1,p[b]-N.length-M.length);const H=N+"-".repeat(L)+M;a.alignDelimiters!==!1&&(L=N.length+L+M.length,L>p[b]&&(p[b]=L),j[b]=L),v[b]=H}d.splice(1,0,v),f.splice(1,0,j),y=-1;const C=[];for(;++y<d.length;){const E=d[y],N=f[y];b=-1;const M=[];for(;++b<h;){const L=E[b]||"";let H="",X="";if(a.alignDelimiters!==!1){const q=p[b]-(N[b]||0),D=u[b];D===114?H=" ".repeat(q):D===99?q%2?(H=" ".repeat(q/2+.5),X=" ".repeat(q/2-.5)):(H=" ".repeat(q/2),X=H):X=" ".repeat(q)}a.delimiterStart!==!1&&!b&&M.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&L==="")&&(a.delimiterStart!==!1||b)&&M.push(" "),a.alignDelimiters!==!1&&M.push(H),M.push(L),a.alignDelimiters!==!1&&M.push(X),a.padding!==!1&&M.push(" "),(a.delimiterEnd!==!1||b!==h-1)&&M.push("|")}C.push(a.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return C.join(`
77
+ `)}function mR(e){return e==null?"":String(e)}function $y(e){const l=typeof e=="string"?e.codePointAt(0):0;return l===67||l===99?99:l===76||l===108?108:l===82||l===114?114:0}function pR(e,l,a,i){const o=a.enter("blockquote"),u=a.createTracker(i);u.move("> "),u.shift(2);const d=a.indentLines(a.containerFlow(e,u.current()),hR);return o(),d}function hR(e,l,a){return">"+(a?"":" ")+e}function xR(e,l){return Yy(e,l.inConstruct,!0)&&!Yy(e,l.notInConstruct,!1)}function Yy(e,l,a){if(typeof l=="string"&&(l=[l]),!l||l.length===0)return a;let i=-1;for(;++i<l.length;)if(e.includes(l[i]))return!0;return!1}function Qy(e,l,a,i){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
78
+ `&&xR(a.stack,a.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
79
+ `}function gR(e,l){const a=String(e);let i=a.indexOf(l),o=i,u=0,d=0;if(typeof l!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===o?++u>d&&(d=u):u=1,o=i+l.length,i=a.indexOf(l,o);return d}function bR(e,l){return!!(l.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function yR(e){const l=e.options.fence||"`";if(l!=="`"&&l!=="~")throw new Error("Cannot serialize code with `"+l+"` for `options.fence`, expected `` ` `` or `~`");return l}function vR(e,l,a,i){const o=yR(a),u=e.value||"",d=o==="`"?"GraveAccent":"Tilde";if(bR(e,a)){const b=a.enter("codeIndented"),v=a.indentLines(u,kR);return b(),v}const f=a.createTracker(i),p=o.repeat(Math.max(gR(u,o)+1,3)),h=a.enter("codeFenced");let y=f.move(p);if(e.lang){const b=a.enter(`codeFencedLang${d}`);y+=f.move(a.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),b()}if(e.lang&&e.meta){const b=a.enter(`codeFencedMeta${d}`);y+=f.move(" "),y+=f.move(a.safe(e.meta,{before:y,after:`
80
+ `,encode:["`"],...f.current()})),b()}return y+=f.move(`
81
+ `),u&&(y+=f.move(u+`
82
+ `)),y+=f.move(p),h(),y}function kR(e,l,a){return(a?"":" ")+e}function rh(e){const l=e.options.quote||'"';if(l!=='"'&&l!=="'")throw new Error("Cannot serialize title with `"+l+"` for `options.quote`, expected `\"`, or `'`");return l}function jR(e,l,a,i){const o=rh(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("definition");let f=a.enter("label");const p=a.createTracker(i);let h=p.move("[");return h+=p.move(a.safe(a.associationId(e),{before:h,after:"]",...p.current()})),h+=p.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(a.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(f=a.enter("destinationRaw"),h+=p.move(a.safe(e.url,{before:h,after:e.title?" ":`
83
+ `,...p.current()}))),f(),e.title&&(f=a.enter(`title${u}`),h+=p.move(" "+o),h+=p.move(a.safe(e.title,{before:h,after:o,...p.current()})),h+=p.move(o),f()),d(),h}function NR(e){const l=e.options.emphasis||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize emphasis with `"+l+"` for `options.emphasis`, expected `*`, or `_`");return l}function Eo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Iu(e,l,a){const i=es(e),o=es(l);return i===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Z0.peek=wR;function Z0(e,l,a,i){const o=NR(a),u=a.enter("emphasis"),d=a.createTracker(i),f=d.move(o);let p=d.move(a.containerPhrasing(e,{after:o,before:f,...d.current()}));const h=p.charCodeAt(0),y=Iu(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(p=Eo(h)+p.slice(1));const b=p.charCodeAt(p.length-1),v=Iu(i.after.charCodeAt(0),b,o);v.inside&&(p=p.slice(0,-1)+Eo(b));const j=d.move(o);return u(),a.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+p+j}function wR(e,l,a){return a.options.emphasis||"*"}function SR(e,l){let a=!1;return lh(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return a=!0,pp}),!!((!e.depth||e.depth<3)&&Kp(e)&&(l.options.setext||a))}function CR(e,l,a,i){const o=Math.max(Math.min(6,e.depth||1),1),u=a.createTracker(i);if(SR(e,a)){const y=a.enter("headingSetext"),b=a.enter("phrasing"),v=a.containerPhrasing(e,{...u.current(),before:`
84
+ `,after:`
85
+ `});return b(),y(),v+`
86
+ `+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
87
+ `))+1))}const d="#".repeat(o),f=a.enter("headingAtx"),p=a.enter("phrasing");u.move(d+" ");let h=a.containerPhrasing(e,{before:"# ",after:`
88
+ `,...u.current()});return/^[\t ]/.test(h)&&(h=Eo(h.charCodeAt(0))+h.slice(1)),h=h?d+" "+h:d,a.options.closeAtx&&(h+=" "+d),p(),f(),h}W0.peek=TR;function W0(e){return e.value||""}function TR(){return"<"}J0.peek=AR;function J0(e,l,a,i){const o=rh(a),u=o==='"'?"Quote":"Apostrophe",d=a.enter("image");let f=a.enter("label");const p=a.createTracker(i);let h=p.move("![");return h+=p.move(a.safe(e.alt,{before:h,after:"]",...p.current()})),h+=p.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(a.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(f=a.enter("destinationRaw"),h+=p.move(a.safe(e.url,{before:h,after:e.title?" ":")",...p.current()}))),f(),e.title&&(f=a.enter(`title${u}`),h+=p.move(" "+o),h+=p.move(a.safe(e.title,{before:h,after:o,...p.current()})),h+=p.move(o),f()),h+=p.move(")"),d(),h}function AR(){return"!"}ek.peek=ER;function ek(e,l,a,i){const o=e.referenceType,u=a.enter("imageReference");let d=a.enter("label");const f=a.createTracker(i);let p=f.move("![");const h=a.safe(e.alt,{before:p,after:"]",...f.current()});p+=f.move(h+"]["),d();const y=a.stack;a.stack=[],d=a.enter("reference");const b=a.safe(a.associationId(e),{before:p,after:"]",...f.current()});return d(),a.stack=y,u(),o==="full"||!h||h!==b?p+=f.move(b+"]"):o==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function ER(){return"!"}tk.peek=RR;function tk(e,l,a){let i=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++u<a.unsafe.length;){const d=a.unsafe[u],f=a.compilePattern(d);let p;if(d.atBreak)for(;p=f.exec(i);){let h=p.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(p.index+1)}}return o+i+o}function RR(){return"`"}function nk(e,l){const a=Kp(e);return!!(!l.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}lk.peek=MR;function lk(e,l,a,i){const o=rh(a),u=o==='"'?"Quote":"Apostrophe",d=a.createTracker(i);let f,p;if(nk(e,a)){const y=a.stack;a.stack=[],f=a.enter("autolink");let b=d.move("<");return b+=d.move(a.containerPhrasing(e,{before:b,after:">",...d.current()})),b+=d.move(">"),f(),a.stack=y,b}f=a.enter("link"),p=a.enter("label");let h=d.move("[");return h+=d.move(a.containerPhrasing(e,{before:h,after:"](",...d.current()})),h+=d.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(a.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(p=a.enter("destinationRaw"),h+=d.move(a.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),p(),e.title&&(p=a.enter(`title${u}`),h+=d.move(" "+o),h+=d.move(a.safe(e.title,{before:h,after:o,...d.current()})),h+=d.move(o),p()),h+=d.move(")"),f(),h}function MR(e,l,a){return nk(e,a)?"<":"["}ak.peek=zR;function ak(e,l,a,i){const o=e.referenceType,u=a.enter("linkReference");let d=a.enter("label");const f=a.createTracker(i);let p=f.move("[");const h=a.containerPhrasing(e,{before:p,after:"]",...f.current()});p+=f.move(h+"]["),d();const y=a.stack;a.stack=[],d=a.enter("reference");const b=a.safe(a.associationId(e),{before:p,after:"]",...f.current()});return d(),a.stack=y,u(),o==="full"||!h||h!==b?p+=f.move(b+"]"):o==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function zR(){return"["}function ih(e){const l=e.options.bullet||"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bullet`, expected `*`, `+`, or `-`");return l}function OR(e){const l=ih(e),a=e.options.bulletOther;if(!a)return l==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===l)throw new Error("Expected `bullet` (`"+l+"`) and `bulletOther` (`"+a+"`) to be different");return a}function LR(e){const l=e.options.bulletOrdered||".";if(l!=="."&&l!==")")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOrdered`, expected `.` or `)`");return l}function rk(e){const l=e.options.rule||"*";if(l!=="*"&&l!=="-"&&l!=="_")throw new Error("Cannot serialize rules with `"+l+"` for `options.rule`, expected `*`, `-`, or `_`");return l}function DR(e,l,a,i){const o=a.enter("list"),u=a.bulletCurrent;let d=e.ordered?LR(a):ih(a);const f=e.ordered?d==="."?")":".":OR(a);let p=l&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),rk(a)===d&&y){let b=-1;for(;++b<e.children.length;){const v=e.children[b];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(d=f),a.bulletCurrent=d;const h=a.containerFlow(e,i);return a.bulletLastUsed=d,a.bulletCurrent=u,o(),h}function _R(e){const l=e.options.listItemIndent||"one";if(l!=="tab"&&l!=="one"&&l!=="mixed")throw new Error("Cannot serialize items with `"+l+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return l}function BR(e,l,a,i){const o=_R(a);let u=a.bulletCurrent||ih(a);l&&l.type==="list"&&l.ordered&&(u=(typeof l.start=="number"&&l.start>-1?l.start:1)+(a.options.incrementListMarker===!1?0:l.children.indexOf(e))+u);let d=u.length+1;(o==="tab"||o==="mixed"&&(l&&l.type==="list"&&l.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=a.createTracker(i);f.move(u+" ".repeat(d-u.length)),f.shift(d);const p=a.enter("listItem"),h=a.indentLines(a.containerFlow(e,f.current()),y);return p(),h;function y(b,v,j){return v?(j?"":" ".repeat(d))+b:(j?u:u+" ".repeat(d-u.length))+b}}function IR(e,l,a,i){const o=a.enter("paragraph"),u=a.enter("phrasing"),d=a.containerPhrasing(e,i);return u(),o(),d}const PR=Qu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function UR(e,l,a,i){return(e.children.some(function(d){return PR(d)})?a.containerPhrasing:a.containerFlow).call(a,e,i)}function HR(e){const l=e.options.strong||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize strong with `"+l+"` for `options.strong`, expected `*`, or `_`");return l}ik.peek=FR;function ik(e,l,a,i){const o=HR(a),u=a.enter("strong"),d=a.createTracker(i),f=d.move(o+o);let p=d.move(a.containerPhrasing(e,{after:o,before:f,...d.current()}));const h=p.charCodeAt(0),y=Iu(i.before.charCodeAt(i.before.length-1),h,o);y.inside&&(p=Eo(h)+p.slice(1));const b=p.charCodeAt(p.length-1),v=Iu(i.after.charCodeAt(0),b,o);v.inside&&(p=p.slice(0,-1)+Eo(b));const j=d.move(o+o);return u(),a.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},f+p+j}function FR(e,l,a){return a.options.strong||"*"}function qR(e,l,a,i){return a.safe(e.value,i)}function VR(e){const l=e.options.ruleRepetition||3;if(l<3)throw new Error("Cannot serialize rules with repetition `"+l+"` for `options.ruleRepetition`, expected `3` or more");return l}function GR(e,l,a){const i=(rk(a)+(a.options.ruleSpaces?" ":"")).repeat(VR(a));return a.options.ruleSpaces?i.slice(0,-1):i}const sk={blockquote:pR,break:Qy,code:vR,definition:jR,emphasis:Z0,hardBreak:Qy,heading:CR,html:W0,image:J0,imageReference:ek,inlineCode:tk,link:lk,linkReference:ak,list:DR,listItem:BR,paragraph:IR,root:UR,strong:ik,text:qR,thematicBreak:GR};function $R(){return{enter:{table:YR,tableData:Xy,tableHeader:Xy,tableRow:XR},exit:{codeText:KR,table:QR,tableData:Ym,tableHeader:Ym,tableRow:Ym}}}function YR(e){const l=e._align;this.enter({type:"table",align:l.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function QR(e){this.exit(e),this.data.inTable=void 0}function XR(e){this.enter({type:"tableRow",children:[]},e)}function Ym(e){this.exit(e)}function Xy(e){this.enter({type:"tableCell",children:[]},e)}function KR(e){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,ZR));const a=this.stack[this.stack.length-1];a.type,a.value=l,this.exit(e)}function ZR(e,l){return l==="|"?l:e}function WR(e){const l=e||{},a=l.tableCellPadding,i=l.tablePipeAlign,o=l.stringLength,u=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
89
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:d,tableCell:p,tableRow:f}};function d(j,C,E,N){return h(y(j,E,N),j.align)}function f(j,C,E,N){const M=b(j,E,N),L=h([M]);return L.slice(0,L.indexOf(`
90
+ `))}function p(j,C,E,N){const M=E.enter("tableCell"),L=E.enter("phrasing"),H=E.containerPhrasing(j,{...N,before:u,after:u});return L(),M(),H}function h(j,C){return fR(j,{align:C,alignDelimiters:i,padding:a,stringLength:o})}function y(j,C,E){const N=j.children;let M=-1;const L=[],H=C.enter("table");for(;++M<N.length;)L[M]=b(N[M],C,E);return H(),L}function b(j,C,E){const N=j.children;let M=-1;const L=[],H=C.enter("tableRow");for(;++M<N.length;)L[M]=p(N[M],j,C,E);return H(),L}function v(j,C,E){let N=sk.inlineCode(j,C,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function JR(){return{exit:{taskListCheckValueChecked:Ky,taskListCheckValueUnchecked:Ky,paragraph:tM}}}function eM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nM}}}function Ky(e){const l=this.stack[this.stack.length-2];l.type,l.checked=e.type==="taskListCheckValueChecked"}function tM(e){const l=this.stack[this.stack.length-2];if(l&&l.type==="listItem"&&typeof l.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const i=a.children[0];if(i&&i.type==="text"){const o=l.children;let u=-1,d;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){d=f;break}}d===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function nM(e,l,a,i){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=a.createTracker(i);u&&f.move(d);let p=sk.listItem(e,l,a,{...i,...f.current()});return u&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(y){return y+d}}function lM(){return[DE(),nR(),iR(),$R(),JR()]}function aM(e){return{extensions:[_E(),lR(e),sR(),WR(e),eM()]}}const rM={tokenize:dM,partial:!0},ok={tokenize:fM,partial:!0},ck={tokenize:mM,partial:!0},uk={tokenize:pM,partial:!0},iM={tokenize:hM,partial:!0},dk={name:"wwwAutolink",tokenize:cM,previous:mk},fk={name:"protocolAutolink",tokenize:uM,previous:pk},Sa={name:"emailAutolink",tokenize:oM,previous:hk},Gl={};function sM(){return{text:Gl}}let Vr=48;for(;Vr<123;)Gl[Vr]=Sa,Vr++,Vr===58?Vr=65:Vr===91&&(Vr=97);Gl[43]=Sa;Gl[45]=Sa;Gl[46]=Sa;Gl[95]=Sa;Gl[72]=[Sa,fk];Gl[104]=[Sa,fk];Gl[87]=[Sa,dk];Gl[119]=[Sa,dk];function oM(e,l,a){const i=this;let o,u;return d;function d(b){return!bp(b)||!hk.call(i,i.previous)||sh(i.events)?a(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(b))}function f(b){return bp(b)?(e.consume(b),f):b===64?(e.consume(b),p):a(b)}function p(b){return b===46?e.check(iM,y,h)(b):b===45||b===95||Dn(b)?(u=!0,e.consume(b),p):y(b)}function h(b){return e.consume(b),o=!0,p}function y(b){return u&&o&&Un(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),l(b)):a(b)}}function cM(e,l,a){const i=this;return o;function o(d){return d!==87&&d!==119||!mk.call(i,i.previous)||sh(i.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rM,e.attempt(ok,e.attempt(ck,u),a),a)(d))}function u(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),l(d)}}function uM(e,l,a){const i=this;let o="",u=!1;return d;function d(b){return(b===72||b===104)&&pk.call(i,i.previous)&&!sh(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(b),e.consume(b),f):a(b)}function f(b){if(Un(b)&&o.length<5)return o+=String.fromCodePoint(b),e.consume(b),f;if(b===58){const v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(b),p}return a(b)}function p(b){return b===47?(e.consume(b),u?h:(u=!0,p)):a(b)}function h(b){return b===null||Du(b)||Pt(b)||Xr(b)||Gu(b)?a(b):e.attempt(ok,e.attempt(ck,y),a)(b)}function y(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),l(b)}}function dM(e,l,a){let i=0;return o;function o(d){return(d===87||d===119)&&i<3?(i++,e.consume(d),o):d===46&&i===3?(e.consume(d),u):a(d)}function u(d){return d===null?a(d):l(d)}}function fM(e,l,a){let i,o,u;return d;function d(h){return h===46||h===95?e.check(uk,p,f)(h):h===null||Pt(h)||Xr(h)||h!==45&&Gu(h)?p(h):(u=!0,e.consume(h),d)}function f(h){return h===95?i=!0:(o=i,i=void 0),e.consume(h),d}function p(h){return o||i||!u?a(h):l(h)}}function mM(e,l){let a=0,i=0;return o;function o(d){return d===40?(a++,e.consume(d),o):d===41&&i<a?u(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(uk,l,u)(d):d===null||Pt(d)||Xr(d)?l(d):(e.consume(d),o)}function u(d){return d===41&&i++,e.consume(d),o}}function pM(e,l,a){return i;function i(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),i):f===38?(e.consume(f),u):f===93?(e.consume(f),o):f===60||f===null||Pt(f)||Xr(f)?l(f):a(f)}function o(f){return f===null||f===40||f===91||Pt(f)||Xr(f)?l(f):i(f)}function u(f){return Un(f)?d(f):a(f)}function d(f){return f===59?(e.consume(f),i):Un(f)?(e.consume(f),d):a(f)}}function hM(e,l,a){return i;function i(u){return e.consume(u),o}function o(u){return Dn(u)?a(u):l(u)}}function mk(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Pt(e)}function pk(e){return!Un(e)}function hk(e){return!(e===47||bp(e))}function bp(e){return e===43||e===45||e===46||e===95||Dn(e)}function sh(e){let l=e.length,a=!1;for(;l--;){const i=e[l][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const xM={tokenize:wM,partial:!0};function gM(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:kM,continuation:{tokenize:jM},exit:NM}},text:{91:{name:"gfmFootnoteCall",tokenize:vM},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:bM,resolveTo:yM}}}}function bM(e,l,a){const i=this;let o=i.events.length;const u=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let d;for(;o--;){const p=i.events[o][1];if(p.type==="labelImage"){d=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return f;function f(p){if(!d||!d._balanced)return a(p);const h=Ml(i.sliceSerialize({start:d.end,end:i.now()}));return h.codePointAt(0)!==94||!u.includes(h.slice(1))?a(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),l(p))}}function yM(e,l){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[a+1],e[a+2],["enter",i,l],e[a+3],e[a+4],["enter",o,l],["exit",o,l],["enter",u,l],["enter",d,l],["exit",d,l],["exit",u,l],e[e.length-2],e[e.length-1],["exit",i,l]];return e.splice(a,e.length-a+1,...f),e}function vM(e,l,a){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u=0,d;return f;function f(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),p}function p(b){return b!==94?a(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(b){if(u>999||b===93&&!d||b===null||b===91||Pt(b))return a(b);if(b===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(Ml(i.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),l):a(b)}return Pt(b)||(d=!0),u++,e.consume(b),b===92?y:h}function y(b){return b===91||b===92||b===93?(e.consume(b),u++,h):h(b)}}function kM(e,l,a){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u,d=0,f;return p;function p(C){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(C){return C===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):a(C)}function y(C){if(d>999||C===93&&!f||C===null||C===91||Pt(C))return a(C);if(C===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return u=Ml(i.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Pt(C)||(f=!0),d++,e.consume(C),C===92?b:y}function b(C){return C===91||C===92||C===93?(e.consume(C),d++,y):y(C)}function v(C){return C===58?(e.enter("definitionMarker"),e.consume(C),e.exit("definitionMarker"),o.includes(u)||o.push(u),wt(e,j,"gfmFootnoteDefinitionWhitespace")):a(C)}function j(C){return l(C)}}function jM(e,l,a){return e.check(Oo,l,e.attempt(xM,l,a))}function NM(e){e.exit("gfmFootnoteDefinition")}function wM(e,l,a){const i=this;return wt(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const d=i.events[i.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?l(u):a(u)}}function SM(e){let a=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:u,resolveAll:o};return a==null&&(a=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(d,f){let p=-1;for(;++p<d.length;)if(d[p][0]==="enter"&&d[p][1].type==="strikethroughSequenceTemporary"&&d[p][1]._close){let h=p;for(;h--;)if(d[h][0]==="exit"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._open&&d[p][1].end.offset-d[p][1].start.offset===d[h][1].end.offset-d[h][1].start.offset){d[p][1].type="strikethroughSequence",d[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},d[h][1].start),end:Object.assign({},d[p][1].end)},b={type:"strikethroughText",start:Object.assign({},d[h][1].end),end:Object.assign({},d[p][1].start)},v=[["enter",y,f],["enter",d[h][1],f],["exit",d[h][1],f],["enter",b,f]],j=f.parser.constructs.insideSpan.null;j&&fl(v,v.length,0,$u(j,d.slice(h+1,p),f)),fl(v,v.length,0,[["exit",b,f],["enter",d[p][1],f],["exit",d[p][1],f],["exit",y,f]]),fl(d,h-1,p-h+3,v),p=h+v.length-2;break}}for(p=-1;++p<d.length;)d[p][1].type==="strikethroughSequenceTemporary"&&(d[p][1].type="data");return d}function u(d,f,p){const h=this.previous,y=this.events;let b=0;return v;function v(C){return h===126&&y[y.length-1][1].type!=="characterEscape"?p(C):(d.enter("strikethroughSequenceTemporary"),j(C))}function j(C){const E=es(h);if(C===126)return b>1?p(C):(d.consume(C),b++,j);if(b<2&&!a)return p(C);const N=d.exit("strikethroughSequenceTemporary"),M=es(C);return N._open=!M||M===2&&!!E,N._close=!E||E===2&&!!M,f(C)}}}class CM{constructor(){this.map=[]}add(l,a,i){TM(this,l,a,i)}consume(l){if(this.map.sort(function(u,d){return u[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(l.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),l.length=this.map[a][0];i.push(l.slice()),l.length=0;let o=i.pop();for(;o;){for(const u of o)l.push(u);o=i.pop()}this.map.length=0}}function TM(e,l,a,i){let o=0;if(!(a===0&&i.length===0)){for(;o<e.map.length;){if(e.map[o][0]===l){e.map[o][1]+=a,e.map[o][2].push(...i);return}o+=1}e.map.push([l,a,i])}}function AM(e,l){let a=!1;const i=[];for(;l<e.length;){const o=e[l];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(e[l+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[l-1][1].type==="tableDelimiterMarker"){const u=i.length-1;i[u]=i[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);l+=1}return i}function EM(){return{flow:{null:{name:"table",tokenize:RM,resolveAll:MM}}}}function RM(e,l,a){const i=this;let o=0,u=0,d;return f;function f(O){let P=i.events.length-1;for(;P>-1;){const J=i.events[P][1].type;if(J==="lineEnding"||J==="linePrefix")P--;else break}const Q=P>-1?i.events[P][1].type:null,oe=Q==="tableHead"||Q==="tableRow"?D:p;return oe===D&&i.parser.lazy[i.now().line]?a(O):oe(O)}function p(O){return e.enter("tableHead"),e.enter("tableRow"),h(O)}function h(O){return O===124||(d=!0,u+=1),y(O)}function y(O){return O===null?a(O):$e(O)?u>1?(u=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),j):a(O):gt(O)?wt(e,y,"whitespace")(O):(u+=1,d&&(d=!1,o+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),d=!0,y):(e.enter("data"),b(O)))}function b(O){return O===null||O===124||Pt(O)?(e.exit("data"),y(O)):(e.consume(O),O===92?v:b)}function v(O){return O===92||O===124?(e.consume(O),b):b(O)}function j(O){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(O):(e.enter("tableDelimiterRow"),d=!1,gt(O)?wt(e,C,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):C(O))}function C(O){return O===45||O===58?N(O):O===124?(d=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),E):q(O)}function E(O){return gt(O)?wt(e,N,"whitespace")(O):N(O)}function N(O){return O===58?(u+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),M):O===45?(u+=1,M(O)):O===null||$e(O)?X(O):q(O)}function M(O){return O===45?(e.enter("tableDelimiterFiller"),L(O)):q(O)}function L(O){return O===45?(e.consume(O),L):O===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),H):(e.exit("tableDelimiterFiller"),H(O))}function H(O){return gt(O)?wt(e,X,"whitespace")(O):X(O)}function X(O){return O===124?C(O):O===null||$e(O)?!d||o!==u?q(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),l(O)):q(O)}function q(O){return a(O)}function D(O){return e.enter("tableRow"),B(O)}function B(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),B):O===null||$e(O)?(e.exit("tableRow"),l(O)):gt(O)?wt(e,B,"whitespace")(O):(e.enter("data"),F(O))}function F(O){return O===null||O===124||Pt(O)?(e.exit("data"),B(O)):(e.consume(O),O===92?Z:F)}function Z(O){return O===92||O===124?(e.consume(O),F):F(O)}}function MM(e,l){let a=-1,i=!0,o=0,u=[0,0,0,0],d=[0,0,0,0],f=!1,p=0,h,y,b;const v=new CM;for(;++a<e.length;){const j=e[a],C=j[1];j[0]==="enter"?C.type==="tableHead"?(f=!1,p!==0&&(Zy(v,l,p,h,y),y=void 0,p=0),h={type:"table",start:Object.assign({},C.start),end:Object.assign({},C.end)},v.add(a,0,[["enter",h,l]])):C.type==="tableRow"||C.type==="tableDelimiterRow"?(i=!0,b=void 0,u=[0,0,0,0],d=[0,a+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},C.start),end:Object.assign({},C.end)},v.add(a,0,[["enter",y,l]])),o=C.type==="tableDelimiterRow"?2:y?3:1):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")?(i=!1,d[2]===0&&(u[1]!==0&&(d[0]=d[1],b=xu(v,l,u,o,void 0,b),u=[0,0,0,0]),d[2]=a)):C.type==="tableCellDivider"&&(i?i=!1:(u[1]!==0&&(d[0]=d[1],b=xu(v,l,u,o,void 0,b)),u=d,d=[u[1],a,0,0])):C.type==="tableHead"?(f=!0,p=a):C.type==="tableRow"||C.type==="tableDelimiterRow"?(p=a,u[1]!==0?(d[0]=d[1],b=xu(v,l,u,o,a,b)):d[1]!==0&&(b=xu(v,l,d,o,a,b)),o=0):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")&&(d[3]=a)}for(p!==0&&Zy(v,l,p,h,y),v.consume(l.events),a=-1;++a<l.events.length;){const j=l.events[a];j[0]==="enter"&&j[1].type==="table"&&(j[1]._align=AM(l.events,a))}return e}function xu(e,l,a,i,o,u){const d=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(u.end=Object.assign({},$i(l.events,a[0])),e.add(a[0],0,[["exit",u,l]]));const p=$i(l.events,a[1]);if(u={type:d,start:Object.assign({},p),end:Object.assign({},p)},e.add(a[1],0,[["enter",u,l]]),a[2]!==0){const h=$i(l.events,a[2]),y=$i(l.events,a[3]),b={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(a[2],0,[["enter",b,l]]),i!==2){const v=l.events[a[2]],j=l.events[a[3]];if(v[1].end=Object.assign({},j[1].end),v[1].type="chunkText",v[1].contentType="text",a[3]>a[2]+1){const C=a[2]+1,E=a[3]-a[2]-1;e.add(C,E,[])}}e.add(a[3]+1,0,[["exit",b,l]])}return o!==void 0&&(u.end=Object.assign({},$i(l.events,o)),e.add(o,0,[["exit",u,l]]),u=void 0),u}function Zy(e,l,a,i,o){const u=[],d=$i(l.events,a);o&&(o.end=Object.assign({},d),u.push(["exit",o,l])),i.end=Object.assign({},d),u.push(["exit",i,l]),e.add(a+1,0,u)}function $i(e,l){const a=e[l],i=a[0]==="enter"?"start":"end";return a[1][i]}const zM={name:"tasklistCheck",tokenize:LM};function OM(){return{text:{91:zM}}}function LM(e,l,a){const i=this;return o;function o(p){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),u)}function u(p){return Pt(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),d):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),d):a(p)}function d(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(p)}function f(p){return $e(p)?l(p):gt(p)?e.check({tokenize:DM},l,a)(p):a(p)}}function DM(e,l,a){return wt(e,i,"whitespace");function i(o){return o===null?a(o):l(o)}}function _M(e){return C0([sM(),gM(),SM(e),EM(),OM()])}const BM={};function IM(e){const l=this,a=e||BM,i=l.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),u=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),d=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(_M(a)),u.push(lM()),d.push(aM(a))}function PM({thread:e}){return e.state==="available"?null:e.state==="working"?r.jsx("span",{className:"inline-flex items-center gap-1 shrink-0",style:{color:g.muted},children:r.jsx(Ku,{})}):r.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[9px] font-mono tracking-wide shrink-0",style:{color:g.muted},children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${Mo(e.state)}`}),r.jsx("span",{children:e.statusLabel})]})}function Ku({className:e=""}){return r.jsxs("span",{className:`inline-flex items-center gap-1 ${e}`,"aria-hidden":"true",children:[r.jsx("span",{className:"os-thinking-dot"}),r.jsx("span",{className:"os-thinking-dot"}),r.jsx("span",{className:"os-thinking-dot"})]})}function jo({messages:e,showAnnotations:l,showStatusMessages:a,inkStyle:i,mutedStyle:o,tagStyle:u,annotStyle:d,agentLookup:f,directThreadLookup:p,onOpenAgentProfile:h,onOpenAgentChat:y,onNudgeMessage:b}){const[v,j]=A.useState(null),[C,E]=A.useState(null),[N,M]=A.useState(null),L=[];let H="",X=0;const q=A.useMemo(()=>a?e:e.filter(P=>P.messageClass!=="status"),[e,a]),D=A.useMemo(()=>new Map(q.map(P=>[P.id,P])),[q]),B=A.useMemo(()=>{let P=null;for(const Q of q)Q.isOperator&&Q.isDirectConversation&&Q.receipt&&(P=Q.id);return P},[q]);A.useEffect(()=>{if(!v)return;const P=window.setTimeout(()=>{j(Q=>Q===v?null:Q)},1400);return()=>window.clearTimeout(P)},[v]),A.useEffect(()=>{if(!C)return;const P=window.setTimeout(()=>{E(Q=>Q===C?null:Q)},1400);return()=>window.clearTimeout(P)},[C]),A.useEffect(()=>{if(!N)return;const P=window.setTimeout(()=>{M(Q=>Q===N?null:Q)},2200);return()=>window.clearTimeout(P)},[N]);const F=z.useCallback(async P=>{try{await gk(Co(P)),j(P)}catch{j(null)}},[]),Z=z.useCallback(P=>{b?.(P),E(P.id)},[b]),O=z.useCallback(P=>{if(typeof document>"u")return;const Q=document.getElementById(km(P));Q&&(Q.scrollIntoView({block:"center",behavior:"smooth"}),M(P))},[]);for(;X<q.length;){const P=q[X],Q=XS(P.authorRole)?P.authorRole:null,oe=P.isOperator?null:f.get(P.authorId)??null,J=oe?p.get(oe.id)??null:null;if(P.dayLabel!==H&&(L.push(r.jsxs("div",{className:"flex items-center gap-3 mb-5 mt-2",children:[r.jsx("div",{className:"flex-1 h-px",style:{backgroundColor:g.border}}),r.jsx("div",{className:"px-2 font-mono text-[9px] tracking-widest uppercase shrink-0",style:o,children:P.dayLabel}),r.jsx("div",{className:"flex-1 h-px",style:{backgroundColor:g.border}})]},`day-${P.dayLabel}`)),H=P.dayLabel),P.isSystem||P.messageClass==="status"){L.push(r.jsxs("div",{className:"flex gap-3 mb-3 group rounded-lg px-2 py-2 -mx-2 bg-[var(--os-hover)]",children:[r.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center text-[9px] font-semibold shrink-0 mt-0.5",style:{backgroundColor:P.avatarColor,color:"white",opacity:.85},children:P.avatarLabel}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"flex items-baseline justify-between mb-0.5",children:r.jsx("div",{className:"flex items-baseline gap-2",children:oe?r.jsx(Jy,{agent:oe,directThread:J,visibleRole:Q,timestampLabel:P.timestampLabel,inkStyle:i,mutedStyle:o,tagStyle:u,onOpenProfile:h,onOpenChat:y}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"font-semibold text-[12px]",style:i,children:P.authorName}),r.jsx("span",{className:"text-[9px] font-mono",style:o,children:P.timestampLabel})]})})}),r.jsxs("div",{id:km(P.id),className:"group/message relative text-[12px] leading-relaxed rounded-lg px-2 py-1.5 pr-12 -mx-2",style:N===P.id?Yb():i,children:[r.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 border rounded font-mono text-[10px] w-fit",style:u,children:[r.jsx(dn,{className:"text-[10px]"}),r.jsxs("span",{children:[r.jsx("span",{style:o,children:"TASK //"})," ",P.body]}),r.jsx("span",{className:"ml-2 px-1 rounded",style:{backgroundColor:"rgba(99,102,241,0.12)",color:"var(--os-accent)"},children:"IN PROGRESS"})]}),r.jsx(Wy,{message:P,copied:v===P.id,nudged:C===P.id,canNudge:!!(b&&!P.isOperator),mutedStyle:o,onCopyRef:F,onNudge:()=>Z(P)})]})]})]},P.id)),X+=1;continue}const ee=[P];let w=X+1;for(;w<q.length&&q[w].authorId===P.authorId&&q[w].dayLabel===P.dayLabel&&!q[w].isSystem&&q[w].messageClass!=="status";)ee.push(q[w]),w+=1;const Y=!!oe;L.push(r.jsxs("div",{className:En("flex gap-3 mb-4 group rounded-lg px-2 py-2 -mx-2",Y&&"bg-[var(--os-hover)]"),children:[r.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center text-[9px] font-semibold shrink-0 mt-0.5",style:{backgroundColor:P.avatarColor,color:"white",opacity:.85},children:P.avatarLabel}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-baseline justify-between mb-1",children:[r.jsx("div",{className:"flex items-baseline gap-2",children:oe?r.jsx(Jy,{agent:oe,directThread:J,visibleRole:Q,timestampLabel:P.timestampLabel,inkStyle:i,mutedStyle:o,tagStyle:u,onOpenProfile:h,onOpenChat:y}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"font-semibold text-[12px]",style:i,children:P.authorName}),Q?r.jsx("span",{className:"text-[9px] font-mono border px-1 py-0.5 rounded",style:u,children:Q}):null,r.jsx("span",{className:"text-[9px] font-mono",style:o,children:P.timestampLabel})]})}),l&&(P.routingSummary||P.provenanceSummary)?r.jsxs("div",{className:"flex items-center gap-1",children:[P.routingSummary?r.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:P.routingSummary}):null,P.provenanceSummary?r.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:P.provenanceSummary}):null]}):null]}),r.jsx("div",{className:"flex flex-col gap-2 mt-0.5",children:ee.map($=>{const ye=$.replyToMessageId?D.get($.replyToMessageId)??null:null,T=!!($.receipt&&(!$.isOperator||!$.isDirectConversation||B===$.id)),_=T&&ZS($.body);return r.jsxs("div",{id:km($.id),className:"group/message relative text-[12px] leading-relaxed rounded-lg px-2 py-1.5 pr-12 -mx-2",style:N===$.id?Yb():i,children:[$.replyToMessageId?ye?r.jsx(e1,{messageId:$.replyToMessageId,preview:lp(ye.body,64),mutedStyle:o,onJump:()=>O($.replyToMessageId)}):r.jsx(e1,{messageId:$.replyToMessageId,mutedStyle:o}):null,_&&$.receipt?r.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[r.jsx("span",{className:"min-w-0 max-w-full whitespace-pre-wrap break-words",style:i,children:$.body}),r.jsx(t1,{receipt:$.receipt,mutedStyle:o,inline:!0})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex flex-col gap-2",children:VM($.body,i,o,u)}),T&&$.receipt?r.jsx(t1,{receipt:$.receipt,mutedStyle:o}):null]}),l&&($.routingSummary||$.provenanceSummary||$.provenanceDetail)?r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-1.5",children:[$.routingSummary?r.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:$.routingSummary}):null,$.provenanceSummary?r.jsx("span",{className:"text-[9px] font-mono border px-1 rounded",style:d,children:$.provenanceSummary}):null,$.provenanceDetail?r.jsx("span",{className:"text-[9px]",style:o,children:$.provenanceDetail}):null]}):null,r.jsx(Wy,{message:$,copied:v===$.id,nudged:C===$.id,canNudge:!!(b&&!$.isOperator),mutedStyle:o,onCopyRef:F,onNudge:()=>Z($)})]},$.id)})})]})]},P.id)),X=w}return r.jsx(r.Fragment,{children:L})}function Wy({message:e,copied:l,nudged:a,canNudge:i,mutedStyle:o,onCopyRef:u,onNudge:d}){return r.jsxs("div",{className:"absolute top-1.5 right-2 flex items-center gap-2 opacity-0 pointer-events-none transition-opacity group-hover/message:opacity-100 group-hover/message:pointer-events-auto group-focus-within/message:opacity-100 group-focus-within/message:pointer-events-auto",children:[i?r.jsx("button",{type:"button",onClick:d,className:"text-[9px] font-mono lowercase tracking-wide transition-colors hover:opacity-80",style:a?{color:g.accent}:o,title:`Follow up with ${e.authorName}`,children:a?"drafted":"nudge"}):null,r.jsx("button",{type:"button",onClick:()=>{u(e.id)},className:"text-[9px] font-mono lowercase tracking-wide transition-colors hover:opacity-80",style:l?{color:g.accent}:o,title:Tv(e.id),children:l?"copied":oC(e.id)})]})}function Jy({agent:e,directThread:l,visibleRole:a,timestampLabel:i,inkStyle:o,mutedStyle:u,tagStyle:d,onOpenProfile:f,onOpenChat:p}){const h=y=>{if(y.preventDefault(),y.stopPropagation(),y.metaKey||y.ctrlKey){p(e.id);return}f(e.id)};return r.jsxs("div",{className:"relative group/agent inline-flex items-baseline gap-2 min-w-0",children:[r.jsxs("button",{type:"button",onClick:h,className:"inline-flex items-baseline gap-2 min-w-0 text-left hover:opacity-90 transition-opacity",title:"Click for overview. Cmd-click to open direct chat.",children:[r.jsx("span",{className:"font-semibold text-[12px] truncate",style:o,children:e.title}),a?r.jsx("span",{className:"text-[9px] font-mono border px-1 py-0.5 rounded shrink-0",style:d,children:a}):null]}),r.jsx("span",{className:"text-[9px] font-mono shrink-0",style:u,children:i}),r.jsx(HM,{agent:e,directThread:l,mutedStyle:u,onOpenProfile:f,onOpenChat:p})]})}function UM({agent:e,directThread:l=null,variant:a="hero",mutedStyle:i={color:g.muted},borderColor:o=g.bg,actions:u=null}){const d=a==="hover",f=Vb(e.role),p=Vb(e.summary),h=l?.statusDetail??e.statusDetail??p??"Available as a local relay channel.";return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsxs("div",{className:"relative shrink-0",children:[r.jsx("div",{className:`${d?"w-8 h-8 text-[11px]":"w-10 h-10 text-[13px]"} rounded text-white flex items-center justify-center font-bold ${e.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:dl(e.id)},children:e.title.charAt(0).toUpperCase()}),r.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-2 h-2 rounded-full ${Mo(e.state)}`,style:{border:`1px solid ${o}`}})]}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("div",{className:d?"text-[12px] font-semibold truncate":"text-[15px] font-semibold tracking-tight",style:{color:g.ink},children:e.title}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:{backgroundColor:g.tagBg,color:g.muted},children:gv(e.profileKind)})]}),d?r.jsx("div",{className:"text-[10px] mt-1",style:i,children:h}):r.jsxs(r.Fragment,{children:[f?r.jsx("div",{className:"text-[11px] mt-1",style:{color:g.ink},children:f}):null,p?r.jsx("div",{className:"text-[12px] leading-[1.55] mt-2",style:{color:g.muted},children:p}):null]}),r.jsx("div",{className:`text-[10px] ${d?"mt-2 flex flex-wrap gap-x-3 gap-y-1":"mt-3 flex items-center gap-2 flex-wrap"}`,style:i,children:d?r.jsxs(r.Fragment,{children:[r.jsx("span",{children:e.harness??"runtime"}),r.jsx("span",{children:Zr(e.projectRoot??e.cwd)??"no path"}),e.lastChatLabel?r.jsxs("span",{children:["last chat ",e.lastChatLabel]}):null]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{children:e.lastChatLabel?`Last chat ${e.lastChatLabel}`:"No direct chat yet."}),e.lastSessionLabel?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-1 h-1 rounded-full",style:{backgroundColor:g.border}}),r.jsxs("span",{children:["Last session ",e.lastSessionLabel]})]}):null]})})]})]}),u?r.jsx("div",{className:"mt-3 flex items-center gap-2",children:u}):null]})}function xo({children:e,icon:l,tone:a="neutral",...i}){return r.jsxs(Nt,{type:"button",variant:"outline",size:"sm",className:"h-8 rounded-xl px-3 text-[10px] font-medium shadow-none",style:a==="primary"?{backgroundColor:g.accentBg,borderColor:g.accentBorder,color:g.accent}:{backgroundColor:g.surface,borderColor:g.border,color:g.ink},...i,children:[l,e]})}function HM({agent:e,directThread:l,mutedStyle:a,onOpenProfile:i,onOpenChat:o}){return r.jsx("div",{className:"absolute left-0 top-full z-30 mt-2 w-72 rounded-xl border p-3 shadow-lg opacity-0 pointer-events-none translate-y-1 transition-all duration-150 group-hover/agent:opacity-100 group-hover/agent:pointer-events-auto group-hover/agent:translate-y-0 group-focus-within/agent:opacity-100 group-focus-within/agent:pointer-events-auto group-focus-within/agent:translate-y-0",style:{borderColor:g.border,backgroundColor:g.surface},children:r.jsx(UM,{agent:e,directThread:l,variant:"hover",mutedStyle:a,borderColor:g.surface,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:u=>{u.preventDefault(),u.stopPropagation(),o(e.id)},children:"Message"}),r.jsx("button",{type:"button",className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},onClick:u=>{u.preventDefault(),u.stopPropagation(),i(e.id)},children:"Overview"}),r.jsx("span",{className:"ml-auto text-[9px] font-mono",style:a,children:"Cmd-click to DM"})]})})})}function e1({messageId:e,preview:l,mutedStyle:a,onJump:i}){return r.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-[9px] leading-none min-w-0",style:{...a,opacity:.7},children:[r.jsx(qN,{size:9,className:"shrink-0"}),i?r.jsx("button",{type:"button",onClick:i,className:"hover:underline underline-offset-2 truncate min-w-0",title:Tv(e),children:l||Co(e)}):r.jsx("span",{className:"font-mono shrink-0",children:Co(e)})]})}function t1({receipt:e,mutedStyle:l,inline:a=!1}){const i=KS(e.state);return r.jsxs("div",{className:`${a?"":"mt-1.5 "}inline-flex items-center gap-1.5 text-[10px] leading-none shrink-0`,style:{...l,color:i.color},title:e.detail??e.label,children:[r.jsx(FM,{state:e.state}),r.jsx("span",{className:"font-mono uppercase tracking-[0.14em]",children:e.label}),e.state==="replied"&&e.detail?r.jsx("span",{style:l,children:e.detail}):null]})}function FM({state:e}){switch(e){case"replied":return r.jsx(O2,{size:11});case"working":return r.jsx(Ku,{className:"text-[var(--os-accent)]"});case"seen":return r.jsx(Ru,{size:11});case"delivered":return r.jsx(Ru,{size:11});default:return r.jsx(Qi,{size:11})}}function Zi({size:e=16,strokeWidth:l=1.35,style:a}){return r.jsx(E1,{size:e,strokeWidth:l,className:"shrink-0",style:a,"aria-hidden":"true"})}function xk({id:e,active:l,size:a=12}){const i=l?{color:g.accent}:void 0;return e==="voice"?r.jsx(Zm,{size:a,className:"os-row-icon shrink-0",style:i}):e==="system"?r.jsx(Yr,{size:a,className:"os-row-icon shrink-0",style:i}):e==="mentions"?r.jsx(Sp,{size:a,className:"os-row-icon shrink-0",style:i}):e==="coordination"?r.jsx(Rl,{size:a,className:"os-row-icon shrink-0",style:i}):e==="all-traffic"?r.jsx(E2,{size:a,className:"os-row-icon shrink-0",style:i}):r.jsx(s2,{size:a,className:"os-row-icon shrink-0",style:i})}function qM({relayState:e,appSettings:l,destinationKind:a,destinationId:i,body:o,replyToMessageId:u,clientMessageId:d}){const f=Date.now(),p=e?.operatorId??"operator",h=aC(e,l),y=a==="direct"?Array.from(new Set([i,...$b(o)])):$b(o),b=a==="channel"?i:a==="direct"?null:"shared",v=a==="channel"&&i==="voice",j=a==="channel"&&i==="system";return{id:`pending-${d}`,clientMessageId:d,conversationId:sC(a,i),createdAt:f,replyToMessageId:u,authorId:p,authorName:h,authorRole:null,body:o,timestampLabel:tC(f),dayLabel:nC(f),normalizedChannel:b,recipients:y,isDirectConversation:a==="direct",isSystem:j,isVoice:v,messageClass:j?"system":"agent",routingSummary:y.length>0?`Targets ${y.join(", ")}`:null,provenanceSummary:"via desktop · sending",provenanceDetail:null,isOperator:!0,avatarLabel:h.slice(0,1).toUpperCase()||"A",avatarColor:dl(p),receipt:{state:"sent",label:"Sending…",detail:null}}}function VM(e,l,a,i){const o={"--os-markdown-ink":String(l.color??g.ink),"--os-markdown-muted":String(a.color??g.muted),"--os-markdown-link":g.accent,"--os-markdown-border":g.border,"--os-markdown-surface":String(i.backgroundColor??g.tagBg),"--os-markdown-inline-border":String(i.borderColor??g.border),"--os-markdown-code-bg":g.termBg,"--os-markdown-code-fg":g.termFg};return r.jsx("div",{className:"os-markdown",style:o,children:r.jsx(SE,{remarkPlugins:[IM],components:{a:({href:u,children:d})=>r.jsx("a",{href:u,target:"_blank",rel:"noreferrer",children:d}),blockquote:({children:u})=>r.jsx("blockquote",{children:u}),code:({className:u,children:d,...f})=>{const p=/language-([\w-]+)/.exec(u??"")?.[1],h=String(d).replace(/\n$/,"");return!p&&!h.includes(`
91
+ `)?r.jsx("code",{className:"os-markdown-inline-code",...f,children:h}):r.jsxs("div",{className:"os-markdown-code-block",children:[r.jsx("div",{className:"os-markdown-code-header",children:r.jsx("span",{children:p??"code"})}),r.jsx("pre",{className:"os-markdown-pre",children:r.jsx("code",{className:u,...f,children:h})})]})},h1:({children:u})=>r.jsx("h1",{children:u}),h2:({children:u})=>r.jsx("h2",{children:u}),h3:({children:u})=>r.jsx("h3",{children:u}),hr:()=>r.jsx("hr",{}),pre:({children:u})=>r.jsx(r.Fragment,{children:u}),table:({children:u})=>r.jsx("div",{className:"os-markdown-table-wrap",children:r.jsx("table",{children:u})})},children:e})})}async function gk(e){if(typeof navigator<"u"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}if(typeof document<"u"){const l=document.createElement("textarea");l.value=e,l.setAttribute("readonly","true"),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select();const a=document.execCommand("copy");if(document.body.removeChild(l),a)return}throw new Error("Clipboard unavailable.")}function GM(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`client-${crypto.randomUUID()}`:`client-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function n1({title:e,subtitle:l,layout:a,roster:i}){return a.isCollapsed?null:r.jsxs("div",{style:{width:a.sidebarWidth,...a.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[r.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:a.onResizeStart}),r.jsxs("div",{className:"px-4 h-14 flex items-center justify-between border-b",style:{borderBottomColor:g.border},children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:a.styles.inkText,children:e}),r.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:a.styles.mutedText,children:l})]}),r.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:a.styles.mutedText,onClick:i.onRefresh,children:r.jsx(gn,{size:14})})]}),r.jsx("div",{className:"flex-1 overflow-y-auto py-3",children:r.jsxs("div",{className:"mb-3 px-2",children:[r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1.5 px-2",style:a.styles.mutedText,children:"Roster"}),r.jsxs("div",{className:"flex items-center justify-end gap-2 px-2 mb-2 relative",children:[r.jsxs("div",{className:"relative",children:[r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] px-2 py-1 rounded",style:{color:g.ink},onClick:()=>i.setAgentRosterMenu(o=>o==="filter"?null:"filter"),title:"Filter roster",children:[r.jsx(JN,{size:11}),r.jsx("span",{style:a.styles.mutedText,children:GS(i.agentRosterFilter)})]}),i.agentRosterMenu==="filter"?r.jsx("div",{className:"absolute right-0 top-full mt-1 w-36 rounded-lg border shadow-sm z-20",style:{backgroundColor:g.surface,borderColor:g.border},children:[["all","All Agents"],["active","Active Only"]].map(([o,u])=>r.jsx("button",{className:"w-full text-left px-3 py-2 text-[11px] transition-opacity hover:opacity-80",style:o===i.agentRosterFilter?a.styles.activeItem:a.styles.inkText,onClick:()=>{i.setAgentRosterFilter(o),i.setAgentRosterMenu(null)},children:u},o))}):null]}),r.jsxs("div",{className:"relative",children:[r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] px-2 py-1 rounded",style:{color:g.ink},onClick:()=>i.setAgentRosterMenu(o=>o==="sort"?null:"sort"),title:"Sort roster",children:[r.jsx(SN,{size:11}),r.jsx("span",{style:a.styles.mutedText,children:$S(i.agentRosterSort)})]}),i.agentRosterMenu==="sort"?r.jsx("div",{className:"absolute right-0 top-full mt-1 w-36 rounded-lg border shadow-sm z-20",style:{backgroundColor:g.surface,borderColor:g.border},children:[["chat","Recent Chat"],["code","Code Changes"],["session","Dev Sessions"],["alpha","A-Z"]].map(([o,u])=>r.jsx("button",{className:"w-full text-left px-3 py-2 text-[11px] transition-opacity hover:opacity-80",style:o===i.agentRosterSort?a.styles.activeItem:a.styles.inkText,onClick:()=>{i.setAgentRosterSort(o),i.setAgentRosterMenu(null)},children:u},o))}):null]})]}),r.jsx("div",{className:"flex flex-col gap-px",children:i.rosterInterAgentAgents.length>0?i.rosterInterAgentAgents.map(o=>{const u=i.selectedInterAgentId===o.id;return r.jsxs("button",{onClick:()=>i.onSelectInterAgent(o.id),className:"flex items-center gap-2 px-2 py-2 rounded text-[12px] transition-opacity w-full text-left",style:u?a.styles.activeItem:a.styles.mutedText,children:[r.jsxs("div",{className:"relative shrink-0",children:[r.jsx("div",{className:`w-6 h-6 rounded text-white flex items-center justify-center text-[9px] font-bold ${o.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:dl(o.id)},children:o.title.charAt(0).toUpperCase()}),r.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${Mo(o.state)}`,style:{border:`1px solid ${g.bg}`}})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"font-medium truncate",style:a.styles.inkText,children:[o.title,(i.rosterAgentTitleCounts.get(o.title)??0)>1&&o.branch?r.jsx("span",{className:"font-normal ml-1 text-[10px]",style:a.styles.mutedText,children:o.branch}):null]}),r.jsx("div",{className:"text-[10px] truncate",style:a.styles.mutedText,children:YS(o,i.agentRosterSort)})]}),r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:u?a.styles.activePill:a.styles.tagBadge,children:o.threadCount})]},o.id)}):r.jsx("div",{className:"px-3 py-8 text-[12px] text-center",style:a.styles.mutedText,children:"No agents match this view yet."})})]})})]})}function $M({activeView:e,layout:l,roster:a,agents:i,logs:o,interAgent:u,sessions:d}){if(e==="agents"){const f=a.rosterInterAgentAgents.length===a.interAgentAgents.length?`${a.interAgentAgents.length} agents`:`${a.rosterInterAgentAgents.length} visible · ${a.interAgentAgents.length} total`;return r.jsxs(r.Fragment,{children:[r.jsx(n1,{title:"Agents",subtitle:f,layout:l,roster:a}),r.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:l.styles.surface,children:[r.jsx("div",{className:"border-b px-4 py-3 shrink-0",style:{...l.styles.surface,borderBottomColor:g.border},children:i.selectedInterAgent?r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[r.jsxs("div",{className:"relative shrink-0",children:[r.jsx("div",{className:`w-9 h-9 rounded-xl text-[13px] text-white flex items-center justify-center font-bold ${i.selectedInterAgent.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:dl(i.selectedInterAgent.id)},children:i.selectedInterAgent.title.charAt(0).toUpperCase()}),r.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full ${Mo(i.selectedInterAgent.state)}`,style:{border:`1px solid ${g.surface}`}})]}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"text-[15px] font-semibold tracking-tight truncate",style:l.styles.inkText,children:i.selectedInterAgent.title}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:i.selectedInterAgent.state==="working"?l.styles.activePill:l.styles.tagBadge,children:i.selectedInterAgent.statusLabel})]}),r.jsx("div",{className:"text-[11px] mt-0.5 truncate max-w-2xl",style:l.styles.mutedText,children:i.selectedInterAgent.statusDetail??i.selectedInterAgent.summary??null})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[r.jsx(xo,{icon:r.jsx(Rl,{size:13}),tone:i.selectedInterAgentDirectThread?"primary":"neutral",onClick:()=>i.onOpenAgentThread(i.selectedInterAgent.id,{focusComposer:!0}),children:i.selectedInterAgentChatActionLabel}),r.jsx(xo,{icon:r.jsx(j1,{size:13}),onClick:i.onPeekAgentSession,children:"Peek"}),r.jsx(xo,{icon:r.jsx(Yr,{size:13}),onClick:()=>i.onOpenAgentSettings(i.selectedInterAgent.id,i.selectedInterAgent.profileKind==="project"),children:i.selectedInterAgent.profileKind==="project"?"Configure":"Settings"})]})]}):r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(Yi,{size:14,style:l.styles.mutedText}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[13px] font-semibold tracking-tight truncate",style:l.styles.inkText,children:"Agents"}),r.jsx("div",{className:"text-[10px] truncate mt-0.5",style:l.styles.mutedText,children:"Select an agent to inspect its operational snapshot and recent threads."})]})]})}),r.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:i.selectedInterAgent?r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...l.styles.surface,borderColor:g.border},children:[r.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{backgroundColor:g.surface,borderBottomColor:g.border},children:[r.jsx("div",{className:"min-w-0",children:r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Live Session"})}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[i.visibleAgentSession?.commandLabel?r.jsx(xo,{icon:r.jsx(wa,{size:13}),onClick:i.onCopyAgentSessionCommand,children:i.agentSessionCopied?"Copied":"Copy"}):null,i.visibleAgentSession&&i.visibleAgentSession.mode!=="none"?r.jsx(xo,{icon:r.jsx(fr,{size:13}),onClick:i.onOpenAgentSession,children:i.visibleAgentSession.mode==="tmux"?"Open TMUX":"Open Logs"}):null]})]}),r.jsx("div",{className:"px-4 py-4 max-h-[320px] overflow-y-auto",style:{backgroundColor:g.bg},children:i.selectedInterAgentActivityMessages.length>0?r.jsx(jo,{messages:i.selectedInterAgentActivityMessages.slice(-8),showAnnotations:!1,showStatusMessages:!1,inkStyle:l.styles.inkText,mutedStyle:l.styles.mutedText,tagStyle:l.styles.tagBadge,annotStyle:l.styles.annotBadge,agentLookup:i.interAgentAgentLookup,directThreadLookup:i.relayDirectLookup,onOpenAgentProfile:i.onOpenAgentProfile,onOpenAgentChat:(p,h)=>i.onOpenAgentThread(p,{draft:h,focusComposer:!0}),onNudgeMessage:i.onNudgeMessage}):r.jsx("div",{className:"text-[11px] leading-[1.6]",style:l.styles.mutedText,children:"No messages yet. Use the broker to send this agent a task."})}),r.jsxs(Nu,{open:i.agentSessionLogsExpanded,onOpenChange:i.setAgentSessionLogsExpanded,children:[r.jsx(wu,{asChild:!0,children:r.jsx("button",{className:"w-full px-4 py-2 border-t flex items-center justify-between gap-2 text-[10px] hover:opacity-90 transition-opacity text-left",style:{borderTopColor:g.border,backgroundColor:g.bg,color:g.muted},children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(El,{size:10,className:"transition-transform duration-150",style:{transform:i.agentSessionLogsExpanded?"rotate(90deg)":void 0}}),r.jsx("span",{className:"font-mono uppercase tracking-wider",children:"Logs"}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:i.visibleAgentSession?.mode==="tmux"?l.styles.activePill:l.styles.tagBadge,children:i.agentSessionPending?"Loading":i.visibleAgentSession?.mode==="tmux"?"TMUX":i.visibleAgentSession?.mode==="logs"?"Logs":"Unavailable"}),i.visibleAgentSession?.updatedAtLabel?r.jsxs("span",{children:["Updated ",i.visibleAgentSession.updatedAtLabel]}):null]})})}),r.jsxs(Su,{children:[r.jsx("div",{style:{backgroundColor:g.termBg},children:i.agentSessionLoading&&!i.visibleAgentSession?r.jsx("div",{className:"px-4 py-8 text-[11px] font-mono",style:{color:g.termFg},children:"Loading live session…"}):i.visibleAgentSession?.body?r.jsx("pre",{ref:p=>{i.agentSessionInlineViewportRef.current=p},onScroll:i.onInlineAgentSessionScroll,className:"px-4 py-4 text-[11px] leading-[1.6] overflow-x-auto whitespace-pre-wrap break-words max-h-[400px] overflow-y-auto",style:{color:g.termFg,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:i.visibleAgentSession.body}):r.jsx("div",{className:"px-4 py-8 text-[11px] leading-[1.65] font-mono",style:{color:g.termFg},children:i.agentSessionPending?"Checking for a live tmux pane first, then falling back to canonical runtime logs.":i.visibleAgentSession?.subtitle??"No session output available yet."})}),r.jsxs("div",{className:"px-4 h-10 border-t flex items-center justify-between gap-3 text-[10px]",style:{borderTopColor:g.border,backgroundColor:g.bg,color:g.muted},children:[r.jsx("div",{className:"truncate min-w-0 font-mono",children:i.renderLocalPathValue(i.visibleAgentSession?.pathLabel??Zr(i.selectedInterAgent.cwd??i.selectedInterAgent.projectRoot)??"No stable session path yet.",{className:"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity"})}),i.agentSessionFeedback?r.jsx("div",{className:"shrink-0",style:l.styles.inkText,children:i.agentSessionFeedback}):null]})]})]})]}),r.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...l.styles.surface,borderColor:g.border},children:[r.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between gap-3",style:{borderBottomColor:g.border,backgroundColor:g.surface},children:[r.jsx("div",{className:"min-w-0",children:r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Recent Activity"})}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0 flex-wrap justify-end",children:[r.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:[i.selectedInterAgentActivityMessages.length," events"]}),i.selectedInterAgentInboundTasks.length>0?r.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:l.styles.activePill,children:[i.selectedInterAgentInboundTasks.length," asks"]}):null,i.selectedInterAgentOutboundFindings.length>0?r.jsxs("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(248, 113, 113, 0.14)",color:"#b91c1c"},children:[i.selectedInterAgentOutboundFindings.length," waiting"]}):null]})]}),i.selectedInterAgentFindings.length>0?r.jsx("div",{className:"px-4 py-3 border-b flex flex-col gap-2",style:{borderBottomColor:g.border,backgroundColor:g.bg},children:i.selectedInterAgentFindings.slice(0,2).map(p=>r.jsxs("div",{className:"rounded-lg border px-3 py-2",style:{borderColor:p.severity==="error"?"rgba(248, 113, 113, 0.28)":"rgba(245, 158, 11, 0.28)",backgroundColor:p.severity==="error"?"rgba(248, 113, 113, 0.08)":"rgba(245, 158, 11, 0.08)"},children:[r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-[11px] font-medium",style:l.styles.inkText,children:p.title}),r.jsx("span",{className:"text-[9px] font-mono uppercase",style:l.styles.mutedText,children:p.ageLabel??p.updatedAtLabel??"Open"})]}),r.jsx("div",{className:"text-[11px] mt-1",style:l.styles.mutedText,children:p.summary})]},p.id))}):null,r.jsxs("div",{className:"px-4 py-4 max-h-[280px] overflow-y-auto",style:{backgroundColor:g.bg},children:[i.selectedInterAgentActivityMessages.length>0?r.jsx(jo,{messages:i.agentActivityExpanded?i.selectedInterAgentActivityMessages:i.selectedInterAgentActivityMessages.slice(-5),showAnnotations:!0,showStatusMessages:!0,inkStyle:l.styles.inkText,mutedStyle:l.styles.mutedText,tagStyle:l.styles.tagBadge,annotStyle:l.styles.annotBadge,agentLookup:i.interAgentAgentLookup,directThreadLookup:i.relayDirectLookup,onOpenAgentProfile:i.onOpenAgentProfile,onOpenAgentChat:(p,h)=>i.onOpenAgentThread(p,{draft:h,focusComposer:!0}),onNudgeMessage:i.onNudgeMessage}):r.jsx("div",{className:"text-[11px] leading-[1.6]",style:l.styles.mutedText,children:"No broker-visible activity for this agent yet."}),i.selectedInterAgentActivityMessages.length>5&&!i.agentActivityExpanded?r.jsxs("button",{className:"w-full text-center py-2 text-[11px] font-medium hover:opacity-80 transition-opacity",style:{color:g.accent},onClick:()=>i.setAgentActivityExpanded(!0),children:["Show all ",i.selectedInterAgentActivityMessages.length," events"]}):null]})]}),r.jsx(Nu,{open:i.agentThreadsExpanded,onOpenChange:i.setAgentThreadsExpanded,children:r.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...l.styles.surface,borderColor:g.border},children:[r.jsx(wu,{asChild:!0,children:r.jsx("button",{className:"w-full px-4 py-3 flex items-center justify-between gap-3 hover:opacity-90 transition-opacity text-left",style:{backgroundColor:g.surface},children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(El,{size:12,className:"transition-transform duration-150",style:{color:g.muted,transform:i.agentThreadsExpanded?"rotate(90deg)":void 0}}),r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Open Threads"}),r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:i.visibleInterAgentThreads.length+1})]})})}),r.jsx(Su,{children:r.jsxs("div",{className:"px-4 py-3 border-t flex flex-col gap-3",style:{borderTopColor:g.border},children:[r.jsxs("div",{className:"border rounded-lg px-3 py-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[13px] font-medium truncate",style:l.styles.inkText,children:"Direct Line"}),r.jsxs("div",{className:"text-[10px] truncate mt-1",style:l.styles.mutedText,children:["You and ",i.selectedInterAgent.title]})]}),r.jsx("span",{className:"text-[10px] font-mono shrink-0",style:l.styles.mutedText,children:i.selectedInterAgentDirectThread?.timestampLabel??i.selectedInterAgent.lastChatLabel??""})]}),r.jsx("div",{className:"text-[12px] leading-[1.55] mt-3",style:l.styles.mutedText,children:i.selectedAgentDirectLinePreview}),r.jsxs("div",{className:"flex items-center justify-between gap-3 mt-3",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:l.styles.activePill,children:"Direct"}),r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:i.selectedInterAgent.statusLabel})]}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded shrink-0",style:{color:g.ink},onClick:()=>i.onOpenAgentThread(i.selectedInterAgent.id,{focusComposer:!0}),children:i.selectedInterAgentChatActionLabel})]})]}),i.visibleInterAgentThreads.length>0?r.jsx("div",{className:"flex flex-col gap-3",children:i.visibleInterAgentThreads.map(p=>r.jsxs("div",{className:"border rounded-lg px-3 py-3",style:{borderColor:g.border,backgroundColor:i.selectedInterAgentThreadId===p.id?g.bg:g.surface},children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[13px] font-medium truncate",style:l.styles.inkText,children:tp(p,i.selectedInterAgent.id)}),r.jsx("div",{className:"text-[10px] truncate mt-1",style:l.styles.mutedText,children:np(p,i.selectedInterAgent.id)})]}),r.jsx("span",{className:"text-[10px] font-mono shrink-0",style:l.styles.mutedText,children:p.timestampLabel??""})]}),r.jsx("div",{className:"text-[12px] leading-[1.55] mt-3",style:l.styles.mutedText,children:p.preview??"No message preview yet."}),r.jsxs("div",{className:"flex items-center justify-between gap-3 mt-3",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:p.sourceKind==="private"?l.styles.tagBadge:l.styles.activePill,children:p.sourceKind==="private"?"Private":"Targeted"}),r.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:[p.messageCount," msgs"]})]}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>i.onOpenThreadInTrafficView(p.id),children:"Open"})]})]},p.id))}):r.jsx("div",{className:"flex flex-col items-start gap-3",children:r.jsx("div",{className:"text-[11px] leading-[1.5]",style:l.styles.mutedText,children:"No other active channels for this agent yet."})})]})})]})}),r.jsx(Nu,{open:i.agentSnapshotExpanded,onOpenChange:i.setAgentSnapshotExpanded,children:r.jsxs("section",{className:"border rounded-xl overflow-hidden",style:{...l.styles.surface,borderColor:g.border},children:[r.jsx(wu,{asChild:!0,children:r.jsxs("button",{className:"w-full px-4 py-3 flex items-center gap-2 hover:opacity-90 transition-opacity text-left",style:{backgroundColor:g.surface},children:[r.jsx(El,{size:12,className:"transition-transform duration-150",style:{color:g.muted,transform:i.agentSnapshotExpanded?"rotate(90deg)":void 0}}),r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:{color:g.accent},children:"Operational Snapshot"})]})}),r.jsx(Su,{children:r.jsx("div",{className:"px-4 py-3 border-t",style:{borderTopColor:g.border},children:r.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[["Harness",i.visibleAgentConfig?.runtime.harness??i.selectedInterAgent.harness??"Not reported"],["Session",i.visibleAgentConfig?.runtime.sessionId??i.selectedInterAgent.sessionId??"Not reported"],["Transport",i.visibleAgentConfig?.runtime.transport??i.selectedInterAgent.transport??"Not reported"],["Wake Policy",i.visibleAgentConfig?.runtime.wakePolicy||i.selectedInterAgent.wakePolicy||"Not reported"],["Last Chat",i.selectedInterAgent.lastChatLabel??"Not reported"],["Last Dev Session",i.selectedInterAgent.lastSessionLabel??"Not reported"],["Last Code Change",i.selectedInterAgent.lastCodeChangeLabel??"Not reported"]].map(([p,h])=>r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-1",style:l.styles.mutedText,children:p}),r.jsx("div",{className:"text-[11px] leading-[1.45] break-words",style:l.styles.inkText,children:h})]},p))})})})]})})]}):r.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:r.jsx(Yi,{size:24,style:{color:g.accent}})}),r.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No agent selected"}),r.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:"Pick an agent from the left rail to inspect its profile, runtime binding, and recent communication."})]})})]})]})}if(e==="logs")return r.jsxs(r.Fragment,{children:[!l.isCollapsed&&r.jsxs("div",{style:{width:l.sidebarWidth,...l.styles.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[r.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:l.onResizeStart}),r.jsx("div",{className:"px-4 h-14 flex items-center border-b",style:{borderBottomColor:g.border},children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:l.styles.inkText,children:"Logs"}),r.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:l.styles.mutedText,children:[o.logSources.length," sources"]})]})}),r.jsx("div",{className:"px-3 py-3 border-b",style:{borderBottomColor:g.border},children:r.jsx("input",{type:"text",value:o.logSourceQuery,onChange:f=>o.setLogSourceQuery(f.target.value),placeholder:"Filter sources…",className:"w-full rounded-lg border px-3 py-2 text-[11px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}})}),r.jsx("div",{className:"flex-1 overflow-y-auto py-3",children:o.logSources.length===0?r.jsxs("div",{className:"px-4 py-6 text-center",children:[r.jsxs("div",{className:"flex justify-center gap-1 mb-2",children:[r.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}}),r.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}}),r.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}})]}),r.jsx("div",{className:"text-[11px]",style:l.styles.mutedText,children:"Loading sources…"})]}):["runtime","app","agents"].map(f=>{const p=o.filteredLogSources.filter(y=>y.group===f);if(p.length===0)return null;const h=f==="runtime"?"Runtime":f==="app"?"App":"Agents";return r.jsxs("div",{className:"mb-3 px-2",children:[r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1.5 px-2",style:l.styles.mutedText,children:h}),r.jsx("div",{className:"flex flex-col gap-px",children:p.map(y=>{const b=o.selectedLogSourceId===y.id;return r.jsxs("button",{onClick:()=>{o.setSelectedLogSourceId(y.id),o.setLogSearchQuery("")},className:"w-full text-left px-2 py-2 rounded transition-opacity hover:opacity-90",style:b?l.styles.activeItem:l.styles.mutedText,children:[r.jsx("div",{className:"text-[12px] font-medium truncate",style:l.styles.inkText,children:y.title}),r.jsx("div",{className:"text-[10px] truncate mt-0.5",style:l.styles.mutedText,children:y.subtitle})]},y.id)})})]},f)})})]}),r.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:l.styles.surface,children:[r.jsx("div",{className:"border-b flex items-center justify-between px-4 h-14 shrink-0 gap-4",style:{...l.styles.surface,borderBottomColor:g.border},children:r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(wo,{size:14,style:l.styles.mutedText}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[13px] font-semibold tracking-tight truncate",style:l.styles.inkText,children:o.selectedLogSource?.title??"Logs"}),r.jsx("div",{className:"text-[10px] truncate mt-0.5",style:l.styles.mutedText,children:o.logContent?.updatedAtLabel?`${o.selectedLogSource?.subtitle??"Log tail"} · Updated ${o.logContent.updatedAtLabel}`:o.selectedLogSource?.subtitle??"Relay runtime, app, and relay agent logs."})]})]})}),r.jsxs("div",{className:"border-b px-4 py-3 flex items-center gap-3",style:{borderBottomColor:g.border},children:[r.jsx("input",{type:"text",value:o.logSearchQuery,onChange:f=>o.setLogSearchQuery(f.target.value),placeholder:"Filter visible lines…",className:"flex-1 rounded-lg border px-3 py-2 text-[11px] bg-transparent outline-none",style:{borderColor:g.border,color:g.ink}}),r.jsx("div",{className:"text-[10px] font-mono shrink-0",style:l.styles.mutedText,children:o.logContent?o.logContent.truncated?`Tail ${o.logContent.lineCount} lines`:`${o.logContent.lineCount} lines`:"No file"})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:[o.selectedLogSource?r.jsx(V1,{title:o.selectedLogSource.title,pathLabel:o.logContent?.pathLabel??o.selectedLogSource.pathLabel,body:o.logContent?.body??null,truncated:o.logContent?.truncated,lineCount:o.logContent?.lineCount,missing:o.logContent?.missing,loading:o.logsLoading,searchQuery:o.logSearchQuery,updatedAtLabel:o.logContent?.updatedAtLabel,minHeight:360}):r.jsx("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:o.logCatalog?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:r.jsx(wo,{size:24,style:{color:g.accent}})}),r.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No log selected"}),r.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:"Pick a relay runtime, app, or relay agent source from the left rail."})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex justify-center gap-1 mb-3",children:[r.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}}),r.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}}),r.jsx("span",{className:"os-thinking-dot",style:{color:g.accent}})]}),r.jsx("p",{className:"text-[13px]",style:l.styles.mutedText,children:"Loading log sources…"})]})}),o.logsFeedback?r.jsx("div",{className:"text-[11px] leading-[1.5] mt-3",style:l.styles.inkText,children:o.logsFeedback}):null]}),r.jsx("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:r.jsx("span",{className:"text-[9px] font-mono",style:l.styles.mutedText,children:"Canonical relay runtime, app, and relay agent log tails"})})]})]});if(e==="inter-agent"){const f=a.rosterInterAgentAgents.length===a.interAgentAgents.length?a.interAgentStateSubtitle:`${a.rosterInterAgentAgents.length} visible · ${a.interAgentStateSubtitle}`;return r.jsxs(r.Fragment,{children:[r.jsx(n1,{title:a.interAgentStateTitle,subtitle:f,layout:l,roster:a}),r.jsxs("div",{className:"w-[336px] border-r shrink-0 overflow-hidden flex flex-col",style:{...l.styles.surface,borderRightColor:g.border},children:[r.jsxs("div",{className:"px-4 h-14 border-b flex flex-col justify-center",style:{borderBottomColor:g.border},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:l.styles.mutedText,children:"Agent Threads"}),r.jsx("div",{className:"text-[12px] mt-1",style:l.styles.inkText,children:u.selectedInterAgent?`${u.selectedInterAgent.title} · ${u.visibleInterAgentThreads.length} thread${u.visibleInterAgentThreads.length===1?"":"s"}`:"Select an agent"})]}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:u.selectedInterAgent&&u.visibleInterAgentThreads.length>0?r.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:u.visibleInterAgentThreads.map(p=>{const h=u.selectedInterAgentThreadId===p.id;return r.jsxs("button",{onClick:()=>u.setSelectedInterAgentThreadId(p.id),className:"w-full text-left px-4 py-3.5 transition-opacity hover:opacity-90",style:h?{backgroundColor:g.bg}:void 0,children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1.5",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium truncate",style:l.styles.inkText,children:tp(p,u.selectedInterAgent.id)}),r.jsx("div",{className:"mt-1",children:r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded",style:p.sourceKind==="private"?l.styles.tagBadge:l.styles.activePill,children:p.sourceKind==="private"?"Private":"Relay"})})]}),r.jsx("span",{className:"text-[10px] font-mono shrink-0",style:l.styles.mutedText,children:p.timestampLabel??""})]}),r.jsx("div",{className:"text-[10px] mb-1.5 truncate",style:l.styles.mutedText,children:np(p,u.selectedInterAgent.id)}),r.jsx("div",{className:"text-[12px] leading-[1.45] line-clamp-2",style:l.styles.mutedText,children:p.preview??"No message preview yet."})]},p.id)})}):r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:r.jsxs("div",{children:[r.jsx("div",{className:"w-14 h-14 rounded-full mx-auto mb-4 flex items-center justify-center",style:{backgroundColor:g.accentBg},children:r.jsx(Zi,{size:22,style:{color:g.accent}})}),r.jsx("div",{className:"text-[14px] font-medium mb-1",style:l.styles.inkText,children:"No agent threads"}),r.jsx("div",{className:"text-[12px]",style:l.styles.mutedText,children:u.selectedInterAgent?`No inter-agent traffic for ${u.selectedInterAgent.title} yet.`:"Pick an agent to inspect its thread network."})]})})})]}),r.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:l.styles.surface,children:[r.jsxs("div",{className:"border-b flex items-center justify-between px-4 h-14 shrink-0 gap-4",style:{...l.styles.surface,borderBottomColor:g.border},children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(Zi,{size:14,style:l.styles.mutedText}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("h2",{className:"text-[13px] font-semibold tracking-tight truncate",style:l.styles.inkText,children:u.interAgentThreadTitle}),u.selectedInterAgentThread?r.jsx("span",{className:"text-[9px] font-mono uppercase px-1.5 py-0.5 rounded shrink-0",style:u.selectedInterAgentThread.sourceKind==="private"?l.styles.tagBadge:l.styles.activePill,children:u.selectedInterAgentThread.sourceKind==="private"?"Private":"Relay"}):null,u.selectedInterAgentThread?r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:l.styles.tagBadge,children:u.selectedInterAgentThread.messageCount}):null]}),r.jsx("div",{className:"text-[10px] truncate mt-0.5",style:l.styles.mutedText,children:u.selectedInterAgentThreadSubtitle})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[u.selectedRelayDirectThread?r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>u.onOpenAgentProfile(u.selectedRelayDirectThread.id),children:[r.jsx(Yi,{size:11}),r.jsx("span",{children:"Agent"})]}):null,r.jsxs("button",{onClick:()=>u.setShowAnnotations(!u.showAnnotations),className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:u.showAnnotations?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},children:["Annotations ",r.jsx("span",{className:"font-mono uppercase",children:u.showAnnotations?"On":"Off"})]}),u.interAgentMessageTarget?r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>u.openAgentDirectMessage(u.interAgentMessageTarget.id),title:`Open direct chat with ${u.interAgentMessageTarget.title}`,children:"Message"}):null,u.interAgentConfigureTarget?r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>u.onOpenAgentSettings(u.interAgentConfigureTarget.id,u.interAgentConfigureTarget.profileKind==="project"),title:u.interAgentConfigureTarget.profileKind==="project"?`Configure ${u.interAgentConfigureTarget.title}`:`Open ${u.interAgentConfigureTarget.title} profile`,children:u.interAgentConfigureLabel}):null]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3 pb-6",children:u.selectedInterAgent?u.selectedInterAgentThread?u.visibleInterAgentMessages.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:r.jsx(Rl,{size:24,style:{color:g.accent}})}),r.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"Thread is quiet"}),r.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:"This agent thread exists, but there are no visible messages in it yet."})]}):r.jsx("div",{className:"flex flex-col gap-1",children:r.jsx(jo,{messages:u.visibleInterAgentMessages,showAnnotations:u.showAnnotations,showStatusMessages:!1,inkStyle:l.styles.inkText,mutedStyle:l.styles.mutedText,tagStyle:l.styles.tagBadge,annotStyle:l.styles.annotBadge,agentLookup:u.interAgentAgentLookup,directThreadLookup:u.relayDirectLookup,onOpenAgentProfile:u.onOpenAgentProfile,onOpenAgentChat:u.openAgentDirectMessage,onNudgeMessage:u.onNudgeMessage})}):r.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:r.jsx(Rl,{size:24,style:{color:g.accent}})}),r.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No thread selected"}),r.jsxs("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:["Pick one of ",u.selectedInterAgent.title,"'s agent threads to read it."]})]}):r.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:r.jsx(Zi,{size:24,style:{color:g.accent}})}),r.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No agent selected"}),r.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:"Choose an agent from the left rail to inspect their traffic with other agents."})]})}),r.jsx("div",{className:"h-7 border-t flex items-center px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:r.jsx("span",{className:"text-[9px] font-mono",style:l.styles.mutedText,children:"Read-only monitor over inter-agent traffic"})})]})]})}return e!=="sessions"?null:r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",style:l.styles.surface,children:[r.jsxs("div",{className:"h-10 border-b flex items-center justify-between px-4 shrink-0",style:{...l.styles.surface,borderBottomColor:g.border},children:[r.jsxs("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[r.jsxs("div",{className:"min-w-0 shrink-0",children:[r.jsx("div",{className:"text-[13px] font-semibold tracking-tight",style:l.styles.inkText,children:"Sessions"}),r.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:l.styles.mutedText,children:d.searchQuery?`${d.filteredSessions.length} results`:`${d.stats.totalSessions} total`})]}),r.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[r.jsx(So,{size:14,style:l.styles.mutedText}),r.jsx("input",{type:"text",placeholder:"Search sessions by title, content, tags, or agent...",value:d.searchQuery,onChange:f=>d.setSearchQuery(f.target.value),className:"flex-1 bg-transparent border-none outline-none text-[12px]",style:{color:g.ink}}),d.searchQuery?r.jsx("button",{onClick:()=>d.setSearchQuery(""),className:"hover:opacity-70",style:l.styles.mutedText,children:r.jsx(ul,{size:14})}):null]})]}),r.jsx("div",{className:"flex items-center gap-2 shrink-0",children:r.jsx("button",{className:"p-1.5 rounded transition-opacity hover:opacity-70",style:l.styles.mutedText,onClick:d.onRefresh,children:r.jsx(gn,{size:14})})})]}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:d.loadingSessions?r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsxs("div",{className:"flex flex-col items-center gap-3",children:[r.jsx(dn,{className:"text-[28px]",style:{color:g.accent}}),r.jsx("span",{className:"text-[13px]",style:l.styles.mutedText,children:"Loading broker workspace…"})]})}):d.filteredSessions.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:r.jsx(fr,{size:24,style:{color:g.accent}})}),r.jsx("h3",{className:"text-[15px] font-medium mb-1",style:l.styles.inkText,children:"No sessions found"}),r.jsx("p",{className:"text-[13px] max-w-sm",style:l.styles.mutedText,children:d.searchQuery?"Try adjusting your search query":"No conversations are in the broker yet."})]}):r.jsx("div",{className:"divide-y",style:{borderColor:g.border},children:d.filteredSessions.map(f=>r.jsxs("button",{onClick:()=>d.setSelectedSession(f),draggable:!0,onDragStart:()=>{d.setDraggedSessionId(f.id),d.setDraggedPhoneSection(null)},onDragEnd:()=>{d.setDraggedSessionId(null),d.setDraggedPhoneSection(null)},className:"w-full text-left px-4 py-3 transition-opacity hover:opacity-90",style:d.selectedSession?.id===f.id?{backgroundColor:g.bg}:void 0,children:[r.jsxs("div",{className:"flex items-start justify-between mb-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-5 h-5 rounded text-white flex items-center justify-center text-[9px] font-bold",style:{backgroundColor:dl(f.agent)},children:f.agent.charAt(0)}),r.jsx("span",{className:"text-[13px] font-medium line-clamp-1",style:l.styles.inkText,children:f.title}),d.phonePreparationState.favorites.includes(f.id)?r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-medium",style:{backgroundColor:g.accentBg,color:g.accent},children:[r.jsx(wb,{size:9}),"Fav"]}):null,!d.phonePreparationState.favorites.includes(f.id)&&d.phonePreparationState.quickHits.includes(f.id)?r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-medium",style:{backgroundColor:g.tagBg,color:g.ink},children:[r.jsx(H2,{size:9}),"My List"]}):null]}),r.jsx("span",{className:"text-[10px] font-mono shrink-0 ml-2",style:l.styles.mutedText,children:d.formatDate(f.lastModified)})]}),r.jsxs("div",{className:"flex items-center gap-2 mb-1.5 pl-7",children:[r.jsx("span",{className:"text-[10px] font-mono",style:l.styles.mutedText,children:f.project}),r.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),r.jsxs("span",{className:"text-[10px]",style:l.styles.mutedText,children:[f.messageCount," messages"]}),f.tokens?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),r.jsxs("span",{className:"text-[10px]",style:l.styles.mutedText,children:[(f.tokens/1e3).toFixed(1),"k tokens"]})]}):null]}),r.jsx("p",{className:"text-[12px] line-clamp-1 pl-7",style:l.styles.mutedText,children:f.preview}),f.tags&&f.tags.length>0?r.jsxs("div",{className:"flex items-center gap-1.5 mt-2 pl-7",children:[f.tags.slice(0,3).map(p=>r.jsx("span",{className:"text-[9px] font-mono border px-1.5 py-0.5 rounded",style:l.styles.tagBadge,children:p},p)),f.tags.length>3?r.jsxs("span",{className:"text-[9px]",style:l.styles.mutedText,children:["+",f.tags.length-3]}):null]}):null]},f.id))})}),r.jsxs("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:[r.jsx("span",{className:"text-[9px] font-mono",style:l.styles.mutedText,children:"Drag sessions into My List or click one for quick actions."}),r.jsx("span",{className:"text-[9px] font-mono uppercase tracking-widest",style:l.styles.mutedText,children:"Index Ready"})]})]}),r.jsxs("div",{className:"w-80 border-l shrink-0 overflow-y-auto flex flex-col",style:{...l.styles.surface,borderLeftColor:g.border},children:[r.jsx("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:g.border},children:r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-1",style:l.styles.mutedText,children:"My List"}),r.jsx("div",{className:"text-[12px] font-medium",style:l.styles.inkText,children:"My List first, then browse and search."})]}),r.jsx("button",{type:"button",onClick:d.onClearPhoneQuickHits,disabled:d.phonePreparationSaving||d.phonePreparationState.quickHits.length===0,className:"rounded px-2 py-1 text-[10px] font-medium transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:g.bg,color:g.ink,border:`1px solid ${g.border}`},children:"Clear"})]})}),r.jsx("div",{className:"p-4 flex-1 flex flex-col gap-4",children:d.phonePreparationLoading?r.jsxs("div",{className:"flex items-center gap-2 text-[12px]",style:l.styles.mutedText,children:[r.jsx(dn,{className:"text-[12px]"}),"Loading list…"]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"rounded-lg border p-3",style:{borderColor:g.border,backgroundColor:g.bg},onDragOver:f=>f.preventDefault(),onDrop:f=>{f.preventDefault(),d.onDropIntoFavorites()},children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wb,{size:12,style:{color:g.accent}}),r.jsx("div",{className:"text-[11px] font-semibold",style:l.styles.inkText,children:"Favorites"})]}),r.jsx("div",{className:"text-[10px] font-mono",style:l.styles.mutedText,children:d.favoritePhoneSessions.length})]}),d.favoritePhoneSessions.length===0?r.jsx("div",{className:"rounded border border-dashed px-3 py-4 text-[11px]",style:{borderColor:g.border,color:g.muted},children:"Drop sessions here to keep them pinned in your list."}):r.jsx("div",{className:"flex flex-col gap-2",children:d.favoritePhoneSessions.map(f=>r.jsx("div",{draggable:!0,onDragStart:()=>{d.setDraggedSessionId(f.id),d.setDraggedPhoneSection("favorites")},onDragEnd:()=>{d.setDraggedSessionId(null),d.setDraggedPhoneSection(null)},className:"rounded border px-3 py-2",style:{borderColor:g.border,backgroundColor:g.surface},children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium line-clamp-1",style:l.styles.inkText,children:f.title}),r.jsxs("div",{className:"text-[10px] mt-1",style:l.styles.mutedText,children:[f.project," · ",d.formatDate(f.lastModified)]})]}),r.jsx("button",{type:"button",onClick:()=>d.onRemoveSessionFromPhoneSection(f.id,"favorites"),className:"text-[10px] hover:opacity-70",style:l.styles.mutedText,children:r.jsx(ul,{size:12})})]})},`favorite-${f.id}`))})]}),r.jsxs("div",{className:"rounded-lg border p-3",style:{borderColor:g.border,backgroundColor:g.bg},onDragOver:f=>f.preventDefault(),onDrop:f=>{f.preventDefault(),d.onDropIntoQuickHits()},children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(C1,{size:12,style:{color:g.accent}}),r.jsx("div",{className:"text-[11px] font-semibold",style:l.styles.inkText,children:"My List"})]}),r.jsx("div",{className:"text-[10px] font-mono",style:l.styles.mutedText,children:d.quickHitPhoneSessions.length})]}),d.quickHitPhoneSessions.length===0?r.jsx("div",{className:"rounded border border-dashed px-3 py-4 text-[11px]",style:{borderColor:g.border,color:g.muted},children:"Drag sessions here and order them however you want."}):r.jsx("div",{className:"flex flex-col gap-2",children:d.quickHitPhoneSessions.map((f,p)=>r.jsx("div",{draggable:!0,onDragStart:()=>{d.setDraggedSessionId(f.id),d.setDraggedPhoneSection("quickHits")},onDragEnd:()=>{d.setDraggedSessionId(null),d.setDraggedPhoneSection(null)},onDragOver:h=>h.preventDefault(),onDrop:h=>{h.preventDefault(),d.onDropIntoQuickHits(p)},className:"rounded border px-3 py-2",style:{borderColor:g.border,backgroundColor:g.surface},children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"text-[11px] font-mono mb-1",style:l.styles.mutedText,children:["#",p+1]}),r.jsx("div",{className:"text-[12px] font-medium line-clamp-1",style:l.styles.inkText,children:f.title}),r.jsxs("div",{className:"text-[10px] mt-1",style:l.styles.mutedText,children:[f.project," · ",d.formatDate(f.lastModified)]})]}),r.jsx("button",{type:"button",onClick:()=>d.onRemoveSessionFromPhoneSection(f.id,"quickHits"),className:"text-[10px] hover:opacity-70",style:l.styles.mutedText,children:r.jsx(ul,{size:12})})]})},`quick-hit-${f.id}`))})]}),d.phonePreparationFeedback?r.jsx("div",{className:"rounded border px-3 py-2 text-[11px]",style:{borderColor:g.border,backgroundColor:g.surface,color:g.ink},children:d.phonePreparationFeedback}):null,r.jsxs("div",{className:"rounded-lg border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase mb-2",style:l.styles.mutedText,children:"Selected Session"}),d.selectedSession?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx("div",{className:"w-8 h-8 rounded text-white flex items-center justify-center text-[12px] font-bold",style:{backgroundColor:dl(d.selectedSession.agent)},children:d.selectedSession.agent.charAt(0)}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium line-clamp-1",style:l.styles.inkText,children:d.selectedSession.title}),r.jsxs("div",{className:"text-[10px]",style:l.styles.mutedText,children:[d.selectedSession.project," · ",d.selectedSession.messageCount," messages"]})]})]}),r.jsx("p",{className:"text-[11px] leading-relaxed mb-3",style:l.styles.mutedText,children:d.selectedSession.preview}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",onClick:()=>d.onAddSessionToPhoneSection(d.selectedSession.id,"favorites"),disabled:d.phonePreparationSaving||d.phonePreparationState.favorites.includes(d.selectedSession.id),className:"flex-1 rounded px-3 py-2 text-[11px] font-medium transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:g.accentBg,color:g.accent},children:d.phonePreparationState.favorites.includes(d.selectedSession.id)?"Pinned":"Add to Favorites"}),r.jsx("button",{type:"button",onClick:()=>d.onAddSessionToPhoneSection(d.selectedSession.id,"quickHits"),disabled:d.phonePreparationSaving||d.phonePreparationState.quickHits.includes(d.selectedSession.id)||d.phonePreparationState.favorites.includes(d.selectedSession.id),className:"flex-1 rounded px-3 py-2 text-[11px] font-medium transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",style:{backgroundColor:g.surface,color:g.ink,border:`1px solid ${g.border}`},children:d.phonePreparationState.quickHits.includes(d.selectedSession.id)||d.phonePreparationState.favorites.includes(d.selectedSession.id)?"Already Added":"Add to My List"})]})]}):r.jsx("div",{className:"text-[11px]",style:l.styles.mutedText,children:"Select a session to pin it or add it to My List."})]})]})})]})]})}const gu=[{label:"Connecting relay service"},{label:"Loading agent availability"},{label:"Loading activity history"}];function YM(e){return e===0?420:195+Math.min(e,5)*12}const QM="11rem",l1="w-[3.25rem]";function XM({color:e}){const l="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8";return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 14 32 4",preserveAspectRatio:"none",className:"h-[6px] w-[3.25rem] shrink-0 overflow-visible",style:{color:e},"aria-hidden":!0,children:[r.jsx("path",{opacity:.8,fill:"currentColor",d:"M2 14 V18 H6 V14z",children:r.jsx("animateTransform",{attributeName:"transform",type:"translate",values:"0 0; 24 0; 0 0",dur:"2s",begin:"0s",repeatCount:"indefinite",keySplines:l,calcMode:"spline"})}),r.jsx("path",{opacity:.5,fill:"currentColor",d:"M0 14 V18 H8 V14z",children:r.jsx("animateTransform",{attributeName:"transform",type:"translate",values:"0 0; 24 0; 0 0",dur:"2s",begin:"0.1s",repeatCount:"indefinite",keySplines:l,calcMode:"spline"})}),r.jsx("path",{opacity:.25,fill:"currentColor",d:"M0 14 V18 H8 V14z",children:r.jsx("animateTransform",{attributeName:"transform",type:"translate",values:"0 0; 24 0; 0 0",dur:"2s",begin:"0.2s",repeatCount:"indefinite",keySplines:l,calcMode:"spline"})})]})}function a1({dark:e,C:l,s:a}){const[i,o]=z.useState(0);z.useEffect(()=>{if(i>=gu.length)return;const y=YM(i),b=setTimeout(()=>o(v=>v+1),y);return()=>clearTimeout(b)},[i]);const u=i>=gu.length,d=e?"rgba(241,245,249,0.92)":"rgba(15,23,42,0.82)",f=e?"rgba(255,255,255,0.08)":"rgba(15,23,42,0.06)",p=e?"rgba(255,255,255,0.14)":"rgba(15,23,42,0.08)",h=e?"rgba(255,255,255,0.05)":"rgba(15,23,42,0.035)";return r.jsxs("div",{className:"w-full max-w-[440px] os-fade-up",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx("img",{src:"/scout-icon.png",alt:"Scout",className:"w-9 h-9 rounded-lg shrink-0",style:{boxShadow:`0 2px 8px ${e?"rgba(0,0,0,0.4)":"rgba(15,23,42,0.08)"}`}}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[15px] font-semibold tracking-tight",style:a.inkText,children:"Scout"}),r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.18em]",style:a.mutedText,children:"Initializing"})]})]}),r.jsx("div",{className:"rounded-lg border overflow-hidden font-mono text-[11px] leading-[1.7] flex flex-col",style:{borderColor:l.border,backgroundColor:l.termBg,color:l.termFg,minHeight:QM},children:r.jsx("div",{className:"flex flex-col flex-1 px-4 py-3 min-h-0",children:r.jsx("div",{className:"space-y-2 shrink-0",children:gu.map((y,b)=>{const v=b<i,j=b===i-1&&!u;return r.jsxs("div",{className:"os-boot-line flex items-center justify-between gap-3 min-h-[1.9em] rounded-md px-2",style:{backgroundColor:v?e?"rgba(255,255,255,0.04)":"rgba(15,23,42,0.035)":"transparent",opacity:v?1:.38},children:[r.jsx("div",{className:"min-w-0 flex items-center gap-3",children:r.jsx("span",{className:"os-boot-line-text min-w-0 truncate",style:{color:l.termFg,opacity:j?1:v?.72:.45},children:y.label})}),r.jsx("div",{className:"shrink-0 min-w-[1.25rem] flex justify-end",children:v?r.jsx("span",{className:"os-boot-prompt inline-flex h-5 min-w-5 items-center justify-center rounded-full border px-1.5 text-[12px] font-semibold leading-none",style:{color:j?l.accent:d,backgroundColor:j?h:f,borderColor:j?"transparent":p,opacity:j?1:.95},"aria-hidden":!0,children:j?"…":"✓"}):null})]},y.label)})})})}),r.jsxs("div",{className:"relative mt-5 h-5",children:[r.jsxs("div",{className:"os-boot-footer-track absolute inset-x-3 top-0 bottom-0 flex items-center gap-3 min-w-0",style:{opacity:u?0:1,transform:u?"translateY(2px)":"translateY(0)",pointerEvents:u?"none":"auto"},children:[r.jsx("div",{className:`${l1} shrink-0`,"aria-hidden":!0}),r.jsxs("span",{className:"text-[10px] font-mono tabular-nums tracking-tight leading-none",style:a.mutedText,children:[i," of ",gu.length]})]}),r.jsxs("div",{className:"os-boot-footer-track absolute inset-x-3 top-0 bottom-0 flex items-center gap-3 min-w-0",style:{opacity:u?1:0,transform:u?"translateY(0)":"translateY(-2px)",pointerEvents:u?"auto":"none"},children:[r.jsxs("div",{className:`os-boot-footer-lead ${l1} shrink-0 flex items-center justify-center`,"aria-hidden":!0,children:[r.jsx("div",{className:"os-boot-wait-wave-wrap",children:r.jsx(XM,{color:l.accent})}),r.jsx("div",{className:"os-boot-wait-static-row",children:[.8,.5,.25].map((y,b)=>r.jsx("span",{className:"w-[3px] h-1 rounded-[1px]",style:{backgroundColor:l.accent,opacity:y}},b))})]}),r.jsx("span",{className:"text-[10px] font-mono tracking-tight leading-none truncate",style:a.mutedText,children:"Finishing up"})]})]})]})}const at={getAppInfo:"scout:get-app-info",getServicesState:"scout:get-services-state",getHomeState:"scout:get-home-state",getMessagesWorkspaceState:"scout:get-messages-workspace-state",getRelayShellPatch:"scout:get-relay-shell-patch",getShellState:"scout:get-shell-state",refreshRelayShellPatch:"scout:refresh-relay-shell-patch",refreshShellState:"scout:refresh-shell-state",getAppSettings:"scout:get-app-settings",refreshSettingsInventory:"scout:refresh-settings-inventory",updateAppSettings:"scout:update-app-settings",retireProject:"scout:retire-project",restoreProject:"scout:restore-project",runOnboardingCommand:"scout:run-onboarding-command",skipOnboarding:"scout:skip-onboarding",restartOnboarding:"scout:restart-onboarding",getAgentConfig:"scout:get-agent-config",updateAgentConfig:"scout:update-agent-config",createAgent:"scout:create-agent",pickDirectory:"scout:pick-directory",reloadApp:"scout:reload-app",quitApp:"scout:quit-app",revealPath:"scout:reveal-path",getPhonePreparation:"scout:get-phone-preparation",updatePhonePreparation:"scout:update-phone-preparation",getPairingState:"scout:get-pairing-state",refreshPairingState:"scout:refresh-pairing-state",controlPairingService:"scout:control-pairing-service",updatePairingConfig:"scout:update-pairing-config",decidePairingApproval:"scout:decide-pairing-approval",restartAgent:"scout:restart-agent",sendRelayMessage:"scout:send-relay-message",controlBroker:"scout:control-broker",getKeepAliveState:"scout:get-keep-alive-state",acquireKeepAliveLease:"scout:acquire-keep-alive-lease",releaseKeepAliveLease:"scout:release-keep-alive-lease",getAgentSession:"scout:get-agent-session",openAgentSession:"scout:open-agent-session",toggleVoiceCapture:"scout:toggle-voice-capture",setVoiceRepliesEnabled:"scout:set-voice-replies-enabled",getLogCatalog:"scout:get-log-catalog",getBrokerInspector:"scout:get-broker-inspector",getFeedbackBundle:"scout:get-feedback-bundle",submitFeedbackReport:"scout:submit-feedback-report",readLogSource:"scout:read-log-source"};function KM(e){return{isDesktop:!0,getAppInfo:()=>e(at.getAppInfo),getServicesState:()=>e(at.getServicesState),getHomeState:()=>e(at.getHomeState),getMessagesWorkspaceState:()=>e(at.getMessagesWorkspaceState),getRelayShellPatch:()=>e(at.getRelayShellPatch),getShellState:()=>e(at.getShellState),refreshRelayShellPatch:()=>e(at.refreshRelayShellPatch),refreshShellState:()=>e(at.refreshShellState),getAppSettings:()=>e(at.getAppSettings),refreshSettingsInventory:()=>e(at.refreshSettingsInventory),updateAppSettings:l=>e(at.updateAppSettings,l),retireProject:l=>e(at.retireProject,l),restoreProject:l=>e(at.restoreProject,l),runOnboardingCommand:l=>e(at.runOnboardingCommand,l),skipOnboarding:()=>e(at.skipOnboarding),restartOnboarding:()=>e(at.restartOnboarding),getAgentConfig:l=>e(at.getAgentConfig,l),updateAgentConfig:l=>e(at.updateAgentConfig,l),createAgent:l=>e(at.createAgent,l),pickDirectory:()=>e(at.pickDirectory),reloadApp:()=>e(at.reloadApp),quitApp:()=>e(at.quitApp),revealPath:l=>e(at.revealPath,l),getPhonePreparation:()=>e(at.getPhonePreparation),updatePhonePreparation:l=>e(at.updatePhonePreparation,l),getPairingState:()=>e(at.getPairingState),refreshPairingState:()=>e(at.refreshPairingState),controlPairingService:l=>e(at.controlPairingService,l),updatePairingConfig:l=>e(at.updatePairingConfig,l),decidePairingApproval:l=>e(at.decidePairingApproval,l),restartAgent:l=>e(at.restartAgent,l),sendRelayMessage:l=>e(at.sendRelayMessage,l),controlBroker:l=>e(at.controlBroker,l),getKeepAliveState:()=>e(at.getKeepAliveState),acquireKeepAliveLease:l=>e(at.acquireKeepAliveLease,l),releaseKeepAliveLease:l=>e(at.releaseKeepAliveLease,l),getAgentSession:l=>e(at.getAgentSession,l),openAgentSession:l=>e(at.openAgentSession,l),toggleVoiceCapture:()=>e(at.toggleVoiceCapture),setVoiceRepliesEnabled:l=>e(at.setVoiceRepliesEnabled,l),getLogCatalog:()=>e(at.getLogCatalog),getBrokerInspector:()=>e(at.getBrokerInspector),getFeedbackBundle:()=>e(at.getFeedbackBundle),submitFeedbackReport:l=>e(at.submitFeedbackReport,l),readLogSource:l=>e(at.readLogSource,l)}}const ZM={"scout:get-app-info":{method:"GET",path:"/api/app"},"scout:get-services-state":{method:"GET",path:"/api/services"},"scout:get-home-state":{method:"GET",path:"/api/home"},"scout:get-messages-workspace-state":{method:"GET",path:"/api/messages-workspace"},"scout:get-relay-shell-patch":{method:"GET",path:"/api/relay-shell-patch"},"scout:get-shell-state":{method:"GET",path:"/api/shell-state"},"scout:refresh-relay-shell-patch":{method:"GET",path:"/api/relay-shell-patch/refresh"},"scout:refresh-shell-state":{method:"GET",path:"/api/shell-state/refresh"},"scout:get-app-settings":{method:"GET",path:"/api/app-settings"},"scout:refresh-settings-inventory":{method:"GET",path:"/api/app-settings/refresh"},"scout:update-app-settings":{method:"POST",path:"/api/app-settings"},"scout:retire-project":{method:"POST",path:"/api/retire-project"},"scout:restore-project":{method:"POST",path:"/api/restore-project"},"scout:run-onboarding-command":{method:"POST",path:"/api/onboarding/run"},"scout:skip-onboarding":{method:"POST",path:"/api/onboarding/skip"},"scout:restart-onboarding":{method:"POST",path:"/api/onboarding/restart"},"scout:get-agent-config":{method:"GET",path:e=>`/api/agent-config/${e[0]}`},"scout:update-agent-config":{method:"POST",path:"/api/agent-config"},"scout:create-agent":{method:"POST",path:"/api/agent/create"},"scout:pick-directory":{method:"GET",path:"/api/pick-directory"},"scout:quit-app":{method:"POST",path:"/api/quit"},"scout:reveal-path":{method:"POST",path:"/api/reveal-path"},"scout:get-phone-preparation":{method:"GET",path:"/api/phone-preparation"},"scout:update-phone-preparation":{method:"POST",path:"/api/phone-preparation"},"scout:get-pairing-state":{method:"GET",path:"/api/pairing-state"},"scout:refresh-pairing-state":{method:"GET",path:"/api/pairing-state/refresh"},"scout:control-pairing-service":{method:"POST",path:"/api/pairing/control"},"scout:update-pairing-config":{method:"POST",path:"/api/pairing/config"},"scout:restart-agent":{method:"POST",path:"/api/agent/restart"},"scout:send-relay-message":{method:"POST",path:"/api/relay/send"},"scout:control-broker":{method:"POST",path:"/api/broker/control"},"scout:get-keep-alive-state":{method:"GET",path:"/api/keep-alive"},"scout:acquire-keep-alive-lease":{method:"POST",path:"/api/keep-alive/acquire"},"scout:release-keep-alive-lease":{method:"POST",path:"/api/keep-alive/release"},"scout:get-agent-session":{method:"GET",path:e=>`/api/agent-session/${e[0]}`},"scout:open-agent-session":{method:"POST",path:e=>`/api/agent-session/${e[0]}/open`},"scout:toggle-voice-capture":{method:"POST",path:"/api/voice/toggle-capture"},"scout:set-voice-replies-enabled":{method:"POST",path:"/api/voice/replies"},"scout:get-log-catalog":{method:"GET",path:"/api/log-catalog"},"scout:get-broker-inspector":{method:"GET",path:"/api/broker-inspector"},"scout:get-feedback-bundle":{method:"GET",path:"/api/feedback-bundle"},"scout:submit-feedback-report":{method:"POST",path:"/api/feedback-report"},"scout:read-log-source":{method:"POST",path:"/api/log-source"}};function WM(){return typeof window<"u"&&window.location.origin?window.location.origin:"http://localhost:3200"}async function r1(e,l){const a=await e.text();if(!e.ok){let i=a.trim()||`HTTP ${e.status}`;if(a.length>0)try{const o=JSON.parse(a);typeof o.error=="string"&&o.error.trim()&&(i=o.detail?`${o.error}: ${o.detail}`:o.error)}catch{}throw new Error(`${l} → ${i}`)}if(!a.length)return null;try{return JSON.parse(a)}catch{throw new Error(`${l} → response is not JSON`)}}async function JM(e,...l){if(e==="scout:reload-app")return typeof window<"u"&&window.location.reload(),!0;const a=ZM[e];if(!a)return console.warn(`[web-bridge] unknown channel: ${e}`),null;const i=WM(),o=typeof a.path=="function"?a.path(l):a.path,u=`${i}${o}`;if(a.method==="GET"){const p=await fetch(u);return r1(p,u)}const d=l[0]!==void 0?l[0]:{},f=await fetch(u,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(d)});return r1(f,u)}function ez(){return{...KM(JM),isDesktop:!1}}let Qm=null;function tz(){return typeof window>"u"?null:window.scoutDesktop?window.scoutDesktop:(Qm||(Qm=ez()),Qm)}function nz({activeView:e,selectedMessagesThread:l,selectedRelayKind:a,selectedRelayId:i,selectedInterAgentId:o}){return e==="messages"?l?.kind==="relay"&&a==="direct"?i:null:e==="agents"?o:null}function i1(e){return{runtime:{cwd:e.runtime.cwd,harness:e.runtime.harness,sessionId:e.runtime.sessionId,transport:e.runtime.transport},systemPrompt:e.systemPrompt,toolUse:{launchArgsText:e.toolUse.launchArgsText},capabilitiesText:e.capabilitiesText}}function lz({activeView:e,scoutDesktop:l,surfaceCaps:a,interAgentState:i,interAgentAgents:o,interAgentThreads:u,relayState:d,selectedMessagesThread:f,selectedMessagesDetailAgentId:p,selectedRelayKind:h,selectedRelayId:y,agentableProjects:b,visibleAppSettings:v,isAppSettingsEditing:j,appSettingsDirty:C,setAppSettings:E,setAppSettingsDraft:N,setActiveView:M,setSettingsSection:L,setSettingsAgentId:H,setShellState:X,setShellError:q,setRelayFeedback:D}){const[B,F]=z.useState(null),[Z,O]=z.useState(null),[P,Q]=z.useState("all"),[oe,J]=z.useState("chat"),[ee,w]=z.useState(!1),[Y,$]=z.useState(!1),[ye,T]=z.useState(!1),[_,le]=z.useState(!1),[R,pe]=z.useState(null),[xe,ce]=z.useState(null),[Re,Te]=z.useState(null),[Ne,He]=z.useState(!1),[Le,Ue]=z.useState(!1),[it,tt]=z.useState(!1),[st,ot]=z.useState(null),[bt,Ye]=z.useState(null),[Ge,We]=z.useState(!1),[we,et]=z.useState(!1),[Se,Ze]=z.useState(()=>Em(b,v)),[mt,re]=z.useState(!1),[ge,Ce]=z.useState(null),[_e,Xe]=z.useState(null),[Ae,ue]=z.useState(!1),[Ee,V]=z.useState(null),[me,je]=z.useState(!1),[Fe,Je]=z.useState(0),[qe,St]=z.useState(!1),Qt=z.useRef(null),Gt=z.useRef(null),Ut=z.useRef(null),yt=z.useRef(!0),Jt=z.useRef(!0),se=z.useMemo(()=>[...o.filter(Ke=>P==="all"?!0:Pb(Ke))].sort((Ke,Ot)=>Hb(Ke,Ot,oe)),[P,oe,o]),Me=z.useMemo(()=>{const ve=new Map;for(const Ke of se)ve.set(Ke.title,(ve.get(Ke.title)??0)+1);return ve},[se]),ze=z.useMemo(()=>o.find(ve=>ve.id===B)??null,[o,B]),nt=z.useMemo(()=>u.filter(ve=>ve.participants.some(Ke=>Ke.id===B)),[u,B]),Xt=z.useMemo(()=>nt.find(ve=>ve.id===Z)??null,[Z,nt]),bn=z.useMemo(()=>ze?d?.directs.find(ve=>ve.id===ze.id)??null:null,[d,ze]),xr=bn?.preview||bn?.timestampLabel?"Open Chat":"Start Chat",$l=bn?.preview||bn?.timestampLabel?bv(bn):ze?`${ze.title} is ready for a direct message.`:"Direct line available.",gr=z.useMemo(()=>Em(b,v),[b,v]),yn=B&&(Re??xe)?.agentId===B?Re??xe:null,Jr=!!(xe?.editable&&yn),br=z.useCallback(ve=>{Te(Ke=>Ke&&ve(Ke)),ot(null)},[]),Hn=z.useMemo(()=>Fb(Re)!==Fb(xe),[Re,xe]),Yt=z.useMemo(()=>{const ve=QS(yn?.capabilitiesText??"");return ve.length>0?ve:ze?.capabilities??[]},[ze?.capabilities,yn?.capabilitiesText]),fn=Ge&&Hn?"Save + Restart":"Restart Agent",Ft=z.useMemo(()=>nz({activeView:e,selectedMessagesThread:f,selectedRelayKind:h,selectedRelayId:y,selectedInterAgentId:B}),[e,B,f,y,h]),Yl=!!(B&&l?.getAgentConfig&&e==="settings"&&Ge),Ol=!!(Ft&&l?.getAgentSession&&(qe||_)),Ql=_e?.agentId===p||_e?.agentId===B?_e:null,ls=Ae&&!Ql;z.useEffect(()=>{if(!i)return;const ve=i.agents,Ke=ve.filter(Bn=>P==="all"?!0:Pb(Bn)).sort((Bn,Aa)=>Hb(Bn,Aa,oe)),Ot=e==="agents"||e==="inter-agent"?Ke:ve;if(!Ot.length){F(null),O(null);return}const vn=Ot.find(Bn=>Bn.threadCount>0)?.id??Ot[0]?.id??null,ni=Ot.some(Bn=>Bn.id===B)?B:vn;ni!==B&&F(ni);const kn=i.threads.filter(Bn=>Bn.participants.some(Aa=>Aa.id===ni)),Ta=kn.some(Bn=>Bn.id===Z)?Z:kn[0]?.id??null;Ta!==Z&&O(Ta)},[e,P,oe,i,B,Z]),z.useEffect(()=>{if(!B){ce(null),Te(null),ot(null),He(!1),w(!1),$(!1),T(!1);return}if(!Yl){He(!1);return}const ve=l;if(!ve?.getAgentConfig){He(!1);return}let Ke=!1;return(async()=>{He(!0);try{const vn=await ve.getAgentConfig(B);if(Ke)return;ce(vn),Te(vn),ot(null),(!bt||bt!==B)&&We(!1)}catch(vn){if(Ke)return;ce(null),Te(null),ot(lt(vn)),We(!1)}finally{Ke||He(!1)}})(),()=>{Ke=!0}},[bt,l,B,Yl]),z.useEffect(()=>{if(!Ft){Xe(null),V(null),je(!1),ue(!1);return}if(!Ol){ue(!1);return}const ve=l;if(!ve?.getAgentSession){ue(!1);return}let Ke=!1;return(async()=>{ue(!0);try{const vn=await ve.getAgentSession(Ft);if(Ke)return;Xe(vn),V(null)}catch(vn){if(Ke)return;Xe(null),V(lt(vn))}finally{Ke||ue(!1)}})(),()=>{Ke=!0}},[Fe,Ft,l,Ol]),z.useEffect(()=>{V(null),je(!1)},[Ft]),z.useEffect(()=>{e!=="agents"&&e!=="messages"&&St(!1)},[e]),z.useEffect(()=>{if(!qe)return;const ve=Ke=>{Ke.key==="Escape"&&St(!1)};return window.addEventListener("keydown",ve),()=>window.removeEventListener("keydown",ve)},[qe]);const Jn=z.useCallback(ve=>ve?ve.scrollHeight-ve.scrollTop-ve.clientHeight<=48:!0,[]),Ll=z.useCallback(ve=>{ve&&(ve.scrollTop=ve.scrollHeight)},[]);z.useEffect(()=>{yt.current=!0,Jt.current=!0},[qe,B]),z.useEffect(()=>{if(!Ft||!Ol)return;const ve=window.setInterval(()=>{Je(Ke=>Ke+1)},qe?1600:2500);return()=>{window.clearInterval(ve)}},[Ft,qe,Ol]),z.useEffect(()=>{if(!me)return;const ve=window.setTimeout(()=>{je(!1)},1500);return()=>{window.clearTimeout(ve)}},[me]),z.useEffect(()=>{if(e!=="settings"||!bt||B!==bt||Ne)return;const ve=Qt.current;if(!ve)return;const Ke=window.requestAnimationFrame(()=>{if(ve.scrollIntoView({block:"center",behavior:"smooth"}),ve.focus(),"value"in ve&&typeof ve.value=="string"){const Ot=ve.value.length;ve.setSelectionRange?.(Ot,Ot)}Ye(Ot=>Ot===bt?null:Ot)});return()=>{window.cancelAnimationFrame(Ke)}},[e,bt,B,Re,Ne]),z.useEffect(()=>{e!=="agents"||!Ge||(We(!1),Ye(null))},[e,Ge]),z.useEffect(()=>{if(!Ql?.body)return;const ve=window.requestAnimationFrame(()=>{yt.current&&Ll(Gt.current),qe&&Jt.current&&Ll(Ut.current)});return()=>window.cancelAnimationFrame(ve)},[qe,Ll,Ql?.agentId,Ql?.body,Ql?.updatedAtLabel]);const ml=z.useCallback(ve=>{F(ve),O(VS(u,ve))},[u]),Dl=z.useCallback((ve,Ke=!1)=>{ml(ve),L("agents"),H(ve),M("settings"),We(Ke),Ye(Ke?ve:null)},[ml,M,H,L]),Ca=z.useCallback(()=>{We(!1),Ye(null)},[]),_l=z.useCallback(()=>{F(null),O(null),We(!1),Ye(null),ot(null)},[]),qt=z.useCallback(()=>{Ze(Em(b,v)),Ce(null),et(!0)},[b,v]),yr=z.useCallback(()=>{(async()=>{try{if(!a?.canPickDirectory||!l?.pickDirectory)return;const ve=await l.pickDirectory();if(!ve)return;Ze(Ke=>({...Ke,projectPath:ve})),Ce(null)}catch(ve){Ce(lt(ve))}})()},[l,a]),vr=z.useCallback(()=>{(async()=>{if(!l?.createAgent){Ce("Desktop bridge is unavailable.");return}const ve=Se.projectPath.trim();if(!ve){Ce("Choose a project path first.");return}re(!0),Ce(null);try{const Ke=await l.createAgent({projectPath:ve,agentName:Se.agentName.trim()||null,harness:Se.harness});if(X(Ke.shellState),q(null),D(`Created ${Ke.agentId}.`),F(Ke.agentId),O(null),M("agents"),et(!1),l.refreshSettingsInventory)try{const Ot=await l.refreshSettingsInventory();E(Ot),(!j||!C)&&N(Ot)}catch{}}catch(Ke){Ce(lt(Ke))}finally{re(!1)}})()},[C,Se,j,l,M,E,N,D,q,X]),Bl=z.useCallback(()=>{M("settings"),L("agents"),B&&H(B),We(!0),B&&Ye(B)},[B,M,H,L]),Xl=z.useCallback(()=>{Te(xe),ot(null),We(!1)},[xe]),Do=z.useCallback(async()=>{if(!(!B||!yn||!l?.updateAgentConfig)){Ue(!0);try{const ve=await l.updateAgentConfig({agentId:B,...i1(yn)});ce(ve),Te(ve),ot("Agent settings saved."),We(!1)}catch(ve){ot(lt(ve))}finally{Ue(!1)}}},[l,B,yn]),as=z.useCallback(async()=>{if(!(!B||!yn||!l?.restartAgent)){tt(!0);try{let ve=yn;Hn&&l.updateAgentConfig&&(Ue(!0),ve=await l.updateAgentConfig({agentId:B,...i1(yn)}),ce(ve),Te(ve),Ue(!1));const Ke=await l.restartAgent({agentId:B,previousSessionId:ze?.sessionId??xe?.runtime.sessionId??null});X(Ke),q(null),ot(`${ze?.title??"Agent"} restarted.`),We(!1)}catch(ve){ot(lt(ve))}finally{Ue(!1),tt(!1)}}},[xe,Hn,l,ze,B,q,X,yn]),ei=z.useCallback(async()=>{if(!(!a?.canOpenNativeSession||!Ft||!l?.openAgentSession))try{await l.openAgentSession(Ft),V(_e?.mode==="tmux"?"Opening tmux session in Terminal.":"Opening session logs.")}catch(ve){V(lt(ve))}},[_e?.mode,Ft,l,a]),rs=z.useCallback(async()=>{if(_e?.commandLabel)try{await gk(_e.commandLabel),je(!0),V("Attach command copied.")}catch(ve){V(lt(ve))}},[_e]),Kl=z.useCallback(()=>{Je(ve=>ve+1)},[]),Il=z.useCallback(()=>{V(null),St(!0),Kl()},[Kl]),Fn=z.useCallback(()=>{St(!1)},[]),Kt=z.useCallback(ve=>{yt.current=Jn(ve.currentTarget)},[Jn]),ti=z.useCallback(ve=>{Jt.current=Jn(ve.currentTarget)},[Jn]);return{selectedInterAgentId:B,selectedInterAgentThreadId:Z,setSelectedInterAgentThreadId:O,agentRosterFilter:P,setAgentRosterFilter:Q,agentRosterSort:oe,setAgentRosterSort:J,agentThreadsExpanded:ee,setAgentThreadsExpanded:w,agentSnapshotExpanded:Y,setAgentSnapshotExpanded:$,agentActivityExpanded:ye,setAgentActivityExpanded:T,agentSessionLogsExpanded:_,setAgentSessionLogsExpanded:le,agentRosterMenu:R,setAgentRosterMenu:pe,selectedInterAgent:ze,rosterInterAgentAgents:se,rosterAgentTitleCounts:Me,visibleInterAgentThreads:nt,selectedInterAgentDirectThread:bn,selectedInterAgentThread:Xt,selectedInterAgentChatActionLabel:xr,selectedAgentDirectLinePreview:$l,isAgentConfigEditing:Ge,visibleAgentConfig:yn,hasEditableAgentConfig:Jr,agentConfigLoading:Ne,agentConfigSaving:Le,agentConfigRestarting:it,agentConfigFeedback:st,agentCapabilitiesPreview:Yt,agentRuntimePathRef:Qt,updateAgentConfigDraft:br,agentConfigDirty:Hn,agentRestartActionLabel:fn,handleSelectInterAgent:ml,handleOpenAgentSettings:Dl,deactivateAgentConfigEdit:Ca,resetAgentInspector:_l,handleStartAgentConfigEdit:Bl,handleCancelAgentConfigEdit:Xl,handleSaveAgentConfig:Do,handleRestartAgent:as,isCreateAgentDialogOpen:we,setIsCreateAgentDialogOpen:et,createAgentDraft:Se,setCreateAgentDraft:Ze,createAgentDefaults:gr,createAgentSubmitting:mt,createAgentFeedback:ge,setCreateAgentFeedback:Ce,handleOpenCreateAgentDialog:qt,handleBrowseCreateAgentProject:yr,handleCreateAgent:vr,visibleAgentSession:Ql,agentSessionPending:ls,agentSessionLoading:Ae,agentSessionFeedback:Ee,agentSessionCopied:me,isAgentSessionPeekOpen:qe,closeAgentSessionPeek:Fn,agentSessionInlineViewportRef:Gt,handleInlineAgentSessionScroll:Kt,agentSessionPeekViewportRef:Ut,handlePeekAgentSessionScroll:ti,handleOpenAgentSession:ei,handleCopyAgentSessionCommand:rs,handlePeekAgentSession:Il,refreshAgentSession:Kl}}async function az(e){if(typeof navigator<"u"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}if(typeof document<"u"){const l=document.createElement("textarea");l.value=e,l.setAttribute("readonly","true"),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select();const a=document.execCommand("copy");if(document.body.removeChild(l),a)return}throw new Error("Clipboard unavailable.")}function rz({activeView:e,settingsSection:l,scoutDesktop:a,surfaceCaps:i,pendingBrokerInspectorFocus:o,setPendingBrokerInspectorFocus:u,relayServiceInspectorRef:d,loadShellState:f,setShellState:p,setShellError:h,applyRestartedOnboardingSettings:y,commitPairingState:b,pairingState:v,setAppSettingsFeedback:j,setRelayFeedback:C,setPairingError:E,setPairingConfigFeedback:N}){const[M,L]=z.useState(null),[H,X]=z.useState(null),[q,D]=z.useState(null),[B,F]=z.useState(null),[Z,O]=z.useState(!1),[P,Q]=z.useState(null),[oe,J]=z.useState(!1),[ee,w]=z.useState(null),[Y,$]=z.useState(!1),[ye,T]=z.useState(null),[_,le]=z.useState(""),[R,pe]=z.useState(null),[xe,ce]=z.useState(null),[Re,Te]=z.useState(null),[Ne,He]=z.useState(!1),[Le,Ue]=z.useState(null),[it,tt]=z.useState(""),[st,ot]=z.useState(""),[bt,Ye]=z.useState(0),Ge=M?.sources??[],We=z.useMemo(()=>{const ue=st.trim().toLowerCase();return ue?Ge.filter(Ee=>Ee.title.toLowerCase().includes(ue)||Ee.subtitle.toLowerCase().includes(ue)):Ge},[st,Ge]),we=Ge.find(ue=>ue.id===H)??null,et=z.useCallback(()=>{Ye(ue=>ue+1)},[]),Se=z.useCallback(()=>{J(!0),Te(null)},[]),Ze=z.useCallback(ue=>{J(ue),ue||Te(null)},[]),mt=z.useCallback(async()=>{if(!a?.getBrokerInspector)return F(null),null;try{const ue=await a.getBrokerInspector();return F(ue),ue}catch{return F(null),null}},[a]),re=z.useCallback(async ue=>{if(!a?.getFeedbackBundle)return T("Feedback diagnostics are unavailable in this build."),null;ue?.showSpinner&&$(!0);try{const Ee=await a.getFeedbackBundle();return w(Ee),T(null),Ee}catch(Ee){return T(lt(Ee)),null}finally{ue?.showSpinner&&$(!1)}},[a]);z.useEffect(()=>{if(e!=="logs")return;if(!a?.getLogCatalog){L(null),Ue("Logs are unavailable in the current desktop bridge. Restart the app so the latest desktop bridge is loaded.");return}let ue=!1;return(async()=>{try{const V=await a.getLogCatalog();if(ue)return;L(V),X(me=>me&&V.sources.some(je=>je.id===me)?me:V.defaultSourceId??V.sources[0]?.id??null),V.sources.length===0&&Ue("No log sources available.")}catch(V){ue||Ue(lt(V))}})(),()=>{ue=!0}},[e,a]),z.useEffect(()=>{if(e!=="logs"||!H)return;if(!a?.readLogSource){D(null);return}let ue=!1;return(!q||q.sourceId!==H)&&He(!0),Ue(null),(async()=>{try{const V=await a.readLogSource({sourceId:H,tailLines:500});if(ue)return;D(V),Ue(null)}catch(V){ue||(D(null),Ue(lt(V)))}finally{ue||He(!1)}})(),()=>{ue=!0}},[e,bt,a,H]),z.useEffect(()=>{e!=="settings"||l!=="communication"||mt()},[e,bt,mt,l]),z.useEffect(()=>{if(!o||e!=="settings"||l!=="communication")return;const ue=window.setTimeout(()=>{d.current?.scrollIntoView({behavior:"smooth",block:"start"}),u(!1)},40);return()=>{window.clearTimeout(ue)}},[e,o,d,l,B]),z.useEffect(()=>{if(e!=="logs")return;const ue=window.setInterval(()=>{Ye(Ee=>Ee+1)},2500);return()=>{window.clearInterval(ue)}},[e]),z.useEffect(()=>{oe&&re({showSpinner:!0})},[oe,re]);const ge=z.useCallback(async ue=>{if(!(!i?.canManageBroker||!a?.controlBroker)){O(!0),Q(null);try{const Ee=await a.controlBroker(ue);p(Ee),h(null),await mt(),Q(ue==="start"?"Relay started.":ue==="stop"?"Relay stopped.":"Relay restarted.")}catch(Ee){Q(lt(Ee))}finally{O(!1)}}},[mt,a,h,p,i]),Ce=z.useCallback(()=>{(async()=>{ce("refresh"),Te(null);try{await re({showSpinner:!0}),Te("Support details refreshed.")}finally{ce(null)}})()},[re]),_e=z.useCallback(()=>{(async()=>{if(!ee?.text){Te("Support bundle is still loading.");return}ce("copy"),Te(null);try{await az(ee.text),Te("Support bundle copied.")}catch(ue){Te(lt(ue))}finally{ce(null)}})()},[ee?.text]),Xe=z.useCallback(()=>{(async()=>{if(!a?.submitFeedbackReport){Te("Feedback submission is unavailable in this build.");return}const ue=_.trim();if(!ue){Te("Add a short description before submitting.");return}ce("submit"),Te(null);try{const Ee=await a.submitFeedbackReport({message:ue});pe(Ee),le(""),Te(`Feedback submitted as ${Ee.key}.`)}catch(Ee){Te(lt(Ee))}finally{ce(null)}})()},[_,a]),Ae=z.useCallback(()=>{(async()=>{const ue=[];ce("repair"),Te(null);try{if(a?.restartOnboarding){const Ee=await a.restartOnboarding();y(Ee)}else ue.push("Onboarding reset unavailable.");if(j(null),C(null),E(null),N(null),Q(null),Ue(null),i?.canManageBroker&&a?.controlBroker)try{const Ee=await a.controlBroker(B?.installed?"restart":"start");p(Ee),h(null)}catch(Ee){ue.push(`Relay: ${lt(Ee)}`)}if(a?.controlPairingService)try{const Ee=await a.controlPairingService(v?.isRunning?"restart":"start");b(Ee)}catch(Ee){ue.push(`Pairing: ${lt(Ee)}`)}try{await mt()}catch(Ee){ue.push(`Broker diagnostics: ${lt(Ee)}`)}if(a?.refreshPairingState)try{const Ee=await a.refreshPairingState();b(Ee)}catch(Ee){ue.push(`Pairing refresh: ${lt(Ee)}`)}await f(!1),await re(),Te(ue.length>0?`Repair finished with notes: ${ue.join(" · ")}`:"Setup repaired. Onboarding was reset and local services were refreshed.")}catch(Ee){Te(lt(Ee))}finally{ce(null)}})()},[y,B?.installed,b,re,f,v?.isRunning,mt,a,j,N,E,C,h,p,i]);return{logCatalog:M,logSources:Ge,filteredLogSources:We,selectedLogSourceId:H,setSelectedLogSourceId:X,selectedLogSource:we,logContent:q,brokerInspector:B,brokerControlPending:Z,brokerControlFeedback:P,isFeedbackDialogOpen:oe,feedbackBundle:ee,feedbackBundleLoading:Y,feedbackBundleError:ye,feedbackDraft:_,setFeedbackDraft:le,feedbackSubmission:R,feedbackActionPending:xe,feedbackActionMessage:Re,logsLoading:Ne,logsFeedback:Le,logSearchQuery:it,setLogSearchQuery:tt,logSourceQuery:st,setLogSourceQuery:ot,refreshLogs:et,refreshBrokerInspector:mt,openFeedbackDialog:Se,handleFeedbackDialogOpenChange:Ze,handleBrokerControl:ge,handleRefreshFeedbackBundle:Ce,handleCopyFeedbackBundle:_e,handleSubmitFeedbackReport:Xe,handleRepairSetup:Ae}}function iz({pairingEnabled:e,scoutDesktop:l,setRelayFeedback:a}){const[i,o]=z.useState(null),[u,d]=z.useState(!1),[f,p]=z.useState(null),[h,y]=z.useState(!1),[b,v]=z.useState(!1),[j,C]=z.useState(null),[E,N]=z.useState(null),M=z.useRef(null),L=z.useRef(0);z.useEffect(()=>{M.current=i},[i]),z.useEffect(()=>{e||(o(null),d(!1),p(null),y(!1),v(!1),C(null),N(null))},[e]);const H=z.useCallback(Z=>{o(O=>DT(O,Z)?O:Z)},[]),X=z.useCallback(async(Z,O)=>{if(!e||!Z)return null;const P=++L.current;O?.showLoading&&d(!0);try{const Q=await Z();return L.current!==P||(H(Q),p(null)),Q}catch(Q){if(L.current===P&&p(lt(Q)),O?.throwOnError)throw Q;return null}finally{O?.showLoading&&L.current===P&&d(!1)}},[H,e]);z.useEffect(()=>{if(!e||!l?.getPairingState)return;X(()=>l.getPairingState(),{showLoading:M.current===null});const Z=window.setInterval(()=>{X(()=>l.getPairingState())},5e3);return()=>{window.clearInterval(Z)}},[e,l,X]);const q=z.useCallback(async()=>e?l?.refreshPairingState?X(()=>l.refreshPairingState(),{throwOnError:!0}):X(l?.getPairingState?()=>l.getPairingState():void 0,{throwOnError:!0}):null,[e,l,X]),D=z.useCallback(async Z=>{if(l?.controlPairingService){y(!0);try{const O=await l.controlPairingService(Z);H(O),p(null),a(Z==="start"?"Pairing started.":Z==="stop"?"Pairing stopped.":"Pairing restarted.")}catch(O){p(lt(O))}finally{y(!1)}}},[H,l,a]),B=z.useCallback(async Z=>{if(l?.updatePairingConfig){v(!0),N(null);try{const O=await l.updatePairingConfig(Z);H(O),p(null),N("Pairing settings saved.")}catch(O){const P=lt(O);throw N(P),O}finally{v(!1)}}},[H,l]),F=z.useCallback(async(Z,O)=>{if(!l?.decidePairingApproval)return;const P=`${Z.sessionId}:${Z.turnId}:${Z.blockId}:${O}`;C(P);try{const Q=await l.decidePairingApproval({sessionId:Z.sessionId,turnId:Z.turnId,blockId:Z.blockId,version:Z.version,decision:O});H(Q),p(null),a(O==="approve"?"Approval sent.":"Action denied.")}catch(Q){p(lt(Q))}finally{C(Q=>Q===P?null:Q)}},[H,l,a]);return{pairingState:i,pairingLoading:u,pairingError:f,setPairingError:p,pairingControlPending:h,pairingConfigPending:b,pairingApprovalPendingId:j,pairingConfigFeedback:E,setPairingConfigFeedback:N,pendingApprovals:i?.pendingApprovals??[],commitPairingState:H,refreshPairingState:q,handlePairingControl:D,handleUpdatePairingConfig:B,handleDecidePairingApproval:F}}const s1={favorites:[],quickHits:[],preparedAt:null};function sz({activeView:e,scoutDesktop:l,sessions:a}){const[i,o]=z.useState(null),[u,d]=z.useState(!1),[f,p]=z.useState(!1),[h,y]=z.useState(null),[b,v]=z.useState(null),[j,C]=z.useState(null),E=z.useRef(null),N=z.useRef(0);z.useEffect(()=>{E.current=i},[i]),z.useEffect(()=>{if(e!=="sessions"||!l?.getPhonePreparation)return;let J=!1;return(async()=>{d(!0);try{const w=await l.getPhonePreparation();if(J)return;o(w),y(null)}catch(w){if(J)return;o(null),y(lt(w))}finally{J||d(!1)}})(),()=>{J=!0}},[e,l]);const M=i??s1,L=z.useMemo(()=>new Map(a.map(J=>[J.id,J])),[a]),H=z.useMemo(()=>[...a].sort((J,ee)=>new Date(ee.lastModified).getTime()-new Date(J.lastModified).getTime()||ee.messageCount-J.messageCount||J.title.localeCompare(ee.title)),[a]),X=z.useMemo(()=>M.favorites.map(J=>L.get(J)).filter(J=>!!J),[M.favorites,L]),q=z.useMemo(()=>M.quickHits.filter(J=>!M.favorites.includes(J)).map(J=>L.get(J)).filter(J=>!!J),[M.favorites,M.quickHits,L]),D=z.useCallback(async(J,ee)=>{if(!l?.updatePhonePreparation){y("Phone preparation is unavailable in this build.");return}const w=++N.current,Y=E.current;o(J),p(!0);try{const $=await l.updatePhonePreparation(J);if(N.current!==w)return;o($),ee?y(ee):ee===null&&y(null)}catch($){if(N.current!==w)return;o(Y),y(lt($))}finally{N.current===w&&(p(!1),v(null),C(null))}},[l]),B=z.useCallback((J,ee)=>{const w=J(E.current??s1);D(w,ee)},[D]),F=z.useCallback(()=>{const J=M.favorites.filter(w=>L.has(w)),ee=H.map(w=>w.id).filter(w=>!J.includes(w)).slice(0,8);D({favorites:J,quickHits:ee,preparedAt:Date.now()},`Prepared ${J.length+ee.length} phone picks.`)},[D,M.favorites,H,L]),Z=z.useCallback(()=>{B(J=>({...J,quickHits:[],preparedAt:Date.now()}),"Cleared My List. Favorites stayed pinned.")},[B]),O=z.useCallback((J,ee)=>{B(w=>ee==="favorites"?{favorites:w.favorites.includes(J)?w.favorites:[...w.favorites,J],quickHits:w.quickHits.filter(Y=>Y!==J),preparedAt:Date.now()}:w.favorites.includes(J)||w.quickHits.includes(J)?{...w,preparedAt:Date.now()}:{...w,quickHits:[...w.quickHits,J],preparedAt:Date.now()},ee==="favorites"?"Pinned for phone.":"Added to My List.")},[B]),P=z.useCallback((J,ee)=>{B(w=>({favorites:ee==="favorites"?w.favorites.filter(Y=>Y!==J):w.favorites,quickHits:ee==="quickHits"?w.quickHits.filter(Y=>Y!==J):w.quickHits,preparedAt:Date.now()}),ee==="favorites"?"Removed from phone favorites.":"Removed from My List.")},[B]),Q=z.useCallback(()=>{b&&O(b,"favorites")},[b,O]),oe=z.useCallback(J=>{b&&B(ee=>{if(ee.favorites.includes(b))return{...ee,preparedAt:Date.now()};const w=ee.quickHits.filter($=>$!==b),Y=typeof J=="number"?Math.max(0,Math.min(J,w.length)):w.length;return w.splice(Y,0,b),{...ee,quickHits:w,preparedAt:Date.now()}},j==="quickHits"?"Reordered My List.":"Added to My List.")},[j,b,B]);return{phonePreparationState:M,phonePreparationLoading:u,phonePreparationSaving:f,phonePreparationFeedback:h,setDraggedSessionId:v,setDraggedPhoneSection:C,favoritePhoneSessions:X,quickHitPhoneSessions:q,handlePreparePhone:F,handleClearPhoneQuickHits:Z,handleDropIntoFavorites:Q,handleDropIntoQuickHits:oe,handleRemoveSessionFromPhoneSection:P,handleAddSessionToPhoneSection:O}}function oz({activeView:e,setActiveView:l,desktopFeatures:a,styles:i,colorTheme:o,sidebarWidth:u,messagesDetailWidth:d,isCollapsed:f,onResizeStart:p,onMessagesDetailResizeStart:h,stats:y,runtime:b,shellState:v,shellError:j,plansState:C,machinesState:E,messagesState:N,interAgentState:M,interAgentAgents:L,interAgentAgentLookup:H,relayDirectLookup:X,homeAgents:q,homeActivity:D,activityRecentMessages:B,activityTasks:F,activityLeadTask:Z,activityFindings:O,activityEndpoints:P,overviewSessions:Q,inboxAlertCount:oe,pendingApprovalsCount:J,inboxFailedTaskCount:ee,inboxAwaitingYouItems:w,availableAgentNames:Y,searchQuery:$,setSearchQuery:ye,filteredSessions:T,selectedSession:_,setSelectedSession:le,isLoadingMessagesWorkspace:R,isLoadingShell:pe,showAnnotations:xe,setShowAnnotations:ce,messagesDetailOpen:Re,setMessagesDetailOpen:Te,messagesDetailTab:Ne,setMessagesDetailTab:He,formatDate:Le,onRefreshShell:Ue,openAgentProfile:it,openSessionDetail:tt,handleSelectSearchSession:st,handleToggleVoiceCapture:ot,handleSetVoiceRepliesEnabled:bt,selectMessageThread:Ye,renderLocalPathValue:Ge,selectedInterAgentActivityMessages:We,selectedInterAgentInboundTasks:we,selectedInterAgentOutboundFindings:et,selectedInterAgentFindings:Se,interAgentThreadTitle:Ze,selectedInterAgentThreadSubtitle:mt,interAgentConfigureTarget:re,interAgentConfigureLabel:ge,interAgentMessageTarget:Ce,visibleInterAgentMessages:_e,relayVoiceState:Xe,messagesController:Ae,agentController:ue,diagnosticsController:Ee,phonePreparationController:V,overviewBootLoader:me}){const je={sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,activePill:i.activePill},Fe=N??{title:"Messages",subtitle:R||pe?"Loading relay workspace":j??"Broker unavailable",lastUpdatedLabel:b?.updatedAtLabel??null,threads:[]};return{overviewInboxActivityViewProps:{activeView:e,overviewViewProps:{C:o,s:i,bootLoader:me,homeAgents:q,activity:D,shellError:j,onRefresh:Ue,onOpenAgent:it,colorForIdentity:dl},inbox:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:je,inboxAlertCount:oe,pendingApprovalsCount:J,inboxFailedTaskCount:ee,inboxAwaitingYouItems:w},activity:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:je,plansState:C,machinesState:E,runtime:b,activityLeadTask:Z,activityTasks:F,activityFindings:O,activityEndpoints:P,activityRecentMessages:B,interAgentAgentLookup:H,overviewSessions:Q,formatDate:Le,onRefresh:Ue,onOpenPlans:()=>l("plans"),onOpenMessages:()=>l("messages"),onOpenAgentProfile:it,onOpenSessionDetail:tt}},opsViewsProps:{activeView:e,machinesViewProps:{machinesState:E??{title:"Machines",subtitle:"Broker unavailable",totalMachines:0,onlineCount:0,degradedCount:0,offlineCount:0,lastUpdatedLabel:null,machines:[]},C:o,s:i,isCollapsed:f,sidebarWidth:u,onResizeStart:p,onOpenRelayAgent:Ae.openDirectConversation,onRefresh:Ue,identityColor:dl},plansViewProps:{plansState:C??{title:"Plans",subtitle:"No broker snapshot yet",taskCount:0,runningTaskCount:0,failedTaskCount:0,completedTaskCount:0,findingCount:0,warningCount:0,errorCount:0,planCount:0,workspaceCount:0,lastUpdatedLabel:null,tasks:[],findings:[],plans:[]},C:o,s:i,isCollapsed:f,sidebarWidth:u,onResizeStart:p,onOpenRelayAgent:Ae.openDirectConversation,onRefresh:Ue,identityColor:dl},search:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:{sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,activeItem:i.activeItem,kbd:i.kbd},availableAgentNames:Y,searchQuery:$,setSearchQuery:ye,filteredSessions:T,stats:{totalSessions:y.totalSessions,totalMessages:y.totalMessages},formatDate:Le,onOpenSession:st}},agentViewsProps:{activeView:e,layout:{isCollapsed:f,sidebarWidth:u,onResizeStart:p,styles:{sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,activePill:i.activePill,activeItem:i.activeItem,annotBadge:i.annotBadge}},roster:{interAgentStateTitle:M?.title??"Inter-Agent",interAgentStateSubtitle:M?.subtitle??"Agent-to-agent traffic",rosterInterAgentAgents:ue.rosterInterAgentAgents,interAgentAgents:L,selectedInterAgentId:ue.selectedInterAgentId,onSelectInterAgent:ue.handleSelectInterAgent,agentRosterMenu:ue.agentRosterMenu,setAgentRosterMenu:ue.setAgentRosterMenu,agentRosterFilter:ue.agentRosterFilter,setAgentRosterFilter:ue.setAgentRosterFilter,agentRosterSort:ue.agentRosterSort,setAgentRosterSort:ue.setAgentRosterSort,rosterAgentTitleCounts:ue.rosterAgentTitleCounts,onRefresh:Ue},agents:{selectedInterAgent:ue.selectedInterAgent,selectedInterAgentDirectThread:ue.selectedInterAgentDirectThread,selectedInterAgentChatActionLabel:ue.selectedInterAgentChatActionLabel,onOpenAgentThread:Ae.openDirectConversation,onPeekAgentSession:ue.handlePeekAgentSession,onOpenAgentSettings:ue.handleOpenAgentSettings,visibleAgentSession:ue.visibleAgentSession,agentSessionPending:ue.agentSessionPending,agentSessionLoading:ue.agentSessionLoading,agentSessionFeedback:ue.agentSessionFeedback,agentSessionCopied:ue.agentSessionCopied,onCopyAgentSessionCommand:()=>{ue.handleCopyAgentSessionCommand()},onOpenAgentSession:()=>{ue.handleOpenAgentSession()},agentSessionLogsExpanded:ue.agentSessionLogsExpanded,setAgentSessionLogsExpanded:ue.setAgentSessionLogsExpanded,agentSessionInlineViewportRef:ue.agentSessionInlineViewportRef,onInlineAgentSessionScroll:ue.handleInlineAgentSessionScroll,renderLocalPathValue:Ge,selectedInterAgentActivityMessages:We,interAgentAgentLookup:H,relayDirectLookup:X,onOpenAgentProfile:it,onNudgeMessage:Ae.nudgeMessage,selectedInterAgentInboundTasks:we,selectedInterAgentOutboundFindings:et,selectedInterAgentFindings:Se,agentActivityExpanded:ue.agentActivityExpanded,setAgentActivityExpanded:ue.setAgentActivityExpanded,agentThreadsExpanded:ue.agentThreadsExpanded,setAgentThreadsExpanded:ue.setAgentThreadsExpanded,visibleInterAgentThreads:ue.visibleInterAgentThreads,selectedInterAgentThreadId:ue.selectedInterAgentThreadId,onOpenThreadInTrafficView:Je=>{ue.setSelectedInterAgentThreadId(Je),l("inter-agent")},selectedAgentDirectLinePreview:ue.selectedAgentDirectLinePreview,agentSnapshotExpanded:ue.agentSnapshotExpanded,setAgentSnapshotExpanded:ue.setAgentSnapshotExpanded,visibleAgentConfig:ue.visibleAgentConfig},logs:{logSources:Ee.logSources,filteredLogSources:Ee.filteredLogSources,selectedLogSourceId:Ee.selectedLogSourceId,setSelectedLogSourceId:Ee.setSelectedLogSourceId,selectedLogSource:Ee.selectedLogSource,logCatalog:Ee.logCatalog,logContent:Ee.logContent,logsLoading:Ee.logsLoading,logsFeedback:Ee.logsFeedback,logSearchQuery:Ee.logSearchQuery,setLogSearchQuery:Ee.setLogSearchQuery,logSourceQuery:Ee.logSourceQuery,setLogSourceQuery:Ee.setLogSourceQuery},interAgent:{selectedInterAgent:ue.selectedInterAgent,visibleInterAgentThreads:ue.visibleInterAgentThreads,selectedInterAgentThreadId:ue.selectedInterAgentThreadId,setSelectedInterAgentThreadId:ue.setSelectedInterAgentThreadId,interAgentThreadTitle:Ze,selectedInterAgentThread:ue.selectedInterAgentThread,selectedInterAgentThreadSubtitle:mt,selectedRelayDirectThread:Ae.selectedDirectConversation,showAnnotations:xe,setShowAnnotations:ce,interAgentMessageTarget:Ce,openAgentDirectMessage:Ae.openAgentDirectMessage,interAgentConfigureTarget:re,onOpenAgentSettings:ue.handleOpenAgentSettings,interAgentConfigureLabel:ge,visibleInterAgentMessages:_e,interAgentAgentLookup:H,relayDirectLookup:X,onOpenAgentProfile:it,onNudgeMessage:Ae.nudgeMessage},sessions:{searchQuery:$,setSearchQuery:ye,filteredSessions:T,stats:{totalSessions:y.totalSessions},onRefresh:Ue,loadingSessions:pe&&!v,selectedSession:_,setSelectedSession:le,phonePreparationState:V.phonePreparationState,phonePreparationLoading:V.phonePreparationLoading,phonePreparationSaving:V.phonePreparationSaving,phonePreparationFeedback:V.phonePreparationFeedback,setDraggedSessionId:V.setDraggedSessionId,setDraggedPhoneSection:V.setDraggedPhoneSection,favoritePhoneSessions:V.favoritePhoneSessions,quickHitPhoneSessions:V.quickHitPhoneSessions,formatDate:Le,onClearPhoneQuickHits:V.handleClearPhoneQuickHits,onDropIntoFavorites:V.handleDropIntoFavorites,onDropIntoQuickHits:V.handleDropIntoQuickHits,onRemoveSessionFromPhoneSection:V.handleRemoveSessionFromPhoneSection,onAddSessionToPhoneSection:V.handleAddSessionToPhoneSection}},messagesRelayViewProps:{activeView:e,layout:{sidebarWidth:u,messagesDetailWidth:d,isCollapsed:f,onResizeStart:p,onMessagesDetailResizeStart:h,styles:{sidebar:i.sidebar,surface:i.surface,inkText:i.inkText,mutedText:i.mutedText,tagBadge:i.tagBadge,annotBadge:i.annotBadge,activeItem:i.activeItem,activePill:i.activePill,kbd:i.kbd}},threading:{messagesState:Fe,messageThreads:Ae.messageThreads,selectedMessagesThread:Ae.selectedMessagesThread,onSelectMessageThread:Ye,showAnnotations:xe,setShowAnnotations:ce,onRefresh:Ue,loadingWorkspace:(R||pe)&&!N,selectedMessagesInternalThread:Ae.selectedMessagesInternalThread,selectedMessagesInternalMessages:Ae.selectedMessagesInternalMessages,selectedMessagesInternalTarget:Ae.selectedMessagesInternalTarget,selectedMessagesDetailAgentId:Ae.selectedMessagesDetailAgentId,selectedMessagesDetailAgent:Ae.selectedMessagesDetailAgent,selectedMessagesSessions:Ae.selectedMessagesSessions,selectedSession:_,setSelectedSession:le,formatDate:Le,interAgentAgents:L,interAgentAgentLookup:H,relayDirectLookup:X,openAgentProfile:it,openAgentDirectMessage:Ae.openAgentDirectMessage,onNudgeMessage:Ae.nudgeMessage,messagesDetailOpen:Re,setMessagesDetailOpen:Te,messagesDetailTab:Ne,setMessagesDetailTab:He},composer:{selectedRelayKind:Ae.selectedConversationKind,selectedRelayId:Ae.selectedConversationId,relayThreadTitle:Ae.currentConversationTitle,relayThreadSubtitle:Ae.currentConversationSubtitle,relayThreadCount:Ae.currentConversationCount,selectedRelayDirectThread:Ae.selectedDirectConversation,relayVoiceState:Xe,visibleRelayMessages:Ae.visibleConversationMessages,relayTimelineViewportRef:Ae.timelineViewportRef,onRelayTimelineScroll:Ae.handleConversationTimelineScroll,relayReplyTarget:Ae.replyTarget,setRelayReplyTarget:Ae.setReplyTarget,relayContextReferences:Ae.contextReferences,relayContextMessageIds:Ae.contextMessageIds,setRelayContextMessageIds:Ae.setContextMessageIds,relayComposerRef:Ae.composerRef,relayDraft:Ae.composerDraft,setRelayDraft:Ae.setComposerDraft,relaySending:Ae.composerSending,relayFeedback:Ae.messagesFeedback,relayComposerSelectionStart:Ae.composerSelectionStart,setRelayComposerSelectionStart:Ae.setComposerSelectionStart,mergedRelayMessages:Ae.mergedConversationMessages,relayMentionMenuOpen:Ae.mentionMenuOpen,relayMentionSuggestions:Ae.mentionSuggestions,relayMentionSelectionIndex:Ae.mentionSelectionIndex,setRelayMentionSelectionIndex:Ae.setMentionSelectionIndex,relayMentionDuplicateTitleCounts:Ae.mentionDuplicateTitleCounts,applyRelayMentionSuggestion:Ae.applyMentionSuggestion,onRelaySend:()=>{Ae.sendMessage()},onToggleVoiceCapture:ot,onSetVoiceRepliesEnabled:Je=>{bt(Je)}},agentSession:{visibleAgentSession:ue.visibleAgentSession,agentSessionPending:ue.agentSessionPending,agentSessionFeedback:ue.agentSessionFeedback,agentSessionCopied:ue.agentSessionCopied,onCopyAgentSessionCommand:()=>{ue.handleCopyAgentSessionCommand()},onOpenAgentSession:()=>{ue.handleOpenAgentSession()},onPeekAgentSession:ue.handlePeekAgentSession,onOpenAgentSettings:ue.handleOpenAgentSettings,desktopVoiceEnabled:a.voice}}}}function cz({activeView:e,setActiveView:l,settingsSection:a,setSettingsSection:i,settingsAgentId:o,setSettingsAgentId:u,settingsSections:d,activeSettingsMeta:f,desktopFeatures:p,stats:h,runtime:y,relayState:b,relayRuntimeBooting:v,relayRuntimeHealthLabel:j,reachableRelayAgentCount:C,dark:E,setDark:N,showAnnotations:M,setShowAnnotations:L,isCollapsed:H,styles:X,scoutDesktop:q,surfaceCaps:D,interAgentAgents:B,openKnowledgeBase:F,openAgentProfile:Z,openDirectConversation:O,renderOnboardingCommandShell:P,renderLocalPathValue:Q,settingsOperatorNameRef:oe,relayServiceInspectorRef:J,handleSetVoiceRepliesEnabled:ee,settingsController:w,diagnosticsController:Y,agentController:$}){const[ye,T]=z.useState(null),[_,le]=z.useState(""),[R,pe]=z.useState("all"),[xe,ce]=z.useState("grid"),Re=z.useMemo(()=>w.agentableProjects.find(Se=>Se.id===ye)??null,[ye,w.agentableProjects]),Te=Re,Ne=z.useMemo(()=>Te?B.find(Se=>Se.id===Te.id||Se.id===Te.definitionId)??null:null,[B,Te]),He=z.useMemo(()=>w.agentableProjects.map(Se=>{const Ze=B.find(ge=>ge.id===Se.id||ge.id===Se.definitionId)??null,mt=!!Ze||Se.registrationKind==="configured",re=Se.harnesses[0]?.harness??Se.defaultHarness;return{project:Se,linkedAgent:Ze,isBound:mt,primaryHarness:re,pathLabel:Zr(Se.root)??Se.root,branchLabel:"local",activityLabel:Ze?.timestampLabel??"Workspace",statusLabel:mt?"Bound":Se.registrationKind==="configured"?"Ready":"Discovered"}}),[B,w.agentableProjects]),Le=z.useMemo(()=>{const Se=_.trim().toLowerCase();return He.filter(({project:Ze,isBound:mt,primaryHarness:re})=>(R==="all"?!0:R==="bound"?mt:!mt)?Se?[Ze.title,Ze.projectName,Ze.root,Ze.relativePath,re].some(Ce=>Ce.toLowerCase().includes(Se)):!0:!1)},[R,He,_]),Ue=z.useMemo(()=>He.filter(Se=>Se.isBound).length,[He]),it=z.useMemo(()=>He.filter(Se=>!Se.isBound).length,[He]),tt=z.useMemo(()=>o?B.find(Se=>Se.id===o)??null:null,[B,o]),st=$.selectedInterAgent?.id===o,ot=st?$.selectedInterAgent:tt,bt=z.useCallback(Se=>{i(Se),u(null)},[u,i]);z.useEffect(()=>{ye&&(w.agentableProjects.some(Se=>Se.id===ye)||T(null))},[ye,w.agentableProjects]);const Ye=z.useCallback(Se=>{T(Se.id),$.resetAgentInspector()},[$]),Ge=z.useCallback(Se=>{if(Se.registrationKind==="configured"){Z(Se.id);return}Ye(Se)},[Ye,Z]),We=z.useCallback(()=>{l("settings"),i("profile"),w.handleBeginGeneralEdit(),w.setAppSettingsFeedback("Add a scan folder below, then go back to Workspaces and refresh to discover workspaces.")},[l,i,w]),we=z.useCallback(Se=>{w.handleRetireProject(Se.root,Se.title).then(Ze=>{!Ze||Re?.root!==Se.root||(T(null),$.resetAgentInspector())})},[$,Re?.root,w]),et=a==="profile"?r.jsxs(r.Fragment,{children:[w.isAppSettingsEditing?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>w.handleCancelAppSettingsEdit(),disabled:w.appSettingsSaving,children:"Cancel"}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{w.handleSaveAppSettings()},disabled:!w.appSettingsDirty||w.appSettingsSaving||w.appSettingsLoading,children:w.appSettingsSaving?"Saving…":"Save General"})]}):r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>w.handleStartAppSettingsEdit(),disabled:w.appSettingsLoading||!w.visibleAppSettings,children:"Edit General"}),r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:w.handleRestartOnboarding,disabled:w.appSettingsLoading||!w.visibleAppSettings,children:[r.jsx(gn,{size:12}),"Restart onboarding"]})]}):a==="communication"?w.isAppSettingsEditing?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>w.handleCancelAppSettingsEdit(),disabled:w.appSettingsSaving,children:"Cancel"}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{w.handleSaveAppSettings()},disabled:!w.appSettingsDirty||w.appSettingsSaving||w.appSettingsLoading,children:w.appSettingsSaving?"Saving…":p.telegram?"Save Telegram":"Save Communication"})]}):r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>w.handleStartAppSettingsEdit(),disabled:w.appSettingsLoading||!w.visibleAppSettings,children:p.telegram?"Edit Telegram":"Edit Communication"}):a==="agents"?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>l("agents"),children:"Open Agents"}),ot&&st&&$.hasEditableAgentConfig?$.isAgentConfigEditing?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>$.handleCancelAgentConfigEdit(),disabled:$.agentConfigSaving||$.agentConfigRestarting,children:"Cancel"}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{$.handleSaveAgentConfig()},disabled:!$.agentConfigDirty||$.agentConfigLoading||$.agentConfigSaving||$.agentConfigRestarting,children:$.agentConfigSaving?"Saving…":"Save Changes"})]}):r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>$.handleStartAgentConfigEdit(),disabled:!o||$.agentConfigLoading||$.agentConfigRestarting,children:"Edit Agent"}):null,ot&&st&&$.hasEditableAgentConfig?r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded disabled:opacity-50",style:{color:g.ink},onClick:()=>{$.handleRestartAgent()},disabled:$.agentConfigLoading||$.agentConfigRestarting||!$.visibleAgentConfig,children:$.agentConfigRestarting?"Restarting…":$.agentRestartActionLabel}):null]}):a==="database"?r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>l("sessions"),children:"Browse Sessions"}):null;return{activeView:e,help:{styles:X,buildOnboardingCommandLine:w.buildOnboardingCommandLine,onboardingCopiedCommand:w.onboardingCopiedCommand,onboardingCommandPending:w.onboardingCommandPending,onCopyOnboardingCommand:w.handleCopyOnboardingCommand,onRunOnboardingCommand:w.handleRunOnboardingCommand,onOpenGeneralSettings:()=>{l("settings"),i("profile")}},settings:{styles:X,settingsSection:a,settingsSections:d,activeSettingsMeta:f,onSetSettingsSection:bt,onOpenFeedbackDialog:Y.openFeedbackDialog,headerActions:et,profile:{styles:X,visibleAppSettings:w.visibleAppSettings,appSettings:w.appSettings,isAppSettingsEditing:w.isAppSettingsEditing,appSettingsSaving:w.appSettingsSaving,appSettingsLoading:w.appSettingsLoading,appSettingsDirty:w.appSettingsDirty,appSettingsFeedback:w.appSettingsFeedback,settingsOperatorNameRef:oe,onboardingWizardStep:w.onboardingWizardStep,setOnboardingWizardStep:w.setOnboardingWizardStep,activeOnboardingStepIndex:w.onboardingWizardIndex,activeOnboardingStep:w.activeOnboardingStep,onboardingWizardSteps:w.onboardingWizardSteps,sourceRootPathSuggestions:w.SOURCE_ROOT_PATH_SUGGESTIONS,onboardingRuntimeMatch:w.onboardingRuntimeMatch,onboardingHasProjectConfig:w.onboardingHasProjectConfig,onboardingCopiedCommand:w.onboardingCopiedCommand,onboardingCommandPending:w.onboardingCommandPending,onboardingCommandResult:w.onboardingCommandResult,canGoToPreviousOnboardingStep:w.canGoToPreviousOnboardingStep,canGoToNextOnboardingStep:w.canGoToNextOnboardingStep,moveOnboardingWizard:w.moveOnboardingWizard,handleOnboardingContinue:w.handleOnboardingContinue,handleRestartOnboarding:w.handleRestartOnboarding,handleStartAppSettingsEdit:w.handleStartAppSettingsEdit,handleBeginGeneralEdit:w.handleBeginGeneralEdit,handleSetSourceRootAt:w.handleSetSourceRootAt,handleBrowseForSourceRoot:w.handleBrowseForSourceRoot,handleRemoveSourceRootRow:w.handleRemoveSourceRootRow,handleAddSourceRootRow:w.handleAddSourceRootRow,handleAddSourceRootSuggestion:w.handleAddSourceRootSuggestion,handleSetOnboardingContextRoot:w.handleSetOnboardingContextRoot,handleBrowseForOnboardingContextRoot:w.handleBrowseForOnboardingContextRoot,setAppSettingsDraft:w.setAppSettingsDraft,setAppSettingsFeedback:w.setAppSettingsFeedback,buildOnboardingCommandLine:w.buildOnboardingCommandLine,handleCopyOnboardingCommand:w.handleCopyOnboardingCommand,handleRunOnboardingCommand:w.handleRunOnboardingCommand,renderOnboardingCommandShell:P,renderLocalPathValue:Q,openKnowledgeBase:F},agentSettingsViewProps:{styles:X,selectedInterAgent:ot,availableAgents:$.rosterInterAgentAgents,isAgentConfigEditing:st?$.isAgentConfigEditing:!1,hasEditableAgentConfig:st?$.hasEditableAgentConfig:!1,agentConfigLoading:o?!st||$.agentConfigLoading:!1,agentConfigSaving:st?$.agentConfigSaving:!1,agentConfigRestarting:st?$.agentConfigRestarting:!1,visibleAgentConfig:st?$.visibleAgentConfig:null,agentConfigFeedback:st?$.agentConfigFeedback:null,agentCapabilitiesPreview:st?$.agentCapabilitiesPreview:[],agentRuntimePathRef:$.agentRuntimePathRef,onOpenAgents:()=>l("agents"),onOpenAgentProfile:Z,onOpenAgentThread:Se=>O(Se,{focusComposer:!0}),onUpdateAgentConfigDraft:$.updateAgentConfigDraft,renderLocalPathValue:Q,interAgentProfileKindLabel:gv,onSelectAgent:Se=>{u(Se),$.handleSelectInterAgent(Se)}},workspaceExplorerViewProps:{styles:X,selectedWorkspaceProject:Te,selectedWorkspaceAgent:Ne,workspaceExplorerQuery:_,setWorkspaceExplorerQuery:le,workspaceExplorerFilter:R,setWorkspaceExplorerFilter:pe,workspaceExplorerViewMode:xe,setWorkspaceExplorerViewMode:ce,workspaceExplorerItems:He,workspaceExplorerBoundCount:Ue,workspaceExplorerDiscoveredCount:it,filteredWorkspaceExplorerItems:Le,workspaceInventoryLoaded:w.workspaceInventoryLoaded,workspaceInventoryLoading:w.workspaceInventoryLoading,canRefreshWorkspaceInventory:w.canRefreshWorkspaceInventory,onboardingCommandPending:w.onboardingCommandPending,appSettingsLoading:w.appSettingsLoading,appSettingsSaving:w.appSettingsSaving,appSettingsDirty:w.appSettingsDirty,appSettingsFeedback:w.appSettingsFeedback,showDoctorOutput:w.showDoctorOutput,doctorOutput:P("doctor",w.buildOnboardingCommandLine("doctor"),w.onboardingCommandPending==="doctor"),projectRetirementPendingRoot:w.projectRetirementPendingRoot,onRefreshWorkspaceDiscovery:()=>{w.handleRunOnboardingCommand("doctor")},onLoadWorkspaceInventory:w.handleLoadWorkspaceInventory,onAddWorkspace:We,onInspectWorkspace:Ye,onOpenWorkspace:Ge,onRetireWorkspace:we,onOpenAgentProfile:Z,onOpenAgentSettings:Se=>$.handleOpenAgentSettings(Se,!0),renderLocalPathValue:Q},communicationSettingsViewProps:{styles:X,showTelegram:p.telegram,showVoice:p.voice,visibleAppSettings:w.visibleAppSettings,isAppSettingsEditing:w.isAppSettingsEditing,appSettingsSaving:w.appSettingsSaving,appSettingsFeedback:w.appSettingsFeedback,onUpdateAppSettingsDraft:w.updateAppSettingsDraft,brokerInspector:Y.brokerInspector,brokerControlPending:Y.brokerControlPending,brokerControlFeedback:Y.brokerControlFeedback,onBrokerControl:Se=>{Y.handleBrokerControl(Se)},relayServiceInspectorRef:J,relayRuntimeBooting:v,relayRuntimeHealthLabel:j,runtime:y,reachableRelayAgentCount:C,voiceCaptureTitle:b?.voice.captureTitle??"Not reported",voiceRepliesEnabled:b?.voice.repliesEnabled??!1,onSetVoiceRepliesEnabled:Se=>{ee(Se)},renderLocalPathValue:Q},database:{styles:X,stats:h,runtime:y,visibleAppSettings:w.visibleAppSettings,renderLocalPathValue:Q,onRevealPath:Se=>{D?.canRevealPath&&q?.revealPath?.(Se)}},appearance:{styles:X,dark:E,setDark:N,showAnnotations:M,setShowAnnotations:L,isCollapsed:H,activeSettingsLabel:f.label}}}}const uz=["~/dev","~/src","~/code"],go=["welcome","source-roots","harness","confirm","setup","doctor","runtimes"];function dz({activeView:e,settingsSection:l,scoutDesktop:a,shellState:i,surfaceCaps:o,completeOnboardingIntoRelay:u,loadShellState:d}){const[f,p]=z.useState(null),[h,y]=z.useState(null),[b,v]=z.useState(!1),[j,C]=z.useState(!1),[E,N]=z.useState(!1),[M,L]=z.useState(null),[H,X]=z.useState(!1),[q,D]=z.useState(null),[B,F]=z.useState("welcome"),[Z,O]=z.useState(null),[P,Q]=z.useState(null),[oe,J]=z.useState({}),[ee,w]=z.useState(null),[Y,$]=z.useState("checking"),ye=H?h??f:f,T=ye?.projectInventory??[],_=ye?.hiddenProjects??[],le=z.useMemo(()=>qb(h)!==qb(f),[h,f]),R=!!ye?.workspaceInventoryLoaded,pe=!!(f&&a?.refreshSettingsInventory),xe=!!(Z==="doctor"||oe.doctor||P?.command==="doctor"),ce=ye?.onboardingContextRoot??ye?.workspaceRoots?.[0]??null,Re=!!ye?.currentProjectConfigPath,Te=(ye?.runtimeCatalog??[]).find(se=>se.name===ye?.defaultHarness)??null,Ne=z.useMemo(()=>new Map((ye?.onboarding.steps??[]).map(se=>[se.id,se.complete])),[ye?.onboarding.steps]),He=z.useMemo(()=>[{id:"welcome",number:"01",title:"Say hi",detail:"Tell Scout what to call you before the rest of setup begins.",complete:Ne.get("welcome")??!1},{id:"source-roots",number:"02",title:"Choose folders to scan",detail:"Pick the parent folders Scout should scan for repos, then choose where this Scout context should live.",complete:Ne.get("source-roots")??!1},{id:"harness",number:"03",title:"Choose a default harness",detail:"This is the assistant family Scout should prefer when a project does not pin one of its own.",complete:Ne.get("harness")??!1},{id:"confirm",number:"04",title:"Confirm this context",detail:"Review which folders Scout will scan and where it will save this context before moving into the command steps.",complete:Ne.get("confirm")??!1},{id:"setup",number:"05",title:"Run setup",detail:"See how Scout writes `.openscout/project.json` at your chosen context root and uses it as this context anchor.",complete:Ne.get("setup")??!1},{id:"doctor",number:"06",title:"Run doctor",detail:"See how Scout combines broker health, scanned folders, and context manifests into one inventory view.",complete:Ne.get("doctor")??!1},{id:"runtimes",number:"07",title:"Run runtimes",detail:"Check whether Claude or Codex is installed, signed in, and ready for broker-owned sessions.",complete:Ne.get("runtimes")??!1}],[Ne]),Le=Math.max(0,go.indexOf(B)),Ue=He[Le]??He[0],it=Le>0,tt=Le<He.length-1,st=Y==="active"&&!!ye?.onboarding,ot=Y!=="done",bt=z.useCallback((se,Me)=>se?{...Me,operatorName:se.operatorName,onboardingContextRoot:se.onboardingContextRoot,workspaceRoots:se.workspaceRoots,includeCurrentRepo:se.includeCurrentRepo,defaultHarness:se.defaultHarness,defaultTransport:se.defaultTransport,defaultCapabilities:se.defaultCapabilities,sessionPrefix:se.sessionPrefix,telegram:se.telegram}:Me,[]),Ye=z.useCallback(se=>{p(se),y(se),se.workspaceInventoryLoaded&&C(!1)},[]),Ge=z.useCallback(se=>{p(se),y(Me=>H?Me:se),se.workspaceInventoryLoaded&&C(!1)},[H]),We=z.useCallback(se=>{p(se),y(Me=>H?bt(Me,se):se),se.workspaceInventoryLoaded&&C(!1)},[H,bt]),we=z.useCallback(se=>{Ye(se),F("welcome"),Q(null),w(null),X(!0),$("active")},[Ye]),et=z.useCallback(se=>{const Me=ce?` --context-root ${ce}`:"",ze=se==="setup"?(ye?.workspaceRoots??[]).map(nt=>` --source-root ${nt}`).join(""):"";return`scout ${se}${Me}${ze}`},[ce,ye?.workspaceRoots]),Se=z.useCallback(async se=>{if(!a?.getAppSettings)return null;const Me=se?.preferInventory&&a.refreshSettingsInventory?await a.refreshSettingsInventory():await a.getAppSettings();return Ge(Me),Me},[a,Ge]);z.useEffect(()=>{if(!(e==="settings"||e==="help"||Y==="active")||!a?.getAppSettings)return;let Me=!1;return(async()=>{v(!0);try{const nt=await a.getAppSettings();if(Me)return;Ye(nt),Y==="active"&&nt.onboarding.needed?(L(null),X(!0),F(Xt=>Xt||"welcome")):(L(null),X(!1)),Y==="active"&&!nt.onboarding.needed&&(u(i),$("done"))}catch(nt){if(Me)return;p(null),y(null),L(lt(nt)),X(!1),Y!=="done"&&$("done")}finally{Me||v(!1)}})(),()=>{Me=!0}},[e,u,Ye,a,i,Y]),z.useEffect(()=>{let se=!1;return a?.getAppSettings?((async()=>{try{const ze=await a.getAppSettings();if(se)return;p(nt=>nt??ze),y(nt=>nt??ze),ze.onboarding.needed?(L(null),X(!0),F("welcome"),$("active")):$("done")}catch{se||$("done")}})(),()=>{se=!0}):($("done"),()=>{se=!0})},[a]),z.useEffect(()=>{if(e!=="settings"||l!=="workspaces"||!a?.refreshSettingsInventory||!f||f.workspaceInventoryLoaded||j)return;let se=!1;return(async()=>{C(!0);try{const ze=await a.refreshSettingsInventory();se||We(ze)}catch(ze){se||L(lt(ze))}finally{se||C(!1)}})(),()=>{se=!0}},[e,f,We,a,l,j]);const Ze=z.useCallback(()=>{y(f),L(null),X(!0),f?.onboarding.needed&&F("welcome")},[f]),mt=z.useCallback(()=>{y(f),L(null),X(!1)},[f]),re=z.useCallback(se=>{y(Me=>Me&&se(Me)),L(null)},[]),ge=z.useCallback(async()=>{if(!h||!a?.updateAppSettings)return!1;N(!0);try{const se=await a.updateAppSettings({operatorName:h.operatorName,onboardingContextRoot:h.onboardingContextRoot,workspaceRootsText:h.workspaceRoots.join(`
92
+ `),includeCurrentRepo:h.includeCurrentRepo,defaultHarness:h.defaultHarness,defaultCapabilitiesText:h.defaultCapabilities.join(`
93
+ `),sessionPrefix:h.sessionPrefix,telegram:{enabled:h.telegram.enabled,mode:h.telegram.mode,botToken:h.telegram.botToken,secretToken:h.telegram.secretToken,apiBaseUrl:h.telegram.apiBaseUrl,userName:h.telegram.userName,defaultConversationId:h.telegram.defaultConversationId,ownerNodeId:h.telegram.ownerNodeId}});return Ye(se),L("Settings saved."),X(se.onboarding.needed),$(Me=>Me==="active"?se.onboarding.needed?"active":"done":Me),await d(!1),!0}catch(se){return L(lt(se)),!1}finally{N(!1)}},[h,d,Ye,a]),Ce=z.useCallback(se=>{F(Me=>{const ze=go.indexOf(Me);if(ze<0)return go[0];const nt=Math.min(go.length-1,Math.max(0,ze+se));return go[nt]})},[]),_e=z.useCallback(async se=>{if(!o?.canProvisionRuntime||!a?.runOnboardingCommand)return L(o&&!o.canProvisionRuntime?"Setup and doctor commands must be run from the Scout CLI (`scout setup`, `scout doctor`) on this host.":null),null;O(se),L(null);try{const Me=(h??f)?.workspaceRoots??[],ze=await a.runOnboardingCommand({command:se,contextRoot:(h??f)?.onboardingContextRoot??Me[0],sourceRoots:se==="setup"?Me:void 0});if(Q(ze),J(nt=>({...nt,[se]:ze})),L(ze.exitCode!==0?`${se} exited with status ${ze.exitCode}. Review the output below before continuing.`:null),a.getAppSettings){const nt=(se==="doctor"||se==="setup")&&a.refreshSettingsInventory?await a.refreshSettingsInventory():await a.getAppSettings();Ye(nt),X(nt.onboarding.needed);const Xt=await d(!1);nt.onboarding.needed?se==="runtimes"&&ze.exitCode===0&&!Xt?.runtime?.brokerReachable?(F("doctor"),L("Relay is still offline. Run doctor again and make sure the broker is reachable before onboarding can finish.")):ze.exitCode===0&&setTimeout(()=>{Ce(1)},1800):u(Xt),$(bn=>bn==="active"?nt.onboarding.needed?"active":"done":bn)}return ze}catch(Me){return L(lt(Me)),null}finally{O(null)}},[f,h,u,d,Ce,a,o]),Xe=z.useCallback(async(se,Me)=>{if(!o?.canEditFilesystem)return L("Project retirement is not available in this host. Use the Scout CLI or desktop app."),!1;if(!a?.retireProject)return L("Project retirement is unavailable in this build."),!1;D(se);try{const ze=await a.retireProject(se);return We(ze),await d(!1),L(`Retired ${Me}. It is hidden from discovery until restored.`),!0}catch(ze){return L(lt(ze)),!1}finally{D(null)}},[We,d,a,o]),Ae=z.useCallback(async se=>{if(!o?.canEditFilesystem)return L("Project restore is not available in this host. Use the Scout CLI or desktop app."),!1;if(!a?.restoreProject)return L("Project restore is unavailable in this build."),!1;D(se.root);try{const Me=await a.restoreProject(se.root);return We(Me),await d(!1),L(`Restored ${se.title}. Scout will discover it again.`),!0}catch(Me){return L(lt(Me)),!1}finally{D(null)}},[We,d,a,o]),ue=z.useCallback(()=>{(async()=>{try{if(!a?.restartOnboarding)return;const se=await a.restartOnboarding();we(se),L("Onboarding restarted.")}catch(se){L(lt(se))}})()},[we,a]),Ee=z.useCallback(se=>{y(Me=>{const ze=Me??f;if(!ze)return Me;const nt=Array.from(new Set([...ze.workspaceRoots,se]));return{...ze,onboardingContextRoot:ze.onboardingContextRoot||se,workspaceRoots:nt}}),L("Project paths updated. Save General to persist the change."),X(!0)},[f]),V=z.useCallback(()=>{H||(y(f),L(null),X(!0))},[f,H]),me=z.useCallback((se,Me)=>{y(ze=>{const nt=ze??f;if(!nt)return ze;const Xt=[...nt.workspaceRoots];for(;Xt.length<=se;)Xt.push("");return Xt[se]=Me,{...nt,onboardingContextRoot:se===0&&(!nt.onboardingContextRoot||nt.onboardingContextRoot===nt.workspaceRoots[0])?Me:nt.onboardingContextRoot,workspaceRoots:Xt}}),L(null),X(!0)},[f]),je=z.useCallback(()=>{y(se=>{const Me=se??f;return Me?{...Me,workspaceRoots:[...Me.workspaceRoots,""]}:se}),L("Project paths updated. Save General to persist the change."),X(!0)},[f]),Fe=z.useCallback(se=>{y(Me=>{const ze=Me??f;if(!ze)return Me;const nt=ze.workspaceRoots[se]??"",Xt=ze.workspaceRoots.filter((xr,$l)=>$l!==se),bn=se===0&&(!ze.onboardingContextRoot||ze.onboardingContextRoot===nt)?Xt[0]??"":ze.onboardingContextRoot;return{...ze,onboardingContextRoot:bn,workspaceRoots:Xt}}),L("Project paths updated. Save General to persist the change."),X(!0)},[f]),Je=z.useCallback(se=>{(async()=>{try{if(!o?.canPickDirectory||!a?.pickDirectory)return;const Me=await a.pickDirectory();if(!Me)return;me(se,Me),L("Project paths updated. Save General to persist the change.")}catch(Me){L(lt(Me))}})()},[me,a,o]),qe=z.useCallback(se=>{y(Me=>{const ze=Me??f;return ze?{...ze,onboardingContextRoot:se}:Me}),L(null),X(!0)},[f]),St=z.useCallback(()=>{(async()=>{try{if(!o?.canPickDirectory||!a?.pickDirectory)return;const se=await a.pickDirectory();if(!se)return;qe(se)}catch(se){L(lt(se))}})()},[qe,a,o]),Qt=z.useCallback(()=>{(async()=>{try{if(a?.skipOnboarding){const se=await a.skipOnboarding();Ye(se)}$("done"),L(null),X(!1)}catch(se){L(lt(se))}})()},[Ye,a]),Gt=z.useCallback(()=>{(async()=>{if(Ue.id!=="confirm"){Ce(1);return}if(!le){Ce(1);return}await ge()&&Ce(1)})()},[Ue.id,le,ge,Ce]);z.useEffect(()=>{const se=Ue.id;if(se!=="setup"&&se!=="doctor"&&se!=="runtimes"||Z||oe[se]||!ye||b||se==="doctor"&&!Re)return;const Me=setTimeout(()=>{_e(se)},600);return()=>clearTimeout(Me)},[Ue.id,b,_e,oe,Z,Re,ye]);const Ut=z.useCallback(()=>{if(tt){Ce(1);return}Qt()},[tt,Qt,Ce]),yt=z.useCallback(async se=>{const Me=et(se);await navigator.clipboard.writeText(Me),w(se),window.setTimeout(()=>{w(ze=>ze===se?null:ze)},1500)},[et]),Jt=z.useCallback(()=>{a?.refreshSettingsInventory&&(C(!0),a.refreshSettingsInventory().then(se=>{We(se)}).catch(se=>{L(lt(se))}).finally(()=>{C(!1)}))},[We,a]);return{SOURCE_ROOT_PATH_SUGGESTIONS:uz,appSettings:f,setAppSettings:p,appSettingsDraft:h,appSettingsLoading:b,workspaceInventoryLoading:j,appSettingsSaving:E,appSettingsFeedback:M,setAppSettingsFeedback:L,setAppSettingsDraft:y,isAppSettingsEditing:H,onboardingWizardStep:B,setOnboardingWizardStep:F,onboardingCommandPending:Z,onboardingCommandResult:P,onboardingCommandHistory:oe,onboardingCopiedCommand:ee,startupOnboardingState:Y,setStartupOnboardingState:$,setIsAppSettingsEditing:X,setOnboardingCommandResult:Q,setOnboardingCopiedCommand:w,visibleAppSettings:ye,agentableProjects:T,hiddenProjects:_,appSettingsDirty:le,projectRetirementPendingRoot:q,workspaceInventoryLoaded:R,canRefreshWorkspaceInventory:pe,showDoctorOutput:xe,onboardingContextRoot:ce,onboardingHasProjectConfig:Re,onboardingRuntimeMatch:Te,onboardingWizardSteps:He,onboardingWizardIndex:Le,activeOnboardingStep:Ue,canGoToPreviousOnboardingStep:it,canGoToNextOnboardingStep:tt,startupOnboardingVisible:st,startupOnboardingBlocking:ot,buildOnboardingCommandLine:et,replaceAppSettings:Ye,syncRefreshedAppSettings:Ge,applyNextAppSettings:We,applyRestartedOnboardingSettings:we,refreshVisibleAppSettings:Se,handleStartAppSettingsEdit:Ze,handleCancelAppSettingsEdit:mt,updateAppSettingsDraft:re,handleSaveAppSettings:ge,moveOnboardingWizard:Ce,handleRunOnboardingCommand:_e,handleRetireProject:Xe,handleRestoreProject:Ae,handleRestartOnboarding:ue,handleAddSourceRootSuggestion:Ee,handleBeginGeneralEdit:V,handleSetSourceRootAt:me,handleAddSourceRootRow:je,handleRemoveSourceRootRow:Fe,handleBrowseForSourceRoot:Je,handleSetOnboardingContextRoot:qe,handleBrowseForOnboardingContextRoot:St,dismissStartupOnboarding:Qt,handleOnboardingContinue:Gt,skipCurrentOnboardingStep:Ut,handleCopyOnboardingCommand:yt,handleLoadWorkspaceInventory:Jt}}function fz({sidebarWidth:e,messagesDetailWidth:l,isCollapsed:a,onResizeStart:i,onMessagesDetailResizeStart:o,styles:u,messagesState:d,messageThreads:f,selectedMessagesThread:p,onSelectMessageThread:h,showAnnotations:y,setShowAnnotations:b,onRefresh:v,loadingWorkspace:j,selectedMessagesInternalThread:C,selectedMessagesInternalMessages:E,selectedMessagesInternalTarget:N,selectedMessagesDetailAgentId:M,selectedMessagesDetailAgent:L,selectedMessagesSessions:H,selectedSession:X,setSelectedSession:q,formatDate:D,interAgentAgents:B,interAgentAgentLookup:F,relayDirectLookup:Z,openAgentProfile:O,openAgentDirectMessage:P,onNudgeMessage:Q,messagesDetailOpen:oe,setMessagesDetailOpen:J,messagesDetailTab:ee,setMessagesDetailTab:w,selectedRelayKind:Y,selectedRelayId:$,relayThreadTitle:ye,relayThreadSubtitle:T,relayThreadCount:_,selectedRelayDirectThread:le,relayVoiceState:R,visibleRelayMessages:pe,relayTimelineViewportRef:xe,onRelayTimelineScroll:ce,relayReplyTarget:Re,setRelayReplyTarget:Te,relayContextReferences:Ne,relayContextMessageIds:He,setRelayContextMessageIds:Le,relayComposerRef:Ue,relayDraft:it,setRelayDraft:tt,relaySending:st,relayFeedback:ot,relayComposerSelectionStart:bt,setRelayComposerSelectionStart:Ye,mergedRelayMessages:Ge,relayMentionMenuOpen:We,relayMentionSuggestions:we,relayMentionSelectionIndex:et,setRelayMentionSelectionIndex:Se,relayMentionDuplicateTitleCounts:Ze,applyRelayMentionSuggestion:mt,onRelaySend:re,onToggleVoiceCapture:ge,onSetVoiceRepliesEnabled:Ce,visibleAgentSession:_e,agentSessionPending:Xe,agentSessionFeedback:Ae,agentSessionCopied:ue,onCopyAgentSessionCommand:Ee,onOpenAgentSession:V,onPeekAgentSession:me,onOpenAgentSettings:je,desktopVoiceEnabled:Fe}){return r.jsxs(r.Fragment,{children:[a?null:r.jsx(mz,{sidebarWidth:e,styles:u,messagesState:d,messageThreads:f,selectedMessagesThread:p,onResizeStart:i,onSelectMessageThread:h}),r.jsx("div",{className:"flex-1 flex flex-col relative min-w-0",style:u.surface,children:p?.kind==="internal"?r.jsx(pz,{styles:u,selectedMessagesThread:p,selectedMessagesInternalThread:C,selectedMessagesInternalMessages:E,selectedMessagesInternalTarget:N,showAnnotations:y,setShowAnnotations:b,setMessagesDetailOpen:J,messagesDetailOpen:oe,onRefresh:v,interAgentAgentLookup:F,relayDirectLookup:Z,openAgentProfile:O,openAgentDirectMessage:P,onNudgeMessage:Q}):r.jsx(hz,{styles:u,selectedRelayKind:Y,selectedRelayId:$,relayThreadTitle:ye,relayThreadSubtitle:T,relayThreadCount:_,selectedRelayDirectThread:le,relayVoiceState:R,visibleRelayMessages:pe,relayTimelineViewportRef:xe,onRelayTimelineScroll:ce,relayReplyTarget:Re,setRelayReplyTarget:Te,relayContextReferences:Ne,relayContextMessageIds:He,setRelayContextMessageIds:Le,relayComposerRef:Ue,relayDraft:it,setRelayDraft:tt,relaySending:st,relayFeedback:ot,relayComposerSelectionStart:bt,setRelayComposerSelectionStart:Ye,mergedRelayMessages:Ge,relayMentionMenuOpen:We,relayMentionSuggestions:we,relayMentionSelectionIndex:et,setRelayMentionSelectionIndex:Se,relayMentionDuplicateTitleCounts:Ze,applyRelayMentionSuggestion:mt,showAnnotations:y,setShowAnnotations:b,setMessagesDetailOpen:J,messagesDetailOpen:oe,onRefresh:v,loadingWorkspace:j,onRelaySend:re,onToggleVoiceCapture:ge,onSetVoiceRepliesEnabled:Ce,interAgentAgentLookup:F,relayDirectLookup:Z,openAgentProfile:O,openAgentDirectMessage:P,onNudgeMessage:Q,desktopVoiceEnabled:Fe})}),oe&&p?r.jsx(gz,{styles:u,messagesDetailWidth:l,selectedMessagesThread:p,selectedMessagesInternalThread:C,selectedMessagesDetailAgentId:M,selectedMessagesDetailAgent:L,selectedMessagesSessions:H,selectedSession:X,setSelectedSession:q,formatDate:D,interAgentAgents:B,messagesDetailTab:ee,setMessagesDetailTab:w,setMessagesDetailOpen:J,onResizeStart:o,openAgentProfile:O,openAgentDirectMessage:P,visibleAgentSession:_e,agentSessionPending:Xe,agentSessionFeedback:Ae,agentSessionCopied:ue,onCopyAgentSessionCommand:Ee,onOpenAgentSession:V,onPeekAgentSession:me,onOpenAgentSettings:je}):null]})}function mz({sidebarWidth:e,styles:l,messagesState:a,messageThreads:i,selectedMessagesThread:o,onResizeStart:u,onSelectMessageThread:d}){return r.jsxs("div",{style:{width:e,...l.sidebar},className:"relative flex flex-col h-full border-r shrink-0 z-10 overflow-hidden",children:[r.jsx("div",{className:"absolute right-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:u}),r.jsx("div",{className:"px-3 py-2.5 flex items-center justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-[13px] font-semibold tracking-tight",style:l.inkText,children:a?.title??"Messages"}),r.jsx("div",{className:"text-[10px] font-mono mt-0.5",style:l.mutedText,children:a?.subtitle??"Broker unavailable"})]})}),r.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:[["inbox","Inbox"],["channels","Channels"],["agents","Agents"],["internal","Internal"]].map(([f,p])=>{const h=i.filter(y=>y.group===f);return h.length===0?null:r.jsxs("div",{className:"mb-3 px-1.5",children:[r.jsx("div",{className:"font-mono text-[9px] tracking-widest uppercase mb-1 px-1.5",style:l.mutedText,children:p}),r.jsx("div",{className:"flex flex-col gap-px",children:h.map(y=>{const b=o?.id===y.id,v=y.kind==="relay"&&y.relayDestinationKind==="direct";return r.jsxs("button",{className:`os-rail-row flex items-center gap-2 px-1.5 py-1 rounded cursor-pointer w-full text-left${b?" os-rail-row-active":""}`,style:b?l.activeItem:l.mutedText,onClick:()=>d(y),children:[y.kind==="internal"?r.jsx("div",{className:"w-4 h-4 shrink-0 flex items-center justify-center",children:r.jsx(Zi,{size:12,style:b?{color:g.accent}:l.mutedText})}):v?r.jsxs("div",{className:"relative shrink-0",children:[r.jsx("div",{className:`os-rail-avatar w-4 h-4 rounded text-white flex items-center justify-center font-bold text-[8px] ${y.reachable?"":"opacity-40 grayscale"}`,style:{backgroundColor:dl(y.relayDestinationId??y.id)},children:y.title.charAt(0).toUpperCase()}),y.state?r.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${Mo(y.state)}`,style:{border:`1px solid ${g.bg}`}}):null]}):r.jsx(xk,{id:y.relayDestinationId??y.id,active:b}),r.jsxs("div",{className:`flex-1 min-w-0 ${y.reachable?"":"opacity-50"}`,children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("div",{className:"font-medium text-[12px] truncate",children:Up(y.title)}),y.state==="working"?r.jsx(Ku,{className:"text-[var(--os-accent)]"}):null]}),r.jsx("div",{className:"text-[10px] truncate",style:l.mutedText,children:y.preview??y.subtitle??""})]}),typeof y.count=="number"&&y.count>0?r.jsx("span",{className:"os-row-count text-[9px] font-mono px-1 rounded",style:b?l.activePill:l.tagBadge,children:y.count}):null]},y.id)})})]},f)})})]})}function pz({styles:e,selectedMessagesThread:l,selectedMessagesInternalThread:a,selectedMessagesInternalMessages:i,selectedMessagesInternalTarget:o,showAnnotations:u,setShowAnnotations:d,setMessagesDetailOpen:f,messagesDetailOpen:p,onRefresh:h,interAgentAgentLookup:y,relayDirectLookup:b,openAgentProfile:v,openAgentDirectMessage:j,onNudgeMessage:C}){return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"border-b flex items-center justify-between px-4 py-2 shrink-0 gap-4",style:{...e.surface,borderBottomColor:g.border},children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(Zi,{size:14,style:e.mutedText}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("h2",{className:"text-[13px] font-semibold tracking-tight truncate",style:e.inkText,children:a?.title??l.title??"Internal"}),a?r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:e.tagBadge,children:a.messageCount}):null]}),r.jsx("div",{className:"text-[10px] truncate mt-0.5",style:e.mutedText,children:a?.subtitle??l.subtitle??"Agent-to-agent coordination"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[o?r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>j(o.id),children:[r.jsx(Rl,{size:11}),r.jsx("span",{children:"Message Agent"})]}):null,r.jsxs("button",{onClick:()=>d(!u),className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:u?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},children:["Annotations ",r.jsx("span",{className:"font-mono uppercase",children:u?"On":"Off"})]}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>{h()},children:"Sync"}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:p?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},onClick:()=>f(E=>!E),children:"Details"})]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3 pb-6",children:i.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:r.jsx(Zi,{size:24,style:{color:g.accent}})}),r.jsx("h3",{className:"text-[15px] font-medium mb-1",style:e.inkText,children:"No internal traffic yet"}),r.jsx("p",{className:"text-[13px] max-w-sm",style:e.mutedText,children:"This thread exists, but no visible agent-to-agent messages have been captured yet."})]}):r.jsx("div",{className:"flex flex-col gap-1",children:r.jsx(jo,{messages:i,showAnnotations:u,showStatusMessages:!1,inkStyle:e.inkText,mutedStyle:e.mutedText,tagStyle:e.tagBadge,annotStyle:e.annotBadge,agentLookup:y,directThreadLookup:b,onOpenAgentProfile:v,onOpenAgentChat:j,onNudgeMessage:C})})}),r.jsx("div",{className:"px-4 py-3 shrink-0",style:e.surface,children:r.jsxs("div",{className:"rounded-lg border px-3 py-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:"Internal Thread"}),r.jsx("div",{className:"text-[11px] mt-1 leading-[1.6]",style:e.mutedText,children:"Internal coordination is read-only here. Open a direct conversation with an agent if you want to intervene."}),o?r.jsxs("button",{type:"button",onClick:()=>j(o.id),className:"mt-3 os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[r.jsx(Sp,{size:11}),"Open Direct Message"]}):null]})}),r.jsx("div",{className:"h-7 border-t flex items-center px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:r.jsx("span",{className:"text-[9px] font-mono",style:e.mutedText,children:"Read-only internal coordination thread inside Messages"})})]})}function hz({styles:e,selectedRelayKind:l,selectedRelayId:a,relayThreadTitle:i,relayThreadSubtitle:o,relayThreadCount:u,selectedRelayDirectThread:d,relayVoiceState:f,visibleRelayMessages:p,relayTimelineViewportRef:h,onRelayTimelineScroll:y,relayReplyTarget:b,setRelayReplyTarget:v,relayContextReferences:j,relayContextMessageIds:C,setRelayContextMessageIds:E,relayComposerRef:N,relayDraft:M,setRelayDraft:L,relaySending:H,relayFeedback:X,relayComposerSelectionStart:q,setRelayComposerSelectionStart:D,mergedRelayMessages:B,relayMentionMenuOpen:F,relayMentionSuggestions:Z,relayMentionSelectionIndex:O,setRelayMentionSelectionIndex:P,relayMentionDuplicateTitleCounts:Q,applyRelayMentionSuggestion:oe,showAnnotations:J,setShowAnnotations:ee,setMessagesDetailOpen:w,messagesDetailOpen:Y,onRefresh:$,loadingWorkspace:ye,onRelaySend:T,onToggleVoiceCapture:_,onSetVoiceRepliesEnabled:le,interAgentAgentLookup:R,relayDirectLookup:pe,openAgentProfile:xe,openAgentDirectMessage:ce,onNudgeMessage:Re,desktopVoiceEnabled:Te}){const Ne=p.at(-1)?.createdAt??null,[He,Le]=z.useState(()=>Date.now());z.useEffect(()=>{if(d?.state!=="working")return;Le(Date.now());const Ge=window.setInterval(()=>{Le(Date.now())},15e3);return()=>window.clearInterval(Ge)},[Ne,d?.activeTask,d?.id,d?.state,d?.statusDetail]);const Ue=d?.state==="working"&&Ne?Math.max(0,He-Ne):0,it=Ue>0?bz(Ue):null,tt=Ue>=9e4,st=d?.activeTask??d?.statusDetail??o??"Agent is still working.",ot=!ye&&p.length===0&&l==="direct",bt=ye?"Loading relay workspace":ot?"Waiting for first relay message":"No relay traffic yet",Ye=ye?"Fetching threads, messages, and agent state for this workspace.":ot?d?.activeTask??d?.statusDetail??"This direct lane is open. Send a message or wait for the agent to speak first.":"Send a message into this lane to wake an agent or start a broker-backed conversation.";return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"border-b flex items-center justify-between px-4 py-2 shrink-0 gap-4",style:{...e.surface,borderBottomColor:g.border},children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("div",{className:"shrink-0",children:l==="direct"?r.jsx(Sp,{size:14,style:e.mutedText}):r.jsx(xk,{id:a,active:!1,size:14})}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("h2",{className:"text-[13px] font-semibold tracking-tight truncate",style:e.inkText,children:i}),u?r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:e.tagBadge,children:u}):null,d?r.jsx(PM,{thread:d}):null]}),o?r.jsx("div",{className:"text-[10px] truncate mt-0.5",style:e.mutedText,children:o}):null]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[d?r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>xe(d.id),children:[r.jsx(Yi,{size:11}),r.jsx("span",{children:"Agent"})]}):null,r.jsxs("button",{onClick:()=>ee(!J),className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:J?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},children:["Annotations ",r.jsx("span",{className:"font-mono uppercase",children:J?"On":"Off"})]}),Te?r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:f?.isCapturing?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},onClick:()=>{_()},title:f?.detail??void 0,children:[f?.captureTitle??"Capture"," ",r.jsx("span",{className:"font-mono uppercase",style:{color:g.accent},children:f?.captureState??"Off"})]}),r.jsxs("button",{className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded",style:f?.repliesEnabled?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},onClick:()=>{le(!(f?.repliesEnabled??!1))},title:f?.detail??void 0,children:["Playback ",r.jsx("span",{className:"font-mono uppercase",style:{color:g.accent},children:f?.speaking?"Speaking":f?.repliesEnabled?"On":"Off"})]})]}):null,r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:{color:g.ink},onClick:()=>{$()},children:"Sync"}),r.jsx("button",{className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded",style:Y?{backgroundColor:g.accentBg,color:g.accent}:{color:g.ink},onClick:()=>w(Ge=>!Ge),children:"Details"})]})]}),r.jsx("div",{ref:h,className:"flex-1 overflow-y-auto px-4 py-3 pb-6",onScroll:y,children:p.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center",children:[r.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:g.accentBg},children:ye||ot?r.jsx(dn,{className:"text-[22px]",style:{color:g.accent}}):r.jsx(Rl,{size:24,style:{color:g.accent}})}),r.jsx("h3",{className:"text-[15px] font-medium mb-1",style:e.inkText,children:bt}),r.jsx("p",{className:"text-[13px] max-w-sm",style:e.mutedText,children:Ye})]}):r.jsx("div",{className:"flex flex-col gap-1",children:r.jsx(jo,{messages:p,showAnnotations:J,showStatusMessages:l==="channel"&&a==="system",inkStyle:e.inkText,mutedStyle:e.mutedText,tagStyle:e.tagBadge,annotStyle:e.annotBadge,agentLookup:R,directThreadLookup:pe,onOpenAgentProfile:xe,onOpenAgentChat:ce,onNudgeMessage:Re})})}),d?.state==="working"?r.jsx("div",{className:"px-4 pb-1 shrink-0",style:e.surface,children:r.jsx("div",{className:"rounded-xl border px-3 py-2.5 flex items-start justify-between gap-3",style:{borderColor:tt?"rgba(245,158,11,0.32)":g.border,backgroundColor:tt?"rgba(245,158,11,0.08)":g.bg},children:r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(Ku,{className:"text-[var(--os-accent)] shrink-0"}),r.jsx("span",{className:"text-[11px] font-medium truncate",style:e.inkText,children:tt?"Still working":"Working"}),it?r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded shrink-0",style:tt?{color:"#b45309",backgroundColor:"rgba(245,158,11,0.14)"}:e.tagBadge,children:tt?`No update for ${it}`:`${it} ago`}):null]}),r.jsx("div",{className:"text-[10px] mt-1 truncate",style:e.mutedText,children:st})]})})}):null,r.jsx(xz,{styles:e,selectedRelayKind:l,selectedRelayId:a,relayVoiceState:f,relayReplyTarget:b,setRelayReplyTarget:v,relayContextReferences:j,relayContextMessageIds:C,setRelayContextMessageIds:E,relayComposerRef:N,relayDraft:M,setRelayDraft:L,relaySending:H,relayComposerSelectionStart:q,setRelayComposerSelectionStart:D,mergedRelayMessages:B,relayMentionMenuOpen:F,relayMentionSuggestions:Z,relayMentionSelectionIndex:O,setRelayMentionSelectionIndex:P,relayMentionDuplicateTitleCounts:Q,applyRelayMentionSuggestion:oe,onRelaySend:T,desktopVoiceEnabled:Te}),r.jsxs("div",{className:"h-7 border-t flex items-center justify-between px-4 shrink-0",style:{backgroundColor:g.bg,borderTopColor:g.border},children:[r.jsxs("div",{className:"flex items-center gap-3 text-[9px] font-mono",style:e.mutedText,children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("span",{style:e.inkText,children:"@"})," mention agents"]}),F?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),r.jsx("span",{children:"↑↓ select · ↵ or Tab insert"})]}):null,r.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"font-sans px-1 py-0.5 rounded border text-[9px] font-medium leading-none shadow-sm",style:e.kbd,children:"Cmd+Enter"})," send"]}),X?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-px h-3",style:{backgroundColor:g.border}}),r.jsx("span",{children:X})]}):null]}),r.jsx("div",{className:"flex items-center gap-2 text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:d?.state==="offline"?r.jsx("span",{children:d.statusLabel}):null})]})]})}function xz({styles:e,selectedRelayKind:l,selectedRelayId:a,relayVoiceState:i,relayReplyTarget:o,setRelayReplyTarget:u,relayContextReferences:d,relayContextMessageIds:f,setRelayContextMessageIds:p,relayComposerRef:h,relayDraft:y,setRelayDraft:b,relaySending:v,relayComposerSelectionStart:j,setRelayComposerSelectionStart:C,mergedRelayMessages:E,relayMentionMenuOpen:N,relayMentionSuggestions:M,relayMentionSelectionIndex:L,setRelayMentionSelectionIndex:H,relayMentionDuplicateTitleCounts:X,applyRelayMentionSuggestion:q,onRelaySend:D,desktopVoiceEnabled:B}){return r.jsxs("div",{className:"px-4 py-3 shrink-0",style:e.surface,children:[o?r.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3 rounded-lg border px-3 py-2",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:["Replying to ",o.authorName," · ",Co(o.messageId)]}),r.jsx("div",{className:"text-[11px] truncate mt-1",style:e.mutedText,children:o.preview})]}),r.jsx("button",{type:"button",onClick:()=>u(null),className:"shrink-0 rounded p-1 transition-opacity hover:opacity-70",style:e.mutedText,title:"Clear reply context",children:r.jsx(ul,{size:12})})]}):null,d.length>0?r.jsx("div",{className:"mb-2 space-y-2",children:d.map(F=>r.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border px-3 py-2",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-widest",style:e.mutedText,children:["Context · ",F.authorName," · ",Co(F.messageId)]}),r.jsx("div",{className:"text-[11px] truncate mt-1",style:e.mutedText,children:F.preview})]}),r.jsx("button",{type:"button",onClick:()=>p(Z=>Z.filter(O=>O!==F.messageId)),className:"shrink-0 rounded p-1 transition-opacity hover:opacity-70",style:e.mutedText,title:"Clear referenced context",children:r.jsx(ul,{size:12})})]},F.messageId))}):null,r.jsxs("div",{className:"relative",children:[N?r.jsxs("div",{className:"absolute inset-x-0 bottom-full mb-2 rounded-xl border shadow-lg overflow-hidden z-20",style:{backgroundColor:g.surface,borderColor:g.border,boxShadow:g.shadowLg},children:[r.jsx("div",{className:"px-3 py-2 border-b text-[9px] font-mono uppercase tracking-widest",style:{...e.mutedText,borderColor:g.border},children:"Mention an agent"}),r.jsx("div",{className:"max-h-64 overflow-y-auto",children:M.map((F,Z)=>{const O=Z===L,P=vz(F),Q=kz(F),oe=(X.get(F.title)??0)>1,J=oe||!!F.harness||!!Q,ee=!!(Q&&Q!==P);return r.jsxs("button",{type:"button",className:"w-full flex items-start justify-between gap-3 px-3 py-2.5 text-left transition-colors",style:{backgroundColor:O?g.bg:"transparent",color:g.ink},onMouseDown:w=>{w.preventDefault(),q(F)},children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[r.jsx("span",{className:"text-[11px] font-medium truncate",children:F.title}),r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:F.statusLabel}),J&&P?r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:P}):null,F.harness?r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:F.harness}):null,ee&&Q?r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:Q}):null]}),r.jsxs("div",{className:"text-[10px] mt-1 truncate",style:e.mutedText,children:[F.mentionToken,oe&&F.subtitle?` · ${Zr(F.subtitle)??F.subtitle}`:""]})]}),r.jsx("span",{className:"text-[9px] font-mono shrink-0",style:e.mutedText,children:O?"↵":""})]},F.agentId)})})]}):null,r.jsxs("div",{className:"border rounded flex items-center px-2 py-1 transition-all focus-within:ring-1",style:{backgroundColor:g.bg,borderColor:g.border},children:[r.jsx("textarea",{ref:h,className:"flex-1 bg-transparent outline-none resize-none h-[20px] min-h-[20px] max-h-[80px] text-[12px] leading-tight py-0.5",style:{color:g.ink},placeholder:yz(l,a),rows:1,value:y,onChange:F=>{const Z=Tz(F.currentTarget.value,E,f);b(Z.body),C(F.currentTarget.selectionStart??Z.body.length),Z.nextReferenceMessageIds!==f&&p(Z.nextReferenceMessageIds)},onClick:F=>C(F.currentTarget.selectionStart??y.length),onKeyUp:F=>C(F.currentTarget.selectionStart??y.length),onSelect:F=>C(F.currentTarget.selectionStart??y.length),onKeyDown:F=>{if(N){if(F.key==="ArrowDown"){F.preventDefault(),H(Z=>M.length===0?0:(Z+1)%M.length);return}if(F.key==="ArrowUp"){F.preventDefault(),H(Z=>M.length===0?0:(Z-1+M.length)%M.length);return}if(F.key==="Enter"&&!F.metaKey&&!F.ctrlKey&&!F.shiftKey||F.key==="Tab"){F.preventDefault();const Z=M[L]??M[0];Z&&q(Z);return}if(F.key==="Escape"){F.preventDefault(),C(y.length);return}}(F.metaKey||F.ctrlKey)&&F.key==="Enter"&&(F.preventDefault(),D())}}),r.jsxs("div",{className:"shrink-0 flex items-center gap-1 ml-2",children:[B?r.jsx("button",{className:"p-1 opacity-50 cursor-default transition-opacity",style:e.mutedText,title:i?.detail??"Voice unavailable on this desktop host",children:r.jsx(b2,{size:12})}):null,r.jsx("button",{type:"button",className:"shrink-0 flex h-[26px] w-[26px] items-center justify-center rounded-md border transition-opacity hover:opacity-85 disabled:opacity-30 disabled:cursor-not-allowed",style:{borderColor:g.border,backgroundColor:g.surface,color:g.ink},onClick:()=>{D()},disabled:v||!y.trim(),title:"Send","aria-label":"Send message",children:r.jsx(R1,{size:14})})]})]})]})]})}function gz({styles:e,messagesDetailWidth:l,selectedMessagesThread:a,selectedMessagesInternalThread:i,selectedMessagesDetailAgentId:o,selectedMessagesDetailAgent:u,selectedMessagesSessions:d,selectedSession:f,setSelectedSession:p,formatDate:h,interAgentAgents:y,messagesDetailTab:b,setMessagesDetailTab:v,setMessagesDetailOpen:j,onResizeStart:C,openAgentProfile:E,openAgentDirectMessage:N,visibleAgentSession:M,agentSessionPending:L,agentSessionFeedback:H,agentSessionCopied:X,onCopyAgentSessionCommand:q,onOpenAgentSession:D,onPeekAgentSession:B,onOpenAgentSettings:F}){return r.jsxs("div",{className:"relative border-l shrink-0 overflow-y-auto flex flex-col",style:{width:l,...e.surface,borderLeftColor:g.border},children:[r.jsx("div",{className:"absolute left-[-3px] top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-indigo-400 z-20 transition-colors",onMouseDown:C}),r.jsxs("div",{className:"px-4 py-3 border-b",style:{borderBottomColor:g.border},children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Thread Details"}),r.jsx("div",{className:"text-[13px] font-semibold mt-1 truncate",style:e.inkText,children:a.kind==="internal"?i?.title??a.title:Up(a.title)}),r.jsx("div",{className:"text-[10px] mt-1 line-clamp-2",style:e.mutedText,children:a.preview??a.subtitle??"Context for the selected thread."})]}),r.jsxs("button",{type:"button",onClick:()=>j(!1),className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded shrink-0",style:{color:g.ink},title:"Hide details",children:[r.jsx(ul,{size:11}),r.jsx("span",{children:"Hide"})]})]}),r.jsx("div",{className:"flex items-center gap-1 mt-3",children:[["overview","Overview"],["live","Live"],["history","History"]].filter(([Z])=>Z!=="live"||!!o).map(([Z,O])=>r.jsx("button",{type:"button",className:"rounded-md px-2.5 py-1.5 text-[11px] font-medium transition-colors",style:b===Z?e.activeItem:e.mutedText,onClick:()=>v(Z),children:O},Z))})]}),r.jsxs("div",{className:"p-4 flex-1 space-y-4",children:[b==="overview"?r.jsxs(r.Fragment,{children:[u?r.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg text-white flex items-center justify-center text-[13px] font-bold",style:{backgroundColor:dl(u.id)},children:u.title.charAt(0).toUpperCase()}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"text-[13px] font-semibold truncate",style:e.inkText,children:u.title}),r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:u.state==="working"?e.activePill:e.tagBadge,children:u.statusLabel})]}),r.jsx("div",{className:"text-[10px] mt-1 line-clamp-2",style:e.mutedText,children:u.summary??u.statusDetail??"No summary yet."})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-3 text-[10px]",children:[r.jsxs("div",{children:[r.jsx("div",{style:e.mutedText,children:"Harness"}),r.jsx("div",{style:e.inkText,children:u.harness??"Unknown"})]}),r.jsxs("div",{children:[r.jsx("div",{style:e.mutedText,children:"Threads"}),r.jsx("div",{style:e.inkText,children:u.threadCount})]}),r.jsxs("div",{children:[r.jsx("div",{style:e.mutedText,children:"Workspace"}),r.jsx("div",{className:"truncate",style:e.inkText,children:u.projectRoot??u.cwd??"Unbound"})]}),r.jsxs("div",{children:[r.jsx("div",{style:e.mutedText,children:"Last Chat"}),r.jsx("div",{style:e.inkText,children:u.lastChatLabel??"No recent chat"})]})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[r.jsxs("button",{type:"button",onClick:()=>N(u.id),className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[r.jsx(Rl,{size:11}),"Message"]}),r.jsxs("button",{type:"button",onClick:()=>{v("live"),B()},className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[r.jsx(j1,{size:11}),"Peek"]}),r.jsxs("button",{type:"button",onClick:()=>F(u.id,u.profileKind==="project"),className:"os-toolbar-button flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[r.jsx(Yr,{size:11}),"Settings"]})]})]}):null,a.kind==="internal"&&i?r.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Participants"}),r.jsx("div",{className:"flex flex-col gap-2 mt-3",children:i.participants.map(Z=>r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium truncate",style:e.inkText,children:Z.title}),r.jsx("div",{className:"text-[10px] truncate",style:e.mutedText,children:Z.role??Z.id})]}),y.some(O=>O.id===Z.id)?r.jsx("button",{type:"button",onClick:()=>E(Z.id),className:"text-[10px] font-medium hover:opacity-80",style:{color:g.accent},children:"Open"}):null]},Z.id))})]}):null]}):null,b==="live"?r.jsxs("section",{className:"rounded-xl border overflow-hidden",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsxs("div",{className:"px-3 py-3 border-b flex items-center justify-between gap-2",style:{borderBottomColor:g.border},children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Live Session"}),r.jsx("div",{className:"text-[11px] mt-1",style:e.mutedText,children:"Runtime, tmux, or log tail for the selected agent."})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[M?.commandLabel?r.jsxs("button",{type:"button",onClick:()=>{q()},className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[r.jsx(wa,{size:11}),X?"Copied":"Copy"]}):null,o?r.jsxs("button",{type:"button",onClick:()=>{D()},className:"os-toolbar-button flex items-center gap-1 text-[10px] font-medium px-2 py-1 rounded",style:{color:g.ink},children:[r.jsx(YN,{size:11}),"Open"]}):null]})]}),r.jsx("div",{className:"p-3",children:L?r.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:e.mutedText,children:[r.jsx(dn,{className:"text-[12px]"}),"Loading live session…"]}):M?.body?r.jsx("pre",{className:"max-h-[280px] overflow-y-auto text-[11px] leading-[1.55] whitespace-pre-wrap break-words font-mono",style:{color:g.termFg,backgroundColor:g.termBg,padding:"12px",borderRadius:g.radiusMd},children:M.body}):r.jsx("div",{className:"text-[11px] leading-[1.6]",style:e.mutedText,children:H??"No live session output is available for this thread yet."})})]}):null,b==="history"?r.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Recent History"}),r.jsx("div",{className:"text-[11px] mt-1",style:e.mutedText,children:"Recent sessions tied to this thread or agent."})]}),f?r.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:e.tagBadge,children:"selected"}):null]}),r.jsx("div",{className:"mt-3 flex flex-col gap-2",children:d.length>0?d.slice(0,8).map(Z=>r.jsx("button",{type:"button",onClick:()=>p(Z),className:"w-full rounded-lg border px-3 py-3 text-left transition-opacity hover:opacity-90",style:{borderColor:g.border,backgroundColor:f?.id===Z.id?g.surface:g.bg},children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[12px] font-medium truncate",style:e.inkText,children:Z.title}),r.jsxs("div",{className:"text-[10px] mt-1",style:e.mutedText,children:[Z.project," · ",Z.messageCount," messages"]}),r.jsx("div",{className:"text-[10px] mt-2 line-clamp-2",style:e.mutedText,children:Z.preview})]}),r.jsx("span",{className:"text-[10px] font-mono shrink-0",style:e.mutedText,children:h(Z.lastModified)})]})},Z.id)):r.jsx("div",{className:"text-[11px] leading-[1.6]",style:e.mutedText,children:"No recent session history is linked to this thread yet."})})]}):null,f?r.jsxs("section",{className:"rounded-xl border p-3",style:{borderColor:g.border,backgroundColor:g.bg},children:[r.jsx("div",{className:"text-[10px] font-mono tracking-widest uppercase",style:e.mutedText,children:"Selected Session"}),r.jsx("div",{className:"text-[12px] font-medium mt-2",style:e.inkText,children:f.title}),r.jsxs("div",{className:"text-[10px] mt-1",style:e.mutedText,children:[f.project," · ",f.agent]}),r.jsx("div",{className:"text-[11px] mt-2 leading-[1.6]",style:e.mutedText,children:f.preview})]}):null]})]})}function bz(e){const l=Math.floor(e/6e4);return l>=1?`${l}m`:`${Math.max(1,Math.floor(e/1e3))}s`}function yz(e,l){return e==="direct"?"Message direct thread...":e==="filter"&&l==="coordination"?"Message #shared-channel or @agent...":e==="channel"&&l==="voice"?"Message #voice...":e==="channel"&&l==="system"?"Message #system...":"Message #shared-channel..."}function vz(e){return jz(e.subtitle)??e.workspaceQualifier??null}function kz(e){const l=e.branch?.trim();return l&&l!=="HEAD"?l:e.workspaceQualifier?.trim()||null}function jz(e){if(!e)return null;const l=e.replace(/[\\/]+$/,"");return l?l.split(/[\\/]/).filter(Boolean).at(-1)??null:null}function bk(){return/\b(?:message:[a-zA-Z0-9._:-]+|m:[a-z0-9]{4,12})\b/gi}function Nz(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function wz(e,l){const a=e.trim().toLowerCase();if(!a)return null;if(a.startsWith("message:")){const u=e.slice(e.indexOf(":")+1).trim();return l.find(d=>d.id===u)??null}if(!a.startsWith("m:"))return null;const i=a.slice(2);if(!i)return null;const o=l.filter(u=>Nz(u.id).endsWith(i));return o.length===1?o[0]:null}function Sz(e,l){if(l.length===0)return e;const a=new Set(l.map(o=>o.toLowerCase()));return e.replace(bk(),o=>a.has(o.toLowerCase())?" ":o).split(/\r?\n/g).map(o=>o.replace(/[ \t]{2,}/g," ").trim()).filter((o,u,d)=>o.length>0||u>0&&u<d.length-1).join(`
94
+ `).trim()}function Cz(e,l){return e.length!==l.length?!1:e.every((a,i)=>a===l[i])}function Tz(e,l,a){const i=e.match(bk())??[];if(i.length===0)return{body:e,nextReferenceMessageIds:a};const o=[...a],u=[];for(const f of i){const p=wz(f,l);p&&(u.push(f),o.includes(p.id)||o.push(p.id))}return{body:Sz(e,u),nextReferenceMessageIds:Cz(o,a)?a:o}}function Az({activeView:e,layout:l,threading:a,composer:i,agentSession:o}){return e!=="messages"&&e!=="relay"?null:r.jsx(fz,{...l,...a,...i,...o})}function Ez({activeView:e,scoutDesktop:l,voiceEnabled:a,relayState:i,messagesState:o,interAgentAgents:u,interAgentThreads:d,sessions:f,appSettings:p,setActiveView:h,applyRelayWorkspacePatch:y}){const[b,v]=z.useState("channel"),[j,C]=z.useState("shared"),[E,N]=z.useState(null),[M,L]=z.useState(""),[H,X]=z.useState(!1),[q,D]=z.useState(0),[B,F]=z.useState(0),[Z,O]=z.useState(null),[P,Q]=z.useState(!0),[oe,J]=z.useState(null),[ee,w]=z.useState([]),[Y,$]=z.useState([]),[ye,T]=z.useState(0),_=z.useRef(null),le=z.useRef(null),R=o?.threads??[],pe=z.useMemo(()=>R.find(V=>V.id===E)??null,[R,E]),xe=z.useMemo(()=>pe?.interAgentThreadId?d.find(V=>V.id===pe.interAgentThreadId)??null:null,[d,pe]),ce=z.useMemo(()=>{if(!xe)return null;const V=xe.participants.map(je=>je.id),me=i?.directs.find(je=>V.includes(je.id))?.id??null;return me?u.find(je=>je.id===me)??null:null},[u,i,xe]),Re=pe?.kind==="relay"&&b==="direct"?j:ce?.id??null;z.useEffect(()=>{if(!i)return;const V=Gb(i),me=WS(i),je=[...V.map(Je=>`${Je.kind}:${Je.id}`),...me.map(Je=>`${Je.kind}:${Je.id}`),...i.directs.map(Je=>`${Je.kind}:${Je.id}`)],Fe=`${b}:${j}`;je.includes(Fe)||(v("channel"),C("shared"))},[i,j,b]),z.useEffect(()=>{const V=_.current;if(!V)return;const me=120;V.style.height="0px";const je=Math.min(V.scrollHeight,me);V.style.height=`${je}px`,V.style.overflowY=V.scrollHeight>me?"auto":"hidden"},[M]),z.useEffect(()=>{if(e!=="relay"&&e!=="messages"||ye===0)return;const V=_.current;if(!V)return;const me=window.requestAnimationFrame(()=>{V.focus();const je=V.value.length;V.setSelectionRange?.(je,je)});return()=>{window.cancelAnimationFrame(me)}},[e,ye]),z.useEffect(()=>{oe&&(b!=="direct"||j!==oe.authorId)&&J(null)},[oe,j,b]),z.useEffect(()=>{if(!i?.messages.length)return;const V=new Set(i.messages.map(me=>me.clientMessageId).filter(me=>!!me));V.size&&$(me=>me.filter(je=>!V.has(je.clientMessageId)))},[i]);const Te=z.useMemo(()=>Gb(i).filter(V=>a||!(V.kind==="channel"&&V.id==="voice")),[i,a]),Ne=i&&b==="direct"?i.directs.find(V=>V.id===j)??null:null,He=i?JS(i,Te,b,j):null,Le=z.useMemo(()=>{const V=i?.messages??[];if(!Y.length)return V;const me=new Set(V.map(Fe=>Fe.clientMessageId).filter(Fe=>!!Fe)),je=Y.filter(Fe=>!me.has(Fe.clientMessageId)).map(Fe=>Fe.message);return je.length?[...V,...je].sort((Fe,Je)=>Fe.createdAt-Je.createdAt||Fe.id.localeCompare(Je.id)):V},[Y,i]),Ue=z.useMemo(()=>eC(Le,b,j),[Le,j,b]),it=z.useMemo(()=>new Map(Le.map(V=>[V.id,V])),[Le]),tt=z.useMemo(()=>ee.map(V=>it.get(V)).filter(V=>!!V).map(V=>({messageId:V.id,authorName:V.authorName,preview:lp(V.body,96)})),[ee,it]),st=Up(He?.title??"# shared-channel"),ot=Ne?bv(Ne):He?.subtitle??null,bt=He&&"count"in He&&He.count>0?He.count:null,Ye=Ue.at(-1)??null,Ge=z.useMemo(()=>u.flatMap(V=>{const me=V.selector??V.defaultSelector;return me?[{agentId:V.id,title:V.title,subtitle:V.projectRoot??V.cwd??V.subtitle??null,mentionToken:me,definitionId:V.definitionId,workspaceQualifier:V.workspaceQualifier,branch:V.branch,harness:V.harness,state:V.state,statusLabel:V.statusLabel,searchText:[V.title,V.id,V.definitionId??"",me,V.selector??"",V.defaultSelector??"",V.workspaceQualifier??"",V.branch??"",V.harness??"",V.projectRoot??"",V.cwd??""].join(" ").toLowerCase()}]:[]}).sort((V,me)=>V.title.localeCompare(me.title)),[u]);z.useEffect(()=>{Q(!0);const V=le.current;V&&window.requestAnimationFrame(()=>{V.scrollTo({top:V.scrollHeight,behavior:"auto"})})},[j,b]),z.useEffect(()=>{if(!P)return;const V=le.current;V&&window.requestAnimationFrame(()=>{V.scrollTo({top:V.scrollHeight,behavior:"smooth"})})},[Ye?.body,Ye?.id,Ye?.receipt?.state,Ne?.activeTask,Ne?.state,P]);const We=z.useCallback(V=>{const me=V.currentTarget,je=me.scrollHeight-me.scrollTop-me.clientHeight;Q(je<=48)},[]),we=z.useMemo(()=>rC(M,q),[M,q]),et=z.useMemo(()=>{if(!we)return[];const V=b==="direct"?j:null;return Ge.map(me=>({candidate:me,score:iC(me,we.query,V)})).filter(({score:me})=>me>0).sort((me,je)=>je.score-me.score||me.candidate.title.localeCompare(je.candidate.title)).slice(0,8).map(({candidate:me})=>me)},[we,Ge,j,b]),Se=z.useMemo(()=>Ge.reduce((V,me)=>(V.set(me.title,(V.get(me.title)??0)+1),V),new Map),[Ge]),Ze=et.length>0;z.useEffect(()=>{if(!Ze){F(0);return}F(V=>Math.min(V,et.length-1))},[Ze,et.length]);const mt=z.useMemo(()=>{if(!xe)return[];const V=new Set(xe.messageIds);return Le.filter(me=>V.has(me.id))},[Le,xe]),re=Re?u.find(V=>V.id===Re)??null:null,ge=z.useMemo(()=>{if(re)return f.filter(V=>V.project===re.id||V.agent===re.title);if(xe){const V=new Set(xe.participants.map(je=>je.id)),me=new Set(xe.participants.map(je=>je.title));return f.filter(je=>V.has(je.project)||me.has(je.agent))}return pe?.relayDestinationKind==="channel"&&pe.relayDestinationId?f.filter(V=>V.tags?.includes(pe.relayDestinationId??"")??!1):f.slice(0,8)},[re,xe,pe,f]),Ce=z.useCallback((V,me)=>{v(V),C(me),N(o?.threads.find(je=>je.relayDestinationKind===V&&je.relayDestinationId===me)?.id??null),h("messages")},[o,h]),_e=z.useCallback(V=>{if(!we)return;const me=M.slice(we.end),je=me.startsWith(" ")||me.length===0?"":" ",Fe=`${M.slice(0,we.start)}${V.mentionToken}${je}${me}`,Je=we.start+V.mentionToken.length+je.length;L(Fe),D(Je),F(0),window.requestAnimationFrame(()=>{const qe=_.current;qe&&(qe.focus(),qe.setSelectionRange(Je,Je))})},[we,M]),Xe=z.useCallback(async()=>{const V=M.trim();if(!V||H||!l?.sendRelayMessage)return;const me=M,je=oe,Fe=ee,Je=GM(),qe=oe?.messageId??ee[0]??null,St=qM({relayState:i,appSettings:p,destinationKind:b,destinationId:j,body:V,replyToMessageId:qe,clientMessageId:Je});X(!0),O("Sending…"),$(Qt=>[...Qt,{clientMessageId:Je,message:St}]),L(""),J(null),w([]);try{const Qt=await l.sendRelayMessage({destinationKind:b,destinationId:j,body:V,replyToMessageId:qe,referenceMessageIds:ee,clientMessageId:Je});y(Qt),$(Gt=>Gt.map(Ut=>Ut.clientMessageId===Je?{...Ut,message:{...Ut.message,receipt:Ut.message.receipt?{...Ut.message.receipt,label:"Sent",detail:null}:{state:"sent",label:"Sent",detail:null}}}:Ut)),O("Sent.")}catch(Qt){$(Gt=>Gt.filter(Ut=>Ut.clientMessageId!==Je)),L(me),J(je),w(Fe),O(lt(Qt))}finally{X(!1)}},[p,M,H,ee,i,oe,l,j,b,y]),Ae=z.useCallback((V,me)=>{Ce("direct",V),w([]),J(me?.replyToMessage?{messageId:me.replyToMessage.id,authorId:me.replyToMessage.authorId,authorName:me.replyToMessage.authorName,preview:lp(me.replyToMessage.body,96)}:null),typeof me?.draft=="string"&&L(me.draft),me?.focusComposer&&T(je=>je+1)},[Ce]),ue=z.useCallback(V=>{V.isOperator||(Ae(V.authorId,{replyToMessage:V,draft:"Following up on this.",focusComposer:!0}),O(`Drafting a follow-up to ${V.authorName}.`))},[Ae]),Ee=z.useCallback((V,me)=>{Ae(V,{draft:me??null,focusComposer:!0})},[Ae]);return{selectedConversationKind:b,setSelectedConversationKind:v,selectedConversationId:j,setSelectedConversationId:C,selectedMessageThreadId:E,setSelectedMessageThreadId:N,selectedMessagesThread:pe,selectedMessagesInternalThread:xe,selectedMessagesInternalTarget:ce,selectedMessagesDetailAgentId:Re,selectedMessagesDetailAgent:re,selectedMessagesInternalMessages:mt,selectedMessagesSessions:ge,composerDraft:M,setComposerDraft:L,composerSending:H,composerSelectionStart:q,setComposerSelectionStart:D,mentionSelectionIndex:B,setMentionSelectionIndex:F,messagesFeedback:Z,setMessagesFeedback:O,replyTarget:oe,setReplyTarget:J,contextMessageIds:ee,setContextMessageIds:w,composerRef:_,timelineViewportRef:le,mergedConversationMessages:Le,visibleConversationMessages:Ue,currentConversationTitle:st,currentConversationSubtitle:ot,currentConversationCount:bt,selectedDirectConversation:Ne,contextReferences:tt,mentionMenuOpen:Ze,mentionSuggestions:et,mentionDuplicateTitleCounts:Se,handleConversationTimelineScroll:We,openConversation:Ce,applyMentionSuggestion:_e,sendMessage:Xe,openDirectConversation:Ae,nudgeMessage:ue,openAgentDirectMessage:Ee,messageThreads:R}}const Rz=["profile","knowledge","agents","workspaces","communication","database","appearance"];function Mz(e){return Rz.includes(e)}function zz(e,l){const a=l?.agentId?.trim();return e==="agents"&&a?`/settings/agents/${encodeURIComponent(a)}`:`/settings/${e}`}function Oz(e){if(e==="/settings"||e==="/settings/")return{section:"profile",agentId:null};if(!e.startsWith("/settings/"))return null;const l=e.slice(10).split("/").filter(Boolean),a=l[0]??"";if(!a)return{section:"profile",agentId:null};if(!Mz(a))return null;if(a!=="agents")return l.length===1?{section:a,agentId:null}:null;if(l.length===1)return{section:"agents",agentId:null};if(l.length===2)try{return{section:"agents",agentId:decodeURIComponent(l[1]??"")||null}}catch{return null}return null}const Lz=["overview","inbox","activity","machines","plans","sessions","search","messages","relay","inter-agent","agents","logs","settings","help"];function Dz(e){return e!==null&&Lz.includes(e)}function _z(e){if(e==="/")return"overview";const l=e.slice(1).split("/")[0]??"";return!l||l==="pairing"||l==="settings"?null:Dz(l)?l:null}function Bz(e,l,a,i){return e==="pairing"?"/pairing":l==="settings"?zz(a,{agentId:i}):l==="overview"?"/":`/${l}`}const Iz={enableAll:!1,overview:!0,inbox:!0,relay:!0,pairing:!0,interAgent:!0,agents:!0,settings:!0,logs:!0,activity:!1,machines:!1,plans:!1,sessions:!0,search:!0,phonePreparation:!1,telegram:!1,voice:!1,monitor:!1},o1=["claude","codex"],yk="scout.desktop.home-cache.v1";function Pz(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(yk);return e?JSON.parse(e):null}catch{return null}}function Uz(e){if(!(typeof window>"u"))try{window.localStorage.setItem(yk,JSON.stringify({...e,savedAt:Date.now()}))}catch{}}function bu(e,l,a){const i={label:e,durationMs:Math.round(performance.now()-l),recordedAt:Date.now(),detail:a};return console.info(`[scout] ${e}`,{durationMs:i.durationMs,...a}),i}function yu(e,l){const a={...e};return l&&(a.Total=`${l.totalMs}ms`,l.steps.forEach(i=>{a[i.label]=`${i.durationMs}ms`})),Object.keys(a).length>0?a:void 0}function vu(e){return{runtime:e.runtime,messages:e.messages,sessions:e.sessions,relay:e.relay,interAgent:e.interAgent,performance:e.performance??null}}function Hz(e,l){return{...l,planCount:e.planCount,workspaceCount:e.workspaceCount,plans:e.plans,subtitle:`${l.taskCount} asks · ${l.findingCount} findings · ${e.planCount} plans · ${e.workspaceCount} workspaces`}}function Fz(){const e=tz(),[l,a]=A.useState(240),[i,o]=A.useState(340),[u,d]=A.useState(!1),[f,p]=A.useState("relay"),[h,y]=A.useState("overview"),[b,v]=A.useState(""),[j,C]=A.useState(null),[E,N]=A.useState(null),[M,L]=A.useState(!0),[H,X]=A.useState("overview"),[q,D]=A.useState(null),[B,F]=A.useState(null),[Z,O]=A.useState(null),[P,Q]=A.useState(null),[oe,J]=A.useState(null),[ee,w]=A.useState({services:null,home:null,workspace:null}),[Y,$]=A.useState(!1),[ye,T]=A.useState(!0),[_,le]=A.useState(!1),[R,pe]=A.useState(!1),[xe,ce]=A.useState(null),[Re,Te]=A.useState(!1),[Ne,He]=A.useState(!1),[Le,Ue]=A.useState("profile"),[it,tt]=A.useState(null),st=A.useRef(null),ot=A.useRef(null),bt=A.useRef(!1),Ye=sN(),Ge=h1();A.useLayoutEffect(()=>{if(!Ge.pathname.startsWith("/settings"))return;const I=Oz(Ge.pathname);if(I){p("relay"),y("settings"),Ue(I.section),tt(I.agentId);return}Ye("/settings/profile",{replace:!0})},[Ge.pathname,Ye]),A.useLayoutEffect(()=>{if(Ge.pathname.startsWith("/settings"))return;if(Ge.pathname==="/pairing"){p("pairing"),y(W=>W==="settings"?"overview":W);return}const I=_z(Ge.pathname);if(I){p("relay"),y(I);return}Ye("/",{replace:!0})},[Ge.pathname,Ye]),A.useEffect(()=>{const I=Bz(f,h,Le,it);Ge.pathname!==I&&Ye(I,{replace:!0})},[h,Ge.pathname,Ye,f,it,Le]);const We=z.useCallback(()=>{p("relay"),y("help"),Ft(null)},[]),[we,et]=A.useState(!1),[Se,Ze]=A.useState(!1),[mt,re]=A.useState(!1),ge=A.useRef(null),Ce=A.useRef(null),_e=A.useRef(null),Xe=A.useRef(!1),Ae=A.useRef(!1),ue=A.useRef(!1),Ee=A.useRef(!1),V=f==="relay"&&(h==="messages"||h==="relay"),me=V?P?.sessions??oe?.sessions??[]:oe?.sessions??[],je=oe?.machines??null,Fe=oe?.plans??null,Je=V?P?.messages??oe?.messages??null:oe?.messages??null,qe=V?P?.runtime??oe?.runtime??null:oe?.runtime??null,St=V?P?.relay??oe?.relay??null:oe?.relay??null,Qt=V?P?.interAgent??oe?.interAgent??null:oe?.interAgent??null,Gt=Qt?.agents??[],Ut=Qt?.threads??[],yt=q?.features??oe?.appInfo.features??Iz,Jt=q?.capabilities??oe?.appInfo.capabilities;A.useEffect(()=>{st.current=B},[B]),A.useEffect(()=>{ot.current=Z},[Z]);const se=z.useCallback((I,W)=>{Uz({homeState:I,servicesState:W})},[]),Me=z.useCallback(async()=>{if(!e?.getServicesState||Ae.current)return null;const I=performance.now();$(!0),Ae.current=!0;try{const W=await e.getServicesState();return O(W),se(st.current,W),w(be=>({...be,services:bu("services-state",I,yu({serviceCount:W.services.length},W.performance))})),W}catch(W){return ce(lt(W)),null}finally{Ae.current=!1,$(!1)}},[se,e]),ze=z.useCallback(async(I=!1)=>{if(!e?.getHomeState)return ce("Desktop bridge is unavailable."),T(!1),null;if(Xe.current)return null;I&&T(!0);const W=performance.now();Xe.current=!0;try{const be=await e.getHomeState();return F(be),ce(null),se(be,ot.current),w(At=>({...At,home:bu("home-state",W,yu({agents:be.agents.length,activity:be.activity.length},be.performance))})),be}catch(be){return ce(lt(be)),null}finally{Xe.current=!1,T(!1)}},[se,e]),nt=z.useCallback(async(I=!1)=>{if(!e?.getMessagesWorkspaceState)return ce("Desktop bridge is unavailable."),le(!1),null;if(ue.current)return null;I&&le(!0),ue.current=!0;const W=performance.now();try{const be=await e.getMessagesWorkspaceState();return Q(be),ce(null),w(At=>({...At,workspace:bu("messages-workspace",W,yu({threads:be.messages.threads.length,messages:be.relay.messages.length,agents:be.interAgent.agents.length,sessions:be.sessions.length},be.performance))})),be}catch(be){return ce(lt(be)),null}finally{ue.current=!1,le(!1)}},[e]),Xt=z.useCallback(async(I=!1)=>{if(!e?.getShellState)return ce("Desktop bridge is unavailable."),pe(!1),null;if(Ee.current)return null;I&&pe(!0),Ee.current=!0;const W=performance.now();try{const be=await e.getShellState();return J(be),ce(null),w(At=>({...At,workspace:bu("relay-workspace",W,yu({messages:be.relay.messages.length,agents:be.interAgent.agents.length,sessions:be.sessions.length},be.performance))})),be}catch(be){return ce(lt(be)),null}finally{Ee.current=!1,pe(!1)}},[e]),bn=z.useCallback(I=>{J(W=>W&&{...W,...I,relay:{...I.relay,voice:W.relay.voice},plans:Hz(W.plans,I.plans)}),Q(W=>W&&{...W,...vu(I),relay:{...I.relay,voice:W.relay.voice}})},[]);A.useEffect(()=>{if(!e?.getAppInfo)return;let I=!1;return(async()=>{try{const be=await e.getAppInfo();I||D(be)}catch{I||D(null)}})(),()=>{I=!0}},[e]),A.useEffect(()=>{if(e?.onOpenKnowledgeBase)return e.onOpenKnowledgeBase(We)},[We,e]);const xr=z.useCallback(I=>{const W=I?.runtime?.brokerReachable??Z?.services.find(be=>be.id==="broker")?.reachable??!1;if(p("relay"),W){y("messages"),el("channel"),Jl("shared"),jn("Relay is running."),Ft(null);return}y("settings"),Ue("communication"),et(!0),Ft("Relay is not running yet. Finish onboarding by starting the broker from Communication.")},[Z]),$l=dz({activeView:h,settingsSection:Le,scoutDesktop:e,shellState:oe,surfaceCaps:Jt,completeOnboardingIntoRelay:xr,loadShellState:Xt}),{SOURCE_ROOT_PATH_SUGGESTIONS:gr,appSettings:yn,setAppSettings:Jr,appSettingsLoading:br,workspaceInventoryLoading:Hn,appSettingsSaving:Yt,appSettingsFeedback:fn,setAppSettingsFeedback:Ft,setAppSettingsDraft:Yl,isAppSettingsEditing:Ol,onboardingWizardStep:Ql,setOnboardingWizardStep:ls,onboardingCommandPending:Jn,onboardingCommandResult:Ll,onboardingCommandHistory:ml,onboardingCopiedCommand:Dl,startupOnboardingState:Ca,setIsAppSettingsEditing:_l,visibleAppSettings:qt,agentableProjects:yr,appSettingsDirty:vr,projectRetirementPendingRoot:Bl,workspaceInventoryLoaded:Xl,canRefreshWorkspaceInventory:Do,showDoctorOutput:as,onboardingContextRoot:ei,onboardingHasProjectConfig:rs,onboardingRuntimeMatch:Kl,onboardingWizardSteps:Il,onboardingWizardIndex:Fn,activeOnboardingStep:Kt,canGoToPreviousOnboardingStep:ti,canGoToNextOnboardingStep:ve,startupOnboardingVisible:Ke,startupOnboardingBlocking:Ot,buildOnboardingCommandLine:vn,applyNextAppSettings:ni,applyRestartedOnboardingSettings:kn,refreshVisibleAppSettings:Ta,handleStartAppSettingsEdit:Bn,handleCancelAppSettingsEdit:Aa,updateAppSettingsDraft:kr,handleSaveAppSettings:Zu,moveOnboardingWizard:_o,handleRunOnboardingCommand:Zl,handleRestoreProject:oh,handleRestartOnboarding:Wu,handleAddSourceRootSuggestion:Bo,handleSetSourceRootAt:is,handleAddSourceRootRow:Ju,handleRemoveSourceRootRow:ed,handleBrowseForSourceRoot:li,handleSetOnboardingContextRoot:wl,handleBrowseForOnboardingContextRoot:ss,dismissStartupOnboarding:os,handleOnboardingContinue:Ea,skipCurrentOnboardingStep:Ra,handleCopyOnboardingCommand:Io,handleLoadWorkspaceInventory:Po}=$l,cs=Ez({activeView:h,scoutDesktop:e,voiceEnabled:yt.voice,relayState:St,messagesState:Je,interAgentAgents:Gt,interAgentThreads:Ut,sessions:me,appSettings:yn,setActiveView:y,applyRelayWorkspacePatch:bn}),{selectedConversationKind:Wl,setSelectedConversationKind:el,selectedConversationId:jr,setSelectedConversationId:Jl,selectedMessageThreadId:Rn,setSelectedMessageThreadId:ea,selectedMessagesThread:ai,selectedMessagesDetailAgentId:Uo,messagesFeedback:us,setMessagesFeedback:jn,mergedConversationMessages:Nr,openConversation:Nn,openDirectConversation:ta}=cs,{pairingState:Ma,pairingLoading:za,pairingError:Ho,setPairingError:ds,pairingControlPending:fs,pairingConfigPending:wr,pairingApprovalPendingId:ri,pairingConfigFeedback:Fo,setPairingConfigFeedback:td,pendingApprovals:ii,commitPairingState:nd,refreshPairingState:ms,handlePairingControl:ld,handleUpdatePairingConfig:ad,handleDecidePairingApproval:ps}=iz({pairingEnabled:yt.pairing,scoutDesktop:e,setRelayFeedback:jn}),rd=FS(Ma,za,Ho),id=sz({activeView:h,scoutDesktop:e,sessions:me}),si=rz({activeView:h,settingsSection:Le,scoutDesktop:e,surfaceCaps:Jt,pendingBrokerInspectorFocus:we,setPendingBrokerInspectorFocus:et,relayServiceInspectorRef:_e,loadShellState:Xt,setShellState:J,setShellError:ce,applyRestartedOnboardingSettings:kn,commitPairingState:nd,pairingState:Ma,setAppSettingsFeedback:Ft,setRelayFeedback:jn,setPairingError:ds,setPairingConfigFeedback:td}),{isFeedbackDialogOpen:sd,feedbackBundle:od,feedbackBundleLoading:cd,feedbackBundleError:ud,feedbackDraft:hs,setFeedbackDraft:dd,feedbackSubmission:fd,feedbackActionPending:md,feedbackActionMessage:qo,refreshLogs:pd,refreshBrokerInspector:hd,openFeedbackDialog:Vo,handleFeedbackDialogOpenChange:xd,handleRefreshFeedbackBundle:gd,handleCopyFeedbackBundle:bd,handleSubmitFeedbackReport:yd,handleRepairSetup:vd}=si,xs=lz({activeView:h,scoutDesktop:e,surfaceCaps:Jt,interAgentState:Qt,interAgentAgents:Gt,interAgentThreads:Ut,relayState:St,selectedMessagesThread:ai,selectedMessagesDetailAgentId:Uo,selectedRelayKind:Wl,selectedRelayId:jr,agentableProjects:yr,visibleAppSettings:qt,isAppSettingsEditing:Ol,appSettingsDirty:vr,setAppSettings:Jr,setAppSettingsDraft:Yl,setActiveView:y,setSettingsSection:Ue,setSettingsAgentId:tt,setShellState:J,setShellError:ce,setRelayFeedback:jn}),{selectedInterAgentId:hn,selectedInterAgentThreadId:Oa,setSelectedInterAgentThreadId:gs,selectedInterAgent:qn,visibleInterAgentThreads:bs,selectedInterAgentThread:tl,handleSelectInterAgent:na,deactivateAgentConfigEdit:Sr,isCreateAgentDialogOpen:La,setIsCreateAgentDialogOpen:kd,createAgentDraft:jd,setCreateAgentDraft:Nd,createAgentDefaults:Go,createAgentSubmitting:$o,createAgentFeedback:Cr,setCreateAgentFeedback:Tr,handleOpenCreateAgentDialog:ch,handleBrowseCreateAgentProject:oi,handleCreateAgent:Yo,visibleAgentSession:Qo,agentSessionPending:ys,agentSessionLoading:vs,agentSessionFeedback:Xo,agentSessionCopied:Ko,isAgentSessionPeekOpen:Zo,closeAgentSessionPeek:wd,agentSessionPeekViewportRef:Sd,handlePeekAgentSessionScroll:Cd,handleOpenAgentSession:Td,handleCopyAgentSessionCommand:Ad,handlePeekAgentSession:Vn,refreshAgentSession:Ar}=xs;A.useEffect(()=>{if(!(h!=="settings"||Le!=="agents")){if(!it){Sr();return}hn!==it&&na(it)}},[h,Sr,na,hn,it,Le]);const Pl=f==="relay"&&(h==="inbox"||h==="activity"||h==="machines"||h==="plans"||h==="sessions"||h==="search"||h==="inter-agent"||h==="agents"||h==="logs"||h==="settings"&&(Le==="agents"||Le==="communication"||Le==="database")),Wo=f==="relay"&&(h==="inbox"||h==="activity"||h==="messages"||h==="relay"||h==="agents"||h==="inter-agent"||h==="sessions"||h==="search");A.useEffect(()=>{if(bt.current||!e)return;bt.current=!0;const I=Pz();I?.servicesState&&O(I.servicesState),I?.homeState&&(F(I.homeState),T(!1)),Me(),ze(!I?.homeState)},[ze,Me,e]),A.useEffect(()=>{if(!(Ot||!V||P)){if(oe){Q(vu(oe));return}nt(!0)}},[nt,V,P,oe,Ot]),A.useEffect(()=>{Ot||!Pl||oe||Xt(!0)},[Xt,Pl,oe,Ot]),A.useEffect(()=>{const I=Je?.threads??[];if(I.length===0){Rn!==null&&ea(null);return}if(Rn&&I.some(be=>be.id===Rn))return;const W=I.find(be=>be.relayDestinationKind===Wl&&be.relayDestinationId===jr)??I.find(be=>be.interAgentThreadId===Oa)??I[0];W&&W.id!==Rn&&ea(W.id)},[Je,jr,Wl,Oa,Rn,ea]),A.useEffect(()=>{Rn&&(L(!0),X("overview"))},[Rn]),A.useEffect(()=>{if(h!=="settings"||!Ol)return;const I=Ce.current;if(!I)return;const W=window.requestAnimationFrame(()=>{I.focus(),I.select()});return()=>{window.cancelAnimationFrame(W)}},[h,Ol]);const ks=A.useMemo(()=>{const I=new Map;return me.forEach(W=>{const be=I.get(W.project);!be||new Date(W.lastModified)>new Date(be.lastModified)?I.set(W.project,{count:(be?.count||0)+1,lastModified:W.lastModified}):be&&I.set(W.project,{...be,count:be.count+1})}),Array.from(I.entries()).map(([W,be])=>({name:W,...be}))},[me]),Jo=A.useMemo(()=>{let I=me;if(j&&(I=I.filter(W=>W.project===j)),b){const W=b.toLowerCase();I=I.filter(be=>be.title.toLowerCase().includes(W)||be.preview.toLowerCase().includes(W)||be.tags?.some(At=>At.toLowerCase().includes(W))||be.agent.toLowerCase().includes(W)||be.project.toLowerCase().includes(W))}return I.sort((W,be)=>new Date(be.lastModified).getTime()-new Date(W.lastModified).getTime())},[me,b,j]),ci=A.useMemo(()=>({totalSessions:me.length,totalMessages:me.reduce((I,W)=>I+W.messageCount,0),totalTokens:me.reduce((I,W)=>I+(W.tokens||0),0),projects:ks.length}),[me,ks]),Ed=A.useMemo(()=>Array.from(new Set(me.map(I=>I.agent))).sort(),[me]),Da=A.useMemo(()=>new Map(Gt.map(I=>[I.id,I])),[Gt]),js=A.useMemo(()=>new Map((St?.directs??[]).map(I=>[I.id,I])),[St]),Er=A.useMemo(()=>{if(!St||!tl)return[];const I=new Set(tl.messageIds);return St.messages.filter(W=>I.has(W.id))},[St,tl]),Ns=A.useMemo(()=>{if(!qn)return[];const I=new Set(bs.filter(W=>W.sourceKind==="private").flatMap(W=>W.messageIds));return Nr.filter(W=>I.has(W.id)||W.authorId===qn.id).slice(-60)},[Nr,qn,bs]),ec=A.useMemo(()=>Fe?.tasks.filter(I=>I.targetAgentId===hn)??[],[Fe,hn]),Sl=A.useMemo(()=>Fe?.findings.filter(I=>I.targetAgentId===hn||I.requesterId===hn)??[],[Fe,hn]),_a=A.useMemo(()=>Sl.filter(I=>I.requesterId===hn),[Sl,hn]),ws=tl?tp(tl,hn):qn?`${qn.title}'s agent threads`:"Inter-Agent",tc=tl?np(tl,hn):qn?.statusDetail??"Select an agent to inspect private threads between agents.",pl=A.useMemo(()=>{if(tl){const I=Pp(tl,hn);if(I.length===1)return Gt.find(W=>W.id===I[0]?.id)??qn}return qn},[tl,hn,Gt,qn]),nc=pl?pl.profileKind==="project"?"Configure":"Profile":null,lc=pl??qn,Rr=z.useCallback((I,W)=>{if(!I)return null;const be=W?.compact?Zr(I)??I:I;return be.includes("/")||be.startsWith("~/")||be.startsWith(".openscout")?r.jsx("button",{type:"button",className:W?.className??"text-left underline underline-offset-2 decoration-dotted hover:opacity-80 transition-opacity",style:W?.style??{color:g.ink},onClick:gi=>{gi.preventDefault(),!(!Jt?.canRevealPath||!e?.revealPath)&&e.revealPath(I).catch(oc=>{Ft(lt(oc))})},title:"Open in Finder",children:be}):r.jsx(r.Fragment,{children:be})},[e,Jt]),Rd=A.useMemo(()=>[...me].sort((I,W)=>new Date(W.lastModified).getTime()-new Date(I.lastModified).getTime()).slice(0,5),[me]);A.useEffect(()=>{qe&&O(I=>{if(!I)return I;const W={...I,updatedAtLabel:qe.updatedAtLabel??I.updatedAtLabel,services:I.services.map(be=>be.id==="broker"?{...be,status:qe.brokerReachable?qe.brokerHealthy?"running":"degraded":"offline",statusLabel:qe.brokerReachable?qe.brokerHealthy?"Running":"Degraded":"Offline",healthy:qe.brokerHealthy,reachable:qe.brokerReachable,detail:qe.brokerLabel,updatedAtLabel:qe.updatedAtLabel??be.updatedAtLabel,url:qe.brokerUrl,nodeId:qe.nodeId}:be.id==="helper"?{...be,status:qe.helperRunning?"running":"offline",statusLabel:qe.helperRunning?"Running":"Offline",healthy:qe.helperRunning,reachable:qe.helperRunning,detail:qe.helperDetail,updatedAtLabel:qe.updatedAtLabel??be.updatedAtLabel}:be)};return se(B,W),W})},[B,se,qe]),A.useEffect(()=>{if(!St)return;const I={title:"Home",subtitle:`${St.directs.length} agents · ${St.messages.filter(W=>!W.isVoice).length} recent updates`,updatedAtLabel:St.lastUpdatedLabel??qe?.updatedAtLabel??null,agents:St.directs.slice(0,24).map(W=>({id:W.id,title:W.title,role:null,summary:W.preview,projectRoot:null,state:W.state,reachable:W.reachable,statusLabel:W.statusLabel,statusDetail:W.statusDetail,activeTask:W.activeTask,timestampLabel:W.timestampLabel})),activity:St.messages.filter(W=>!W.isVoice).sort((W,be)=>be.createdAt-W.createdAt).slice(0,24).map(W=>({id:W.id,kind:W.isSystem?"system":"message",actorId:W.authorId,actorName:W.authorName,title:W.authorName,detail:W.body,conversationId:W.conversationId,channel:W.normalizedChannel,timestamp:W.createdAt,timestampLabel:W.timestampLabel})),recentSessions:[...me].sort((W,be)=>new Date(be.lastModified).getTime()-new Date(W.lastModified).getTime()).slice(0,6)};F(I),se(I,Z)},[se,St,qe?.updatedAtLabel,Z,me]);const ui=B?.agents??[],Md=B?.activity??[],di=A.useMemo(()=>[...Fe?.tasks??[]].sort((I,W)=>W.createdAt-I.createdAt).slice(0,18),[Fe]),ac=A.useMemo(()=>[...Fe?.findings??[]].slice(0,10),[Fe]),Ss=A.useMemo(()=>(je?.machines??[]).flatMap(I=>I.endpoints.map(W=>({machineId:I.id,machineTitle:I.title,machineStatus:I.status,endpoint:W}))).sort((I,W)=>{const be=At=>{switch(At){case"running":return 0;case"waiting":return 1;case"idle":return 2;default:return 3}};return be(I.endpoint.state)-be(W.endpoint.state)||I.endpoint.agentName.localeCompare(W.endpoint.agentName)}).slice(0,14),[je]),nl=A.useMemo(()=>[...Nr].filter(I=>!I.isVoice).slice(-18).reverse(),[Nr]),Mr=A.useMemo(()=>(Fe?.tasks??[]).filter(I=>I.status==="failed").length,[Fe]),Mn=ii.length+Mr,Ba=di.find(I=>I.status==="running")??di[0]??null,zn=Z?.services.find(I=>I.id==="broker")??null,fi=ui.filter(I=>I.reachable).length,mi=ui.length>0?ui.length:qe?.agentCount??0,hl=!Ot&&ye&&!Z&&!B&&!xe,la=hl?"Syncing…":zn?.statusLabel??(qe?.brokerReachable?"Running":"Offline"),rc=hl?"Checking relay health.":zn?.detail?`Relay diagnostics · ${zn.detail}`:zn?.reachable||qe?.brokerReachable?"Open Relay diagnostics":"Relay is offline. Open diagnostics.",pi=hl?"bg-sky-500 animate-pulse":zn?.status==="running"||qe?.brokerReachable?"bg-emerald-500":zn?.status==="degraded"?"bg-amber-500":"bg-slate-400",Ia=hl?"Syncing":zn?.healthy||qe?.brokerHealthy?"Healthy":zn?.reachable||qe?.brokerReachable?"Reachable":"Offline",Cs=A.useMemo(()=>xe||St?.voice.captureState==="error"?"error":hl?null:zn&&(!zn.reachable||!zn.healthy)||qe&&(!qe.brokerReachable||!qe.brokerHealthy)?"warning":null,[zn,hl,St?.voice.captureState,qe,xe]),In=Cs==="error"?"Logs · attention required":Cs==="warning"?"Logs · check runtime warnings":"Logs",Ts=lC(new Date),en=[];yt.overview&&en.push({id:"overview",icon:r.jsx(Ap,{size:16,strokeWidth:1.5}),title:"Overview"}),yt.inbox&&en.push({id:"inbox",icon:r.jsx(AN,{size:16,strokeWidth:1.5}),title:"Inbox",badgeCount:Mn>0?Mn:void 0}),yt.relay&&en.push({id:"messages",icon:r.jsx(Rl,{size:16,strokeWidth:1.5}),title:"Messages"}),yt.activity&&en.push({id:"activity",icon:r.jsx(Zm,{size:16,strokeWidth:1.5}),title:"Activity Monitor"}),yt.machines&&en.push({id:"machines",icon:r.jsx(E1,{size:16,strokeWidth:1.5}),title:"Machines"}),yt.plans&&en.push({id:"plans",icon:r.jsx(Tp,{size:16,strokeWidth:1.5}),title:"Plans"}),yt.search&&en.push({id:"search",icon:r.jsx(So,{size:16,strokeWidth:1.5}),title:"Search"});const As=new Set(en.map(I=>I.id).filter(I=>I!=="overview"));yt.logs&&As.add("logs");const xl=[{id:"profile",label:"General",description:"Local Scout defaults, CLI setup commands, and workspace scanning roots.",icon:r.jsx(fr,{size:15})},{id:"agents",label:"Agents",description:"Select an agent, then edit its runtime, capabilities, and restart controls.",icon:r.jsx(Yi,{size:15})},{id:"workspaces",label:"Workspaces",description:"Workspace discovery, repo bindings, and harness readiness.",icon:r.jsx(fr,{size:15})},{id:"communication",label:"Communication",description:"Broker, relay delivery, and live runtime status.",icon:r.jsx(Zm,{size:15})}];yt.sessions&&xl.push({id:"database",label:"Database",description:"Session indexing and storage.",icon:r.jsx(GN,{size:15})}),yt.enableAll&&xl.push({id:"appearance",label:"Appearance",description:"Visual preferences and display options.",icon:r.jsx(j2,{size:15})});const aa=xl.find(I=>I.id===Le)??xl[0];A.useEffect(()=>{if(f!=="relay")return;new Set([...en.map(W=>W.id),...yt.relay?["relay","inter-agent","agents"]:[],...yt.sessions?["sessions"]:[],...yt.settings?["settings"]:[],...yt.logs?["logs"]:[]]).has(h)||y(yt.relay?"messages":"overview")},[h,yt.logs,yt.relay,yt.sessions,yt.settings,en,f]),A.useEffect(()=>{xl.some(I=>I.id===Le)||Ue("profile")},[Le,xl]);const Pa=z.useCallback((I,W)=>{I.preventDefault(),ge.current=W,document.addEventListener("mousemove",Ua),document.addEventListener("mouseup",wn)},[]),ic=z.useCallback(I=>{Pa(I,"left-sidebar")},[Pa]),Es=z.useCallback(I=>{Pa(I,"right-sidebar")},[Pa]),Ua=z.useCallback(I=>{if(ge.current==="left-sidebar"){const W=I.clientX-48;W>160&&W<400&&a(W);return}if(ge.current==="right-sidebar"){const W=window.innerWidth-I.clientX;W>280&&W<520&&o(W)}},[]),wn=z.useCallback(()=>{ge.current=null,document.removeEventListener("mousemove",Ua),document.removeEventListener("mouseup",wn)},[Ua]);A.useEffect(()=>()=>{document.removeEventListener("mousemove",Ua),document.removeEventListener("mouseup",wn)},[Ua,wn]);const ra=async()=>{Te(!0),jn("Refreshing…");try{if(f==="pairing"&&yt.pairing&&(e?.refreshPairingState||e?.getPairingState)){await ms()&&jn("Pairing refreshed.");return}if(h==="overview")await Promise.all([Me(),ze(!B)]);else if(Wo&&e?.refreshRelayShellPatch){const I=await e.refreshRelayShellPatch();bn(I),ce(null)}else if(V)await nt(!0);else if(Pl&&e?.refreshShellState){const I=await e.refreshShellState();J(I),ce(null)}else Pl&&await Xt(!0);(h==="settings"||h==="help")&&await Ta({preferInventory:h==="settings"&&Le==="workspaces"}),h==="settings"&&Le==="communication"&&await hd(),h==="logs"&&pd(),h==="agents"&&hn&&Ar(),jn("Refreshed.")}catch(I){jn(lt(I))}finally{Te(!1)}},Ha=z.useCallback(()=>{if(!(typeof window>"u")){if(He(!0),e?.reloadApp){e.reloadApp();return}window.location.reload()}},[e]),hi=z.useCallback(()=>{p("relay"),y("settings"),Ue("communication"),et(!0)},[]),Fa=z.useCallback(()=>{(async()=>{try{if(!Jt?.canQuitHost)return;e?.quitApp&&await e.quitApp()}catch(I){Ft(lt(I))}})()},[e,Jt]),Sn=z.useCallback(I=>{na(I),Sr(),L(!0),X("overview"),Nn("direct",I)},[Sr,na,Nn]),Gn=async()=>{if(!e?.toggleVoiceCapture){ce("Desktop bridge is unavailable.");return}try{const I=await e.toggleVoiceCapture();J(I),Q(W=>W&&vu(I)),ce(null),jn(I.relay.voice.isCapturing?"Voice capture started.":"Voice capture stopped.")}catch(I){jn(lt(I))}},Cl=async I=>{if(!e?.setVoiceRepliesEnabled){ce("Desktop bridge is unavailable.");return}try{const W=await e.setVoiceRepliesEnabled(I);J(W),Q(be=>be&&vu(W)),ce(null),jn(I?"Playback enabled.":"Playback disabled.")}catch(W){jn(lt(W))}},gl=I=>{N(I),L(!0),X("history");const W=Je?.threads.find(be=>be.relayDestinationKind==="direct"&&be.relayDestinationId===I.project)??null;W&&xi(W),C(null),y("messages")},ll=A.useMemo(()=>(Fe?.tasks??[]).filter(I=>I.status==="failed").slice(0,10).map(I=>({id:`task-failed:${I.id}`,kind:"task",tone:"critical",title:I.title,summary:`${I.targetAgentName} reported a failed ask.`,detail:I.statusDetail??I.replyPreview??I.body,meta:[I.project,I.updatedAtLabel,I.ageLabel].filter(Boolean).join(" · ")||I.createdAtLabel,actionLabel:"Open Agent",onAction:()=>Sn(I.targetAgentId)})),[Sn,Fe]),bl=A.useMemo(()=>ii.map(I=>({id:`approval:${I.sessionId}:${I.turnId}:${I.blockId}`,kind:"approval",tone:I.risk==="high"?"critical":I.risk==="medium"?"warning":"info",title:I.title,summary:I.description,detail:I.detail,meta:`${I.sessionName} · ${I.risk} risk`,actionLabel:"Open Pairing",onAction:()=>{p("pairing")},onSecondaryAction:()=>{ps(I,"approve")},secondaryActionLabel:"Approve"})),[ps,ii]),sc=A.useMemo(()=>[...bl,...ll].sort((I,W)=>{const be=At=>At==="critical"?0:At==="warning"?1:2;return be(I.tone)-be(W.tone)||I.title.localeCompare(W.title)}),[bl,ll]),xi=z.useCallback(I=>{if(ea(I.id),I.kind==="relay"&&I.relayDestinationKind&&I.relayDestinationId){el(I.relayDestinationKind),Jl(I.relayDestinationId);return}if(!I.interAgentThreadId)return;gs(I.interAgentThreadId);const be=(Ut.find(At=>At.id===I.interAgentThreadId)??null)?.participants.find(At=>Gt.some(gi=>gi.id===At.id))?.id??null;be&&(na(be),gs(I.interAgentThreadId))},[na,Gt,Ut,Jl,el,gs,ea]),Rs=I=>{const W=new Date(I);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][W.getUTCMonth()]} ${W.getUTCDate()}`},vt={root:{backgroundColor:g.bg,color:g.ink},surface:{backgroundColor:g.surface},border:{borderColor:g.border},topBar:{backgroundColor:g.surface,borderBottomColor:g.border},navBar:{backgroundColor:g.bg,borderRightColor:g.border},sidebar:{backgroundColor:g.bg,borderRightColor:g.border},sectionLabel:{color:g.muted},inkText:{color:g.ink},mutedText:{color:g.muted},tagBadge:{backgroundColor:g.tagBg,borderColor:g.border,color:g.muted},activePill:{backgroundColor:g.accentBg,color:g.accent},activeItem:{backgroundColor:g.surface,borderColor:g.border,color:g.ink},kbd:{backgroundColor:g.surface,borderColor:g.border,color:g.ink},hoverBg:"hover:bg-[var(--os-hover)]",annotBadge:{backgroundColor:g.tagBg,borderColor:g.border,color:g.muted}},ln=(I,W,be)=>{const At=ml[I]??(Ll?.command===I?Ll:null);return r.jsx(mA,{command:I,commandLine:W,running:be,commandResult:At,visibleAppSettings:qt,onboardingCopiedCommand:Dl,onboardingCommandPending:Jn,onboardingContextRoot:ei,onCopyOnboardingCommand:Io,onRunOnboardingCommand:Zl})},Bt=cz({activeView:h,setActiveView:y,settingsSection:Le,setSettingsSection:Ue,settingsAgentId:it,setSettingsAgentId:tt,settingsSections:xl,activeSettingsMeta:aa,desktopFeatures:yt,stats:ci,runtime:qe,relayState:St,relayRuntimeBooting:hl,relayRuntimeHealthLabel:Ia,reachableRelayAgentCount:fi,dark:mt,setDark:re,showAnnotations:Se,setShowAnnotations:Ze,isCollapsed:u,styles:{surface:vt.surface,inkText:vt.inkText,mutedText:vt.mutedText,tagBadge:vt.tagBadge,activePill:vt.activePill},scoutDesktop:e,surfaceCaps:Jt,interAgentAgents:Gt,openKnowledgeBase:We,openAgentProfile:Sn,openDirectConversation:ta,renderOnboardingCommandShell:ln,renderLocalPathValue:Rr,settingsOperatorNameRef:Ce,relayServiceInspectorRef:_e,handleSetVoiceRepliesEnabled:Cl,settingsController:$l,diagnosticsController:si,agentController:xs}),ft=oz({activeView:h,setActiveView:y,desktopFeatures:yt,styles:{sidebar:vt.sidebar,surface:vt.surface,inkText:vt.inkText,mutedText:vt.mutedText,tagBadge:vt.tagBadge,activePill:vt.activePill,activeItem:vt.activeItem,annotBadge:vt.annotBadge,kbd:vt.kbd},colorTheme:g,sidebarWidth:l,messagesDetailWidth:i,isCollapsed:u,onResizeStart:ic,onMessagesDetailResizeStart:Es,stats:ci,runtime:qe,shellState:oe,shellError:xe,plansState:Fe,machinesState:je,messagesState:Je,interAgentState:Qt,interAgentAgents:Gt,interAgentAgentLookup:Da,relayDirectLookup:js,homeAgents:ui,homeActivity:Md,activityRecentMessages:nl,activityTasks:di,activityLeadTask:Ba,activityFindings:ac,activityEndpoints:Ss,overviewSessions:Rd,inboxAlertCount:Mn,pendingApprovalsCount:ii.length,inboxFailedTaskCount:Mr,inboxAwaitingYouItems:sc,availableAgentNames:Ed,searchQuery:b,setSearchQuery:v,filteredSessions:Jo,selectedSession:E,setSelectedSession:N,isLoadingMessagesWorkspace:_,isLoadingShell:R,showAnnotations:Se,setShowAnnotations:Ze,messagesDetailOpen:M,setMessagesDetailOpen:L,messagesDetailTab:H,setMessagesDetailTab:X,formatDate:Rs,onRefreshShell:()=>{ra()},openAgentProfile:Sn,openSessionDetail:gl,handleSelectSearchSession:I=>{N(I),y("sessions")},handleToggleVoiceCapture:()=>{Gn()},handleSetVoiceRepliesEnabled:I=>{Cl(I)},selectMessageThread:xi,renderLocalPathValue:Rr,selectedInterAgentActivityMessages:Ns,selectedInterAgentInboundTasks:ec,selectedInterAgentOutboundFindings:_a,selectedInterAgentFindings:Sl,interAgentThreadTitle:ws,selectedInterAgentThreadSubtitle:tc,interAgentConfigureTarget:pl,interAgentConfigureLabel:nc,interAgentMessageTarget:lc,visibleInterAgentMessages:Er,relayVoiceState:St?.voice,messagesController:cs,agentController:xs,diagnosticsController:si,phonePreparationController:id,overviewBootLoader:!Ot&&ye&&!B&&!xe?r.jsx(a1,{dark:mt,C:g,s:vt}):null});return Ot?r.jsx("div",{className:`min-h-screen w-full font-sans${mt?" dark":""}`,style:{backgroundColor:g.bg,color:g.ink},children:r.jsxs("div",{className:"relative min-h-screen flex items-center justify-center px-6 py-10",children:[r.jsx("div",{className:"absolute top-6 left-6 z-10",children:r.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full border px-3 py-1.5 text-[12px] transition-opacity hover:opacity-80",style:{borderColor:g.border,color:g.muted},onClick:Fa,children:[r.jsx(ul,{size:12}),"Quit"]})}),Ke&&qt?r.jsx("div",{className:"w-full max-w-[820px] os-scale-in",children:r.jsxs("div",{className:"rounded-2xl border overflow-hidden",style:{borderColor:g.border,backgroundColor:g.surface,boxShadow:`0 24px 80px ${mt?"rgba(0,0,0,0.4)":"rgba(15,23,42,0.08)"}`},children:[r.jsxs("div",{className:"px-8 pt-8 pb-6 border-b cursor-grab active:cursor-grabbing",style:{borderBottomColor:g.border,WebkitAppRegion:"drag"},children:[r.jsxs("div",{className:"flex items-center justify-between gap-4",children:[r.jsx("div",{className:"text-[11px] font-mono uppercase tracking-[0.22em]",style:vt.mutedText,children:"Scout Setup"}),r.jsx("button",{className:"text-[12px] transition-opacity hover:opacity-70",style:{...vt.mutedText,WebkitAppRegion:"no-drag"},onClick:os,children:"Skip onboarding"})]}),r.jsx("div",{className:"flex items-center gap-1.5 mt-6",children:Il.map((I,W)=>{const be=W<Fn,At=W===Fn;return r.jsx("div",{className:"h-1 flex-1 rounded-full transition-all duration-300",style:{backgroundColor:be||At?g.accent:mt?"rgba(255,255,255,0.06)":"rgba(15,23,42,0.06)",opacity:At?.6:1}},I.id)})}),r.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[r.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full",style:{backgroundColor:g.accentBg,color:g.accent},children:[Kt.number,"/",Il.length]}),r.jsx("span",{className:"text-[12px] font-medium",style:vt.mutedText,children:Kt.title})]})]}),r.jsxs("div",{className:"px-8 py-8 os-fade-up",children:[r.jsx(pA,{activeOnboardingStep:Kt,visibleAppSettings:qt,appSettingsSaving:Yt,appSettingsLoading:br,appSettingsDirty:vr,onboardingCommandPending:Jn,onboardingHasProjectConfig:rs,sourceRootPathSuggestions:gr,settingsOperatorNameRef:Ce,setAppSettingsDraft:Yl,setAppSettingsFeedback:Ft,setIsAppSettingsEditing:_l,handleAddSourceRootRow:Ju,handleSetSourceRootAt:is,handleBrowseForSourceRoot:li,handleRemoveSourceRootRow:ed,handleSetOnboardingContextRoot:wl,handleBrowseForOnboardingContextRoot:ss,handleAddSourceRootSuggestion:Bo,handleRunOnboardingCommand:Zl,buildOnboardingCommandLine:vn,renderOnboardingCommandShell:ln,renderLocalPathValue:Rr,styles:{inkText:vt.inkText,mutedText:vt.mutedText,activePill:vt.activePill,tagBadge:vt.tagBadge},availableHarnesses:o1}),fn?r.jsx("div",{className:"text-[13px] mt-6 leading-[1.6] os-fade-in",style:vt.inkText,children:fn}):null]},Kt.id),r.jsxs("div",{className:"px-8 py-5 border-t flex items-center justify-between gap-4",style:{borderTopColor:g.border,backgroundColor:g.bg},children:[r.jsx("button",{className:"os-btn flex items-center gap-1 text-[12px] font-medium px-4 py-2.5 rounded-lg border disabled:opacity-40 transition-all",style:{color:g.muted,borderColor:g.border,backgroundColor:"transparent"},onClick:()=>_o(-1),disabled:!ti,children:"Back"}),r.jsxs("div",{className:"text-[11px] font-mono text-center",style:vt.mutedText,children:[Kt.number," of ",Il.length]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{className:"os-btn flex items-center gap-1 text-[12px] font-medium px-4 py-2.5 rounded-lg transition-all",style:{color:g.muted},onClick:Ra,children:ve?"Skip step":"Finish later"}),r.jsxs("button",{className:"os-btn-primary flex items-center gap-1 text-[12px] font-semibold px-5 py-2.5 rounded-lg disabled:opacity-40 transition-all",style:{backgroundColor:g.accent,color:"#fff"},onClick:Ea,disabled:!ve||Yt||br,children:[Kt.id==="confirm"?Yt?"Confirming…":"Confirm":"Continue",Kt.id==="confirm"?null:r.jsx(El,{size:12})]})]})]})]})}):r.jsx(a1,{dark:mt,C:g,s:vt})]})}):r.jsxs(r.Fragment,{children:[r.jsx(PT,{dark:mt,setDark:re,C:g,s:vt,productSurface:f,setProductSurface:p,activeView:h,setActiveView:y,desktopFeatures:yt,pairingSurfaceBadge:rd,openRelayDiagnostics:hi,relayStatusTitle:rc,relayRuntimeBooting:hl,relayStatusDotClassName:pi,relayStatusLabel:la,runtime:qe,headerAgentCount:mi,appReloadPending:Ne,handleReloadApp:Ha,handleQuitApp:Fa,navViews:en,collapsibleViews:As,isCollapsed:u,setIsCollapsed:d,pairingSurfaceProps:{pairingControlPending:fs,pairingConfigFeedback:Fo,pairingConfigPending:wr,pairingError:Ho,pairingLoading:za,pairingState:Ma,onControlPairing:ld,onDecideApproval:ps,onOpenFullLogs:()=>{p("relay"),y("logs")},onOpenFeedback:Vo,pairingApprovalPendingId:ri,onUpdateConfig:ad,onRefresh:()=>{ra()},onRevealPath:I=>{Jt?.canRevealPath&&e?.revealPath?.(I)}},isAgentSessionPeekOpen:Zo,selectedInterAgent:qn,visibleAgentSession:Qo,agentSessionPending:ys,agentSessionLoading:vs,agentSessionFeedback:Xo,agentSessionCopied:Ko,agentSessionPeekViewportRef:Sd,handlePeekAgentSessionScroll:Cd,closeAgentSessionPeek:wd,handleCopyAgentSessionCommand:()=>{Ad()},handleOpenAgentSession:()=>{Td()},renderLocalPathValue:Rr,isCreateAgentDialogOpen:La,setIsCreateAgentDialogOpen:kd,agentableProjects:yr,createAgentDraft:jd,setCreateAgentDraft:Nd,createAgentDefaults:Go,createAgentSubmitting:$o,createAgentFeedback:Cr,setCreateAgentFeedback:Tr,handleBrowseCreateAgentProject:oi,handleCreateAgent:Yo,availableAgentHarnesses:o1,isFeedbackDialogOpen:sd,handleFeedbackDialogOpenChange:xd,feedbackDraft:hs,setFeedbackDraft:dd,feedbackSubmission:fd,feedbackActionPending:md,feedbackBundleLoading:cd,feedbackBundle:od,feedbackBundleError:ud,feedbackActionMessage:qo,handleSubmitFeedbackReport:()=>{yd()},handleRefreshFeedbackBundle:()=>{gd()},handleRepairSetup:()=>{vd()},handleCopyFeedbackBundle:()=>{bd()},openFeedbackDialog:Vo,openKnowledgeBase:We,logsAttentionLevel:Cs,logsButtonTitle:In,footerTimeLabel:Ts,children:f==="relay"?r.jsxs(r.Fragment,{children:[r.jsx(FT,{...ft.overviewInboxActivityViewProps}),r.jsx(aA,{...ft.opsViewsProps}),r.jsx(fA,{...Bt}),r.jsx($M,{...ft.agentViewsProps}),r.jsx(Az,{...ft.messagesRelayViewProps})]}):null}),r.jsx("div",{className:"pointer-events-none fixed right-4 top-20 z-40",children:r.jsxs("div",{className:"w-[220px] rounded-2xl border px-4 py-3 shadow-[0_18px_48px_rgba(15,23,42,0.12)]",style:{backgroundColor:mt?"rgba(17, 24, 39, 0.9)":"rgba(255,255,255,0.92)",borderColor:g.border,backdropFilter:"blur(10px)"},children:[r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-[10px] font-mono uppercase tracking-[0.16em]",style:vt.mutedText,children:"Dev Load Times"}),r.jsx("div",{className:"text-[10px]",style:vt.mutedText,children:"live"})]}),r.jsx("div",{className:"mt-3 space-y-2",children:[{key:"services",title:"Relay health",metric:ee.services,loading:Y,idleLabel:"—",idleDetail:"No measurement yet"},{key:"home",title:"Home data",metric:ee.home,loading:ye,idleLabel:"—",idleDetail:"No measurement yet"},{key:"workspace",title:"Workspace",metric:ee.workspace,loading:V?_:Pl&&R,idleLabel:V||Pl?"—":"deferred",idleDetail:V||Pl?"No measurement yet":"Loads only on workspace-heavy surfaces"}].map(I=>r.jsxs("div",{className:"rounded-xl border px-3 py-2",style:{borderColor:g.border,backgroundColor:mt?"rgba(255,255,255,0.03)":"rgba(15,23,42,0.025)"},children:[r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-[11px] font-medium",style:vt.inkText,children:I.title}),r.jsx("div",{className:"text-[11px] font-mono",style:I.loading?{color:g.accent}:vt.inkText,children:I.loading?"loading…":I.metric?`${I.metric.durationMs}ms`:I.idleLabel})]}),r.jsx("div",{className:"mt-1 text-[10px] leading-[1.5]",style:vt.mutedText,children:I.metric?`${I.metric.label} · ${new Date(I.metric.recordedAt).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",second:"2-digit"})}`:I.idleDetail}),I.metric?.detail?r.jsx("div",{className:"mt-2 space-y-1",children:Object.entries(I.metric.detail).slice(0,8).map(([W,be])=>r.jsxs("div",{className:"flex items-center justify-between gap-3 text-[10px]",style:vt.mutedText,children:[r.jsx("span",{className:"truncate",children:W}),r.jsx("span",{className:"font-mono shrink-0",style:vt.inkText,children:String(be)})]},W))}):null]},I.key))})]})})]})}const yp=document.getElementById("root");if(!yp)throw new Error("Root element was not found.");const c1=r.jsx(A.StrictMode,{children:r.jsx(gN,{children:r.jsx(Fz,{})})}),qz=typeof window<"u"&&Object.prototype.hasOwnProperty.call(window,"__INITIAL_STATE__");qz?pb.hydrateRoot(yp,c1):pb.createRoot(yp).render(c1);